ITPub博客

首页 > 数据库 > Oracle > logical standby switchover

logical standby switchover

原创 Oracle 作者:mis_wub 时间:2007-01-04 11:35:51 0 删除 编辑
ONLY TEST[@more@]

logical standby switchover:
rac26(primary):
SQL> alter database commit to switchover to logical standby;
SQL> alter system set log_archive_dest_state_2=defer scope=both;
將主數據庫轉換為備用模式﹐并設為沒有能力傳送日志到其它地方

RAC49(standby):
SQL> alter database commit to switchover to primary;
SQL> alter system set log_archive_dest_2='service=ora9i26' scope=both;
將備數據庫轉換為主模式﹐并設為具有傳送日志到遠程的能力

rac26(standby):
SQL> execute dbms_logstdby.guard_bypass_on;
SQL> create database link lgstb
2 connect to oracle identified by oracle using 'ora9i49';
oracel 用戶具有select_catalog_role的權限
SQL> execute dbms_logstdby.guard_bypass_off;
SQL> select * from dba_users@lgstb;
成功連接
創建DBLINK﹐當global_names=true時﹐DBLINK連接可能會不成功 ﹐請將它設為FALSE

SQL> alter database start logical standby apply new primary lgstb;
SQL> alter system set standby_archive_dest='/opt/ora9/arch/9istb' scope=both;
利用DBLINK應用日志
System altered.

SQL> alter system set standby_file_management='AUTO' scope=both;

System altered.

RAC49(primary):
SQL> alter system archive log start;

System altered.

SQL> alter system switch logfile;

System altered.
---開始歸檔﹐并做日志切換


實驗﹕
RAC49(primary):
SQL> connect oracle/oracle
Connected.
SQL> create table temp01(a number);

Table created.

SQL> insert into temp01 values(1);

1 row created.

SQL> insert into temp01 values(2);

1 row created.

SQL> commit;

Commit complete.

SQL> conn sys/oracle as sysdba
Connected.
SQL> alter system archive log current;
SQL> alter system archive log current;

RAC26(standby):
SQL> select * from oracle.temp01;

A
----------
1
2
傳送完成并創建表

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

上一篇: RDA的使用
请登录后发表评论 登录
全部评论
  • 博文量
    3
  • 访问量
    18797