Shareplex Database Synchronization

Source: Internet
Author: User
Source OS: RedHatEnterpriseLinuxServerrelease5.5 (Tikanga) ORACLE: OracleDatabase10gEnterpriseEditionRelease10.2.0.5.0

Source OS: Red Hat Enterprise Linux Server release 5.5 (Tikanga) ORACLE: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit Production shareplex Directory:/oradata/shareplex destination: OS: red Hat Enterprise Linux Server release 5.8

Source end

OS: Red Hat Enterprise Linux Server release 5.5 (Tikanga)

ORACLE: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit Production

Shareplex Directory:/oradata/shareplex

Destination:

OS: Red Hat Enterprise Linux Server release 5.8 (Tikanga)

ORACLE: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit Production

Shareplex Directory:/data/shareplex


Shareplex software: SharePlex-7.6.1-b27-oracle100-rh-40-amd64-m64.tar

Unzipping: SharePlex-7.6.1-b27-oracle100-rh-40-amd64-m64.tpm

1) create a SPLEX user and set the archive Mode

A. Source and target -- create A user and authorize the user (pay attention to the system time ):

Create user splex identified by splex default tablespace users; ---- it is best to create a tablespace for SPLEX users separately

Grant dba, connect, resource to splex; --- SPLEX must have DBA permission

The source must be in archive mode.

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 7
Next log sequence to archive 9
Current log sequence 9


Alter database add supplemental log data (primary key, unique index) columns;

Create the data to be synchronized at the target end (note that the default tablespace and data table space at the source end are created)

Create user test identified by test default tablespace TBS_DATA01;
Grant connect, resource, unlimited tablespace to test;


2) install shareplex

Source end

$./SharePlex-7.6.1-b27-oracle100-rh-40-amd64-m64.tpm
Unpacking ....................................... ...........................
........................................ ..................................
........................................ ..................................
........................................ ..................................

SharePlex for Oracle installation program:
SharePlex Version: 7.6.1
Supported Oracle Version: 10gR2
Build platform: rh-40-amd64
Target platform: rh-40-amd64


Please enter the product directory location? /Oradata/shareplex/prodir
Please enter the variable data directory location? /Oradata/shareplex/vardir
Please specify the SharePlex Admin group (select a number ):
1. [oinstall]
2. dba
3. Timeout
?
Please wait while the installer obtains Oracle information ..
Please enter the ORACLE_SID that corresponds to this installation? [Hrdb]
Please enter the ORACLE_HOME directory that corresponds to this ORACLE_SID? [/Opt/app/oracle/product/10.2.0/db_1]
Please enter the TCP/IP port number for SharePlex communications? [2100] 2200


Preparing to install SharePlex for Oracle v. 7.6.1:
User: oracle
Admin Group: oinstall
Product Directory:/oradata/shareplex/prodir
Variable Data Directory:/oradata/shareplex/vardir
ORACLE_SID: hrdb
ORACLE_HOME:/opt/app/oracle/product/10.2.0/db_1


Proceed with installation? [Yes]
Installing ....................................... .........................
........................................ .................................
........................................ ............................
Setting file ownerships ..................................... ..............
........................................ .................................
........
Setting file permissions ..................................... .............
........................................ .................................
.........
Do you have a valid SharePlex for Oracle v. 7.6.1 license? [Yes]
Please enter the License key? Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Please enter the customer name associated with this license key? Yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy


SharePlex for Oracle v. 7.6.1 license validation successful:
Customer Name: yyyyyyyyyyyyyyyyyyyyyyyyyyyyy
License Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Product Name: SharePlex for Oracle-RAC
License Key Type: "Perpetual Key"


NOTE: You can upgrade this license key or add license keys for additional machines
By executing utility/oradata/shareplex/prodir/install/splex_add_key.


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


$./Ora_setup

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

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
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 shoshould be installed [hrdb]:

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

Enter a DBA user name: system
Enter password for the DBA account, which will not echo:

Note: In the RAC environment, enter the password for the oracle database system account, but add @ TNS_ALIAS to the password, and press Enter.;


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.


Wocould you like to create a new SharePlex user? [Y]: n
Enter username of an existing user: splexhr
Enter user password for splexhr:

Note:In the RAC environment,Enter the password of OracleSharePlex, but add @ TNS_ALIAS to the password and press Enter;


Validating user name and password... This may take a few seconds.


Warning: This user is now being granted unlimited tablespace.
This privilege will remain in effect until it is explicitly changed.
SPLEX_ROLE_BOTH already exists; continuing setup...


Setup will now install SharePlex objects.

These are the existing tablespaces.

SYSTEM UNDOTBS1 sysaux temp users TBS_DATA01 TBS_DATA02 TBS_DATA03
TBS_INDEX01 TBS_INDEX02 TBS_INDEX03 TBS_SPLEX

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

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

Enter the index tablespace for use by SharePlex [TBS_SPLEX]:

Creating SharePlex objects [Installation type: Upgrade]...
SPLEXHR. SHAREPLEX_ACTID already exists; continuing setup...
SPLEXHR. SHAREPLEX_MARKER already exists; continuing setup...
SPLEXHR. SHAREPLEX_OBJMAP already exists; continuing setup...
SPLEXHR. SHAREPLEX_OBJMAP_I1 already exists; continuing setup...
SPLEXHR. SHAREPLEX_TRANS already exists; continuing setup...
SPLEXHR. SHAREPLEX_LOGLIST already exists; continuing setup...
SPLEXHR. SHAREPLEX_LOBMAP already exists; continuing setup...
SPLEXHR. SHAREPLEX_ROUTES already exists; continuing setup...
SPLEXHR. SHAREPLEX_ROUTES_I1 already exists; continuing setup...
SPLEXHR. SHAREPLEX_ROUTES_I2 already exists; continuing setup...
SPLEXHR. SHAREPLEX_WILDCARD already exists; continuing setup...
SPLEXHR. SHAREPLEX_WILDCARD_I1 already exists; continuing setup...
SPLEXHR. SHAREPLEX_WILDCARD_I2 already exists; continuing setup...
SPLEXHR. SHAREPLEX_PARTITION_CACHE already exists; continuing setup...
SPLEXHR. SHAREPLEX_PARTITION_CACHE_I1 already exists; continuing setup...
SPLEXHR. SHAREPLEX_LOB_CACHE already exists; continuing setup...
SPLEXHR. SHAREPLEX_LOB_CACHE_I1 already exists; continuing setup...
SPLEXHR. SHAREPLEX_CONFIG already exists; continuing setup...
SPLEXHR. SHAREPLEX_COMMAND already exists; continuing setup...
SPLEXHR. SHAREPLEX_JOBID already exists; continuing setup...
SPLEXHR. SHAREPLEX_JOBS already exists; continuing setup...
SPLEXHR. SHAREPLEX_JOB_STATS already exists; continuing setup...
SPLEXHR. SHAREPLEX_DATAEQUATOR already exists; continuing setup...
Already exists; continuing setup...
Already exists; continuing setup...
Already exists; continuing setup...
SPLEXHR. DEMO_SRC already exists; continuing setup...
SPLEXHR. DEMO_DEST already exists; continuing setup...
SPLEXHR. SHAREPLEX_ACT_MARKER already exists; continuing setup...
SPLEXHR. SHAREPLEX_PARTITION already exists; continuing setup...
SPLEXHR. SHAREPLEX_OOS_MASTER already exists; continuing setup...
SPLEXHR. SHAREPLEX_OOS_KEYS already exists; continuing setup...
SPLEXHR. SHAREPLEX_SYNC_MARKER already exists; continuing setup...
SPLEXHR. SHAREPLEX_CHANGE_OBJECT already exists; continuing setup...
SPLEXHR. SHAREPLEX_DDL_CONTROL already exists; continuing setup...

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

Creating Conflict Resolution Package... Done.

Setup of SharePlex objects successful...

Changing SharePlex parameter database...

Setup completed successfully

3) install shareplex on the target end

The./SharePlex-7.6.1-b27-oracle100-rh-40-amd64-m64.tpm and./ora_setup are similar, different

Besides

Oracle ASM detected. Enable SharePlex ASM support? [Y]:
SharePlex ASM support enabled.

(Note: If shareplex has been installed on both the source and target terminals, clear the SPLEX user capture or post information and perform the following operations before starting:

./Ora_cleansp splexhr/splexhr

)

3) Source Operation

A. Start shareplex.

[Oracle @ hrdb bin] $./sp_cop-u2200 &
[1] 25839
[Oracle @ hrdb bin] $
**************************************** ***************
* SharePlex for Oracle Startup
* 10 Quest Software, Inc.
* All rights reserved.
* Protected by U. S. Patents: 7,461,103 and 7,065,538.
* Version: 7.6.1.27-m64-oracle100
* VarDir:/oradata/shareplex/vardir
* Port: 2200
**************************************** ***************

B. Go to the console.

[Oracle @ hrdb bin] $./sp_ctrl

**************************************** ***************
* SharePlex for Oracle Command Utility
* 10 Quest Software, Inc.
* All rights reserved.
* Protected by U. S. Patents: 7,461,103 and 7,065,538.
**************************************** ***************
C. Add a configuration file
Sp_ctrl (hrdb: 2200)> list config

File Name State Datasource
---------------------------------------------------------------------------
ORA_config Inactive o. SOURCE_SID
Last Modified At: 13-Jun-11 Size: 151

Sp_ctrl (hrdb: 2200)> copy config ORA_config to hr_config

Sp_ctrl (hrdb: 2200)> view config hr_config

Datasource: o. hrdb

# Source tables target tables routing map

Splex. demo_src splex. demo_dest 10.1.2.18@o.backupdb
Expand TEST. % TEST. % 10.1.2.18@o.backupdb


4) Target operations

$./Sp_cop-u2200 &

$./Sp_ctrl

Sp_ctrl (backupdb: 2200)> status

Brief Status for backupdb
Process State PID Running Since
-------------------------------------------------------------------------
Cop Running 26483 31-Jul-12 09:31:06
Cmd & Ctrl Running 26485 31-Jul-12 09:31:14
There are no active configuration files


Sp_ctrl (backupdb: 2200)> stop post

5) Source end

Sp_ctrl (hrdb: 2200)> activate config hr_config

Not all tables activated successfully

Source-export data (SCN is used here to ensure consistency ):

SQL> set num 50
SQL> select current_scn from v $ database;
CURRENT_SCN
--------------------------------------------------
165290627611

Expdp system/xxxx directory = DUMP_DIR DUMPFILE = 20120730_HR.dmp FLASHBACK_SCN = 165290627611 SCHEMAS = test LOGFILE = 20120730_HR.log

Or use the EXP method.

6) target end

Impdp system/oracle DIRECTORY = DUMP_DIR DUMPFILE = 20120730_HR.dmp SCHEMAS = test LOGFILE = impdp_2012730_HR.log

Or use IMP

Disable searching related jobs

Select job_name from dba_scheduler_jobs where OWNER = 'test ';

Disable a trigger

Select 'alter trigger' | owner | '.' | object_name | 'disable'
From dba_objects
Where object_type = 'trigger' and owner = 'test ';

Search for Foreign keys and constraints

Select 'alter table' | t. owner | '.' | t. table_name | 'Disable constraint' | t. constraint_name | ';'
From dba_constraints t
Where owner = 'test' and constraint_type = 'R ';

Sp_ctrl (backupdb: 2200)> qstatus

Queues Statistics for backupdb
Name: hrdb (Oracle hrdb-o.backupdb) (MTPost queue)
Number of messages: 207 (Age 0 min; Size 0 mb)
Backlog (messages): 207 (Age 0 min)


Sp_ctrl (backupdb: 2200)> reconcile queue hrdb for o. hrdb-o.backupdb scn 165290627611

Sp_ctrl (backupdb: 2200)> start post

(

Clear the queue records at the source or target end:

$./Ora_cleansp splexhr/splexhr

If the CONFIG file has been activate due to incorrect configuration, deactivate config needs to be edited and then activated; otherwise, it is possible to keep HANG after CONFIG is activated.

)

***********************************

Note: In the RAC environment:

1. If the instance names of the two nodes are different, it must be in the tnsnames of the two nodes of Oracle10g RAC. create a TNS alias in the ora file and add the following entry to the/etc/oratab file:

Splex:/oracle/product/db/10.2: N

Splex is the new TNS alias, and ORACLE_HOME is the full path of the Oracle HOME Directory.

2. If the ORACLE_HOME of each node in RAC is different, you should create the same symbolic connection under the oracle user on the two nodes to point to the local ORACLE_HOME. Edit the oratab file and change the path in the file to a symbolic connection.

# Ln-s/local_ORACLE_HOME/$ ORACLE_HOME

Edit oratab file: SID:/pathname_to_symbolic_link: N



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

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

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