Oracle ADG 備庫新增備庫
Oracle ADG
備庫新增備庫
2
種情況:
1、
主備資料目錄一樣,無需重啟,線上新增備庫
2、
主備資料目錄設定不一樣,需要重啟讓引數生效
一、
主備資料目錄一樣線上新增備庫
1、
主庫備份和建立
standby
控制檔案
用常規備份指令碼就行,歸檔可備份可不備份
建立備庫控制檔案
alter database create standby controlfile as '/home/oracle/xie/208ctl.ctl';
密碼檔案
拷貝到備庫的
dbs
目錄下面
把控制檔案和備份檔案以及需要的歸檔拷貝到備庫
2、
配置監聽
主備庫,
CRMPOS102
為新新增的備庫
3
的監聽:
3、
備庫開啟歸檔,配置引數檔案
主要注意新增這幾個引數,用
pfile
更改方便些:
*.db_name='crmpos'
*.db_unique_name='crmpos102'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_dest_1='location=/u01/app/oracle/arch/crmpos'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_config='dg_config=(crmpos,crmpos01,crmpos02,crmpos102)'
*.log_archive_dest_2='service=crmpos lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) REOPEN=60 COMPRESSION=ENABLE db_unique_name=crmpos'
*.log_archive_dest_state_2='enable
*.fal_client='crmpos102'
*.fal_server=crmpos
startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initcrmpos.ora';
create spfile from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initcrmpos.ora';
shutdown immediate;
startup nomount
4
、恢復
standby
控制檔案
RMAN> restore standby controlfile from '/xie/crmpos/175ctl.ctl';
5
、恢復庫
SQL> sql 'alter database mount';
RMAN> catalog start with '/xie/crmpos/2022021602';
crosscheck backup;
delete noprompt expired backup;
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
6、
新增
srl
alter system set standby_file_management='manual';
alter database add standby logfile group 12 ('/u01/app/oracle/oradata/crmpos/stdred02.log') size 1024M;
alter database add standby logfile group 13 ('/u01/app/oracle/oradata/crmpos/stdred03.log') size 1024M;
alter database add standby logfile group 14 ('/u01/app/oracle/oradata/crmpos/stdred04.log') size 1024M;
alter database add standby logfile group 15 ('/u01/app/oracle/oradata/crmpos/stdred05.log') size 1024M;
alter system set standby_file_management='auto';
7
、主庫更改引數
(
注意:log_archive_config
寫的是
db_unique_name)
alter system set log_archive_config='dg_config=(crmpos,crmpos01,crmpos02,
crmpos102)';
alter system set log_archive_dest_4='service=crmpos102 lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) REOPEN=60 COMPRESSION=ENABLE db_unique_name=crmpos102' scope=both;
(
注意:'service
寫的是
tns
裡的名字
)
alter system set log_archive_dest_4='service=crmpos102 lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) REOPEN=60 COMPRESSION=ENABLE db_unique_name=crmpos102' scope=both;
8
、備庫
open read only
,並開啟實時同步
alter database open read only;
alter database recover managed standby database using current logfile disconnect from session;
二、
主備資料目錄不一樣新增備庫
(
需重啟
)
uenqs
為新新增的備庫
前面步驟一樣:備份、建立
standby
控制檔案、傳輸密碼檔案、配置監聽、新增
srl
不一樣的地方:
1
、恢復庫的時候更改資料目錄
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
SET NEWNAME FOR DATAFILE 1 to '/u01/app/oracle/oradata/uenqs/system01.dbf';
SET NEWNAME FOR DATAFILE 2 to '/u01/app/oracle/oradata/uenqs/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 to '/u01/app/oracle/oradata/uenqs/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 to '/u01/app/oracle/oradata/uenqs/users01.dbf';
SET NEWNAME FOR DATAFILE 5 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs01.dbf';
SET NEWNAME FOR DATAFILE 6 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs01.dbf';
SET NEWNAME FOR DATAFILE 7 to '/u01/app/oracle/oradata/uenqs/ams_tbs01.dbf';
SET NEWNAME FOR DATAFILE 8 to '/u01/app/oracle/oradata/uenqs/ams_tbs02.dbf';
SET NEWNAME FOR DATAFILE 9 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs02.dbf';
SET NEWNAME FOR DATAFILE 10 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs03.dbf';
SET NEWNAME FOR DATAFILE 11 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs04.dbf';
SET NEWNAME FOR DATAFILE 12 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs02.dbf';
SET NEWNAME FOR DATAFILE 13 to '/u01/app/oracle/oradata/uenqs/uenshks_tbs01.dbf';
SET NEWNAME FOR DATAFILE 14 to '/u01/app/oracle/oradata/uenqs/sysaux02.dbf';
SET NEWNAME FOR DATAFILE 15 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs03.dbf';
SET NEWNAME FOR DATAFILE 16 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs05.dbf';
SET NEWNAME FOR DATAFILE 17 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs06.dbf';
SET NEWNAME FOR DATAFILE 18 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs04.dbf';
SET NEWNAME FOR DATAFILE 19 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs07.dbf';
SET NEWNAME FOR DATAFILE 20 to '/u01/app/oracle/oradata/uenqs/uenpay_tbs08.dbf';
SET NEWNAME FOR DATAFILE 21 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs05.dbf';
SET NEWNAME FOR DATAFILE 22 to '/u01/app/oracle/oradata/uenqs/uenagent_tbs06.dbf';
SET NEWNAME FOR DATAFILE 23 to '/u01/app/oracle/oradata/uenqs/UENJSGL_tbs01.dbf';
restore database;
switch datafile all;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
2
、更改引數檔案
主庫的引數:
(UENPAY
為之前另外一套庫的,可以不用配置,改convert
引數需要重啟
)
alter system set log_archive_config='dg_config=(UENPAY,UENPAY01,UENPAY02,UENQS)';
alter system set log_archive_config='dg_config=(UENPAY,UENPAY01,UENPAY02,UENQS)';
alter system set log_archive_dest_4='service=UENQS lgwr async NOAFFIRM valid_for=(online_logfiles,primary_role) REOPEN=60 COMPRESSION=ENABLE db_unique_name=UENQS' scope=both;
alter system set db_file_name_convert='/u01/app/oracle/oradata/uenqs/','/data/uenpay/data/' scope=spfile;
alter system set log_file_name_convert='/u01/app/oracle/oradata/uenqs/','/data/uenpay/data/','/u01/app/oracle/arch/uenqs/','/data/archivelog/' scope=spfile;
alter system set db_file_name_convert='/data/uenpay/data/','/u01/app/oracle/oradata/uenqs/' scope=spfile;
alter system set log_file_name_convert='/data/uenpay/data/','/u01/app/oracle/oradata/uenqs/','/data/archivelog/','/u01/app/oracle/arch/uenqs/' scope=spfile;
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_4=defer scope=both;
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_4=ENABLE scope=both;
備庫的日誌轉換引數和主庫相反,其他一樣
其他的一樣,然後開啟備庫,開啟實時同步就行
---------------------------
有報錯就看日誌,然後查 v$archive_dest;
分析
select dest_name, status, error from v$archive_dest;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31098809/viewspace-2856400/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle adg備庫歸檔滿了無法同步Oracle
- oracle rac+adg調整redo日誌組導致adg備庫ogg抽取程式abendOracle
- Oracle DG備庫手動管理新增資料檔案Oracle
- 11g ADG級聯備庫基礎測試環境準備
- ORACLE DG之備庫角色Oracle
- Oracle:Failover 到物理備庫OracleAI
- oracle資料庫備份之exp增量備份Oracle資料庫
- 如何在12.2版本ADG備庫生成AWR報告
- Oracle Adg 備庫 ORA-10458 ORA-01196 ORA-01110: ORA-10458 故障處理Oracle
- 「Oracle」Oracle 資料庫備份還原Oracle資料庫
- Oracle ADG環境下的RMAN備份策略Oracle
- oracle 備份資料庫,匯出資料庫Oracle資料庫
- Oracle搭建rac到單庫的adgOracle
- Oracle資料庫冷備和恢復Oracle資料庫
- 每天自動備份Oracle資料庫Oracle資料庫
- ORACLE DG從庫 Rman備份恢復Oracle
- oracle uncatalog資料庫備份檔案Oracle資料庫
- 19c ADG環境中主庫PDB調整SGA_TARGET自動同步到備庫
- Oracle資料庫備份、災備的23個常見問題Oracle資料庫
- Oracle 12.2 physical standby備庫收集AWR報告Oracle
- Oracle備庫當機啟動解決方案Oracle
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- Oracle資料庫由dataguard備庫引起的log file sync等待Oracle資料庫
- DG備庫手動管理 新增資料檔案
- Mysqldump 在備庫進行備份時會阻塞備庫的sql_threadMySqlthread
- Oracle 19c adg全庫遷移資料Oracle
- Oracle檢視歸檔是否被備庫應用Oracle
- Oracle資料庫備份還原詳解XKUSOracle資料庫
- STANDBY_FILE_MANAGEMENT引數未設定auto導致的ADG備庫異常
- oracle sqldeveloper選擇性複製備份資料庫OracleSQLDeveloper資料庫
- 【DATAGUARD】Oracle Dataguard物理備庫切換最佳實踐(sqlplus)OracleSQL
- 資料庫備份資料庫
- 【ASK_ORACLE】Oracle Data Guard(二)物理備庫的概念和優勢Oracle
- 【ASK_ORACLE】Oracle Data Guard(四)快照備庫的概念和優勢Oracle
- mysqldump備份單庫、部分庫、全庫、及排除部分庫MySql
- MySQL 5.7 主庫崩潰切備庫MySql
- oracle adg主庫通過rman無法刪除歸檔Oracle
- BMMySQL定時備份資料庫(全庫備份)的實現meuMySql資料庫