物理Standby角色切換作業failover

aishu521發表於2012-06-21

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章