版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、概要信息1.1文檔簡(jiǎn)介該文檔主要用于指導(dǎo)利用 OGG來進(jìn)行數(shù)據(jù)的同步復(fù)制,其中源數(shù)據(jù)庫為單機(jī),目標(biāo) 數(shù)據(jù)庫為單機(jī)。OGG相關(guān)安裝軟件版本為 12c,主要包括如下:1. OGG,主要用于源庫與目標(biāo)庫的數(shù)據(jù)同步2. OGG Veridata,主要用于同步數(shù)據(jù)校驗(yàn)溫馨提醒:3. 請(qǐng)仔細(xì)閱讀該文檔注意事項(xiàng)!1.2機(jī)器環(huán)境1.2.1源機(jī)器信息操作系統(tǒng)版本Redhat 6.4數(shù)據(jù)庫版本11.2.0.4.0主機(jī)名oggsrcIP地址192.168.1.1861.2.2目標(biāo)機(jī)器信息操作系統(tǒng)版本Redhat 6.4集群數(shù)據(jù)庫版本11.2.0.4.0主機(jī)名oggtgtIP地址192.168.1.1871.3 軟件
2、環(huán)境軟件名稱軟件版本部署節(jié)點(diǎn)備注Oracle GoldenGate12.2.0.1.1oggsrc (源庫) oggtgt (目標(biāo)庫)Oracle ADR12.2.1.0.0oggsrc (源庫)oggtgt (目標(biāo)庫)JDK1.8oggsrc (源庫)oggtgt (目標(biāo)庫)1.4 軟件包信息軟件名稱軟件包名稱Oracle GoldenGate 12fbo_ggs_Linux_x64_shiphome.zipOracle Application Development Runtime Infrastructure (ADR)fmw_1221.0.0_infrastructure_Disk1_
3、1of1.zipJDKjdk-8u112-linux-x64.rpm1.5 注意事項(xiàng)-軟件安裝:對(duì)于RAC的OGG,有三種方式選擇:l.oracle推薦直接安裝在共享文件系統(tǒng)上(共享存儲(chǔ)/OCFS/AFS ;2 .也可以安裝在 RAC所有節(jié)點(diǎn)的本地目錄,但必需保證所有節(jié)點(diǎn)的安裝路徑一致;3 .還可以只安裝其中一個(gè)節(jié)點(diǎn),但必需保證安裝OGG的節(jié)點(diǎn)可以訪問其它節(jié)點(diǎn)的歸檔目錄(本文檔使用)-關(guān)于歸檔本文檔中,源庫歸檔目錄為本地目錄-關(guān)于IP配置:RAC上的VIP必需為固定IP且與管理IP是同一網(wǎng)段,不可以是 DHCP獲取-關(guān)于主機(jī)hosts表安裝過程中涉及到的主機(jī)名及IP對(duì)應(yīng)關(guān)系都配置到每臺(tái)主機(jī)的h
4、osts表中-關(guān)于時(shí)間同步:所有節(jié)點(diǎn)必需配有時(shí)間同步功能保證所有節(jié)點(diǎn)的操作系統(tǒng)時(shí)間一致,因?yàn)镺GG的EXTRACT進(jìn)程是通過對(duì)比commit時(shí)間(即操作系統(tǒng)時(shí)間)來決定是否傳輸相關(guān)的數(shù)據(jù)關(guān)于 COMPATIBLE確保所有節(jié)點(diǎn)的數(shù)據(jù)庫 COMPATIBL叁數(shù)已經(jīng)設(shè)置-OGG數(shù)據(jù)存放路徑將OGG數(shù)據(jù)存放路徑 mount在單邊,防止相同的進(jìn)程在其它節(jié)點(diǎn)啟動(dòng)引起進(jìn)程沖突-源庫數(shù)據(jù)對(duì)象是否支持OGG對(duì)數(shù)據(jù)對(duì)象支持有一定的限制,可以通過腳本提前檢查full-schemaCheckOrade.sql-關(guān)于數(shù)據(jù)遷移方式本文檔推薦使用數(shù)據(jù)泵方式進(jìn)行數(shù)據(jù)遷移,因此需要提前將目標(biāo)數(shù)據(jù)庫建好二、OGG搭建環(huán)境準(zhǔn)備2.
5、1 源庫操作2.1.1 開啟歸檔-歸檔目錄為所有節(jié)點(diǎn)共享目錄一節(jié)點(diǎn)SQL alter system set log_archive_dest_1=location=/arch scope=sp*;System altered.SQL alter system set recyclebin=off scope=spfile;-For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.System altered.SQL shutdow
6、n immediateOGGSRC:/home/oracle$export ORACLE_SID=oggsrcOGGSRC:/home/oracle$sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 - Production on Mon Sep 19 16:29:11 2016Copyright (c) 1982, 2008, Oracle. All rights reserved.Connected to an idle instance.SQL startup mount;ORACLE instance started.Total Syste
7、m Global Area 4275781632 bytesFixed SizeVariable SizeDatabase BuffersRedo BuffersDatabase mounted.2160600 bytes2365589544 bytes1895825408 bytes12206080 bytesSQL alter database archivelog;Database altered.SQL archive log list;Archive ModeEnabled/archDatabase log mode Automatic archival Archive destin
8、ationOldest online log sequence Next log sequence to archive Current log sequenceSQL alter database open;Database altered.SQL alter system archive log current;System altered.2.1.2 開啟附加日志功能和force_logging一節(jié)點(diǎn)SQL SELECT supplemental_log_data_min, force_logging FROM v$database;SUPPLEME FOR NO NOSQL ALTER
9、 DATABASE ADD SUPPLEMENTAL LOG DATA;Database altered.SQL alter database force logging;Database altered.SQL SELECT supplemental_log_data_min, force_logging FROM v$database;SUPPLEME FOR YES YESSQL ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH;System altered.2.2 目標(biāo)庫操作2.2.1 開啟歸檔(可不必打開
10、)-節(jié)點(diǎn),歸檔目錄/arch非共享SQL alter system set log_archive_dest_1=location=/arch scope=sp*;System altered.$export ORACLE_SID=oggtgt $sqlplus / as sysdbaSQL startup mount;ORACLE instance started.Total System Global Area 4275781632 bytesFixed SizeVariable SizeDatabase BuffersRedo BuffersDatabase mounted.216060
11、0 bytes2365589544 bytes1895825408 bytes12206080 bytesSQL alter database archivelog;Database altered.SQL archive log list; Database log mode Automatic archivalArchive ModeEnabledArchive destinationOldest online log sequence Next log sequence to archive Current log sequence/arch4SQL alter database ope
12、n;Database altered.SQL alter system archive log current;System altered.2.2.2 開啟參數(shù) ENABLE_GOLDENGATE_REPLICATION/11.2.0.4版本的必須設(shè)置該參數(shù)為 trueSQL ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH;System altered.三、 OGG搭建3.1 OGG軟件安裝-此處只在源庫節(jié)點(diǎn) xxxx和目標(biāo)庫節(jié)點(diǎn)xxxx上操作,其它節(jié)點(diǎn)不操作!此處只以xxx為例!3.1.1 創(chuàng)建OGG目錄一節(jié)
13、點(diǎn)rootoggsrc media# mkdir -p /u01/ogg/dirdatrootoggsrc media# chown -R oracle:oinstall /u01/oggrootoggsrc media# chmod -R 775 /u01/oggrootoggsrc media# su - oracle3.1.2 配置OGG用戶環(huán)境變量-此處用oracle用戶安裝 OGG添加或修改oracle用戶環(huán)境變量export OGG_HOME=/u01/oggexport PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/b
14、in:$OGG_HOME, export LIBPATH=$ORACLE HOME/lib:$OGG HOME3.1.3 安裝OGG軟件oracleoggsrc $ cd /u01/media/ oracleoggsrc media$ ls -lrttotal 4616920drwxr-xr-x 7 oracle oinstall4096 Aug 26-rw-r-r-.oracleoinstallp13390677_112040_Linux-x86-64_2of7.zip-rw-r-r-.oracleoinstallp13390677_112040_Linux-x86-64_1of7.zip-
15、rw-r-r-oracleoinstall2013 database1151304589Jul1820:431395582860Jul1820:441534167825Jul1823:55fmw_12.2.1.0.0_infrastructure_Disk1_1of1.zip-rw-r-r-1 oracle oinstall475611228 Jul 19 00:00 fbo_ggs_Linux_x64_shiphome.zip-rw-r-r-1 oracle oinstall167741674 Jul 19 00:04 jdk-8u112-linux-x64.rpm-rw-r-r-1 ora
16、cle oinstall210877 Jul 19 05:55 pdksh-5.2.14-37.el5_8.1.x86_64.rpm-rw1 oracle oinstall4194304 Jul 19 06:10 coreoracleoggsrc media$ unzip -q fbo_ggs_Linux_x64_shiphome.ziporacleoggsrc media$ cd fbo_ggs_Linux_x64_shiphome $cd Disk1$lsinstallresponserunInstaller stageOGGSRC:/u01/media/fbo ggs AIX ppc s
17、hiphome/Disk1$./runInstallerSummaryoracle GoldenGate 12.2.0.0.0 - install wizard - step 3 of 54 Oracle Gold5GMe 122OJS Clobl SettingsSummwyi ource Loc Mio ri: /uD l/mtsiirfbc.g gj.L nuxjcfi 4hi;hoieDisk spKt: required 7W mb wanabli 46.54 ctInna lOpilon 0cm e Cild*nCflie for OrMle Duabace 11g三 Imtall
18、alim Drfaih$:化儂飛 Location: /uOl/ofl$artfalse| Iwr Response File J create subdirsCreating subdirectories under current directory /u01/oggParameter filesReport files Checkpoint files Process status files SQL script files Database definitions filesExtract data files Temporary files Stdout files/u01/ogg
19、/dirprm: already exists/u01/ogg/dirrpt: created/u01/ogg/dirchk: created/u01/ogg/dirpcs: created/u01/ogg/dirsql: created/u01/ogg/dirdef: created/u01/ogg/dirdat: created/u01/ogg/dirtmp: created/u01/ogg/dirout: createdGGSCI (OGGSRC) 2 exit3.2.2 創(chuàng)建OGG用戶OGGSRC:/u01/ogg$sqlplus / as sysdbaSQL create table
20、space ogg datafile 7oradata/oggsrc/ogg01.dbf size 2G ;Tablespace created.SQL create user ogg identified by ogg default tablespace ogg temporary tablespace temp account unlock;User created.SQL grant dba to ogg;Grant succeeded.3.2.3 授權(quán)OGG用戶OGGSRC:/u01/ogg$sqlplus / as sysdbaSQL grant execute on utl_ o
21、gg;Grant succeeded.SQL /u01/ogg/marker_setup.sqlEnter Oracle GoldenGate schema name:oggScript complete.SQL /u01/ogg/ddl_setup.sqlEnter Oracle GoldenGate schema name:oggSTATUS OF DDL REPLICATION SUCCESSFUL installation of DDL Replication software componentsScript complete.SQL /u01/ogg/role_setup.sqlE
22、nter GoldenGate schema name:oggRole setup script completeGRANT GGS_GGSUSER_ROLE TO SQL grant ggs_ggsuser_role to oggtgt;Grant succeeded.SQL /u01/ogg/ddl_enable.sqlTrigger altered.SQL /u01/ogg/marker_status.sqlPlease enter the name of a schema for the GoldenGate database objects: oggSetting schema na
23、me to OGGMARKER TABLE OKMARKER SEQUENCE OKSQL ?/rdbms/admin/dbmspoolPackage created.Grant succeeded.SQL /u01/ogg/ddl_pin.sql oggPL/SQL procedure successfully completed.PL/SQL procedure successfully completed.PL/SQL procedure successfully completed.SQL /u01/ogg/sequence.sqlPlease enter the name of a
24、schema for the GoldenGate database objects:Setting schema name to OGGSTATUS OF SEQUENCE SUPPORTSUCCESSFUL installation of Oracle Sequence Replication supportSQL grant execute on oggtgt.updatesequence to oggtgt;Grant succeeded.3.2.4 倉值GLOBAL成件OGGSRC:/u01/ogg/dirdat$cd $OGG_HOMEOGGSRC:/u01/ogg$ggsciOr
25、acle GoldenGate Command Interpreter for OracleVersion 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230AIX 5L, ppc, 64bit (optimized), Oracle 11g on Apr 23 2012 05:03:51Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.GGSCI (OGGSRC) 20 edit params ./GLOBALS#輸入如下內(nèi)容#GGSCHE
26、MA ogg3.2.5創(chuàng)建Manager配置文件#5輯MGR配置文件,GGSCI (OGGSRC) 1 edit params mgr#輸入如下內(nèi)容#PORT 7809DYNAMICPORTLIST 7810-7820, 7830AUTOSTART EXTRACT *AUTORESTART EXTRACT *, RETRIES 4, WAITMINUTES 2STARTUPVALIDATIONDELAY 5PURGEOLDEXTRACTS/u01/ogg/dirdat/*, USECHECKPOINTS, minkeepdays 73.2.6 創(chuàng)建 primary Extract 配置文件GG
27、SCI (OGGSRC) 9 edit params exee#輸入如下內(nèi)容#EXTRACT exeeSETENV (ORACLE_SID = oggsrc)SETENV (ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1)SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)USERID ogg, PASSWORD oggWARNLONGTRANS 2h, CHECKINTERVAL 300sFETCHOPTIONS NOUSESNAPSHOTexttrail /u01/ogg/dirdat/ltdiscar
28、d, megabytes 500gettruncatesddl &include objname MESIF.* &include objname AHBIUSR.* &include objtype USERddloptions addtrandatatable MESIF.*;sequence MESIF.*;table AHBIUSR.*;sequence AHBIUSR.*;#料僉查確認(rèn)EXEE配置文件內(nèi)容無誤OGGSRC:/u01/ogg$/u01/ogg/checkprm /u01/ogg/dirprm/exee.prm -C extract -m Classic -V3.2.7創(chuàng)
29、建data pump配置文件GGSCI (OGGSRC) 9 edit params dpee#輸入如下內(nèi)容#EXTRACTdpeeSETENV (ORACLE_SID = oggsrc)SETENV (ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1)SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK) RMTHOST 192.168.1.187, MGRPORT 7809, compress RMTTRAIL /u01/ogg/dirdat/rt gettruncates table MESIF.*;se
30、quence MESIF.*;table AHBIUSR.*;sequence AHBIUSR.*;#料僉查確認(rèn)DPEE配置文件內(nèi)容無誤OGGSRC:/u01/ogg/checkprm /u01/ogg/dirprm/dpee.prm -C extract -m Classic -V3.2.8為需要抽取數(shù)據(jù)的 schema增加trandata#此步根據(jù)對(duì)象表數(shù)量的多少需要相應(yīng)的時(shí)間,GGSCI (OGGSRC) 13 dblogin userid ogg password ogg Successfully logged into database.GGSCI (OGGSRC) 14add tr
31、andata MESIF.*GGSCI (OGGSRC) 14add trandata AHBIUSR.*1.1.9 酉己置extract進(jìn)程GGSCI (OGGSRC) 15 add ext exee,tranlog,begin now EXTRACT added.GGSCI (OGGSRC) 16 add exttrail /u01/ogg/dirdat/lt, ext exee, megabytes 50 EXTTRAIL added.1.1.10 酉己置data pump進(jìn)程GGSCI (OGGSRC) 17 add ext dpee, exttrailsource /u01/ogg/
32、dirdat/lt EXTRACT added.GGSCI (OGGSRC) 19 add rmttrail /u01/ogg/dirdat/rt, ext dpee, megabytes 50 RMTTRAIL added.3.3 目標(biāo)庫OGG配置-配置OGG全部用oracle用戶去操作!3.3.1 創(chuàng)建OGG應(yīng)用子目錄oggtgt:/home/oracle$cd /u01/ogg oggtgt:/u01/ogg$ggsciOracle GoldenGate Command Interpreter for OracleVersion 12.2.0.1.1 OGGCORE_1220.1.0_P
33、LATFORMS_151211.1401_FBOAIX 6, ppc, 64bit (optimized), Oracle 11g on Jan 21 2016 09:52:07 Operating system character set identified as ISO-8859-1.Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.GGSCI (oggtgt) 1 create subdirsParameter filesReport filesCheckpoint filesProc
34、ess status filesSQL script files Database definitions filesExtract data filesTemporary filesStdout filesGGSCI (oggtgt) 2Creating subdirectories under current directory /u01/ogg/u01/ogg/dirprm: already exists/u01/ogg/dirrpt: created/u01/ogg/dirchk: created/u01/ogg/dirpcs: created/u01/ogg/dirsql: crea
35、ted/u01/ogg/dirdef: created/u01/ogg/dirdat: created/u01/ogg/dirtmp: created/u01/ogg/dirout: created3.3.2 創(chuàng)建OGG用戶oggtgt:/home/oracle$sqlplus / as sysdbaSQL create tablespace oggtgt datafile 7oradata/oggtgt/ogg01.dbf size 2G ;Tablespace created.SQL create user ogg identified by ogg default tablespace
36、ogg temporary tablespace temp account unlock;User created.SQL grant dba to ogg;Grant succeeded.3.3.3 授權(quán)OGG用戶oggtgt:/u01/ogg$sqlplus / as sysdbaSQL /u01/ogg/sequence.sqlPlease enter the name of a schema for the GoldenGate database objects:Setting schema name to OGGSTATUS OF SEQUENCE SUPPORTSUCCESSFUL
37、 installation of Oracle Sequence Replication supportSQL grant execute on ogg.replicatesequence to ogg;Grant succeeded.3.3.4 倉值GLOBAL的置文件oggtgt:/u01/ogg/dirdat$cd $OGG_HOME oggtgt:/u01/ogg$ggsciGGSCI (oggtgt) 2 edit params ./GLOBALS#輸入如下內(nèi)容#GGSCHEMA oggCHECKPOINTTABLE ogg.ckpttable3.3.5 創(chuàng)建Manager配置文件#
38、5輯MGR配置文件GGSCI (oggtgt) 3 edit params mgr#輸入如下內(nèi)容#PORT 7809DYNAMICPORTLIST 7810-7820, 7830AUTOSTART REPLICAT *AUTORESTART REPLICAT *, RETRIES 4, WAITMINUTES 2STARTUPVALIDATIONDELAY 5PURGEOLDEXTRACTS /u01/ogg/dirdat/*, USECHECKPOINTS, minkeepdays 73.3.6 添加 checkpointtableGGSCI (oggtgt) 5 DBLOGIN USERI
39、D ogg, PASSWORD ogg Successfully logged into database.GGSCI (oggtgt) 6 ADD CHECKPOINTTABLE ogg.ckpttableSuccessfully created checkpoint table ogg.ckpttable.3.3.7 創(chuàng)建replicat配置文件GGSCI (oggtgt) 8 edit params rpee#輸入如下內(nèi)容#REPLICAT rpeeSETENV (ORACLE_SID = oggtgt)SETENV (ORACLE_HOME=/u01/app/oracle/produc
40、t/11.2.0/db_1)SETENV (NLS_LANG = AMERICAN_AMERICA.ZHS16GBK)USERID ogg, PASSWORD ogg-handlecollisions assumetargetdefs allownoopupdatesdiscard, megabytes 500 gettruncatesddl &include objname MESIF.* &include objname AHBIUSR.* &include objtype USERDBOPTIONS DEFERREFCONSTmap MESIF.*, target MESIF.*;map
41、 AHBIUSR.*, target AHBIUSR.*;#確認(rèn)RPEE配置文件內(nèi)容oggtgt:/u01/ogg$/u01/ogg/checkprm /u01/ogg/dirprm/rpee.prm -C replicat -m Classic -V3.3.8 配置 replicat 進(jìn)程GGSCI (oggtgt) 9 add rep rpee,exttrail /u01/ogg/dirdat/rt CHECKPOINTTABLE ogg.ckpttable REPLICAT added.3.4 測(cè)試啟動(dòng)OGG-配置OGG全部用oracle用戶去操作!3.4.1 目標(biāo)庫啟動(dòng)OGGGGSCI
42、 (oggtgt) 9 start mgrManager started.GGSCI (oggtgt) 11 start replicat rpee REPLICAT RPEE is already running.GGSCI (oggtgt) 12 info allProgram Status Group Lag at Chkpt Time Since ChkptMANAGER RUNNINGREPLICAT RUNNING RPEE 00:00:0000:00:06等待章節(jié)3.4.2的DPEE進(jìn)程啟動(dòng)正常后,關(guān)閉 REPLICAT rpeeGGSCI (oggtgt) 13 stop re
43、plicat rpee3.4.2 源庫啟動(dòng)OGGGGSCI (OGGSRC) 17 start mgrManager started.GGSCI (OGGSRC) 18 info mgrManager is running (IP port OGGSRC.7809).GGSCI (OGGSRC) 68 start EXTRACT exeeSending START request to MANAGER . EXTRACT EXEE startingGGSCI (OGGSRC) 69 start EXTRACT dpeeSending START request to MANAGER .EXTR
44、ACT DPEE startingGGSCI (OGGSRC) 1 info allProgramStatusGroupLag at ChkptTime Since ChkptMANAGERRUNNINGEXTRACTRUNNINGDPEE00:00:0000:00:03EXTRACTRUNNINGEXEE00:00:0000:00:10此處/、要關(guān)閉EXEBS 程!四、遷移數(shù)據(jù)4.1 數(shù)據(jù)泵方式4.1.1 源庫創(chuàng)建數(shù)據(jù)泵目錄OGGSRC:/home/oracle$export ORACLE_SID=oggsrcOGGSRC:/home/oracle$sqlplus / as sysdbaSQ
45、L create or replace directory expdp as /u01/expdp;Directory created.SQL grant read,write on directory expdp to public;Grant succeeded.SQL col owner for a15SQL col directory_name for a15SQL col directory_path for a25SQL select * from dba_directories where directory_name=EXPDP;OWNERDIRECTORY_NAME DIRE
46、CTORY_PATHSYSEXPDP/u01/expdp4.1.2 源庫獲取數(shù)據(jù)庫當(dāng)前 SCNSQL select dbms_flashback.get_system_change_number from dual;GET_SYSTEM_CHANGE_NUMBER3867034.1.3 源庫基于SCN號(hào)導(dǎo)由數(shù)據(jù)nohupexpdpMESPRD/MESPRDdirectory=expdirschemas=AHBIUSR,MESERMESBIGDATA,MESDMZTMMONITORUSER,MESPTS,MESWMS,ME:SIF dump job_name=expdpmes parallel=
47、4 =7G flashback_scn=386703COMPRESSION=a1110g&4.1.4 目標(biāo)庫創(chuàng)建數(shù)據(jù)泵目錄oggtgt:/home/oracle$sqlplus / as sysdbaSQL create or replace directory impdp as /u01/impdir;Directory created.SQL grant read,write on directory impdp to public;Grant succeeded.SQL select * from dba_directories where directory_name=IMPDP;SQ
48、L col owner for a15SQL col directory_name for a15SQL col directory_path for a25SQL select * from dba_directories where directory_name=EXPDP;OWNERDIRECTORY_NAME DIRECTORY_PATHSYSEXPDP/u01/expdp4.1.5 目標(biāo)庫導(dǎo)入數(shù)據(jù)把相關(guān)的dmp文件,導(dǎo)出日志文件從源庫拷貝至目標(biāo)庫機(jī)器oggtgt上,導(dǎo)入腳本如下:export ORACLE SID=oggtgtexport ORACLE_BASE=/u01/app/o
49、racleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1export PATH=$ORACLE_HOME/bin:$PATHnohup impdp system/oracleora directory=expdp dump schemas= AHBIUSR,MESERMESBIGDATA,MESDMZTMMONITORUSER,MESPTS,MESWMS,MESIF log parallel=4 job name=impdp mes cluster=N &4.1.6 目標(biāo)庫匹配導(dǎo)入導(dǎo)由數(shù)據(jù)行數(shù)oggtgt:/u01/expdp$ g
50、rep rows expdpmes.log |sort -n| awk print $4,$7,$8 /tmp/exp.a oggtgt:/u01/expdp$ grep rows impdpmes.log |sort -n| awk print $4,$7,$8 /tmp/imp.boggtgt:/u01/expdp$ diff /tmp/exp.a /tmp/imp.b#此時(shí)沒有結(jié)果輸出說明導(dǎo)入導(dǎo)出數(shù)據(jù)行數(shù)一致五、 目標(biāo)庫開啟OGG同步5.1 禁用目標(biāo)庫觸發(fā)器#參數(shù)owner_list里面的用戶名請(qǐng)根據(jù)實(shí)際情況修改#禁用約束腳本如下:oggtgt:/home/oracle/ogg$cat
51、disable_cascade.sqlset serveroutput on size 1000000spool /home/oracle/disable_cascade.logdefine owner_list= in ( AHBIUSR, MESIF)declarecursor c is SELECT A.OWNER, A.TABLE_NAME,A.CONSTRAINT_NAME,.COLUMN_NAME, A.STATUS,A.DELETE_RULE,B.TABLE_NAMEEFER_TABLEFROM dba_CONSTRAINTS A,dba_CONSTRAINTS B,dba_CO
52、NS_COLUMNS CWHERE A.R_CONSTRAINT_NAME=B.CONSTRAINT_NAMEAND A.CONSTRAINT_NAME=C.CONSTRAINT_NAMEAND A.status =ENABLEDAND A.delete_rule like %CASCADE%and A.owner &owner_list;temp varchar2(512);begindbms_output.put_line(- BEGIN ALTER TABLE DISABBLE CASCADE -);dbms_output.put_line(- WAIT FOR A MONENT -);dbms_output.put_line(-);for x in c 100Ptemp := ALTER TABLE | x.OWNER | . | x.TABLE_NAME| DISABLE CONSTRAINT | x.CONS
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024石家莊公租房租賃合同編寫指南及范本3篇
- 2024版貨物訂購合同
- 2024英文企業(yè)海外市場(chǎng)拓展與業(yè)務(wù)洽談合同3篇
- 2025年度園林景觀沙石供應(yīng)與施工承包合同樣本4篇
- 2025年度醫(yī)藥代銷合同模板(醫(yī)藥供應(yīng)鏈)4篇
- 2025年度商業(yè)街區(qū)物業(yè)管理與服務(wù)合同3篇
- 2025年度商場(chǎng)家具安裝與商業(yè)空間優(yōu)化承包協(xié)議4篇
- 2024版權(quán)評(píng)估合同3篇帶眉腳
- 2025年度溫室大棚配套設(shè)施供應(yīng)與售后服務(wù)合同4篇
- 2025年度智慧城市基礎(chǔ)設(shè)施建設(shè)承包協(xié)議4篇
- 2025年神經(jīng)外科護(hù)理工作計(jì)劃例文(2篇)
- 2025年湖北省武漢市東湖高新區(qū)管委會(huì)招聘工作人員歷年高頻重點(diǎn)提升(共500題)附帶答案詳解
- 初中英語聽力高頻詞
- 一年級(jí)期末數(shù)學(xué)家長(zhǎng)會(huì)課件
- 2024年社區(qū)警務(wù)規(guī)范考試題庫
- 通信工程安全知識(shí)培訓(xùn)
- 2022年高考真題-政治(天津卷) 含答案
- 2024年度乙方提供物流配送服務(wù)合同標(biāo)的為800萬元人民幣
- 個(gè)體診所醫(yī)生述職報(bào)告3篇
- 2024年事業(yè)單位招聘考試公共基礎(chǔ)知識(shí)試題庫及答案(共316題)
- 杭州宋韻文化課程設(shè)計(jì)
評(píng)論
0/150
提交評(píng)論