I got ” ORA-01012 not logged on ” error in Oracle database.
ORA-01012 not logged on
Details of error are as follows.
ORA-01012: Not logged on
Cause: A host language program issued an Oracle call, other than OLON or OLOGON, without
being logged on to Oracle. This can occur when a user process attempts to access the database
after the instance it is connected to terminates, forcing the process to disconnect.
This may also occur if the server has run out of available connections. This problem may also
be caused by using MSDAORA. When you end the connection to the Oracle database on the server
side while using MSDAORA, the broken connection is returned to the connection pool.
The connection pooling code incorrectly interacts with the ResetConnection property of
MSDAORA. When this property is not supported by the provider, the pooling code incorrectly
interprets that the connection is reset, and that the connection is a valid one. When the
client code opens a new connection, the broken connection that was returned to the connection
pool may be retrieved. Therefore, you receive the error message that is mentioned in the
"Symptoms" section.
Action: Log on to Oracle, by calling OLON or OLOGON, before issuing any Oracle calls. When
the instance has been restarted, retry the action.
If the problem is due to running out of connections, kill some connections or increase the
value of the 'processes' parameter.
Not logged on
This ORA-01012 error is related with the host language program issued an Oracle call, other than OLON or OLOGON, without being logged on to Oracle. This can occur when a user process attempts to access the database after the instance it is connected to terminates, forcing the process to disconnect. This may also occur if the server has run out of available connections. This problem may also be caused by using MSDAORA.
When you end the connection to the Oracle database on the server side while using MSDAORA, the broken connection is returned to the connection pool. The connection pooling code incorrectly interacts with the ResetConnection property of MSDAORA. When this property is not supported by the provider, the pooling code incorrectly interprets that the connection is reset, and that the connection is a valid one. When the client code opens a new connection, the broken connection that was returned to the connection pool may be retrieved. Therefore, you receive the error message that is mentioned in the “Symptoms” section.
Log on to Oracle, by calling OLON or OLOGON, before issuing any Oracle calls. When the instance has been restarted, retry the action.
If the problem is due to running out of connections, kill some connections or increase the value of the ‘processes’ parameter.
You can increase processes parameter in Oracle database as follows.
SQL> alter system set processes=2000 scope=spfile; System altered.
But This parameter is activated after Database restart.
If you cannot restart database, then You may solve this problem to kill inactive sessions like following.
select 'kill -9 ' || p.SPID, s.USERNAME, 'alter system kill session '''||sid||',' || s.serial# || ''';',s.STATUS from v$session s, v$process p where s.PADDR = p.ADDR (+) and s.STATUS='INACTIVE' and s.USERNAME = 'DWH' order by 1;
Or Oracle database has been terminated or crashed and An orphaned shared memory segment exist.
Then use the following script to kill all Oracle Processes, then startup again.
kill -9 `ps -ef|grep oracle | awk '{print $2}'`
SQL> startup
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )