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

db_wjw發表於2012-07-30

線上重新同步資料庫流程:(重點是啟動抽取程式時間要在恢復的SCN之前)
1、備份源系統:
rman target /
run {
backup as compressed backupset database include current controlfile format '/ywdata/full_rman/fulllisbackup_%U';
}

2、傳輸備份資料檔案
scp

3、還原目標資料庫
Export ORACLE_SID=lis
Rman target /
shutdown immediate;startup 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;

4、停止所有程式並刪除抽取程式、data pump程式
stop 程式
dblogin userid goldengate password goldengate
delete 程式

5、重新配置抽取程式:
add extract extlis, tranlog, begin now
add exttrail ./dirdat/et extract extlis, megabytes 100
view params extlis

6、重新配置data pump程式:
add extract dpelis, exttrailsource ./dirdat/et
add rmttrail ./dirdat/rt, extract dpelis
view params dpelis

7、啟動抽取程式和data pump程式:
start 程式

8、查詢源端資料庫SCN號:
select dbms_flashback.get_system_change_number from dual;
892706679

9、在源庫切換日誌並複製相關歸檔日誌到目標資料庫歸檔目錄:
alter system switch logfile;

10、還原目標資料庫至指定SCN號並開啟資料庫
recover database until scn 892706679;
alter database open resetlogs;

11、重新建立臨時表空間
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;

12、停止並刪除複製程式:
dblogin userid goldengate password goldengate
delete 程式


13、配置目標端複製程式:
dblogin userid goldengate password goldengate
edit params ./GLOBALS
新增引數,一般就是CHECKPOINTTABLE goldengate.ggchkpt
exit
dblogin userid goldengate password goldengate
add checkpointtable
add replicat replis,EXTTRAIL ./dirdat/rt CHECKPOINTTABLE goldengate.ggchkpt
view params replis

14、啟動目標端複製程式:
start replis aftercsn 892706679

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

相關文章