ora11g dataguard新特性嘗試2

blueocean926發表於2009-01-01
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4

前期準備

檢視STANDBY庫必須的引數

DB_UNIQUE_NAME=boston

LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)'

LOG_ARCHIVE_DEST_1='LOCATION=/usr/oradata/arch1/boston/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=boston'

LOG_ARCHIVE_DEST_2='SERVICE=STANDBY ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chicago'

LOG_ARCHIVE_DEST_STATE_1=ENABLE

LOG_ARCHIVE_DEST_STATE_2=ENABLE

REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

LOG_ARCHIVE_FORMAT=%t_%s_%r.arc

LOG_ARCHIVE_MAX_PROCESSES=5

FAL_SERVER=chicago

FAL_CLIENT=boston

STANDBY_FILE_MANAGEMENT=AUTO

CREATE SPFILE FROM PFILE='/tmp/initboston.ora';

ALTER DATABASE ADD STANDBY LOGFILE('/usr/oradata/ora11g/standby01.dbf') size 50M;

ALTER DATABASE ADD STANDBY LOGFILE('/usr/oradata/ora11g/standby02.dbf') size 50M;

ALTER DATABASE ADD STANDBY LOGFILE('/usr/oradata/ora11g/standby03.dbf') size 50M;

ALTER DATABASE ADD STANDBY LOGFILE('/usr/oradata/ora11g/standby04.dbf') size 50M;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

檢視那些歸檔日誌被APPLY

SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# APP

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

26 YES

27 YES

28 YES

29 YES

30 YES

ALTER DATABASE OPEN READ ONLY;

PRIMARY庫上做些插入操作

SQL> insert into person values (1,'aa','bb');

SQL> insert into person values (2,'bb','cc');

SQL> alter system switch logfile;

STANDBY庫上可以立刻查詢到對應的修改

SQL> select * from person

ID NAME NAME1

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

1 aa bb

2 bb cc
[@more@]

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

相關文章