1. 首页
  2. IT资讯

2013-3-19数据库DG切换

(1) DG切换–查询角色及切换状态select database_role, switchover_status from v$database;
–查询归档最大序列号:select max(sequence#) from v$archived_log where applied=’YES’;
–首先:主库切换到备库alter database commit to switchover to physical standby with session shutdown;shutdown immediatestartup mountalter database recover managed standby database disconnect from session;(开启恢复)
–然后:备库切换到主库alter database commit ot switchover to primary with session shutdown ;alter database open;
–改密码:alter user product identified by XXXXX;
–最后检查进程:(主库执行,激活远程归档)alter system set log_archive_dest_state_2=ENABLE;alter system switch logfile;
(备库执行,检查是否有MRP、RFS两个进程)select process, status from v$managed_standby;
(2) DG关闭
–查询角色:select database_role, switchover_status from v$database;
–先关主库:shutdown immediate;lsnrclt stop ->重启服务器
–再关备库alter database recover managed standby database cancel;shutdown immediate;lsnrclt stop ->重启服务器
(3) DG 开启
–先开备库:lsnrctl startstartup mountalter database recover managed standby database disconnect from session;(开启恢复)
–再开主库:lsnrctl startstartup
–改密码:alter user product identified by XXXXX;
–最后检查进程:(主库执行,激活远程归档)alter system set log_archive_dest_state_2=ENABLE;alter system switch logfile;
(备库执行,检查是否有MRP、RFS两个进程)select process, status from v$managed_standby;
—修改密码:alter user product identified by XXXXX;alter user PRODUCT_B2B identified by XXXXX;
(4)中央改密码:alter user product identified by XXXXX;alter user PRODUCT_B2B identified by XXXXX;
一、【1.14】:————————CT_WAREHOU CENTER.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-12-17 21:03:49SE
WAREHOUSE WXXRDB1_26.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-12-17 21:02:50WAREHOUSE CENTER.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-09-17 22:43:46—————————-
(1) CENTER.CENTER.WXXR.COM.CN
sqlplus CT_WAREHOU/ct_warehousedrop database link CENTER.CENTER.WXXR.COM.CN;create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using ‘CENTER-WXXRDB’;select * from dual@CENTER.CENTER.WXXR.COM.CN;
(2) WXXRDB1_26.CENTER.WXXR.COM.CN
sqlplus WAREHOUSE/warehousedrop database link WXXRDB1_26.CENTER.WXXR.COM.CN;create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using ‘CENTER-WXXRDB’;select * from dual@WXXRDB1_26.CENTER.WXXR.COM.CN;
(3) CENTER.CENTER.WXXR.COM.CN
sqlplus WAREHOUSE/warehousedrop database link CENTER.CENTER.WXXR.COM.CN ;create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using ‘CENTER-WXXRDB’;select * from dual@CENTER.CENTER.WXXR.COM.CN;
二、【1.18】———————————-WAREHOUSE WXXRDB.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2013-02-07 11:03:13WAREHOUSE WXXRDB1_26.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2013-02-01 10:20:10———————————-(1) WXXRDB.CENTER.WXXR.COM.CN
sqlplus/ as sysdbadrop database link WXXRDB.CENTER.WXXR.COM.CN;create database link WXXRDB.CENTER.WXXR.COM.CN connect to product identified by XXXXX using ‘CENTER-WXXRDB’;
(2) WXXRDB1_26.CENTER.WXXR.COM.CN
sqlplus/ as sysdbadrop database link WXXRDB1_26.CENTER.WXXR.COM.CN;create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using ‘CENTER-WXXRDB’;
三、【1.74】——————————STAGEAREA WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-27 13:46:41PUBLIC WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-19 09:12:39
————————————–(1) WXXRDB.CENTER.WXXR.COM.CN
sqlplus STAGEAREA/stageareadrop database link WXXRDB.CENTER.WXXR.COM.CN;create database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using ‘WXXRDB.CENTER.WXXR.COM.CN’;select * from dual@WXXRDB.CENTER.WXXR.COM.CN;
(2) WXXRDB.CENTER.WXXR.COM.CN sqlplus / as sysdbadrop public database link WXXRDB.CENTER.WXXR.COM.CN;create public database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using ‘WXXRDB.CENTER.WXXR.COM.CN’;select * from dual@WXXRDB.CENTER.WXXR.COM.CN;
四 、【1.24】
export ORACLE_SID=wxxrdbjxsqlplus / as sysdba alter user product identified by XXXXX;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-756480/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:布吉卡,转转请注明出处:http://www.cxybcw.com/196013.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code