OGG配置DML單向複製一例及錯誤分析

來源:互聯網
上載者:User

環境:11.2.0.3+OEL5.7

192.168.1.55zlm sid:zlm11g

192.168.1.60zlm2 sid:zlm11g

gg軟體包:ogg112101_fbo_ggs_Linux_x64_ora11g_64bit

Oracle DML流程

PL/SQL“ ORA-14551: 無法在查詢中執行 DML 操作”解決

MySQL常用DDL、DML、DCL語言整理(附範例)

Oracle基本事務和ForAll執行批量DML練習

Oracle DML語句(insert,update,delete) 復原開銷估算

一、安裝OGG軟體並配置實驗環境

 

*******

源主庫:

*******

1.把gg軟體包複製到源主機,2次解壓到gg安裝目錄gg11

[oracle@zlmdb_1]$ cd $OACLE_BASE

[oracle@zlm~]$ ls

接下來請看第2頁精彩內容:

incremental_hot_database_backup.sh ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

incremental_hot_database_backup.sh.out orz.sh

[oracle@zlmoracle]$ mkdir gg11

[oracle@zlmoracle]$ cd gg11

[oracle@zlmgg11]$ unzip /home/oracle/ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

[oracle@zlmgg11]$ ll

total223764

-rw-rw-r--1 oracle oinstall 228556800 Apr 23 2012fbo_ggs_Linux_x64_ora11g_64bit.tar

-rwxrwxrwx1 oracle oinstall 220546 May 2 2012OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf

-rwxrwxrwx1 oracle oinstall 93696 May 2 2012Oracle GoldenGate 11.2.1.0.1README.doc

-rwxrwxrwx1 oracle oinstall 24390 May 2 2012Oracle GoldenGate 11.2.1.0.1README.txt

[oracle@zlmgg11]$ tar xvoffbo_ggs_Linux_x64_ora11g_64bit.tar

UserExitExamples/

UserExitExamples/ExitDemo_more_recs/

UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX

UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS

UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX

UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX

UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj

UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c

UserExitExamples/ExitDemo_more_recs/readme.txt

.............

 

2.修改環境變數檔案.bash_profile,加入OGG的環境變數

export GGHOME=/$ORACLE_BASE/gg11

exportPATH=$ORACLE_BASE/gg11:$ORACLE_HOME/bin:/usr/bin/:$PATH

 

[oracle@zlmgg11]$ . ~/.bash_profile

[oracle@zlmgg11]$ ggsci

ggsci:error while loading shared libraries: libnnz11.so: cannot open shared objectfile: No such file or directory

 

由於沒有設定LD_LIBRARY_PATH環境變數,所以無法執行ggsci,重新添加到.bash_profile

在環境變數中添加如下命令:

export LD_LIBLARY_PATH=$ORACLE_BASE/gg11:$ORACLE_HOME/lib:$ORACLE_HOME/bin

重新source一下後執行ggsci

 

[oracle@zlmgg11]$ . ~/.bash_profile

[oracle@zlmgg11]$ ggsci

 

OracleGoldenGate Command Interpreter for Oracle

Version 11.2.1.0.1OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO

Linux,x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

 

Copyright(C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

 

3.建立OGG專用目錄subdirs

GGSCI (zlm)1> create subdirs

 

Creatingsubdirectories under current directory /u01/app/oracle/gg11

 

Parameterfiles /u01/app/oracle/gg11/dirprm: already exists

Reportfiles /u01/app/oracle/gg11/dirrpt: created

Checkpointfiles /u01/app/oracle/gg11/dirchk:created

Processstatus files /u01/app/oracle/gg11/dirpcs: created

SQLscript files /u01/app/oracle/gg11/dirsql: created

Databasedefinitions files /u01/app/oracle/gg11/dirdef: created

Extractdata files /u01/app/oracle/gg11/dirdat: created

Temporaryfiles /u01/app/oracle/gg11/dirtmp: created

Stdoutfiles /u01/app/oracle/gg11/dirout: created

 

4.對來源資料庫設定補充日誌,並開啟歸檔模式和強制歸檔

SQL>alter database add supplemental log data;

 

Databasealtered.

 

SQL>alter system switch logfile;

 

Systemaltered.

 

SQL>select supplemental_log_data_min,log_mode,force_logging from v$database;

 

SUPPLEMELOG_MODE FOR

-------------------- ---

YES ARCHIVELOG NO

 

SQL> alterdatabase force logging;

 

Databasealtered.

 

SQL>select supplemental_log_data_min,log_mode,force_loggingfrom v$database;

 

SUPPLEMELOG_MODE FOR

-------------------- ---

YES ARCHIVELOG YES

 

5.編輯來源資料庫管理進程參數檔案

GGSCI(zlm) 1> edit params mgr

Cannotload ICU resource bundle 'ggMessage', error code 2 - No such file or directory

Cannotload ICU resource bundle 'ggMessage', error code 2 - No such file or directory

Aborted

 

這裡報錯是因為之前進入ggsci介面是並沒有在OGG安裝目錄,必須要在$GGHOME(如果配置過的話,我這裡$GGHOME=/u01/app/oracle/gg11)

 

[oracle@zlm~]$ cd $ORACLE_BASE/gg11

[oracle@zlmgg11]$ ggsci

 

OracleGoldenGate Command Interpreter for Oracle

Version 11.2.1.0.1OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO

Linux,x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

 

Copyright(C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

 

GGSCI(zlm) 1> edit params mgr

 

在mgr中添加入如下一行:(和vi編輯器一樣操作)

PORT 7809

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.