您好,登錄后才能下訂單哦!
DG-duplicate 操作注意事項
log_file_name_convert='+orcl_DATA/orcldb','+orcl_data/orcldb_dg2'
查看ASM磁盤的詳細信息及狀態
select group_number,disk_number,header_status,mode_status,state,total_mb,name,failgroup,path from v$asm_disk;
select name,state from v$asm_diskgroup;
-- 添加 ASM磁盤組
Create diskgroup orcl1_DATA external redundancy disk '/dev/asm_vdd';
Create diskgroup orcl2_DATA external redundancy disk '/dev/asm_vdb';
Create diskgroup orcl3_DATA external redundancy disk '/dev/asm_vdi';
給磁盤組添加磁盤
alter diskgroup data add disk '/dev/asm_vde';
alter diskgroup data add disk '/dev/asm_vdf';
alter diskgroup data add disk '/dev/asm_vdg';
alter diskgroup data add disk '/dev/asm_vdh';
alter diskgroup data add disk '/dev/asm_vdj';
--加載磁盤組
ALTER DISKGROUP DATA MOUNT;
ip地址 orcldb-dg
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
1
LOG_ARCHIVE_DEST_2
ERROR ORA-16191: ??????????????????
2
LOG_ARCHIVE_DEST_2
ERROR ORA-16191: ??????????????????
或者
2
LOG_ARCHIVE_DEST_2
ERROR ORA-16058: ??????????
1
LOG_ARCHIVE_DEST_2
ERROR ORA-16058: ??????????
這個時候需要去備庫重啟數據庫實例
Shutdown immediate
startup
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/28/2018 19:36:20
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/28/2018 19:36:20
ORA-00245: ????????; ?????????????
嘗試手動執行命令,不用腳本
crsctl start resource ora.diskmon
crsctl status resource -t
crs_stat -p ora.cssd
crsctl modify resource "ora.cssd" -attr "AUTO_START=1" --設置自動啟動
crs_stat -p ora.diskmon
crsctl modify resource "ora.diskmon" -attr "AUTO_START=1" --設置自動啟動
注意:這里采用圖形界面安裝GRID軟件,要選擇第二項安裝
如果選擇的是最后一項安裝軟件,可能會漏掉一些CRS服務,導致無法使用asmca命令打開圖形界面
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
2
LOG_ARCHIVE_DEST_2
ERROR ORA-01033: ORACLE initialization or shutdown in progress
1
LOG_ARCHIVE_DEST_2
ERROR ORA-01033: ORACLE initialization or shutdown in progress
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
解決方法:
1、檢查RAC節點的密碼文件是否同步,可以直接拷貝覆蓋一下
2、檢查DG節點的密碼文件是否同步, 可以直接拷貝RAC的密碼文件到DG覆蓋
3、在主節點alter system set log_archive_dest_state_2=enable;
4、再次查詢狀態變成VALID正常
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
2
LOG_ARCHIVE_DEST_2
VALID
1
LOG_ARCHIVE_DEST_2
VALID
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
注意:檢驗是否因密碼問題導致DG日志不同步,也可以在alter.log里面查找驗證(主庫和備庫都看)
19、如果遇到下面的報錯,哈哈,可能你設置的路徑并不是LOG_ARCHIVE_DEST_2
也可能是LOG_ARCHIVE_DEST_3,所以要看清楚了。 select * from V$ARCHIVE_DEST_STATUS
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
2
LOG_ARCHIVE_DEST_2
BAD PARAM
1
LOG_ARCHIVE_DEST_2
BAD PARAM
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
20、在DG庫上設置同步后,發現日志并沒有同步
SQL> select thread#,process,client_process,sequence#,status from v$managed_standby;
THREAD# PROCESS CLIENT_P SEQUENCE# STATUS
---------- --------- -------- ---------- ------------
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
2 MRP0 N/A 2880 APPLYING_LOG
這個時候,查看主庫狀態
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
1
LOG_ARCHIVE_DEST_2
ERROR ORA-03135: connection lost contact
2
LOG_ARCHIVE_DEST_2
ERROR ORA-03135: connection lost contact
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
在主庫重新enable也沒用
alter system set log_archive_dest_state_2=ENABLE;
檢查DG備庫監聽,發現監聽沒啟動
su - oracle
lsnrctl start
然后再次檢查,發現還是不同步
主庫查狀態
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
1
LOG_ARCHIVE_DEST_2
ERROR ORA-12543: TNS:destination host unreachable
2
LOG_ARCHIVE_DEST_2
ERROR ORA-12543: TNS:destination host unreachable
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
這個時候,檢查DG備庫,發現,iptables -L 發現防火墻阻攔了
iptables -F清除
問題解決
21、 在DG庫上設置同步后,發現日志并沒有同步
SQL> select thread#,process,client_process,sequence#,status from v$managed_standby;
THREAD# PROCESS CLIENT_P SEQUENCE# STATUS
---------- --------- -------- ---------- ------------
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
0 ARCH ARCH 0 CONNECTED
2 MRP0 N/A 2880 APPLYING_LOG
這個時候,查看主庫狀態
SQL> select inst_id,dest_name,status,error from gv$archive_dest_status where dest_name='LOG_ARCHIVE_DEST_2';
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
2
LOG_ARCHIVE_DEST_2
DISABLED ORA-16057: server not in Data Guard configuration
1
LOG_ARCHIVE_DEST_2
DISABLED ORA-16057: server not in Data Guard configuration
INST_ID
----------
DEST_NAME
--------------------------------------------------------------------------------
STATUS ERROR
--------- -----------------------------------------------------------------
看到這個報錯,就要去檢查log_archive_config了
主備庫兩個都要檢查,因為他們要一致
主庫查看
SQL> show parameter log_archive_config
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config string DG_CONFIG=orcldb,orcldbdg3)
備庫查看
SQL> show parameter log_archive_config
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_config string DG_CONFIG=(orcldbdg3,orcldbdg)
果然不一致,修改它
SQL> alter system set log_archive_config='DG_CONFIG=(orcldbdg3,orcldb)';
去主庫重新enable一下
alter system set log_archive_dest_state_2=ENABLE;
回到備庫,發現已經開通同步日志了
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。