等待安装完成。
点击close退出。
然后进入/opt/app/ogg目录,执行“./ggsci”,并查看进程状态: [grid@rac1 ogg]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2013 00:31:13 Operating system character set identified as UTF-8.
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (rac1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING GGSCI (rac1) 2>
先来配置rac源端数据库,具体如下,与单实例一样: SQL> archive log list
Database log mode Archive Mode Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 90 Next log sequence to archive 91 Current log sequence 91
SQL> select force_logging from v$database; FOR --- YES
SQL> select supplemental_log_data_min from v$database;
SUPPLEME -------- NO
SQL> alter database add supplemental log data;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system set recyclebin=off scope=spfile;
System altered.
然后重新启动数据库:
[grid@rac1 ~]$ srvctl stop database -d oradb [grid@rac1 ~]$ srvctl start database -d oradb
然后创建goldengate用户:
SQL> create tablespace goldengate;
Tablespace created.
SQL> create user goldengate identified by goldengate default tablespace goldengate;
User created.
SQL> grant connect,resource to goldengate;
Grant succeeded.
SQL> grant execute on utl_file to goldengate;
Grant succeeded.
SQL> exec dbms_streams_auth.grant_admin_privilege('GOLDENGATE');
PL/SQL procedure successfully completed.
SQL> grant insert on system.logmnr_restart_ckpt$ to goldengate;
Grant succeeded.
SQL> grant update on sys.streams$_capture_process to goldengate;
Grant succeeded.
SQL> grant become user to goldengate;
Grant succeeded.
SQL> grant dba to goldengate;
Grant succeeded.
SQL> alter system set undo_retention=86400;
System altered.
SQL> grant flashback any table to goldengate;
Grant succeeded.
下面执行脚本,配置goldengate可以对ddl操作进行复制: 在配置ddl的时候,需要在goldengate目录使用sqlplus登录数据库,因为我们使用的是grid用户而不是oracle用户,所以需要配置集群的监听,然后来远程登录oracle数据库: [grid@rac1 ogg]$ sqlplus sys/Passw0rd@ggora as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 12 14:58:30 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options
SQL> @marker_setup
Marker setup script
You will be prompted for the name of a schema for the Oracle GoldenGate database objects. NOTE: The schema must be created prior to running this script. NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:goldengate
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects: Setting schema name to GOLDENGATE
MARKER TABLE
-------------------------------- OK
MARKER SEQUENCE -------------------------------- OK
Script complete. SQL> @ddl_setup
Oracle GoldenGate DDL Replication setup script
Verifying that current user has privileges to install DDL Replication...
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script. NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name:goldengate
Working, please wait ...
Spooling to file ddl_setup_spool.txt
Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...
Check complete.
Using GOLDENGATE as a Oracle GoldenGate schema name.
Working, please wait ...
DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects: Setting schema name to GOLDENGATE
CLEAR_TRACE STATUS:
Line/pos
------------------------------------------------------------------------------------------------------------------------ Error
----------------------------------------------------------------- No errors