프린트 하기

OS환경 : Oracle Linux 6.8 (64bit)


DB 환경 : Oracle Database 11.2.0.4


방법 : 오라클 리스너 패스워드 분실시 조치방법

리스너 패스워드를 모르는 상태에서 할수 있는 방법을 설명함



리스너 상태 확인

1
2
3
4
5
6
7
8
$ lsnrctl status
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2020 09:44:33
 
Copyright (c) 19912013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
TNS-01169: The listener has not recognized the password

패스워드가 걸려 있어 조회가 되지 않음



리스너 정지 시도

1
2
3
4
5
6
7
8
$ lsnrctl stop
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2020 09:45:31
 
Copyright (c) 19912013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
TNS-01169: The listener has not recognized the password

패스워드를 입력하지 않아 당연히 정지도 안됨



ps -ef | grep tns 로 리스너 프로세스 확인

1
2
3
4
$ ps -ef | grep tns
root        15     2  0  2019 ?        00:00:00 [netns]
oracle    3999     1  0 09:37 ?        00:00:00 /oracle/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit
oracle    4039  3873  0 09:45 pts/1    00:00:00 grep tns



리스너 프로세스 kill, kill 후 확인

1
2
3
4
$ kill -9 3999
$ ps -ef | grep tns
root        15     2  0  2019 ?        00:00:00 [netns]
oracle    4045  3873  0 09:46 pts/1    00:00:00 grep tns



리스너 파일 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ vi $ORACLE_HOME/network/admin/listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE11)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
 
ADR_BASE_LISTENER = /oracle/app/oracle
LOCAL_OS_AUTHENTICATION_LISTENER = OFF
 
#----ADDED BY TNSLSNR 22-MAY-2020 09:25:24---
PASSWORDS_LISTENER = 373C511F8C082638
#--------------------------------------------

하단에 PASSWORDS_LISTENER(리스너 패스워드) 가 보임



PASSWORDS_LISTENER 부분 주석 처리 후 저장

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ vi $ORACLE_HOME/network/admin/listener.ora
# listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE11)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
 
ADR_BASE_LISTENER = /oracle/app/oracle
LOCAL_OS_AUTHENTICATION_LISTENER = OFF
 
#----ADDED BY TNSLSNR 22-MAY-2020 09:25:24---
#PASSWORDS_LISTENER = 373C511F8C082638
#--------------------------------------------



리스너 기동

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$ lsnrctl start
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2020 09:49:03
 
Copyright (c) 19912013, Oracle.  All rights reserved.
 
Starting /oracle/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/ORACLE11/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORACLE11)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                22-MAY-2020 09:49:05
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/ORACLE11/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORACLE11)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

정상적으로 기동됨



잠시후 또는 (sqlplus 에서 alter system register; 명령 후)

리스너 상태 조회

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ lsnrctl status
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2020 09:49:50
 
Copyright (c) 19912013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                22-MAY-2020 09:49:05
Uptime                    0 days 0 hr. 0 min. 45 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/ORACLE11/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORACLE11)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ORCL11" has 1 instance(s).
  Instance "ORCL11", status READY, has 1 handler(s) for this service...
The command completed successfully

서비스가 정상적으로 붙고 정상적으로 조회가능함



이후 패스워드 적용하고 싶을 시 

https://positivemh.tistory.com/571 글을 참조하여 설정하면 됨



save_config 명령시 TNS-01169: The listener has not recognized the password가 발생할 경우 대처방법

set password 로 먼저 접속 후 다시 save_config 명령 실행

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$ lsnrctl
 
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAY-2020 09:51:16
 
Copyright (c) 19912013, Oracle.  All rights reserved.
 
Welcome to LSNRCTL, type "help" for information.
 
LSNRCTL> change_password
Old password: <-- 엔터
New password: <-- 패스워드 입력
Reenter new password: <-- 패스워드 재입력
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
LSNRCTL> save_config <-- 패스워드 저장
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
TNS-01169: The listener has not recognized the password  <-- 패스워드 저장 실패
LSNRCTL> set password <-- set password 로 패스워드 입력후 접속
Password: 
The command completed successfully
LSNRCTL> save_config <-- 패스워드 저장명령 재실행
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORACLE11)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File   /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Old Parameter File   /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.bak
The command completed successfully





참조 : https://positivemh.tistory.com/571