1031 ogg 恢復(fù)操作
1、在目標(biāo)端停掉復(fù)制進(jìn)程,刪除目標(biāo)端OGG的復(fù)制進(jìn)程
ggsci> dblogin userid ggtarget,password ggtarget
ggsci> stop repesse
ggsci> delete replicat repesse
2、在源端停掉傳輸和抽取進(jìn)程,刪除源端OGG的傳輸進(jìn)程,抽取進(jìn)程
ggsci> dblogin userid ggsrc, password ggsrc
ggsci> stop dpesse
ggsci> stop extesse
ggsci> DELETE EXTTRAIL /home/ogg/dirdat/es
ggsci> DELETE rmttrail /home/ogg/dirdat/es
ggsci> delete EXTRACT extesse
ggsci> delete EXTRACT dpesse
3、清除源端和目標(biāo)端的TRAILS 文件
登陸源端
服務(wù)器:
cd /home/ogg/dirdat/
rm -rf *
登陸目標(biāo)服務(wù)器:
cd /home/ogg/dirdat/
rm -rf *
4、備份參數(shù)文件
登陸源端服務(wù)器:
cd /ogg/dirprm
mv extesse.prm extesse.prm.old
mv dpesse.prm dpesse.prm.old
登陸目標(biāo)服務(wù)器:
cd /ogg/dirprm
mv repesse.prm repesse.prm.old
5、源端配置extract進(jìn)程
ggsci> add extract extesse, tranlog, begin now, threads 2
ggsci> edit params extesse
extract extesse
setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )
USERID ggsrc, PASSWORD ggsrc
reportcount every 120 minutes, rate
report at 01:00
reportrollover at 01:15
EXTTRAIL /home/ogg/dirdat/es
TRANLOGOPTIONS ALTARCHIVELOGDEST PRIMARY INSTANCE essedb2 /home/arch3, ALTARCHIVELOGDEST INSTANCE essedb1 /home/arch2
TRANLOGOPTIONS ASMUSER SYS@ESSEDBASM,ASMPASSWORD ORACLE
threadoptions maxcommitpropagationdelay 30000
discardfile ./dirrpt/extesse01.dsc, append megabytes 100
discardrollover at 01:15
warnlongtrans 4h, checkinterval 5m
dynamicresolution
table shema.tablename;
------------------------------------------------------
ggsci> add exttrail /home/ogg/dirdat/es, extract extesse, megabytes 50
ggsci> start extesse
6、源端配置datapump進(jìn)程
ggsci> add extract dpesse, exttrailsource /home/ogg/dirdat/es
ggsci> edit params dpesse
extract dpesse
setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )
USERID ggsrc, PASSWORD ggsrc
rmthost 10.154.2.80, mgrport 7809
rmttrail /home/ogg/dirdat/es
passthru
discardfile ./dirout/dpesse01.dsc, append megabytes 100
discardrollover at 00:00 on sunday
reportcount every 30 minutes, rate
report at 01:00
reportrollover at 01:15
Dynamicresolution
table shema.tablename;
ggsci> add rmttrail /home/ogg/dirdat/es, extract dpesse, megabytes 50
ggsci> start dpesse
7、目標(biāo)端配置replicat進(jìn)程,但不啟動(dòng)
ggsci> add replicat repesse exttrail /home/ogg/dirdat/es
ggsci> edit params repesse
replicat repesse
SETENV (NLS_LANG ="AMERICAN_AMERICA.ZHS16GBK")
userid ggtarget, password ggtarget
assumetargetdefs
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
reperror default, abend
discardfile ./dirout/repesse01.dsc, append, megabytes 100
DiscardRollover at 02:00 ON SUNDAY
dynamicresolution
MAP shema.tablename ,target shema.tablename;
8、初始化數(shù)據(jù)
SQL> select dbms_flashback.get_system_change_number from dual;
16423942351
cd /home/backup/expdpdir
export NLS_LANG=american_america.ZHS16GBK
使用expdp 導(dǎo)出
創(chuàng)建 dumpfile
create directory expdpdir as '/home/backup/expdpdir/';
在94上 新建目錄 /home/backup/expdpdir/
創(chuàng)建導(dǎo)出文件 expdp1031.par:
DIRECTORY=expdpdir
DUMPFILE=esse1031_%U.dmp
LOGFILE=esse1031.log
tables=tablenames...
ACCESS_METHOD=DIRECT_PATH
filesize=10000M
parallel=4
flashback_scn=16423942351
nohup /usr/bin/time -p expdp dbuser/dbuserpasswd@orcl parfile=expdp1031.par >/home/backup/expdpdir/expdp1031.log &
10、 備庫導(dǎo)入
創(chuàng)建 dumpfile
create directory expdpdir as '/home/backup/expdpdir/';
在94上 新建目錄 /home/backup/expdpdir/
創(chuàng)建導(dǎo)出文件 impdp1031.par:
DIRECTORY=expdpdir
DUMPFILE=esse1031.dmp
LOGFILE=esse1031.log
remap_tablespace=TS_KCS_FLOW:EAPP_DATA1,IDX_KCS_FLOW:EAPP_IDX1
TABLE_EXISTS_ACTION=SKIP
parallel=10
nohup /usr/bin/time -p impdp dbuser/dbuserpasswd@bkorcl parfile=impdp1031.par >/home/backup/expdpdir/imp0801.log &
當(dāng)出現(xiàn) ORA-01659: unable to allocate MINEXTENTS beyond 4 in tablespace
重新resize數(shù)據(jù)文件的大小即可 大小不用改變
alter database datafile '/home/oracle/oradata/bmzbbdb/EAPP_IDX1.dbf' resize 20480m;
11、啟動(dòng)復(fù)制進(jìn)程
start repesse, aftercsn 16423942351
網(wǎng)站名稱:Oracle+Ogg歸檔丟失重新導(dǎo)數(shù)據(jù)建立ogg同步步驟
瀏覽地址:
http://weahome.cn/article/pohohh.html