shareplex 8.6.6 实现同一数据库内的两个用户的标的复制

[


BEGIN] 2017/4/6 9:15:25
环境配置:
[oracle@middle ~]$ exit
logout
[root@middle oracle]# uname -a
Linux middle 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@middle oracle]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 4.5 (Tikanga)
[root@middle oracle]# cat /etc/hosts

~
~
127.0.0.1         localhost.localdomain localhost
192.168.1.55      middle

[root@middle oracle]#
[root@middle oracle]#
[root@middle oracle]#
[root@middle oracle]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:32:F4:A7  
          inet addr:192.168.1.55  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe32:f4a7/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:76329 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3977 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:111365678 (106.2 MiB)  TX bytes:497718 (486.0 KiB)

lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1143 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1143 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1833573 (1.7 MiB)  TX bytes:1833573 (1.7 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[root@middle oracle]#
[root@middle oracle]#
[root@middle oracle]#
[root@middle oracle]#


oracle用户及环境变量:
[root@middle oracle]# su - oracle
[oracle@middle ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:16:21 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> select banner from v$version;
SP2-0640: Not connected
SQL> connect /as sysDBA
Connected.
SQL> select banner from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE        10.2.0.5.0        Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

SQL>
SQL>
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ cd
[oracle@middle ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

#PATH=$PATHHOME/bin

#export PATH
PATH=$PATHHOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=.{PATH}HOME/binORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}ORACLE_BASE/common/oracle/bin
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp

[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ cat /etc/oratab
orcl:/u01/app/oracle/product/10.2.0/db_1:N
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[root@middle oracle]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16384
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@middle oracle]#
[root@middle oracle]#
[root@middle oracle]#

数据库配置:

[root@middle oracle]# su - oracle
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:17:57 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> connect /as sysdba
SQL> archive log list;
Database log mode               Archive Mode
Automatic archival               Enabled
Archive destination               USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence               2
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> show parameter recovery_parallelism

NAME                                     TYPE         VALUE
------------------------------------ ----------- ------------------------------
recovery_parallelism                     integer         0
SQL>
SQL>

SQL> alter database add supplemental log data(primary key,unique index) columns;

Database altered.

SQL>
SQL>
SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ ##########install shareplex soft##################
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ ls -l
total 104388
-r-xr-xr-x 1 root root 106782720 Apr  5 21:13 shareplex-8.6.6-b64-oracle100-rh-40-amd64-m64.tar
[oracle@middle ~]$ tar -xvf shareplex-8.6.6-b64-oracle100-rh-40-amd64-m64.tar
SharePlex-8.6.6-b64-oracle100-rh-40-amd64-m64.tpm
[oracle@middle ~]$ ls -l
total 208772
-r-xr-xr-x 1 root   root     106782720 Apr  5 21:13 shareplex-8.6.6-b64-oracle100-rh-40-amd64-m64.tar
-rwxr-xr-x 1 oracle oinstall 106776262 Jan 13 12:26 SharePlex-8.6.6-b64-oracle100-rh-40-amd64-m64.tpm
[oracle@middle ~]$ ./SharePlex-8.6.6-b64-oracle100-rh-40-amd64-m64.tpm
Unpacking ..................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ..........................................................................
  ...............................................................

SharePlex installation program:
    SharePlex Version: 8.6.6
    Build platform: rh-40-amd64
    Target platform: rh-40-amd64

Please enter the product directory location? /u01/app/oracle/proddir
Please enter the variable data directory location? /u01/app/oracle/vardir2100
Please specify the SharePlex Admin group (select a number):
1. [oinstall]
2. dba
3. oper
?  1
Please wait while the installer obtains Oracle information ..
Please enter the ORACLE_SID that corresponds to this installation? [orcl]
Please enter the ORACLE_HOME directory that corresponds to this ORACLE_SID? [/u01/app/oracle/product/10.2.0/db_1]
Please enter the TCP/IP port number for SharePlex communications? [2100]

Preparing to install SharePlex for Oracle v.8.6.6:
    User:                     oracle
    Admin Group:              oinstall
    Product Directory:        /u01/app/oracle/proddir
    Variable Data Directory:  /u01/app/oracle/vardir2100
    ORACLE_SID:               orcl
    ORACLE_HOME:              /u01/app/oracle/product/10.2.0/db_1

Proceed with installation? [yes] yes
Installing ................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  ..........................................
Setting file ownerships ...................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .......................................................
Setting file permissions ..................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  .........................................................................
  ........................................................
Do you have a valid SharePlex v. 8.6.6 license? [yes] yes
Please enter the License key? y
Please enter the customer name associated with this license key?
WARNING: Unknown license problem: License "y": Customer ""

NOTE: Installation will continue. You may add license keys by executing utility
      /u01/app/oracle/proddir/install/splex_add_key

Installation log saved to: /home/oracle/.shareplex/INSTALL-SharePlex-8.6.6-1704052121.log
SharePlex for Oracle v.8.6.6 installation successful.


注册license:
[oracle@middle ~]$ /u01/app/oracle/proddir/install/splex_add_key



        SharePlex License Utility

        1) Read license key from file
        2) Enter license key manually
        3) Add license key for alternate host
        q) Quit License Utility

        Enter option: 2
        Enter Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        Enter Customer Name: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


The SharePlex for Oracle - RAC license, "erpetual Key" has been successfully added for host 38945.

        SharePlex License Utility

        1) Read license key from file
        2) Enter license key manually
        3) Add license key for alternate host
        q) Quit License Utility
        Enter option: q
       
       
       
       
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ pwd
/home/oracle
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ cd /u01/app/oracle/proddir
[oracle@middle proddir]$ pwd
/u01/app/oracle/proddir
[oracle@middle proddir]$ cd bin
[oracle@middle bin]$ pwd
/u01/app/oracle/proddir/bin
[oracle@middle bin]$ ls -l
total 4
lrwxrwxrwx 1 oracle oinstall   27 Apr  5 21:22 cleanup.sql -> ../.app-modules/cleanup.sql
lrwxrwxrwx 1 oracle oinstall   31 Apr  5 21:22 clean_vardir.sh -> ../.app-modules/clean_vardir.sh
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 config_parser -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 dumpfile -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 dumpque -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 hana_cleansp -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 hana_setup -> ../.app-modules/launcher
drwxrwxr-x 2 oracle oinstall 4096 Apr  5 21:22 hooks
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 ora_chpwd -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 ora_cleansp -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 ora_setup -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 pb_ctrl -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 pg_cleansp -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 pg_setup -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 qview -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 socket_test -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_cop -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_ctrl -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_declt -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_desvr -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_sync_clt -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_sync_launcher -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_sync_svr -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 sp_wallet -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 td_cleansp -> ../.app-modules/launcher
lrwxrwxrwx 1 oracle oinstall   24 Apr  5 21:22 td_setup -> ../.app-modules/launcher
-rw-rw-r-- 1 oracle oinstall    0 Apr  5 21:22 vardirs.log

调整oracle用户环境变量:
[oracle@middle bin]$ pwd
/u01/app/oracle/proddir/bin
[oracle@middle bin]$ cd
[oracle@middle ~]$ vi .bash_profile
[oracle@middle ~]$ source .bash_profile
[oracle@middle ~]$ grep PATH .bash_profile
#PATH=$PATH:$HOME/bin
#export PATH
PATH=$PATH:$HOME/bin
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:/u01/app/oracle/proddir/bin:$ORACLE_BASE/common/oracle/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
[oracle@middle ~]$
[oracle@middle ~]$


测试调整是否生效:
[oracle@middle ~]$ sp_ctrl


*******************************************************
* SharePlex for Oracle Command Utility
* Copyright 2016 Quest Software Inc.
* ALL RIGHTS RESERVED.
* Protected by U.S. Patents: 7,461,103 and 7,065,538
*******************************************************

   Your tcp port is not set properly or 'sp_cop' is not running
   Attempted to connect to sp_cop on port 2100
sp_ctrl > exit
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$


执行ORA_SETUP 设置:
[oracle@middle ~]$ ora_setup


Welcome to the Oracle SharePlex setup process for port 2100.
This process creates tables and user accounts needed to run
Oracle SharePlex replication.

Will the SharePlex install be using a BEQUEATH connection? (Entering 'n' implies a SQL*net connection)  [y] :
Please note the following:
** In response to prompts, a carriage return will choose the default
   given in brackets.  If there is no default, a reply must be entered.

** To exit the program while the program is waiting for input, use the
   CTRL-C key sequence.
   This sequences can be entered by holding down the CONTROL key and
   pressing the C key.


Enter the Oracle SID for which SharePlex should be installed [orcl] :

In order to create the SharePlex tables and user account, we must
connect to the database as a DBA user

Enter a DBA user for orcl  : system

Enter password for the DBA account, which will not echo :

connecting--This may take a few seconds.

validating user name and password. . . This may take a few seconds.
SharePlex objects will need to be created under a special
account.  You can pick an existing user or create a new one.
Would you like to create a new SharePlex user ? [y] :
Enter username for new user [splex/splex] :

Warning:  This user is now being granted unlimited tablespace.
This privilege will remain in effect until it is explicitly changed.

Setup will now install SharePlex objects.

These are the existing tablespaces.

SYSTEM UNDOTBS1 SYSAUX TEMP USERS EXAMPLE

Enter the default tablespace for use by SharePlex [USERS] :

Enter the temporary tablespace for use by SharePlex [TEMP] :
Enter the index tablespace for use by SharePlex [ ] : USERS

Creating SharePlex objects [Installation type: Fresh]. . .

Creating SharePlex Oracle-timezone-region map . . . Done.

Creating Conflict Resolution Package . . . Done.

Creating SharePlex Dataequator package . . .

Loading Compare Package from "/u01/app/oracle/proddir/util/sp_deq_pkg.plb"...Done.

Loading Compare Varray Package from "/u01/app/oracle/proddir/util/sp_deq_v_pkg.plb"...Done.

Will the current setup for sid: [orcl] be used as source (including cases as source for failover or master-master setups)?  [y] :   

Setup of SharePlex objects successful . . .

Changing SharePlex connection database . . .

Setup completed successfully

[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$




后台启动sp_cop:


[oracle@middle ~]$ sp_cop &
[1] 8529
[oracle@middle ~]$

*******************************************************
* SharePlex for Oracle Startup
* Copyright 2016 Quest Software Inc.
* ALL RIGHTS RESERVED.
* Protected by U.S. Patents: 7,461,103 and 7,065,538
* Version: 8.6.6.64-m64-oracle100
* VarDir : /u01/app/oracle/vardir2100
* Port   : 2100
*******************************************************

[oracle@middle ~]$
[oracle@middle ~]$





创建测试用户:



[oracle@middle ~]$
[oracle@middle ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:30:10 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> exit   
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ ###########create test user for capture and replicat#######################33
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:30:50 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> connect /as sysdba
Connected.
SQL> create user source identified by source account unlock;

User created.

SQL> grant connect,resource to source;

Grant succeeded.

SQL> create user target identified by target account unlock;

User created.

SQL> grant connect,resource to target;

Grant succeeded.

SQL> connect source/source
Connected.
SQL> select tname from tab;

no rows selected

SQL> create table t1(id int primary key,name varchar2(20));

Table created.

SQL> connect target/target
Connected.
SQL> select tname from tab;

no rows selected

SQL> create table t1(id int primary key,name varchar2(20));

Table created.

SQL>
SQL>
SQL>
SQL> select tname from tab;

TNAME
------------------------------
T1

SQL>
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options





登录控制台编辑配置文件:


[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$
[oracle@middle ~]$ sp_ctrl


*******************************************************
* SharePlex for Oracle Command Utility
* Copyright 2016 Quest Software Inc.
* ALL RIGHTS RESERVED.
* Protected by U.S. Patents: 7,461,103 and 7,065,538
*******************************************************

sp_ctrl (middle:2100)> helpo
   Unknown command 'helpo'
sp_ctrl (middle:2100)> help

   List of command groups:

   config     - Control configurations.
   connect    - Control sp_cop connections.
   info       - Display status and statistics.
   maint      - Control displays and files.
   misc       - Miscellaneous commands.
   param      - Control parameters.
   properties - Display properties of the system, SharePlex and user.
   routes     - Manage deprecated route artifacts.
   run        - Control processes.
   sync       - Control synchronization.
   target     - Define target configuration.
   connection - Define connection user.
   key        - Define encryption key.

   Type 'help' and a group name for a list of commands in the group
   Type 'help' and a command name for a full description and syntax



sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)> show

Process    Source                               Target                 State                   PID
---------- ------------------------------------ ---------------------- -------------------- ------

sp_ctrl (middle:2100)> list config

File   Name                                         State       Datasource     
--------------------------------------------------  ----------  ---------------
ORA_config                                          Inactive    o.SOURCE_SID   
Last Modified At: 05-Apr-17 21:22    Size: 151   

sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)> copy config ORA_config to test
sp_ctrl (middle:2100)> list config

File   Name                                         State       Datasource     
--------------------------------------------------  ----------  ---------------
ORA_config                                          Inactive    o.SOURCE_SID   
Last Modified At: 05-Apr-17 21:22    Size: 151   

test                                                Inactive    o.SOURCE_SID   
Last Modified At: 05-Apr-17 21:35    Size: 151   

sp_ctrl (middle:2100)> edit config test
sp_ctrl (middle:2100)> view config test

datasource.orcl

#source tables      target tables           routing map

splex.demo_src      splex.demo_dest             target_system@o.target_sid
source.t1           target.t1                   middle@o.orcl


激活配置文件:

由于是同一主机你会看到没有export import 相关进程,本测试是shareplex 同步一个数据库中的两个用户

sp_ctrl (middle:2100)> activate config test

   Not all tables activated successfully

进程状态正常:


sp_ctrl (middle:2100)> show

Process    Source                               Target                 State                   PID
---------- ------------------------------------ ---------------------- -------------------- ------
Capture    o.orcl                                                      Running                8684
Read       o.orcl                                                      Running                8690
Post       o.orcl-middle                        o.orcl                 Running                8708

sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)>
sp_ctrl (middle:2100)> exit



source 用户插入数据并提交:


[oracle@middle ~]$ sqlplus source/source@orcl

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:38:37 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select count(*) from t1;

  COUNT(*)
----------
         0

SQL> desc t1;
Name                                           Null?    Type
----------------------------------------- -------- ----------------------------
ID                                           NOT NULL NUMBER(38)
NAME                                                    VARCHAR2(20)

SQL> insert into t1 values (1,'name1');

1 row created.

SQL> commit;

Commit complete.

SQL> insert into t1 values (2,'name2');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t1;

        ID NAME
---------- --------------------
         1 name1
         2 name2

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@middle ~]$



查看队列状态:



[oracle@middle log]$ sp_ctrl


*******************************************************
* SharePlex for Oracle Command Utility
* Copyright 2016 Quest Software Inc.
* ALL RIGHTS RESERVED.
* Protected by U.S. Patents: 7,461,103 and 7,065,538
*******************************************************

sp_ctrl (middle:2100)> qstatus

Queues Statistics for middle
  Name:  o.orcl (Capture queue)
    Number of messages:          0 (Age         0 min; Size          1 mb)
    Backlog (messages):          0 (Age         0 min)

  Name:  middle (o.orcl-o.orcl) (Post queue)
    Number of messages:          0 (Age         0 min; Size          2 mb)
    Backlog (messages):          0 (Age         0 min)


sp_ctrl (middle:2100)> exit



target 用户确认数据是否同步成功:



[oracle@middle log]$ sqlplus target/target@orcl

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Apr 5 21:41:05 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select tname from tab;

TNAME
------------------------------
T1

SQL> desc t1;
Name                                           Null?    Type
----------------------------------------- -------- ----------------------------
ID                                           NOT NULL NUMBER(38)
NAME                                                    VARCHAR2(20)

SQL> select count(*) from t1;

  COUNT(*)
----------
         2

可以看到数据同步成功:



SQL> select * from t1;

        ID NAME
---------- --------------------
         1 name1
         2 name2

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@middle log]$ sp_ctrl


*******************************************************
* SharePlex for Oracle Command Utility
* Copyright 2016 Quest Software Inc.
* ALL RIGHTS RESERVED.
* Protected by U.S. Patents: 7,461,103 and 7,065,538
*******************************************************

sp_ctrl (middle:2100)> show

Process    Source                               Target                 State                   PID
---------- ------------------------------------ ---------------------- -------------------- ------
Capture    o.orcl                                                      Running                8684
Read       o.orcl                                                      Running                8690
Post       o.orcl-middle                        o.orcl                 Running                8708

sp_ctrl (middle:2100)> status

Brief Status for middle
Process          State                             PID     Running   Since     
---------------  ------------------------------  --------  --------------------
Cop              Running                             8529  05-Apr-17 21:28:59  
Capture          Running                             8684  05-Apr-17 21:37:40  
Read             Running                             8690  05-Apr-17 21:37:41  
Post             Running                             8708  05-Apr-17 21:37:43  
Cmd & Ctrl       Running                             8796  05-Apr-17 21:41:49  

System is used as a source machine
There is 1 active configuration file

sp_ctrl (middle:2100)> qstatus

Queues Statistics for middle
  Name:  o.orcl (Capture queue)
    Number of messages:          0 (Age         0 min; Size          2 mb)
    Backlog (messages):          0 (Age         0 min)

  Name:  middle (o.orcl-o.orcl) (Post queue)
    Number of messages:          0 (Age         0 min; Size          2 mb)
    Backlog (messages):          0 (Age         0 min)



[END] 2017/4/6 9:44:36
标签: 暂无标签
dongxujian

写了 86 篇文章,拥有财富 384,被 13 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P4 | 发表于 2017-4-6 10:17:04
基本上和goldengate一样,你会发现没有 export,import两个进程就如同goldengate实现同样功能是不用配置datapump一样
回复

使用道具

P4 | 发表于 2017-4-6 10:20:40
官网提供一个月使用版及测试license
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈