利用Oracle的STANDBY技术,可以将单实例数据库升级到RAC数据库。这种方式可以有效的降低单实例迁移到RAC环境的停机时间。
这篇文章介绍STANDBY数据库的建立。
上一篇完成了绝大部分准备的工作,下面在打开数据库之前,还要设置一下目标数据库上的密码文件。
在STANDBY的RAC环境的两个节点上分别拷贝密码文件:
bash-3.00$ cd $ORACLE_HOME/dbs
bash-3.00$ ftp 172.0.2.61
Connected to 172.0.2.61.
220 netdb1 FTP server ready.
Name (172.0.2.61:oracle): oracle
331 Password required for oracle.
Password:
230 User oracle logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set toI.
ftp> cd /data/oracle/product/11.1/dbs
250 CWD command successful.
ftp> prompt
Interactive mode off.
ftp> mget orapwtest11g
200 PORT command successful.
150 Opening BINARY mode data connection for orapwtest11g(1536 bytes).
226 Transfer complete.
local: orapwtest11gremote: orapwtest11g
1536 bytes received in 0.017 seconds (87.65 Kbytes/s)
ftp> exit
?Invalid command
ftp> quit
221-You have transferred 1536 bytes in 1 files.
221-Total traffic for this session was 2229 bytes in 2 transfers.
221-Thank you for using the FTP service on netdb1.
221 Goodbye.
bash-3.00$ mv orapwtest11gorapwtest11gr1
在节点2上,密码文件应该重命名为orapwtest11gr2。
修改STANDBY数据库节点1上的监听配置,在SID_LIST_LISTENER的配置中,添加test11gr1的配置:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = rac11g1)
(ORACLE_HOME = /data/oracle/product/11.1/database)
)
(SID_DESC =
(SID_NAME = test11gr1)
(ORACLE_HOME = /data/oracle/product/11.1/database)
)
)
下面重启监听:
bash-3.00$ lsnrctl stop
LSNRCTL for Solaris: Version11.1.0.6.0 - Production on 13-7月-2009 17:21:39
Copyright (c) 1991, 2007, Oracle. All rights reserved.
正在连接到(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ser1-vip)(PORT=1521)))
命令执行成功
bash-3.00$ lsnrctl start
LSNRCTL for Solaris: Version11.1.0.6.0 - Production on 13-7月-2009 17:21:42
Copyright (c) 1991, 2007, Oracle. All rights reserved.
启动/data/oracle/product/11.1/database/bin/tnslsnr:请稍候...
TNSLSNR for Solaris: Version11.1.0.6.0 - Production
系统参数文件为/data/oracle/product/11.1/database/network/admin/listener.ora
写入/data/oracle/diag/tnslsnr/ser1/listener/alert/log.xml的日志信息
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.0.2.68)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ser1)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
正在连接到(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ser1-vip)(PORT=1521)))
LISTENER的STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for Solaris: Version11.1.0.6.0 - Production
查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/