ORA-01012 not logged on

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 )

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

2 comments

  1. Thanks a lot, the ‘alter system’ command helped me. I was trying many other solutions out there, but none of them could help me, only yours.

Leave a Reply

Your email address will not be published. Required fields are marked *