[BEGIN] 2017/5/1 21:22:59
SQL> exit
IP地址规划及主机配置:
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.88 dg2
192.168.1.87 dg1
192.168.1.89 node1
[oracle@dg1 ~]$ exit
logout
[root@dg1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@dg1 ~]# uname -a
Linux dg1 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@dg1 ~]# arch
x86_64
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
dg1 dataguard 物理主库:
[root@dg1 ~]# su - oracle
[oracle@dg1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:23:22 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysDBA
Connected.
SQL> select database_role,protection_mode from v$database;
DATABASE_ROLE PROTECTION_MODE
---------------- --------------------
PRIMARY MAXIMUM PERFORMANCE
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/example01.dbf
SQL>
SQL>
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
dg2 物理备库:
[oracle@dg1 ~]$ ssh dg2
oracle@dg2's password:
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:24:11 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select database_role,protection_mode from v$database;
DATABASE_ROLE PROTECTION_MODE
---------------- --------------------
PHYSICAL STANDBY MAXIMUM PERFORMANCE
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$
dg1 dg2 node1 创建 ogg 软件安装目录:
[oracle@dg1 ~]$ mkdir -p /u01/app/ogg
[oracle@dg1 ~]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 09:24:04 2017 from dg1
[oracle@dg2 ~]$ mkdir -p /u01/app/ogg
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ~]$ ssh node1
The authenticity of host 'node1 (192.168.1.89)' can't be established.
RSA key fingerprint is 28:5d:76:19:60:ac:26:ca:3e:84:83:5e:fe:7e:51:3d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1,192.168.1.89' (RSA) to the list of known hosts.
oracle@node1's password:
[oracle@node1 ~]$ mkdir -p /u01/app/ogg
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ exit
logout
Connection to node1 closed.
dg1, node1 上传ogg 安装介质:
[oracle@dg1 ~]$
[oracle@dg1 ~]$
[oracle@dg1 ~]$ cd /u01/app/ogg
[oracle@dg1 ogg]$ ls -l
total 90400
-rw-r--r--. 1 root root 92569288 May 1 09:27 V34339-01.zip
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:26:27 2017 from dg1
[oracle@node1 ~]$ cd /u01/app/ogg
[oracle@node1 ogg]$ ls -l
total 90400
-rw-r--r--. 1 root root 92569288 May 1 09:28 V34339-01.zip
[oracle@node1 ogg]$
[oracle@node1 ogg]$
[oracle@node1 ogg]$
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
dg1,node1 调整环境变量:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ cd
[oracle@dg1 ~]$ cat .bash_profile
# ---------------------------------------------------
# OS User: oracle
# Application: Oracle Database Software Owner
# Version: Oracle 11g release 2
# ---------------------------------------------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_SID=orcl; export ORACLE_SID #another is dgh2
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.{JAVA_HOME}/bin{PATH}HOME/binORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------
# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# ---------------------------------------------------
umask 022
[oracle@dg1 ~]$ vi .bash_profile
[oracle@dg1 ~]$ source .bash_profile
[oracle@dg1 ~]$ echo $GGHOME
/u01/app/ogg
[oracle@dg1 ~]$ grep GGHOME .bash_profile
GGHOME=/u01/app/ogg;export GGHOME
[oracle@dg1 ~]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:27:57 2017 from dg1
[oracle@node1 ~]$ cat .bash_profile
# ---------------------------------------------------
# OS User: oracle
# Application: Oracle Database Software Owner
# Version: Oracle 11g release 2
# ---------------------------------------------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
ORACLE_SID=orcl; export ORACLE_SID #another is dgh2
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.{JAVA_HOME}/bin{PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------
# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# ---------------------------------------------------
umask 022
[oracle@node1 ~]$ vi .bash_profile
[oracle@node1 ~]$ source .bash_profile
[oracle@node1 ~]$ grep GGHOME .bash_profile
GGHOME=/u01/app/ogg;export GGHOME
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ exit
logout
Connection to node1 closed.
dg1 ,node1 安装ogg 软件 配置mgr进程:
[oracle@dg1 ~]$ cd $GGHOME
[oracle@dg1 ogg]$ ls -l
total 90400
-rw-r--r--. 1 root root 92569288 May 1 09:27 V34339-01.zip
[oracle@dg1 ogg]$ unzip V34339-01.zip
Archive: V34339-01.zip
inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar
inflating: Oracle_GoldenGate_11.2.1.0.3_README.doc
inflating: Oracle GoldenGate_11.2.1.0.3_README.txt
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf
[oracle@dg1 ogg]$ tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar
[oracle@dg1 ogg]$ ls -l
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> edit params mgr
GGSCI (dg1) 2> view params mgr
port 7809
GGSCI (dg1) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
GGSCI (dg1) 6> create subdirs
Creating subdirectories under current directory /u01/app/ogg
Parameter files /u01/app/ogg/dirprm: already exists
Report files /u01/app/ogg/dirrpt: created
Checkpoint files /u01/app/ogg/dirchk: created
Process status files /u01/app/ogg/dirpcs: created
SQL script files /u01/app/ogg/dirsql: created
Database definitions files /u01/app/ogg/dirdef: created
Extract data files /u01/app/ogg/dirdat: created
Temporary files /u01/app/ogg/dirtmp: created
Stdout files /u01/app/ogg/dirout: created
GGSCI (dg1) 7> view params mgr
port 7809
GGSCI (dg1) 8> start mgr
Manager started.
GGSCI (dg1) 9> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (dg1) 10> exit
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:31:04 2017 from dg1
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ls -l
total 90400
-rw-r--r--. 1 root root 92569288 May 1 09:28 V34339-01.zip
[oracle@node1 ogg]$ unzip V34339-01.zip
Archive: V34339-01.zip
inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar
inflating: Oracle_GoldenGate_11.2.1.0.3_README.doc
inflating: Oracle GoldenGate_11.2.1.0.3_README.txt
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf
[oracle@node1 ogg]$ ls
fbo_ggs_Linux_x64_ora11g_64bit.tar Oracle_GoldenGate_11.2.1.0.3_README.doc V34339-01.zip
OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf Oracle GoldenGate_11.2.1.0.3_README.txt
[oracle@node1 ogg]$ tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> create subdirs
Creating subdirectories under current directory /u01/app/ogg
Parameter files /u01/app/ogg/dirprm: already exists
Report files /u01/app/ogg/dirrpt: created
Checkpoint files /u01/app/ogg/dirchk: created
Process status files /u01/app/ogg/dirpcs: created
SQL script files /u01/app/ogg/dirsql: created
Database definitions files /u01/app/ogg/dirdef: created
Extract data files /u01/app/ogg/dirdat: created
Temporary files /u01/app/ogg/dirtmp: created
Stdout files /u01/app/ogg/dirout: created
GGSCI (node1) 2> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
GGSCI (node1) 3> edit params mgr
GGSCI (node1) 5> view params mgr
port 7809
GGSCI (node1) 6> start mgr
Manager started.
GGSCI (node1) 7> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (node1) 8> exit
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
dg1 创建ogg 管理用户,并赋予权限:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:36:04 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> create tablespace ogg datafile '/u01/app/oracle/oradata/orcl/ogg.dbf' size 1G autoextend on extent management local uniform size 1M;
Tablespace created.
SQL> create user OGG identified by oracle default tablespace ogg temporary tablespace TEMP;
User created.
SQL> grant DBA to OGG;
Grant succeeded.
SQL> EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('OGG');
PL/SQL procedure successfully completed.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
查看物理备库dg2 是否同步用户及权限:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Permission denied, please try again.
oracle@dg2's password:
Last login: Mon May 1 09:25:33 2017 from dg1
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:38:17 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL> desc dba_users;
Name Null? Type
----------------------------------------- -------- ----------------------------
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
PASSWORD VARCHAR2(30)
ACCOUNT_STATUS NOT NULL VARCHAR2(32)
LOCK_DATE DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
CREATED NOT NULL DATE
PROFILE NOT NULL VARCHAR2(30)
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
EXTERNAL_NAME VARCHAR2(4000)
PASSWORD_VERSIONS VARCHAR2(8)
EDITIONS_ENABLED VARCHAR2(1)
AUTHENTICATION_TYPE VARCHAR2(8)
SQL> C/remporary/temporary
1* select username,default_tablespace,temporary_tablespace from dba_users where username='OGG'
SQL> /
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
TEMPORARY_TABLESPACE
------------------------------
OGG OGG
TEMP
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:34:28 2017 from dg1
node1 创建ogg 管理用户并赋予权限:
[oracle@node1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:39:48 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> create tablespace ogg datafile '/u01/app/oracle/oradata/orcl/ogg.dbf' size 1g;
Tablespace created.
SQL> create user OGG identified by oracle default tablespace ogg temporary tablespace TEMP;
User created.
SQL> grant DBA to OGG;
Grant succeeded.
SQL> EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('OGG');
PL/SQL procedure successfully completed.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
确认 dg1 处于归档模式,force logging 打开,最小附加日志打开:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 09:41:22 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/fast_recovery_area
Oldest online log sequence 29
Next log sequence to archive 31
Current log sequence 31
SQL> select force_logging from v$database;
FOR
---
YES
SQL> Select SUPPLEMENTAL_LOG_DATA_MIN,SUPPLEMENTAL_LOG_DATA_PK,SUPPLEMENTAL_LOG_DATA_UI,SUPPLEMENTAL_LOG_DATA_FK,SUPPLEMENTAL_LOG_DATA_ALL from v$database;
SUPPLEME SUP SUP SUP SUP
-------- --- --- --- ---
YES NO NO NO NO
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
dg1 开启表级别附加日志:
[oracle@dg1 ogg]$ cd $GGHOME
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (dg1) 4> dblogin userid ogg,password oracle
Successfully logged into database.
GGSCI (dg1) 5>
GGSCI (dg1) 5>
GGSCI (dg1) 5> info trandata hr.*
Logging of supplemental redo log data is disabled for table HR.COUNTRIES.
Logging of supplemental redo log data is disabled for table HR.DEPARTMENTS.
Logging of supplemental redo log data is disabled for table HR.EMPLOYEES.
Logging of supplemental redo log data is disabled for table HR.JOBS.
Logging of supplemental redo log data is disabled for table HR.JOB_HISTORY.
Logging of supplemental redo log data is disabled for table HR.LOCATIONS.
Logging of supplemental redo log data is disabled for table HR.REGIONS.
GGSCI (dg1) 6> add trandata hr.*
Logging of supplemental redo data enabled for table HR.COUNTRIES.
Logging of supplemental redo data enabled for table HR.DEPARTMENTS.
Logging of supplemental redo data enabled for table HR.EMPLOYEES.
Logging of supplemental redo data enabled for table HR.JOBS.
Logging of supplemental redo data enabled for table HR.JOB_HISTORY.
Logging of supplemental redo data enabled for table HR.LOCATIONS.
Logging of supplemental redo data enabled for table HR.REGIONS.
GGSCI (dg1) 7> info trandata hr.*
Logging of supplemental redo log data is enabled for table HR.COUNTRIES.
Columns supplementally logged for table HR.COUNTRIES: COUNTRY_ID.
Logging of supplemental redo log data is enabled for table HR.DEPARTMENTS.
Columns supplementally logged for table HR.DEPARTMENTS: DEPARTMENT_ID.
Logging of supplemental redo log data is enabled for table HR.EMPLOYEES.
Columns supplementally logged for table HR.EMPLOYEES: EMPLOYEE_ID.
Logging of supplemental redo log data is enabled for table HR.JOBS.
Columns supplementally logged for table HR.JOBS: JOB_ID.
Logging of supplemental redo log data is enabled for table HR.JOB_HISTORY.
Columns supplementally logged for table HR.JOB_HISTORY: EMPLOYEE_ID, START_DATE.
Logging of supplemental redo log data is enabled for table HR.LOCATIONS.
Columns supplementally logged for table HR.LOCATIONS: LOCATION_ID.
Logging of supplemental redo log data is enabled for table HR.REGIONS.
Columns supplementally logged for table HR.REGIONS: REGION_ID.
GGSCI (dg1) 8>
GGSCI (dg1) 8>
GGSCI (dg1) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
dg1 配置抽取进程:
GGSCI (dg1) 9> edit params hext
GGSCI (dg1) 10> view params hext
Extract hext
SETENV (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
UserId ogg,password oracle
Exttrail ./dirdat/hi
table HR.*;
GGSCI (dg1) 11> add extract hext, tranlog, begin now;
EXTRACT added.
GGSCI (dg1) 12> add exttrail ./dirdat/hi extract hext, megabytes 200
EXTTRAIL added.
GGSCI (dg1) 13> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED HEXT 00:00:00 00:00:12
GGSCI (dg1) 14>
GGSCI (dg1) 14>
GGSCI (dg1) 14>
GGSCI (dg1) 14>
dg1 配置data pump 投递进程:
GGSCI (dg1) 14> edit params hpump
GGSCI (dg1) 15> view params hpump
Extract hpump
UserId ogg,password oracle
rmthost node1, mgrport 7809
rmttrail ./dirdat/hp
table HR.*;
GGSCI (dg1) 16> add extract hpump, exttrailsource ./dirdat/hi
EXTRACT added.
GGSCI (dg1) 17> add rmttrail ./dirdat/hp, extract hpump , megabytes 200
RMTTRAIL added.
GGSCI (dg1) 18> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED HEXT 00:00:00 00:01:27
EXTRACT STOPPED HPUMP 00:00:00 00:00:10
dg1 启动抽取投递进程:
GGSCI (dg1) 19> start hext
Sending START request to MANAGER ...
EXTRACT HEXT starting
GGSCI (dg1) 20> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:01:42 00:00:01
EXTRACT STOPPED HPUMP 00:00:00 00:00:25
GGSCI (dg1) 21> start hpump
Sending START request to MANAGER ...
EXTRACT HPUMP starting
GGSCI (dg1) 22> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:01:42 00:00:06
EXTRACT RUNNING HPUMP 00:00:00 00:00:30
GGSCI (dg1) 23> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:00:00 00:00:00
EXTRACT RUNNING HPUMP 00:00:00 00:00:01
GGSCI (dg1) 24> exit
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
node3 配置复制进程:
[oracle@dg1 ogg]$ ssh node3
^C
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:39:45 2017 from dg1
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> dblogin userid ogg,password oracle
Successfully logged into database.
GGSCI (node1) 2> edit params ./GLOBALS
GGSCI (node1) 4> view params ./GLOBALS
checkpointtable ogg.chkt
GGSCI (node1) 5> edit params hrep
GGSCI (node1) 6> view params hrep
Replicat hrep
AssumeTargetDefs
DiscardFile ./dirrpt/rpdw.dsc, Purge
UserId ogg,password oracle
HANDLECOLLISIONS
Map HR.*, target HR.*;
GGSCI (node1) 15> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (node1) 16> view params ./GLOBALS
checkpointtable ogg.chkt
GGSCI (node1) 17> add checkpointtable ogg.chkt
Successfully created checkpoint table ogg.chkt.
GGSCI (node1) 18> add replicat hrep exttrail ./dirdat/hp
REPLICAT added.
GGSCI (node1) 19> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT STOPPED HREP 00:00:00 00:00:03
GGSCI (node1) 20> start hrep
Sending START request to MANAGER ...
REPLICAT HREP starting
GGSCI (node1) 21> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:08
GGSCI (node1) 22> stats hrep
Sending STATS request to REPLICAT HREP ...
No active replication maps.
node1 确认AT EOF 后,注销HANGLECOLLISIONS 参数:
GGSCI (node1) 23> lag hrep
Sending GETLAG request to REPLICAT HREP ...
No records yet processed.
At EOF, no more records to process.
GGSCI (node1) 24> edit params hrep
GGSCI (node1) 25> view params hrep
Replicat hrep
AssumeTargetDefs
DiscardFile ./dirrpt/rpdw.dsc, Purge
UserId ogg,password oracle
---HANDLECOLLISIONS
Map HR.*, target HR.*;
GGSCI (node1) 26> stop hrep
Sending STOP request to REPLICAT HREP ...
Request processed.
GGSCI (node1) 27> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT STOPPED HREP 00:00:00 00:00:03
GGSCI (node1) 28> start hrep
Sending START request to MANAGER ...
REPLICAT HREP starting
GGSCI (node1) 29> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:07
GGSCI (node1) 30> exit
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:00:00 00:00:02
EXTRACT RUNNING HPUMP 00:00:00 00:00:04
GGSCI (dg1) 2> exit
dg1 解锁测试用户hr:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:05:01 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> alter user hr identified by oracle account unlock;
User altered.
SQL> connect hr/oracle
Connected.
SQL> select tname from tab;
TNAME
------------------------------
COUNTRIES
DEPARTMENTS
EMPLOYEES
EMP_DETAILS_VIEW
JOBS
JOB_HISTORY
LOCATIONS
REGIONS
8 rows selected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 09:38:14 2017 from dg1
dg2 物理备库应该同步解锁操作,连接dg2 测试:
[oracle@dg2 ~]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:05:34 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select tname from tab;
TNAME
------------------------------
COUNTRIES
DEPARTMENTS
EMPLOYEES
EMP_DETAILS_VIEW
JOBS
JOB_HISTORY
LOCATIONS
REGIONS
8 rows selected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
node1 未开启 ddl 复制,授权信息不回复制到目标端,验证,并手动调整:
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 09:46:35 2017 from dg1
[oracle@node1 ~]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:05:53 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-28000: the account is locked
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@node1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:05:58 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> alter user hr identified by oracle account unlock;
User altered.
SQL> connect hr/oracle
Connected.
SQL> select tname from tab;
TNAME
------------------------------
COUNTRIES
DEPARTMENTS
EMPLOYEES
EMP_DETAILS_VIEW
JOBS
JOB_HISTORY
LOCATIONS
REGIONS
8 rows selected.
SQL>
SQL>
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ~]$ exit
logout
Connection to node1 closed.
下面步骤为添加测试用表TAB:
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:00:00 00:00:03
EXTRACT RUNNING HPUMP 00:00:00 00:00:06
GGSCI (dg1) 2> lag hext
Sending GETLAG request to EXTRACT HEXT ...
Last record lag: 1 seconds.
At EOF, no more records to process.
GGSCI (dg1) 3> lag hpump
Sending GETLAG request to EXTRACT HPUMP ...
No records yet processed.
At EOF, no more records to process.
GGSCI (dg1) 4> stop hext
Sending STOP request to EXTRACT HEXT ...
Request processed.
GGSCI (dg1) 5> stop hpump
Sending STOP request to EXTRACT HPUMP ...
Request processed.
GGSCI (dg1) 6> exit
[oracle@dg1 ogg]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:07:40 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> create table tab (id int primary key,name varchar2(20));
Table created.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> dblogin userid ogg,password ogg
ERROR: Unable to connect to database using user ogg. Please check privileges.
ORA-01017: invalid username/password; logon denied.
GGSCI (dg1) 2> dblogin userid ogg,password oracle
Successfully logged into database.
GGSCI (dg1) 3> add trandata hr.tab
Logging of supplemental redo data enabled for table HR.TAB.
GGSCI (dg1) 4> info trandata hr.tab
Logging of supplemental redo log data is enabled for table HR.TAB.
Columns supplementally logged for table HR.TAB: ID.
GGSCI (dg1) 5> exit
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED HEXT 00:00:00 00:01:28
EXTRACT STOPPED HPUMP 00:00:00 00:01:24
GGSCI (dg1) 2> exit
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 10:05:49 2017 from dg1
[oracle@node1 ~]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:08:58 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select tname from tab;
TNAME
------------------------------
COUNTRIES
DEPARTMENTS
EMPLOYEES
EMP_DETAILS_VIEW
JOBS
JOB_HISTORY
LOCATIONS
REGIONS
8 rows selected.
SQL> create table tab (id int primary key,name varchar2(20));
Table created.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
EMPLOYEES
COUNTRIES
TAB
JOB_HISTORY
JOBS
DEPARTMENTS
LOCATIONS
REGIONS
8 rows selected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:08
GGSCI (node1) 2> exit
[oracle@node1 ogg]$
[oracle@node1 ogg]$
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED HEXT 00:00:00 00:02:53
EXTRACT STOPPED HPUMP 00:00:00 00:02:50
GGSCI (dg1) 2> start hext
Sending START request to MANAGER ...
EXTRACT HEXT starting
GGSCI (dg1) 3> start hpump
Sending START request to MANAGER ...
EXTRACT HPUMP starting
GGSCI (dg1) 4> lag *
Sending GETLAG request to EXTRACT HEXT ...
No records yet processed.
At EOF, no more records to process.
Sending GETLAG request to EXTRACT HPUMP ...
No records yet processed.
GGSCI (dg1) 5> exit
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
dg1 主库执行事务验证dataguard 及ogg 复制情况:
[oracle@dg1 ogg]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:10:37 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from tab;
COUNT(*)
----------
0
SQL> desc tab;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER(38)
NAME VARCHAR2(20)
SQL> begin
2 for i in 1 .. 100
3 loop
4 insert into tab values (i,to_char(i));
5 commit;
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL> select count(*) from tab;
COUNT(*)
----------
100
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> stats hext
Sending STATS request to EXTRACT HEXT ...
Start of Statistics at 2017-05-01 10:11:35.
Output to ./dirdat/hi:
Extracting from HR.TAB to HR.TAB:
*** Total statistics since 2017-05-01 10:11:21 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Daily statistics since 2017-05-01 10:11:21 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Hourly statistics since 2017-05-01 10:11:21 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Latest statistics since 2017-05-01 10:11:21 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
End of Statistics.
GGSCI (dg1) 2> stats hpump
Sending STATS request to EXTRACT HPUMP ...
Start of Statistics at 2017-05-01 10:11:38.
Output to ./dirdat/hp:
Extracting from HR.TAB to HR.TAB:
*** Total statistics since 2017-05-01 10:11:22 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Daily statistics since 2017-05-01 10:11:22 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Hourly statistics since 2017-05-01 10:11:22 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Latest statistics since 2017-05-01 10:11:22 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
End of Statistics.
GGSCI (dg1) 3> exit
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 10:05:27 2017 from dg1
[oracle@dg2 ~]$ sqlplus hr/oraclel
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:11:48 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@dg2 ~]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:11:54 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> desc tab;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER(38)
NAME VARCHAR2(20)
SQL> select count(*) from tab;
COUNT(*)
----------
100
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 10:08:53 2017 from dg1
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:08
GGSCI (node1) 2> stats hrep
Sending STATS request to REPLICAT HREP ...
Start of Statistics at 2017-05-01 10:12:25.
Replicating from HR.TAB to HR.TAB:
*** Total statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Daily statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Hourly statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
*** Latest statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 100.00
End of Statistics.
GGSCI (node1) 3> exit
[oracle@node1 ogg]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:12:32 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from tab;
COUNT(*)
----------
100
SQL> exit]
SP2-0584: EXIT variable "]" was non-numeric
Usage: { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | n |
<variable> | :<bindvariable> ] [ COMMIT | ROLLBACK ]
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ogg]$
[oracle@node1 ogg]$
[oracle@node1 ogg]$
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ #####停止业务,确认dg sequence#追平,确认ogg 抽取间隔,停止ogg,dg 主备切换,ogg 相关目录拷贝至新主库,启动ogg ,验证同步
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:18:04 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select max(sequence#) from v$archived_log where status='A';
MAX(SEQUENCE#)
--------------
30
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 10:11:45 2017 from dg1
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:18:41 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select max(sequence#) from v$archived_log where status='A';
MAX(SEQUENCE#)
--------------
30
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:00:00 00:00:04
EXTRACT RUNNING HPUMP 00:00:00 00:00:01
GGSCI (dg1) 2> lag *
Sending GETLAG request to EXTRACT HEXT ...
Last record lag: 2 seconds.
At EOF, no more records to process.
Sending GETLAG request to EXTRACT HPUMP ...
Last record lag: 4 seconds.
At EOF, no more records to process.
GGSCI (dg1) 3> exixt
ERROR: Invalid command.
GGSCI (dg1) 4> exit
[oracle@dg1 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 10:12:14 2017 from dg1
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:09
GGSCI (node1) 2> lag hrep
Sending GETLAG request to REPLICAT HREP ...
Last record lag: 6 seconds.
At EOF, no more records to process.
GGSCI (node1) 3> exit
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:00:00 00:00:01
EXTRACT RUNNING HPUMP 00:00:00 00:00:09
GGSCI (dg1) 2> stop hext
Sending STOP request to EXTRACT HEXT ...
Request processed.
GGSCI (dg1) 3> stop hpump
Sending STOP request to EXTRACT HPUMP ...
Request processed.
GGSCI (dg1) 4> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
GGSCI (dg1) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED HEXT 00:00:00 00:00:10
EXTRACT STOPPED HPUMP 00:00:00 00:00:07
GGSCI (dg1) 6> exit
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:21:19 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ps -ef | grep LOCAL=NO
oracle 2925 1 0 08:42 ? 00:00:00 oracleorcl (LOCAL=NO)
oracle 2942 1 0 08:42 ? 00:00:00 oracleorcl (LOCAL=NO)
oracle 2946 1 0 08:42 ? 00:00:02 oracleorcl (LOCAL=NO)
oracle 4661 1 0 09:28 ? 00:00:01 oracleorcl (LOCAL=NO)
oracle 6578 4461 0 10:22 pts/0 00:00:00 grep LOCAL=NO
[oracle@dg1 ogg]$ kill -9 2925
[oracle@dg1 ogg]$ kill -9 2942
[oracle@dg1 ogg]$ kill -9 2946
[oracle@dg1 ogg]$ kill -9 4661
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:23:05 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdb a
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SQL> connect /as sysdba
Connected.
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 10:18:36 2017 from dg1
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:24:15 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:24:38 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY with session shutdown;
Database altered.
SQL> shutdown immediate;
ORA-01012: not logged on
SQL> shutdwon immediate;
SP2-0734: unknown command beginning "shutdwon i..." - rest of line ignored.
SQL> shutdown immediate;
ORA-01012: not logged on
SQL> connect /as sysdba
Connected to an idle instance.
SQL> exit
Disconnected
[oracle@dg1 ogg]$ ps -ef | grep ora_
oracle 6775 4461 0 10:26 pts/0 00:00:00 grep ora_
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:26:11 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2253664 bytes
Variable Size 989858976 bytes
Database Buffers 603979776 bytes
Redo Buffers 7319552 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ ssh node2
^C
[oracle@dg1 ogg]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 10:24:12 2017 from dg1
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:26:42 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
NOT ALLOWED
SQL> /
SWITCHOVER_STATUS
--------------------
NOT ALLOWED
SQL> /
SWITCHOVER_STATUS
--------------------
NOT ALLOWED
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$ ps -ef | grep ora_
oracle 2847 1 0 08:41 ? 00:00:00 ora_pmon_orcl2
oracle 2849 1 0 08:41 ? 00:00:01 ora_psp0_orcl2
oracle 2851 1 1 08:41 ? 00:01:58 ora_vktm_orcl2
oracle 2855 1 0 08:41 ? 00:00:00 ora_gen0_orcl2
oracle 2857 1 0 08:41 ? 00:00:00 ora_diag_orcl2
oracle 2859 1 0 08:41 ? 00:00:00 ora_dbrm_orcl2
oracle 2861 1 0 08:41 ? 00:00:03 ora_dia0_orcl2
oracle 2863 1 0 08:41 ? 00:00:00 ora_mman_orcl2
oracle 2865 1 0 08:41 ? 00:00:01 ora_dbw0_orcl2
oracle 2867 1 0 08:41 ? 00:00:01 ora_lgwr_orcl2
oracle 2869 1 0 08:41 ? 00:00:03 ora_ckpt_orcl2
oracle 2871 1 0 08:41 ? 00:00:00 ora_smon_orcl2
oracle 2873 1 0 08:41 ? 00:00:00 ora_reco_orcl2
oracle 2875 1 0 08:41 ? 00:00:02 ora_mmon_orcl2
oracle 2877 1 0 08:41 ? 00:00:02 ora_mmnl_orcl2
oracle 2879 1 0 08:41 ? 00:00:00 ora_d000_orcl2
oracle 2881 1 0 08:41 ? 00:00:00 ora_s000_orcl2
oracle 2891 1 0 08:41 ? 00:00:00 ora_arc0_orcl2
oracle 2893 1 0 08:42 ? 00:00:00 ora_arc1_orcl2
oracle 2895 1 0 08:42 ? 00:00:00 ora_arc2_orcl2
oracle 2897 1 0 08:42 ? 00:00:00 ora_rvwr_orcl2
oracle 2899 1 0 08:42 ? 00:00:00 ora_arc3_orcl2
oracle 2901 1 0 08:42 ? 00:00:00 ora_arc4_orcl2
oracle 5669 5634 0 10:27 pts/1 00:00:00 grep ora_
[oracle@dg2 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:27:47 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2253664 bytes
Variable Size 989858976 bytes
Database Buffers 603979776 bytes
Redo Buffers 7319552 bytes
Database mounted.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
NOT ALLOWED
SQL> alter database commit to switchover to primary;
alter database commit to switchover to primary
*
ERROR at line 1:
ORA-16139: media recovery required
SQL> alter database recover managed standbyh databas disconnect from session;
alter database recover managed standbyh databas disconnect from session
*
ERROR at line 1:
ORA-02000: missing STANDBY keyword
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
SQL> alter database commit to switchover to primary;
Database altered.
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> shutdwon immediate;
SP2-0734: unknown command beginning "shutdwon i..." - rest of line ignored.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2253664 bytes
Variable Size 989858976 bytes
Database Buffers 603979776 bytes
Redo Buffers 7319552 bytes
Database mounted.
Database opened.
SQL> select database_role,protection_mode from v$database;
DATABASE_ROLE PROTECTION_MODE
---------------- --------------------
PRIMARY MAXIMUM PERFORMANCE
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ~]$ exit
logout
Connection to dg2 closed.
[oracle@dg1 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:31:08 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL> alter database recover managed standby database disconnect from session using current logfile;
Database altered.
SQL> select open_mode,database_role,protection_mode from v$database;
OPEN_MODE DATABASE_ROLE PROTECTION_MODE
-------------------- ---------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM PERFORMANCE
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ogg]$ exit
logout
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]# ssh dg2
root@dg2's password:
Last login: Mon May 1 08:40:10 2017 from 192.168.1.1
[root@dg2 ~]# grep GGHOME
^C
[root@dg2 ~]# grep GGHOME .bash_profile
[root@dg2 ~]# vi .bash_profile
[root@dg2 ~]# su - oracle
[oracle@dg2 ~]$ grep GGHOME .bash_profile
[oracle@dg2 ~]$ vi .bash_profile
[oracle@dg2 ~]$ soruce .bash_profile
-bash: soruce: command not found
[oracle@dg2 ~]$ source .bash_profile
[oracle@dg2 ~]$ cd $GGHOME
[oracle@dg2 ogg]$ ls -l
total 0
[oracle@dg2 ogg]$ exit
logout
[root@dg2 ~]# exit
logout
Connection to dg2 closed.
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]#
[root@dg1 ~]# cd $GGHOME
[root@dg1 ~]# ls
anaconda-ks.cfg Desktop Documents Downloads install.log install.log.syslog Music Pictures Public rhel6.iso Templates Videos
[root@dg1 ~]# su - oracle
[oracle@dg1 ~]$ cd $GGHOME
[oracle@dg1 ogg]$ ls
bcpfmt.tpl ddl_session1.sql dirdat keygen params.sql
bcrypt.txt ddl_session.sql dirdef libantlr3c.so prvtclkm.plb
BR ddl_setup.sql dirjar libdb-5.2.so pw_agent_util.sh
cfg ddl_status.sql dirout libgglog.so remove_seq.sql
chkpt_ora_create.sql ddl_staymetadata_off.sql dirpcs libggrepo.so replicat
cobgen ddl_staymetadata_on.sql dirprm libicudata.so.38 retrace
convchk ddl_tracelevel.sql dirrpt libicui18n.so.38 reverse
db2cntl.tpl ddl_trace_off.sql dirsql libicuuc.so.38 role_setup.sql
ddl_cleartrace.sql ddl_trace_on.sql dirtmp libxerces-c.so.28 sequence.sql
ddlcob defgen emsclnt libxml2.txt server
ddl_ddl2file.sql demo_more_ora_create.sql extract logdump sqlldr.tpl
ddl_disable.sql demo_more_ora_insert.sql fbo_ggs_Linux_x64_ora11g_64bit.tar marker_remove.sql tcperrs
ddl_enable.sql demo_ora_create.sql freeBSD.txt marker_setup.sql ucharset.h
ddl_filter.sql demo_ora_insert.sql ggcmd marker_status.sql ulg.sql
ddl_ora10.sql demo_ora_lob_create.sql gglog-mgr.dmp mgr UserExitExamples
ddl_ora10upCommon.sql demo_ora_misc.sql ggMessage.dat notices.txt usrdecs.h
ddl_ora11.sql demo_ora_pk_befores_create.sql ggsci oggerr V34339-01.zip
ddl_ora9.sql demo_ora_pk_befores_insert.sql ggserr.log OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf zlib.txt
ddl_pin.sql demo_ora_pk_befores_updates.sql help.txt Oracle_GoldenGate_11.2.1.0.3_README.doc
ddl_remove.sql dirchk jagent.sh Oracle GoldenGate_11.2.1.0.3_README.txt
[oracle@dg1 ogg]$ pwd
/u01/app/ogg
[oracle@dg1 ogg]$ cd ../
[oracle@dg1 app]$ tar cvf ogg.tar ogg/*
ogg/bcpfmt.tpl
ogg/bcrypt.txt
ogg/BR/
ogg/BR/HEXT/
ogg/BR/HEXT/stale/
ogg/cfg/
ogg/cfg/password.properties
ogg/cfg/mpmetadata.xml
ogg/cfg/Config.properties
ogg/cfg/jps-config-jse.xml
ogg/cfg/MPMetadataSchema.xsd
ogg/cfg/ProfileConfig.xml
ogg/chkpt_ora_create.sql
ogg/cobgen
ogg/convchk
ogg/db2cntl.tpl
ogg/ddl_cleartrace.sql
ogg/ddlcob
ogg/ddl_ddl2file.sql
ogg/ddl_disable.sql
ogg/ddl_enable.sql
ogg/ddl_filter.sql
ogg/ddl_ora10.sql
ogg/ddl_ora10upCommon.sql
ogg/ddl_ora11.sql
ogg/ddl_ora9.sql
ogg/ddl_pin.sql
ogg/ddl_remove.sql
ogg/ddl_session1.sql
ogg/ddl_session.sql
ogg/ddl_setup.sql
ogg/ddl_status.sql
ogg/ddl_staymetadata_off.sql
ogg/ddl_staymetadata_on.sql
ogg/ddl_tracelevel.sql
ogg/ddl_trace_off.sql
ogg/ddl_trace_on.sql
ogg/defgen
ogg/demo_more_ora_create.sql
ogg/demo_more_ora_insert.sql
ogg/demo_ora_create.sql
ogg/demo_ora_insert.sql
ogg/demo_ora_lob_create.sql
ogg/demo_ora_misc.sql
ogg/demo_ora_pk_befores_create.sql
ogg/demo_ora_pk_befores_insert.sql
ogg/demo_ora_pk_befores_updates.sql
ogg/dirchk/
ogg/dirchk/HEXT.cpb
ogg/dirchk/HPUMP.cps
ogg/dirchk/HEXT.cps
ogg/dirchk/HEXT.cpe
ogg/dirchk/HPUMP.cpe
ogg/dirdat/
ogg/dirdat/hi000000
ogg/dirdat/hi000001
ogg/dirdef/
ogg/dirjar/
ogg/dirjar/identityutils.jar
ogg/dirjar/jps-manifest.jar
ogg/dirjar/org.springframework.instrument-3.0.0.RELEASE.jar
ogg/dirjar/slf4j-log4j12-1.4.3.jar
ogg/dirjar/org.springframework.jdbc-3.0.0.RELEASE.jar
ogg/dirjar/xmlparserv2.jar
ogg/dirjar/log4j-1.2.15.jar
ogg/dirjar/jps-internal.jar
ogg/dirjar/jps-common.jar
ogg/dirjar/jps-upgrade.jar
ogg/dirjar/org.springframework.context.support-3.0.0.RELEASE.jar
ogg/dirjar/osdt_cert.jar
ogg/dirjar/spring-security-web-3.0.1.RELEASE.jar
ogg/dirjar/oraclepki.jar
ogg/dirjar/commons-codec-1.3.jar
ogg/dirjar/jps-unsupported-api.jar
ogg/dirjar/slf4j-api-1.4.3.jar
ogg/dirjar/org.springframework.core-3.0.0.RELEASE.jar
ogg/dirjar/org.springframework.expression-3.0.0.RELEASE.jar
ogg/dirjar/org.springframework.orm-3.0.0.RELEASE.jar
ogg/dirjar/org.springframework.web-3.0.0.RELEASE.jar
ogg/dirjar/fmw_audit.jar
ogg/dirjar/org.springframework.beans-3.0.0.RELEASE.jar
ogg/dirjar/commons-logging-1.0.4.jar
ogg/dirjar/jsr250-api-1.0.jar
ogg/dirjar/osdt_xmlsec.jar
ogg/dirjar/monitor-common.jar
ogg/dirjar/spring-security-config-3.0.1.RELEASE.jar
ogg/dirjar/jps-mbeans.jar
ogg/dirjar/spring-security-acl-3.0.1.RELEASE.jar
ogg/dirjar/jdmkrt-1.0-b02.jar
ogg/dirjar/spring-security-taglibs-3.0.1.RELEASE.jar
ogg/dirjar/xstream-1.3.jar
ogg/dirjar/org.springframework.aspects-3.0.0.RELEASE.jar
ogg/dirjar/org.springframework.aop-3.0.0.RELEASE.jar
ogg/dirjar/jps-patching.jar
ogg/dirjar/xpp3_min-1.1.4c.jar
ogg/dirjar/jps-api.jar
ogg/dirjar/jagent.jar
ogg/dirjar/jps-wls.jar
ogg/dirjar/jmxremote_optional-1.0-b02.jar
ogg/dirjar/org.springframework.test-3.0.0.RELEASE.jar
ogg/dirjar/org.springframework.transaction-3.0.0.RELEASE.jar
ogg/dirjar/ldapjclnt11.jar
ogg/dirjar/org.springframework.asm-3.0.0.RELEASE.jar
ogg/dirjar/jacc-spi.jar
ogg/dirjar/spring-security-core-3.0.1.RELEASE.jar
ogg/dirjar/jps-ee.jar
ogg/dirjar/osdt_core.jar
ogg/dirjar/spring-security-cas-client-3.0.1.RELEASE.jar
ogg/dirjar/identitystore.jar
ogg/dirjar/org.springframework.context-3.0.0.RELEASE.jar
ogg/dirout/
ogg/dirpcs/
ogg/dirprm/
ogg/dirprm/hpump.prm
ogg/dirprm/mgr.prm
ogg/dirprm/jagent.prm
ogg/dirprm/hext.prm
ogg/dirrpt/
ogg/dirrpt/HEXT.rpt
ogg/dirrpt/HEXT0.rpt
ogg/dirrpt/HPUMP.rpt
ogg/dirrpt/HPUMP0.rpt
ogg/dirrpt/MGR.rpt
ogg/dirsql/
ogg/dirtmp/
ogg/emsclnt
ogg/extract
ogg/fbo_ggs_Linux_x64_ora11g_64bit.tar
ogg/freeBSD.txt
ogg/ggcmd
ogg/gglog-mgr.dmp
ogg/ggMessage.dat
ogg/ggsci
ogg/ggserr.log
ogg/help.txt
ogg/jagent.sh
ogg/keygen
ogg/libantlr3c.so
ogg/libdb-5.2.so
ogg/libgglog.so
ogg/libggrepo.so
ogg/libicudata.so.38
ogg/libicui18n.so.38
ogg/libicuuc.so.38
ogg/libxerces-c.so.28
ogg/libxml2.txt
ogg/logdump
ogg/marker_remove.sql
ogg/marker_setup.sql
ogg/marker_status.sql
ogg/mgr
ogg/notices.txt
ogg/oggerr
ogg/OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf
ogg/Oracle_GoldenGate_11.2.1.0.3_README.doc
ogg/Oracle GoldenGate_11.2.1.0.3_README.txt
ogg/params.sql
ogg/prvtclkm.plb
ogg/pw_agent_util.sh
ogg/remove_seq.sql
ogg/replicat
ogg/retrace
ogg/reverse
ogg/role_setup.sql
ogg/sequence.sql
ogg/server
ogg/sqlldr.tpl
ogg/tcperrs
ogg/ucharset.h
ogg/ulg.sql
ogg/UserExitExamples/
ogg/UserExitExamples/ExitDemo_lobs/
ogg/UserExitExamples/ExitDemo_lobs/Makefile_lob.HPUX
ogg/UserExitExamples/ExitDemo_lobs/exitdemo_lob.vcproj
ogg/UserExitExamples/ExitDemo_lobs/readme.txt
ogg/UserExitExamples/ExitDemo_lobs/exitdemo_lob.c
ogg/UserExitExamples/ExitDemo_lobs/Makefile_lob.SOLARIS
ogg/UserExitExamples/ExitDemo_lobs/Makefile_lob.AIX
ogg/UserExitExamples/ExitDemo_lobs/Makefile_lob.LINUX
ogg/UserExitExamples/ExitDemo_pk_befores/
ogg/UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.AIX
ogg/UserExitExamples/ExitDemo_pk_befores/readme.txt
ogg/UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.vcproj
ogg/UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.HPUX
ogg/UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.c
ogg/UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.LINUX
ogg/UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.SOLARIS
ogg/UserExitExamples/ExitDemo_more_recs/
ogg/UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX
ogg/UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS
ogg/UserExitExamples/ExitDemo_more_recs/readme.txt
ogg/UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj
ogg/UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c
ogg/UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX
ogg/UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX
ogg/UserExitExamples/ExitDemo_passthru/
ogg/UserExitExamples/ExitDemo_passthru/Makefile_passthru.LINUX
ogg/UserExitExamples/ExitDemo_passthru/readme.txt
ogg/UserExitExamples/ExitDemo_passthru/exitdemopassthru.vcproj
ogg/UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
ogg/UserExitExamples/ExitDemo_passthru/Makefile_passthru.SOLARIS
ogg/UserExitExamples/ExitDemo_passthru/exitdemo_passthru.c
ogg/UserExitExamples/ExitDemo_passthru/Makefile_passthru.HPUX
ogg/UserExitExamples/ExitDemo_passthru/Makefile_passthru.HP_OSS
ogg/UserExitExamples/ExitDemo/
ogg/UserExitExamples/ExitDemo/Makefile_exit_demo.AIX
ogg/UserExitExamples/ExitDemo/Makefile_exit_demo.SOLARIS
ogg/UserExitExamples/ExitDemo/Makefile_exit_demo.HPUX
ogg/UserExitExamples/ExitDemo/readme.txt
ogg/UserExitExamples/ExitDemo/Makefile_exit_demo.LINUX
ogg/UserExitExamples/ExitDemo/Makefile_exit_demo.HP_OSS
ogg/UserExitExamples/ExitDemo/exitdemo.c
ogg/UserExitExamples/ExitDemo/exitdemo_utf16.c
ogg/UserExitExamples/ExitDemo/exitdemo.vcproj
ogg/usrdecs.h
ogg/V34339-01.zip
ogg/zlib.txt
[oracle@dg1 app]$ ls -l | grep ogg.tar
-rw-r--r--. 1 oracle oinstall 571166720 May 1 10:35 ogg.tar
[oracle@dg1 app]$ scp -pr ogg.tar dg2:/u01/app/
oracle@dg2's password:
ogg.tar 100% 545MB 23.7MB/s 00:23
[oracle@dg1 app]$
[oracle@dg1 app]$
[oracle@dg1 app]$
[oracle@dg1 app]$
[oracle@dg1 app]$
[oracle@dg1 app]$ ssh dg2
oracle@dg2's password:
Last login: Mon May 1 10:26:39 2017 from dg1
[oracle@dg2 ~]$ cd /u01/app/
[oracle@dg2 app]$ ls
ogg ogg.tar oracle oraInventory
[oracle@dg2 app]$ tar -xf ogg.tar
[oracle@dg2 app]$ ls -l
total 557796
drwxr-xr-x. 15 oracle oinstall 4096 May 1 10:37 ogg
-rw-r--r--. 1 oracle oinstall 571166720 May 1 10:35 ogg.tar
drwxrwxr-x. 8 oracle oinstall 4096 Nov 30 2015 oracle
drwxrwx---. 6 oracle oinstall 4096 Aug 8 2015 oraInventory
[oracle@dg2 app]$ cd $GGHOME
[oracle@dg2 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (dg2) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED HEXT 00:00:00 00:18:10
EXTRACT STOPPED HPUMP 00:00:00 00:18:07
GGSCI (dg2) 2> start mgr
Manager started.
GGSCI (dg2) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED HEXT 00:00:00 00:18:15
EXTRACT STOPPED HPUMP 00:00:00 00:18:11
GGSCI (dg2) 4> start hext
Sending START request to MANAGER ...
EXTRACT HEXT starting
GGSCI (dg2) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:18:25 00:00:02
EXTRACT STOPPED HPUMP 00:00:00 00:18:22
GGSCI (dg2) 6> start hpump
Sending START request to MANAGER ...
EXTRACT HPUMP starting
GGSCI (dg2) 7> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:18:25 00:00:06
EXTRACT RUNNING HPUMP 00:00:00 00:18:26
GGSCI (dg2) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING HEXT 00:18:25 00:00:10
EXTRACT RUNNING HPUMP 00:00:00 00:18:30
GGSCI (dg2) 9> lag hext
Sending GETLAG request to EXTRACT HEXT ...
Last record lag: 303 seconds.
At EOF, no more records to process.
GGSCI (dg2) 10> lag hpump
Sending GETLAG request to EXTRACT HPUMP ...
No records yet processed.
At EOF, no more records to process.
GGSCI (dg2) 11> exit
[oracle@dg2 ogg]$ ssh node1
The authenticity of host 'node1 (192.168.1.89)' can't be established.
RSA key fingerprint is 28:5d:76:19:60:ac:26:ca:3e:84:83:5e:fe:7e:51:3d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1,192.168.1.89' (RSA) to the list of known hosts.
oracle@node1's password:
Last login: Mon May 1 10:19:16 2017 from dg1
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:04
GGSCI (node1) 2> lag hrep
Sending GETLAG request to REPLICAT HREP ...
Last record lag: 6 seconds.
At EOF, no more records to process.
GGSCI (node1) 3>
GGSCI (node1) 3>
GGSCI (node1) 3> exit
[oracle@node1 ogg]$ exit
logout
Connection to node1 closed.
[oracle@dg2 ogg]$
[oracle@dg2 ogg]$
[oracle@dg2 ogg]$
[oracle@dg2 ogg]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:38:53 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect hr/oracle
Connected.
SQL> select count(*) from tab;
COUNT(*)
----------
100
SQL> delete from tab;
100 rows deleted.
SQL> commit;
Commit complete.
SQL> select count(*) from tab;
COUNT(*)
----------
0
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg2 ogg]$ ssh node1
oracle@node1's password:
[oracle@dg2 ogg]$ ssh dg1
The authenticity of host 'dg1 (192.168.1.87)' can't be established.
RSA key fingerprint is 28:5d:76:19:60:ac:26:ca:3e:84:83:5e:fe:7e:51:3d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'dg1,192.168.1.87' (RSA) to the list of known hosts.
oracle@dg1's password:
Permission denied, please try again.
oracle@dg1's password:
[oracle@dg1 ~]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:39:44 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from tab;
COUNT(*)
----------
0
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dg1 ~]$ exit
logout
Connection to dg1 closed.
[oracle@dg2 ogg]$ ssh node1
oracle@node1's password:
Last login: Mon May 1 10:38:33 2017 from dg2
[oracle@node1 ~]$ ggsci
-bash: ggsci: command not found
[oracle@node1 ~]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (node1) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING HREP 00:00:00 00:00:07
GGSCI (node1) 2> stats hrep
Sending STATS request to REPLICAT HREP ...
Start of Statistics at 2017-05-01 10:40:10.
Replicating from HR.TAB to HR.TAB:
*** Total statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 100.00
Total discards 0.00
Total operations 200.00
*** Daily statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 100.00
Total discards 0.00
Total operations 200.00
*** Hourly statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 100.00
Total discards 0.00
Total operations 200.00
*** Latest statistics since 2017-05-01 10:11:24 ***
Total inserts 100.00
Total updates 0.00
Total deletes 100.00
Total discards 0.00
Total operations 200.00
End of Statistics.
GGSCI (node1) 3> exit
[oracle@node1 ogg]$ sqlplus hr/oracle
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 1 10:40:20 2017
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, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from tab;
COUNT(*)
----------
0
SQL>
SQL>
SQL>
[END] 2017/5/1 22:43:25
|
|