데이터베이스

[ORACLE] ORA-01012: not logged on 에러 해결방법

화이트해커 Luna 🌙 2022. 11. 7. 18:10
728x90
반응형

ORA-01012가 로그온되지 않음 오류

<오라클 공식문서>

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.

 


세부사항

ORA-01012오류는 Oracle에 로그온하지 않고 OLON 또는 OLOGON 이외의 Oracle 호출을 발행한 호스트 언어 프로그램과 관련이 있습니다. 이 문제는 연결된 인스턴스가 종료된 후 사용자 프로세스가 데이터베이스에 액세스하려고 시도하여 프로세스의 연결을 강제로 끊을 때 발생할 수 있습니다. 서버에 사용 가능한 연결이 부족한 경우에도 발생할 수 있습니다. 이 문제는 MSDAORA를 사용하여 발생할 수도 있습니다.

 

MSDAORA를 사용하는 동안 서버 쪽에서 Oracle 데이터베이스에 대한 연결을 종료하면 끊어진 연결이 연결 풀로 반환됩니다. 연결 풀링 코드가 MSDAORA의 속성을 다시 연결 잘못 상호 작용합니다. 공급자가 이 속성을 지원하지 않는 경우 풀링 코드는 연결이 다시 설정되고 연결이 유효한 연결임을 잘못 해석합니다. 클라이언트 코드가 새 연결을 열면 연결 풀로 반환된 끊어진 연결이 검색될 수 있습니다. 따라서 "현상" 절에서 설명한 오류 메시지가 나타납니다.

 

오라클 호출을 실행하기 전에 OLON 또는 OLAGON을 호출하여 Oracle에 로그온하십시오. 인스턴스가 다시 시작되면 작업을 다시 시도합니다.

 

연결 부족으로 인한 문제인 경우 일부 연결을 종료하거나 'processes' 매개 변수의 값을 늘립니다.


Oracle 데이터베이스에서 프로세스 매개 변수를 늘리는 명령어

SQL> alter system set processes=2000 scope=spfile;

실패


데이터베이스를 다시 시작할 수없는 경우 비활성 세션을 종료 하는 명령어

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;

 

실패

 


모든 Oracle 프로세스를 종료하는 명령어

kill -9 `ps -ef|grep oracle | awk '{print $2}'`

실패 


껏다 다시켜기

그냥 시스템부터 서버 네트워크 다 껏다가 다시 켰습니다.

성공

 

728x90
반응형