ogg停止業務重新初始化目標資料庫流程

db_wjw發表於2012-07-07
有時候如果資料差異太大,可能需要重新同步整個資料庫,可以參考下列流程

源端:
run {
backup as compressed backupset database include current controlfile format '/ywdata/full_rman/fulllisbackup_%U';
}
查詢一個scn號:
select current_scn from v$database;
select dbms_flashback.get_system_change_number from dual;
887839592
將備份集複製到目標端


目標端:
停止應用程式
shutdown immediate;
start nomount;
restore controlfile from '/ywarch/full_rman/fulllisbackup_senffv7v_1_1'
alter database mount;
catalog backuppiece  '/ywarch/full_rman/fulllisbackup_sdnffs25_1_1'
restore database;
複製歸檔日誌
recover database until scn 887839592;
alter database open resetlogs;

建立臨時表空間
create temporary tablespace test tempfile '/ywdata/lis/test01.dbf' size 200m;
alter database default temporary tablespace test;
drop tablespace temp including contents and datafiles;
create temporary tablespace temp tempfile '/ywdata/lis/temp01.dbf' size 2g reuse;
alter database default temporary tablespace temp;
drop tablespace test including contents and datafiles;
select file_name from dba_temp_files;


目標端goldengate:
dblogin userid goldengate password goldengate
delete replicat replis
edit params ./GLOBALS
新增引數,一般就是CHECKPOINTTABLE goldengate.ggchkpt
exit
dblogin userid goldengate password goldengate
add checkpointtable
add replicat replis,EXTTRAIL ./dirdat/rt CHECKPOINTTABLE goldengate.ggchkpt
edit params replis
引數根據需要做修改
alter replicat replis extseqno 89, extrba 0
start replis aftercsn 887839592

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

相關文章