您好,登錄后才能下訂單哦!
配置好主庫參數文件:
添加:
*.log_archive_config='DG_CONFIG=(CWFOL,CWFOLB)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=CWFOL'
*.log_archive_dest_2='SERVICE=CWFOLB LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=CWFOLB'
重啟每個節點:
2.為主庫添加standby log:
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 1('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
3.配置靜態監聽,,主庫和備庫,各節點,,,
4.主庫開啟閃回和強制日志:
5.生成密碼文件:
orapwd file='$ORACLE_HOME/dbs/orapwCWFOL1' password=oracle entries=5 force=y ignorecase=y;
orapwd file='$ORACLE_HOME/dbs/orapwCWFOL2' password=oracle entries=5 force=y ignorecase=y;
orapwd file='$ORACLE_HOME/dbs/orapwCWFOLB' password=oracle entries=5 force=y ignorecase=y;
或者在一個節點生成后,然后拷貝到別的節點,重新命名。
6.備庫編輯一個文件,只需要db_name:
[oracle@foldg dbs]$ cat initCWFOLB.ora
db_name=CWFOLB
7.編輯duplicate.sql
[oracle@foldb1 ~]$ cat duplicate.sql
duplicate target database
for standby
from active database
DORECOVER
spfile
set service_names='CWFOLB'
set db_unique_name='CWFOLB'
set log_archive_dest_1='location=+FRA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=CWFOLB'
set log_archive_dest_2='SERVICE=COWELLORC LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=CWFOL'
set standby_file_management='AUTO'
set fal_server='CWFOL'
set fal_client='CWFOLB'
set control_files='+DATA'
set cluster_database='false';
出現的錯誤:
1.
MAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/28/2016 13:03:45
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04014: startup failed: ORA-00119: invalid specification for system parameter REMOTE_LISTENER
ORA-00132: syntax error or unresolved network name 'foldb-cluster-scan:1521'
RMAN> **end-of-file**
*.remote_listener='foldb-cluster-scan:1521'
解決辦法:再主庫上去掉這個參數,復制完成后,修改回來。
2.主庫和備庫無法進行實時同步, 狀態為wait_for_log.需要alter system switch logfile才行.
原因是在備庫上沒有針對節點2的standby log,添加:
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
alter database add standby logfile thread 2('+DATA','+FRA') size 200M;
正常結果如下:
SQL> select status from v$managed_standby;
STATUS
------------
CLOSING
CLOSING
CLOSING
CONNECTED
IDLE
IDLE
APPLYING_LOG
IDLE
IDLE
IDLE
IDLE
11 rows selected.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。