Oracle 10g: Issue with startup mount command (ORA-24324, ORA-01041) - oracle

I want to disable the archive logs in my oracle db. But when i shutdown and try to mount the database i am getting the following error.
C:\>sqlplus scott/tiger#ORCL as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 18 10:44:17 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
SQL> startup mount
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
Can any one please help me in resolving this issue.
Edit1:- Listener.ora
# listener.ora Network Configuration File: E:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = INHOS.dg.server.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)

Not sure if this is root cause, but after shutdown and before startup, try exiting and re-entering SQL*Plus.
First edit:
Ok, so, two different problems. The "hostdef extension doesn't exist" error happens when you try to startup from the same SQL*Plus session you shutdown from. Solution is to exit and re-enter SQL*Plus between shutdown and startup.
The ORA-12514 "Listener does not currently know of service requested in connect descriptor" is due to trying to remotely start (your SQL*Plus connect string is scott/tiger#ORCL as sysdba which specifies #ORCL) the instance, and the listener is configured only for dynamic service registration. If your listener is configured only for dynamic service registration, then trying to remotely start the instance will give you an ORA-12514. It's a bit of a catch-22. The problem is, until the instance is started, it can't register with the listener. If it's not registered with the listener, you can't start it up. There are two possible solutions:
You could add a static listener configuration to the listener.ora file and bounce the listener.
You could directly login as the Oracle software owner, to the server that the database is installed on, and set ORACLE_HOME and ORACLE_SID, then connect as / as sysdba.
Hope that helps.

ORA-24324 can mean that the database simply has not been started, and so the resolution would be to
first start the database and listeners (if any)

Related

Oracle Personal Edition 21c: Listener cannot find service name

I'm getting started with Oracle Personal Edition. Installation was successful. Trying to connect to the database and getting stuck. I have:
tnsping xe2
TNS Ping Utility for 64-bit Windows: Version 21.0.0.0.0 - Production on 16-APR-2022 17:14:25
Copyright (c) 1997, 2021, Oracle. All rights reserved.
Used parameter files:
C:\app\geral\product\21c\homes\OraDB21Home1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host.docker.internal)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))
OK (10 msec)
which seems promising. In sqlplus I can:
sqlplus / as sysdba
SQL*Plus: Release 21.0.0.0.0 - Production on Sat Apr 16 17:14:40 2022
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
then show the pdbs:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 XEPDB1 READ WRITE NO
SQL>
So, I now want to try to connect to the CON_NAME XEPDB1 using that TNS entry I tested:
SQL> conn foo#xe2
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Warning: You are no longer connected to ORACLE.
At this point, I'm stuck. How do I troubleshoot and resolve the cause of the error message?
Your listener is on and working but your instance has not dynamically registered it’s services with it nor are they statically part of your listener config.
Easiest option is to get your instance to register itself. Look at the instance parameter local_listener, this needs to point to your listener running on (HOST = host.docker.internal)(PORT = 1521), you can do this with a tnsname that points to the same listener or you can take advantage of EZConnect syntax and just use the host name (the default port is 1521 anyway). I would recommend setting up a tnsnames entry just called listener which contains the host and port but no connect_data.
(Using EZconnect)
Alter system set local_listener='host.docker.internal';
This will self-validate .
You then just need to wait for automatic registration to occur, you can see this happening in your listener logs, you can trigger it manually with alter system register; and you can confirm it’s happened by looking at the results of lsnrctl status host.docker.internal.

ORA-12505, TNS:listener does not currently know of SID given in connect

I'm using JDeveloper when I try to create a database connection with the hr/hr user I get this message:
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:ORCL
then I go to the command line and I put tnsping ORCL
C:\Users\Administrator>tnsping ORCL
TNS Ping Utility for 64-bit Windows: Version 12.2.0.1.0 - Production on 20-FEB-2
018 15:55:23
Copyright (c) 1997, 2016, Oracle. All rights reserved.
Used parameter files:
C:\app\oracle\virtual\product\12.2.0\dbhome_1\network\admin\sqlnet.ora
Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=213.130.77.281)(PORT=1521)))
OK (90 msec)
C:\Users\Administrator>é2#
and checking If the Oracle listener is running:
C:\Users\Administrator>lsnrctl status
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 22-FEB-2018 12:34
:05
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=TESTINFRA)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Produ
ction
Start Date 20-FEB-2018 15:02:35
Uptime 1 days 21 hr. 31 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\oracle\virtual\product\12.2.0\dbhome_1\network\
admin\listener.ora
Listener Log File C:\app\oracle\virtual\diag\tnslsnr\TESTINFRA\listener\
alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TESTINFRA)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Your listener service doesn't clearly state that it has any ORCL database SID here, on this host.
When you used TNSPING command to check connectivity, you walked around this by using Oracle EZCONNECT adapter that resolves all needed connect info itself, but JDBC driver needs either clear declaration of SID in listener or clear command to use EZCONNECT adapter.
So are two ways to solve this:
Open listener.ora and find these lines:
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle\virtual\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle\virtual\product\12.2.0\dbhome_1\bin\oraclr11.dll")
)
)
Replace them with these:
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle\virtual\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle\virtual\product\12.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = C:\app\oracle\virtual\product\12.2.0\dbhome_1)
(GLOBAL_DBNAME = ORCL)
)
)
Then use "lsnrctl stop" and "lsnrctl start" to restart the listener. This change will register new SID_DESC block with description of your database SID in listener.
Change JDBC string to connect through EZCONNECT adapter and not through SID. Please, post your JDBC connection string if you want exact answers, but in overall you shouldn't use:
jdbc:oracle:thin:#213.130.77.281:1521:orcl
And use instead:
jdbc:oracle:thin:#//213.130.77.281:1521/orcl
This change will tell JDBC to use EZCONNECT adapter.
In you jdbc error you are using : localhost:1521:ORCL
In the TNSPING, it’s 213.130.77.281
Use the ip address in jdev also.

ORA-12545 : Oracle SID Suddenly Stopped working

I have a baffling problem. I have an Oracle 11g set up on Linux that was working fine. I was able to connect remotely from other machines using a SID based connection string such as
sqlplus myschema#192.168.184.102:1521:orcl
then for some inexplicable reason it stopped working. I'm not sure what I or someone else jiggled loose.
now i'm only able to connect remotely using a SERVICE_NAME or TNSNAME based methods
sqlplus myschema#192.168.184.102:1521/orcl
sqlplus myschema#ORCL
Both work and this would be fine and well, but I have applications that rely on SID connection pattern that I can change. Could some kind soul help me figure out what I'm missing
Below is my configuration:
LISTENER.ORA:
[oracle#dbora112 ~]$ cat /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dbora112)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /opt/u01/app/oracle
LISTENER STATUS:
[oracle#dbora112 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 04-MAR-2015 14:50:05
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 04-MAR-2015 14:37:12
Uptime 0 days 0 hr. 12 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /opt/u01/app/oracle/diag/tnslsnr/dbora112/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbora112)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
TNSNAMES.ORA:
[oracle#dbora112 ~]$ cat /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.184.102)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = orcl)
)
)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.184.102)(PORT = 1521))
SQLNET:
[oracle#dbora112 ~]$ cat /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /opt/u01/app/oracle
Can connect with not problem using TNS
[oracle#dbora112 ~]$ sqlplus schema/xxx#ORCL
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 4 14:54:10 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Can connect with no problem using Service Name
[oracle#dbora112 ~]$ sqlplus schema/xxx#192.168.184.102/ORCL
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 4 14:55:52 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Cannnot connect with SID
[oracle#dbora112 ~]$ sqlplus schema/xxx#192.168.184.102:orcl
SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 4 14:56:38 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Database Instance (SID)
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
orcl
Since you can connect with your TNS alias, and that is using the SID in the connection description, the SID is working.
But your EasyConnect string is incorrect. From the SQL*Plus documentation:
The easy or abbreviated connection identifier has the syntax:
[//]host[:port][/service_name]
You cannot use the SID with Easy Connect, only the service name; so your connect using:
sqlplus schema/xxx#192.168.184.102:orcl
or even
sqlplus schema/xxx#192.168.184.102:1521:orcl
... can never have worked. You can use that form with a JDBC URL using the older style:
jdbc:oracle:thin:#192.168.184.102:1521:orcl
... but that is not the same thing as an SQL*Plus connection, despite looking similar.
If you're trying to check if a JDBC connection of that form will work, you cannot do so with SQL*Plus, but your TNS alias check is verifying it is set up as you expect anyway - as long as it uses the same host, port and SID. It would probably be better to use the newer JDBC syntax, but from the question it sounds like you can't change that.
Read more about Easy Connect.
This could be when Oracle cannot resolve the hostname to IP. Can you resolve your hostname with nslookup? I.e.,
nslookup yourhostname
Also make sure reverse lookup is working:
nslookup yourIpAddr

The listener supports no services

I installed Oracle Database 11gR2 as well as Oracle Grid Infrastructure on a Linux box, then I created the orcl database.
I have always been able to connect to my database using SQL*Plus or OEM. But lately, I'm facing an issue when typing the command lsnrctl status, and so I'm not able to connect to the database.
My listener.ora file:
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = pc.company.com)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
My tnsnames.ora file :
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = pc.company.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.example.com)
)
)
When typing lsnrctl status, I get the following :
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-JUL-2014 03:35:48
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 21-JUL-2014 03:25:58
Uptime 0 days 0 hr. 9 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/pc151/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pc.company.com)(PORT=1521)))
The listener supports no services
The command completed successfully
When typing sqlplus / as sysdba then startup, I get this :
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-29701: unable to connect to Cluster Synchronization Service
And the srvctl start database command fails to start the database up too.
My oratab file is the following :
#Backup file is /u01/app/oracle/product/11.2.0/dbhome_1/srvm/admin/oratab.bak.pc150 line added by Agent
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/oracle/product/11.2.0/grid:N
orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N # line added by Agent
The database registers its service name(s) with the listener when it starts up. If it is unable to do so then it tries again periodically - so if the listener starts after the database then there can be a delay before the service is recognised.
If the database isn't running, though, nothing will have registered the service, so you shouldn't expect the listener to know about it - lsnrctl status or lsnrctl services won't report a service that isn't registered yet.
You can start the database up without the listener; from the Oracle account and with your ORACLE_HOME, ORACLE_SID and PATH set you can do:
sqlplus /nolog
Then from the SQL*Plus prompt:
connect / as sysdba
startup
Or through the Grid infrastructure, from the grid account, use the srvctl start database command:
srvctl start database -d db_unique_name [-o start_options] [-n node_name]
You might want to look at whether the database is set to auto-start in your oratab file, and depending on what you're using whether it should have started automatically. If you're expecting it to be running and it isn't, or you try to start it and it won't come up, then that's a whole different scenario - you'd need to look at the error messages, alert log, possibly trace files etc. to see exactly why it won't start, and if you can't figure it out, maybe ask on Database Adminsitrators rather than on Stack Overflow.
If the database can't see +DATA then ASM may not be running; you can see how to start that here; or using srvctl start asm. As the documentation says, make sure you do that from the grid home, not the database home.
for listener support no services you can use the following command to set local_listener paramter in your spfile use your listener port and server ip address
alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.101)(PORT=1520)))' sid='testdb' scope=spfile;
You need to add your ORACLE_HOME definition in your listener.ora file. Right now its not registered with any ORACLE_HOME.
Sample listener.ora
abc =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.kma.com)(PORT = 1521))
)
)
SID_LIST_abc =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /abc/DbTier/11.2.0)
(SID_NAME = abc)
)
)
you need to reconfigure your tnsnames.ora so that it can point to your hostname
after that listener will be able to pick the new hostname. after which check the status of your listener lsnrctl status and start listener lsnrctl start
then register your listener. Alter system register
Check local_listener definition in your spfile or pfile. In my case, the problem was with pfile, I had moved the pfile from a similar environment and it had LISTENER_sid as LISTENER and not just LISTENER.

Error while connecting to Oracle DB on server

I am getting an error while trying to connect to oracle DB on the server throught Toad. The error message is :
ORA-12514: TNS:listener could not resolve Service_Name given in connect descriptor.
Everything was working fine till yesterday but today my server got restarted and i am not ablt to connect to DB. I tried tnsping as well and it is working fine:
TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 10-NOV-20
10 15:13:29
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
c:\oracle\ora92\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = MY4D) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =sim)))
OK (80 msec)
I did lsnrctl start and it says Service OracleOraHome92TNSListener already running.
Still oracle throught toad is not working. Can anyone help me in solving this.
This error usually happens when your oracle services are not running. You will see the services by names "Oracle..TNSListener" and another service with name "OracleServicesim" in your services.msc. Check if both of them are running, or restart both those services. Then try to connect. It should work fine.

Resources