DBA Hub

📋Steps in this guide1/3

Dbvisit Replicate Installation on Oracle Linux 5 and 6

This article describes the installation and configuration of Dbvisit Replicate with Oracle Database 11g Release 2 on Oracle Linux 5 and 6.

oracle miscconfigurationintermediate
by OracleDba
12 views
1

Assumptions

- You have two servers (physical or VMs) with an operating system and Oracle installed on them. In this case I've used Oracle Linux 5.7 and Oracle Database 11.2.0.3. The Oracle versions can be different. - The servers are pingable using their hostnames (dbvisit1 and dbvisit2). - A database is running in archivelog mode on each server. For one-way replication the destination server can be in noarchivelog mode if you prefer. - The servers can make SQL*Net connections to each other. In this case the SQL*Net connection aliases are PRODA and PRODB. The following information may help you to tailor the installation for your own installation. The "tnsnames.ora" file on each server contains the following entries. The following user is created in each database. I made a few mistakes the first couple of times I ran through the process. If you are trying this out on virtual servers I would suggest you complete the basic setup of the OS and database on the servers, then take snapshots of them so you can revert back at any point and start again.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

Primary hostname  : dbvisit1.localdomain ORACLE_SID=PRODA
Secondary hostname: dbvisit2.localdomain ORACLE_SID=PRODB

PRODA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbvisit1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PRODA.WORLD)
    )
  )

PRODB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbvisit2)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PRODB.WORLD)
    )
  )

CREATE USER test IDENTIFIED BY test
  DEFAULT TABLESPACE users
  TEMPORARY TABLESPACE temp
  QUOTA UNLIMITED ON users;

GRANT CREATE SESSION, CREATE TABLE TO test;
2

Installation

Install the DBvisit Replicate RPM on both servers as the "root" user. As the "oracle" user, run the following commands on the first server. When requested, enter "setup wizard" at the prompt and answer the questions. There are quite a lot of questions to answer. Be careful when typing responses to the questions! If you need any explanation of these responses, check the Dbvisit Replicate 2.2 User Guide . For this test I set up one-way schema replication from TEST@PRODA to TEST@PRODB. The replication process was called "PROD" and the configuration directory used on both servers was "/home/oracle/PROD". Once the configuration is complete, navigate to the directory you chose to hold the configuration scripts and run the top-level script. On successful completion the script lists 8 steps you should take to complete the setup. Since this is a simple test case they can be summarised as follows. On the second server make the configuration directory and copy across the necessary files. The following operations are performed as the "oracle" user. In this case the users are already in sync, so we can ignore step 6. Run the following scripts as the "oracle" user on their respective servers. Start the console on the primary server to monitor the replication. Provided you have no errors, replication is now configured and running.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# rpm -Uvh dbvisit_replicate-2.2.14-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:dbvisit_replicate      ########################################### [100%]
#

$ cd /usr/dbvisit/replicate
$ dbvrep

$ cd /home/oracle/PRODA
$ ./PROD-all.sh 
Setting up Dbvisit Replicate configuration
Configure database PRODA...
Configure database PRODB...
Object grants for database PRODA...
Object grants for database PRODB...
Setting up the configuration
Initializing......done
WARN-1850: No DDC DB available, dictionary table does not exist.
DDC loaded from database (0 variables).
OK-9056: Directory /home/oracle/PROD/ddc_backup set by variable DDC_BACKUP_DIR does not exist on this system.
OK-9056: Directory /home/oracle/PROD/ddc_backup set by variable DDC_BACKUP_DIR does not exist on this system.
Dbvisit Replicate version 2.2.14.1286
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /home/oracle/PROD/PROD-onetime.ddc loaded.
MINE: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists)
APPLY: Cannot determine Dbvisit Replicate dictionary version. (no dictionary exists)
dbvrep> set ON_WARNING SKIP
Variable ON_WARNING set to SKIP for process *.
dbvrep> set ON_ERROR EXIT
Variable ON_ERROR set to EXIT for process *.
dbvrep> ENGINE SETUP MINE DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> ENGINE SETUP MINE CREATE DICTIONARY
dbvrep> ENGINE SETUP MINE LOAD DICTIONARY
Supplemental logging on database set.
Loading dictionary table DBRSCOL$
Loading dictionary table DBRSOBJ$
Loading dictionary table DBRSTAB$
Loading dictionary table DBRSUSER$
Loading dictionary table DBRSV_$DATABASE
dbvrep> ENGINE SETUP APPLY DROP DICTIONARY
0 dictionary objects dropped.
dbvrep> ENGINE SETUP APPLY CREATE DICTIONARY
dbvrep> ENGINE SETUP APPLY LOAD DICTIONARY
dbvrep> ENGINE PREPARE_DP SETUP CLEAR
dbvrep> ENGINE SETUP PAIR MINE AND APPLY
ID of mine proces is 69A7CC48-54B1-11E1-85ED-87AF35973BA3. If not using DDC in database, set MINE_UNIQUE_ID to
this value.
1 applier SCN set.
dbvrep> ENGINE SUPPLEMENTAL LOGGING SCHEMA TEST ENABLE PRIMARY KEY
dbvrep> ENGINE SWITCH_REDOLOG
dbvrep> PREPARE OFFLINE SCHEMA TEST
dbvrep> ENGINE SWITCH_REDOLOG
dbvrep> ENGINE PREPARE_DP WRITE DP_NETWORKLINK DIRECTORY DATA_PUMP_DIR FILE /home/oracle/PROD/APPLY.sh DBLINK
PRODA USERID SYSTEM/password@PRODB
Created Data Pump script /home/oracle/PROD/APPLY.sh, using network import.
dbvrep> create ddcdb from ddcfile
DDC loaded into database (151 variables).
dbvrep> set ON_WARNING SKIP
Variable ON_WARNING set to SKIP for process *.
dbvrep> set ON_ERROR SKIP
Variable ON_ERROR set to SKIP for process *.
OK-0: Completed successfully.
1) Create the necessary directory(ies) on the servers:
dbvisit1: /home/oracle/PROD
dbvisit2: /home/oracle/PROD

2) Copy the DDC files to the server(s) where the processes will run:
/home/oracle/PROD/PROD-APPLY.ddc
/home/oracle/PROD/PROD-MINE.ddc

3) Review that path to dbvrep executable is correct in the run scripts:
/home/oracle/PROD/PROD-run-dbvisit1.sh
/home/oracle/PROD/PROD-run-dbvisit2.sh

4) Copy the run script to the server(s) where the processes will run:
/home/oracle/PROD/PROD-run-dbvisit1.sh
/home/oracle/PROD/PROD-run-dbvisit2.sh

5) Ensure firewall is open for listen interfaces dbvisit2:7902, dbvisit1:7901 used by the processes.

6) Make sure the data on apply are in sync as of time when setup was run.
For Oracle targets, scripts for Data Pump were created:
/home/oracle/PROD/APPLY.sh
Create referenced database links before running the scripts.

7) Start the replication processes on all servers:
/home/oracle/PROD/PROD-run-dbvisit1.sh
/home/oracle/PROD/PROD-run-dbvisit2.sh

8) Start the console to monitor the progress:
/usr/bin/dbvrep --ddcfile /home/oracle/PROD/PROD-MINE.ddc
$

$ mkdir -p /home/oracle/PROD
$ scp oracle@dbvisit1:/home/oracle/PROD/PROD-APPLY.ddc /home/oracle/PROD/PROD-APPLY.ddc
$ scp oracle@dbvisit1:/home/oracle/PROD/PROD-run-dbvisit2.sh /home/oracle/PROD/PROD-run-dbvisit2.sh

$ # Run on dbvisit1
$ /home/oracle/PROD/PROD-run-dbvisit1.sh

$ # Run on dbvisit2
$ /home/oracle/PROD/PROD-run-dbvisit2.sh

$ /usr/bin/dbvrep --ddcfile /home/oracle/PROD/PROD-MINE.ddc
3

Test

Run the following script from SQL*Plus to create and populate a table in the primary database. The console screen will now show the replication has taken place. For more information see: - Dbvisit.com - Dbvisit Replicate 2.2 User Guide - Dbvisit Standby Installation on Oracle Linux 5 and 6 - Dbvisit Reporting Installation on Oracle Linux 5 and 6 Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CONN test/test@PRODA

CREATE TABLE tab1 (
  id NUMBER,
  description VARCHAR2(50),
  CONSTRAINT tab1_pk PRIMARY KEY (id)
);

INSERT INTO tab1
SELECT level, 'Description for ' || level
FROM   dual
CONNECT BY level < 1000;

COMMIT;

/MINE IS running. Currently at plog 10 and SCN 1046379 (02/11/2012 13:22:24).
APPLY IS running. Currently at plog 10 and SCN 1046361 (02/11/2012 13:22:20).
Progress of replication PROD:MINE->APPLY: total/this execution
--------------------------------------------------------------------------------------------------------------------------------------------
TEST.TAB1:                    100%  Mine:999/999         Unrecov:0/0         Applied:999/999     Conflicts:0/0       Last:11/02/2012 13:21:42/OK
--------------------------------------------------------------------------------------------------------------------------------------------
1 tables listed.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!