2013. 4. 7. 22:48 오라클
11gR2 RAC listener 변경
11gR2 에서는 srvctl modify 로 간편하게 변경해 줄수 있다. 명령자체는 아래의 2개 명령어만 쳐 주면 된다.
[root@test1 ~] srvctl modify listener -l listener -o /u01/app/11.2.0/grid -p "TCP:1522"
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL=TCP)(HOST=192.168.56.13)(PORT = 1522))' scope=both SID='TEST1';
아래는 테스트한 결과의 기록물이다.
[oracle:/home/oracle]#srvctl modify listener -l listener -o /u01/app/11.2.0/grid -p "TCP:1522"
[oracle:/home/oracle]#srctl stop listener
[oracle:/home/oracle]#srvctl start listener
[oracle:/home/oracle]#lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 07-APR-2013 22:17:48
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 07-APR-2013 22:17:40
Uptime 0 days 0 hr. 0 min. 8 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/test1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.11)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.13)(PORT=1522)))
The listener supports no services
The command completed successfully
변경되었으나 local_listener 에 변경된 포트가 등록되지 않아 접속이 되지 않는다.
[oracle:/home/oracle]#sqlplus system/manager@TEST
SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 7 22:21:02 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
[oracle:/home/oracle]#sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 7 22:17:57 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter local
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
(ADDRESS=(PROTOCOL=TCP)(HOST=1
92.168.56.13)(PORT=1521))
log_archive_local_first boolean
TRUE
parallel_force_local boolean
1522 포트로 바꿔주고 INSTANCE를 내렸다. 올려준다.
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL=TCP)(HOST=192.168.56.13)(PORT = 1522))' scope=both SID='TEST1'
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 356517372 bytes
Database Buffers 159383552 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SQL> show parameter local
showmode OFF
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
local_listener string
(ADDRESS = (PROTOCOL=TCP)(HOST
=192.168.56.13)(PORT = 1522))
log_archive_local_first boolean
TRUE
parallel_force_local boolean
FALSE
SQL> exit
접속이 정상적으로 된다.
[oracle:/home/oracle]#sqlplus system/manager@TEST
SQL*Plus: Release 11.2.0.3.0 Production on Sun Apr 7 22:23:18 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> exit