方法1:
[oracle@PROD admin]$ more listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC
=
(SID_NAME
= PLSExtProc)
(ORACLE_HOME
= /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM
= extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1521))
(ADDRESS
= (PROTOCOL = IPC)(KEY =
EXTPROC0))
)
)
LSNR2 =
(DESCRIPTION_LIST =
(DESCRIPTION
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1526))
)
)
SID_LIST_LSNR2 =
(SID_LIST =
(SID_DESC
=
(SID_NAME
= PROD)
(ORACLE_HOME
= /u01/app/oracle/product/10.2.0/db_1)
)
)
PROD_S =
(DESCRIPTION =
(ADDRESS_LIST
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1526))
)
(CONNECT_DATA
=
(SERVICE_NAME
= PROD)
)
)
PROD =
(DESCRIPTION =
(ADDRESS_LIST
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1521))
)
(CONNECT_DATA
=
(SERVICE_NAME
= PROD)
)
)
[oracle@PROD admin]$ sqlplus / as
sysdba
SQL*Plus:
Release 10.2.0.1.0 - Production on Sat Aug 25 19:20:04 2012
Copyright (c) 1982, 2005,
Oracle. All rights
reserved.
Connected to:
Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data
Mining options
SQL> alter system set
remote_listener='PROD_S';
SQL> show parameter
lis
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
recovery_parallelism integer 0
remote_listener string PROD_S
方法2:
[oracle@PROD admin]$ more
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC
=
(SID_NAME
= PLSExtProc)
(ORACLE_HOME
= /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM
= extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1521))
(ADDRESS
= (PROTOCOL = IPC)(KEY =
EXTPROC0))
)
)
LSNR2 =
(DESCRIPTION_LIST =
(DESCRIPTION
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1526))
)
)
SID_LIST_LSNR2 =
(SID_LIST =
(SID_DESC
=
(SID_NAME
= PROD)
(ORACLE_HOME
= /u01/app/oracle/product/10.2.0/db_1)
)
)
[oracle@PROD admin]$ more tnsnames.ora
LISTENER_PROD=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=PROD)(PORT=1521)
(ADDRESS=(PROTOCOL=TCP)(HOST=PROD)(PORT=1526))
PROD_D =
(DESCRIPTION =
(ADDRESS_LIST
=
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1521))
(ADDRESS
= (PROTOCOL = TCP)(HOST =
PROD)(PORT = 1526))
)
(CONNECT_DATA
=
(SERVICE_NAME
= PROD)
)
)
[oracle@PROD admin]$ sqlplus / as
sysdba
SQL*Plus:
Release 10.2.0.1.0 - Production on Sat Aug 25 19:20:04 2012
Copyright (c) 1982, 2005,
Oracle. All rights
reserved.
Connected to:
Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data
Mining options
SQL> alter system set
local_listener='PROD_D';
SQL> show parameter
lis
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string PROD_D
recovery_parallelism integer 0
remote_listener string