Oracle搭建rac到單庫的adg
上海主庫rac的資料目錄全放在ASM下面
北京備庫的資料目錄存放在/data/uencordb/下面
主庫:
1、把密碼檔案拷貝過去
2、建立備庫控制檔案,拷貝到備庫
alter database create standby controlfile as '/home/oracle/stdctl.ctl';
3、把redo改成合適的大小和組數
4、建立standby redo log --主庫建立這個是為了轉換為備庫,不轉備庫的話沒必要建
alter system set standby_file_management='manual';
alter database add standby logfile thread 1 group 41 ('+DATA/uencordb/onlinelog/standby41.log') size 1g;
alter database add standby logfile thread 1 group 42 ('+DATA/uencordb/onlinelog/standby42.log') size 1g;
alter database add standby logfile thread 1 group 43 ('+DATA/uencordb/onlinelog/standby43.log') size 1g;
alter database add standby logfile thread 1 group 44 ('+DATA/uencordb/onlinelog/standby44.log') size 1g;
alter database add standby logfile thread 1 group 45 ('+DATA/uencordb/onlinelog/standby45.log') size 1g;
alter database add standby logfile thread 1 group 46 ('+DATA/uencordb/onlinelog/standby46.log') size 1g;
alter database add standby logfile thread 1 group 47 ('+DATA/uencordb/onlinelog/standby47.log') size 1g;
alter database add standby logfile thread 2 group 51 ('+DATA/uencordb/onlinelog/standby51.log') size 1g;
alter database add standby logfile thread 2 group 52 ('+DATA/uencordb/onlinelog/standby52.log') size 1g;
alter database add standby logfile thread 2 group 53 ('+DATA/uencordb/onlinelog/standby53.log') size 1g;
alter database add standby logfile thread 2 group 54 ('+DATA/uencordb/onlinelog/standby54.log') size 1g;
alter database add standby logfile thread 2 group 55 ('+DATA/uencordb/onlinelog/standby55.log') size 1g;
alter database add standby logfile thread 2 group 56 ('+DATA/uencordb/onlinelog/standby56.log') size 1g;
alter database add standby logfile thread 2 group 57 ('+DATA/uencordb/onlinelog/standby57.log') size 1g;
alter system set standby_file_management='auto';
5、修改主庫資料庫引數
ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(uencordb,bjcordb)' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+ARCH VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=uencordb' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_3='SERVICE=bjcordb LGWR ASYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=bjcordb' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_3=ENABLE scope=both sid='*';
ALTER SYSTEM SET FAL_CLIENT = 'uencordb' scope=both sid='*';
ALTER SYSTEM SET FAL_SERVER ='bjcordb' scope=both sid='*';
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT =AUTO scope=both sid='*';
如果rac主庫要被切換為備庫的話,就配置下面的引數,需要重啟資料庫
SQL> alter system set db_file_name_convert ='/data/uencordb/','+DATA/uencordb/datafile/','/data/uencordb/','+DATA/uencordb/tempfile/' scope=spfile sid='*';
SQL> alter system set log_file_name_convert='/data/uencordb/','+DATA/uencordb/onlinelog/' scope=spfile sid='*';
6、配置北京備庫引數
*.audit_file_dest='/u01/app/oracle/admin/uencordb/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/data/uencordb/control01.ctl','/data/uencordb/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='uencordb'
*.db_unique_name='bjcordb'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=uencordbXDB)'
*.fal_client='bjcordb'
*.fal_server='uencordb'
*.log_archive_config='dg_config=(uencordb,bjcordb)'
*.log_archive_dest_1='LOCATION=/data/arch/coradg VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=bjcordb'
*.log_archive_dest_2='SERVICE=uencordb LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=uencordb'
*.db_file_name_convert='+DATA/uencordb/datafile/','/data/uencordb/','+DATA/uencordb/tempfile/','/data/uencordb/'
*.log_file_name_convert='+DATA/uencordb/onlinelog/','/data/uencordb/'
*.standby_file_management='auto'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=16135487488
*.processes=5000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=5505
*.sga_max_size=85899345920
*.sga_target=48407511040
*.undo_tablespace='UNDOTBS1'
7、配置靜態監聽:
主庫配置靜態監聽是為了配置dgbroker
主庫節點1
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME = uencordb_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = uencordb1)
)
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME = uencordb_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = uencordb2)
)
)
北京備庫
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME = uencordb_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/
dbhome_1)
(SID_NAME = uencordb)
)
)
8、配置好監聽後,主備互相驗證:
sqlplus sys/xxx@uencordb as sysdba
然後進去rman還原控制檔案:
restore controlfile from '/home/oracle/stdctl.ctl';
然後重新進來做dumplicate
[oracle@adg admin]$ rman target sys/xxx@uencordb auxiliary sys/xxx@bjcordb
RMAN> duplicate target database for standby from active database;
恢復好後,進去sql模式(當前是mount),開啟程式追下歸檔
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
等日誌追平後,再開到readonly
select thread#,sequence#, applied from v$archived_log order by 3 desc,2;
select THREAD#,max(SEQUENCE#) from v$archived_log group by THREAD#;
select process,status from v$managed_standby;
SQL> alter database recover managed standby database cancel;
SQL> ALTER DATABASE OPEN READ ONLY;
結束
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31098809/viewspace-2872490/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 搭建Physical ADG 11.2.0.3 for RAC
- 搭建RAC到單例項DG單例
- OGG搭建(rac到-->單例項)單例
- 單例項Primary快速搭建Standby RAC參考手冊(19.16 ADG)單例
- oracle rac+adg調整redo日誌組導致adg備庫ogg抽取程式abendOracle
- Oracle ADG 備庫新增備庫Oracle
- 主庫RAC,備庫單節點ASM的dataguard搭建ASM
- 使用RMAN遷移單庫到RAC
- oracle 12c 搭建adg注意地方Oracle
- 透過RMAN備份搭建單節點ADG(oracle11g)Oracle
- Oracle 11.2.4.0 ADG 單例項安裝(COPY建立備庫)Oracle單例
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- RAC從帶庫到單例項的恢復單例
- Networker恢復oracle rac到單機Oracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- Oracle RAC搭建(三)Oracle
- Oracle RAC搭建(二)Oracle
- Oracle RAC搭建(一)Oracle
- openPower伺服器搭建Oracle 19c adg伺服器Oracle
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- DG RAC - 單點搭建
- RAC資料庫恢復到單例項資料庫資料庫單例
- 建立Oracle ADG standby資料庫若干方法Oracle資料庫
- Oracle RAC+DG搭建Oracle
- 恢復RAC資料庫到單例項(ASM)資料庫單例ASM
- 從單例項資料庫轉換到RAC環境——RAC的建立和配置單例資料庫
- Oracle 11g RAC到單例項OGG同步Oracle單例
- 將Oracle 10g RAC庫用rman 的方式備份並恢復到異機單機Oracle 10g
- Oracle RAC恢復成單節點資料庫Oracle資料庫
- Oracle RAC & Data Guard搭建高可用資料庫系統方案Oracle資料庫
- Oracle 19c adg全庫遷移資料Oracle
- oracle adg備庫歸檔滿了無法同步Oracle
- 將Oracle 10g RAC庫用rman 的方式備份並恢復到異機單機-3Oracle 10g
- 將Oracle 10g RAC庫用rman 的方式備份並恢復到異機單機 -2Oracle 10g
- ORACLE RAC TO RAC DG搭建過程中可能遇到的問題Oracle
- rac到單例項的rman恢復單例
- RAC叢集資料庫搭建資料庫
- oracle ADG與DG的區別Oracle