ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 物理Standby角色切換作業failover

物理Standby角色切換作業failover

原创 Linux操作系统 作者:aishu521 时间:2012-06-21 17:23:23 0 删除 编辑

1,先關閉主的數據庫

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

以下都是在備援上面測試

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;

Database altered.

SQL> alter database commit to switchover to primary;

Database altered.

SQL> create spfile from pfile;

File created.

SQL>  ALTER DATABASE OPEN;

Database altered.

SQL> alter database stop logical standby apply;

Database altered.
SQL> shutdown immediate;      ------------1
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  348127232 bytes
Fixed Size                  1219328 bytes
Variable Size             113247488 bytes
Database Buffers          226492416 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

SQL> alter system set db_unique_name='zdtdbat1' scope=spfile;

System altered.
SQL> alter system set log_archive_dest_1='LOCATION=/u09/archivelog/zdtdbat1/ VALID_FOR=

(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=zdtdbat1' sco
pe=spfile;

System altered.

SQL> create pfile= '$ORACLE_HOME/dbs/initzdtdbat1.ora_2' from spfile;

File created.

SQL> shutdown immediate  ----- 2
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@zdttest dbs]$ export ORACLE_SID=zdtdbat1
[oracle@zdttest dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 21 16:41:51 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.
SQL> startup pfile='$ORACLE_HOME/dbs/initzdtdbat1.ora_2';    
ORACLE instance started.

Total System Global Area  348127232 bytes
Fixed Size                  1219328 bytes
Variable Size             104858880 bytes
Database Buffers          234881024 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile='$ORACLE_HOME/dbs/initzdtdbat1.ora_2';

File created.

SQL> shutdown immediate;       -------3
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area  348127232 bytes
Fixed Size                  1219328 bytes
Variable Size             104858880 bytes
Database Buffers          234881024 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.
SQL> create pfile='$ORACLE_HOME/dbs/initzdtdbat1.ora' from spfile;

File created.
[oracle@zdttest dbs]$ vi   initzdtdbat1.ora
zdtdbat1sb.__db_cache_size=234881024
zdtdbat1.__db_cache_size=234881024
zdtdbat1.__java_pool_size=4194304
[oracle@zdttest dbs]$ sqlplus / as sysdba

SQL> startup pfile='$ORACLE_HOME/dbs/initzdtdbat1.ora';
ORACLE instance started.

Total System Global Area  348127232 bytes
Fixed Size                  1219328 bytes
Variable Size             104858880 bytes
Database Buffers          234881024 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.
SQL> create spfile from  pfile='$ORACLE_HOME/dbs/initzdtdbat1.ora';

File created.
SQL> shutdown immediate                 ----4
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup                            
SQL> select count(*) from aishu.OBJ_TS;

  COUNT(*)
----------
     50048

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

上一篇: 主備切換(failover)
请登录后发表评论 登录
全部评论

注册时间:2012-05-26

  • 博文量
    139
  • 访问量
    676951