为了减少机器浪费,决定把分布在两个服务器上的数据库用户数据合并到同一个服务器上的同一个数据库。
数据库A和数据库B的service_name都一样,IP不一样。
由于有不同的应用分布在这两个数据库上,为了不影响这些程序的运行,需要把原来的两个服务器用到的IP都分配给新服务器。相应的监听文件也应作相应的修改:
原监听文件:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.107)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = mydb)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(SID_NAME = mysid)
新监听文件:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.107)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.201)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = mydb)
(ORACLE_HOME = /opt/oracle/product/9.2.0)
(SID_NAME = mysid)
)
)
这样,不用修改程序的数据库连接,就可以正常运行原来的程序。整个数据库合并对应用透明。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/231499/viewspace-63740/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/231499/viewspace-63740/