In this article you will see solution of Oracle database error ORA-01012, this is an Intermittent ORA-01012 not logged on error. you can query the database once you are logged in . But say after about 10 minutes, your application users get the ORA-04031_unable_to_allocate_shared_memory. When you try to open another SQL*Plus session and try to execute SQL statements is says “not logged on”.
Error Cause
Without being signed on to Oracle, a host language software issued an Oracle call other than OLON or OLOGON. When a user process tries to access the database after the instance to which it is connected has terminated, the process is forced to disconnect.
This can also happen if the server is running out of connections. This issue could also be caused by MSDAORA can cause this. When the connection to the Oracle database on the server is terminated The broken connection is returned to the connection pool when using MSDAORA.
The connection pooling code interacts poorly with MSDAORA’s Reset Connection attribute. When the provider does not offer this feature, the pooling code wrongly views the connection as being reset rather than valid. The broken connection that was returned to the connection pool may be reclaimed when the client code starts a new connection. As a result, you get the error notice described in the “Symptoms” section.
Error Syntax
SQL> select instance_name from v$instance;
select instance_name from v$instance
*
ERROR at line 1:
ORA-01012: not logged on
Action Log
Before making any Oracle calls, contact OLON or OLOGON to log in to Oracle. Retry the action after the instance has been restarted.
If the problem is caused by a lack of connections, kill some of them or increase the ‘processes’ option value.
Using the sysresv utility, remove the orphaned shared memory segment to fix the problem.
The sysresv command will show the presently allocated IPC resources for shared memory, and the ipcrm -m command will remove the shared memory segment.