單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(5)

cow977發表於2011-12-05

單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(1)http://space.itpub.net/81227/viewspace-713012

單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(2)http://space.itpub.net/81227/viewspace-713013

單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(3)http://space.itpub.net/81227/viewspace-713014

單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(4)http://space.itpub.net/81227/viewspace-713017

 

 

七. 一些其他操作

1. 設定新的資料保護模式並重啟資料庫  --primary資料庫操作

當保護模式更改順序:maximize protection ---&gt  maximize availability ----&gt maximize performance

當在把dataguard的保護級別按這上面的順序減低的時候,不需要primary庫在mount狀態,否則primary 必須在mount 狀態。如:

SQL> select protection_mode,protection_level from v$database;

PROTECTION_MODE      PROTECTION_LEVEL

-------------------- --------------------

MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE

 

SQL> alter database set standby database to maximize availability;

SQL> select protection_mode,protection_level from v$database;

PROTECTION_MODE      PROTECTION_LEVEL

-------------------- --------------------

MAXIMUM AVAILABILITY RESYNCHRONIZATION

 

SQL> alter system switch logfile;

SQL> select protection_mode,protection_level from v$database;

PROTECTION_MODE      PROTECTION_LEVEL

-------------------- --------------------

MAXIMUM AVAILABILITY RESYNCHRONIZATION

 

SQL> shutdown immediate;

SQL> startup

SQL> select protection_mode,protection_level from v$database;

 

PROTECTION_MODE      PROTECTION_LEVEL

-------------------- --------------------

MAXIMUM AVAILABILITY RESYNCHRONIZATION

 

Maximum protection/AVAILABILITY/ PERFORMANCE模式必須滿足的條件

 

最大保護

最高可能用

最高效能

REDO寫程式

LGWR

LGWR

LGWR or ARCH

網路傳輸模式

SYNC

SYNC

LGWRSYNC or ASYNC. ARCHSYNC

磁碟寫操作

AFFIRM

AFFIRM

AFFIRM or NOAFFIRM

是否需要Standby redolog?

Yes

Yes

可沒有但推薦有

 

SQL> alter system set log_archive_dest_2='SERVICE=stby LGWR SYNC AFFIRM valid_for=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=stby' scope=spfile;

 

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database set standby database to maximize availability;

SQL> alter database open;

Database altered.

SQL> select protection_mode,protection_level from v$database;

PROTECTION_MODE      PROTECTION_LEVEL

-------------------- --------------------

MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY

 

 

alter database set standby database to maximize performance;

提示:maximize後可跟{PROTECTION | AVAILABILITY | PERFORMANCE},分別對應最大保護,最高可用性及最高效能。

在最大保護模式下,直接關閉備庫是不行的,如果在備庫上關閉資料庫,會有如下提示:

SQL> shutdown immediate

ORA-01154: database busy. Open, close, mount, and dismount not allowed now

在最大保護模式下,備庫是不允許關閉的,此時首先關閉主庫,然後備庫就可以順利關閉了。

注意:主庫的保護模式修改之後,備庫的模式也會改變,和主庫保持一致。

3. 檢視日誌歸檔情況

主庫進行日誌切換:

SQL>Alter system switch logfile;

select max(sequence#) from v$archived_log;

select max(sequence#) from v$log_history;

select group#,sequence#,archived,status from v$log;

select name,sequence#,applied from v$archived_log;

select sequence#,applied from v$archived_log;

若不同步,

1)看log日誌,archive是否有丟失

2)可以在備庫做如下操作:

alter database recover managed standby database cancel;

alter database recover managed standby database disconnect from session;

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/81227/viewspace-713018/,如需轉載,請註明出處,否則將追究法律責任。

相關文章