需求:
A库服务器 和 B库服务器之间要实现监听跳转。A库服务器 数据库关闭,但是它的监听需要把外来的程序转到B库上进行访问。
具体操作:
A库:
shutdown immediate;
lsnrctl start
B库:
vi tnsnames.ora
新增
----------------------------------------
LISTENE_R =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.31.152)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dgfghsdb)
)
)
----------------------------------------
数据库中修改remote_listener
SYS@fghsdb> alter system set remote_listener=LISTENE_R;
修改 listener.ora (修改成A库一样的名字)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=dgfghsdb)
(SID_NAME=fghsdb)
(ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1)
)
)
lsnrctl stop
lsnrctl start