Replicating between two different versions of Oracle within the same host
说明
Shareplex for Oracle Replicating between two different version of Oracle within the same host. This example replicating Oracle 8.1.7 to Oracle 9.2.0.4 within the same host.
解决办法
<Disclaimer For Shareplex installation please refer to release notes and installation manuals: This document is complementary to Shareplex Installation manuals and is not QA by Quest Software. >
You could use your own path and naming convention, this is an example for your convenience to see the real live environment.
Installing the Shareplex for Oracle 817 1. Create directories sp9204 and sp817 under splex for example /u00/splex/sp817 2. Make sure both instances of oracle 817 and 9204 are running 3. cd sp817 ; pwd /u00/splex/sp817 4. Download Shareplex 4.5 install and patches oracle 8i Please refer to Shareplex Installation Guide 5. Uncompress and tar -xv the install binaries 6. cd SharePlex-4.5.1.240_CD1 and run splex_install make sure pointing to right vardir and proddir. In this example we are using port 7777 Make sure all these variable are exported from your shell: SP_COP_UPORT=7777 SP_COP_TPORT=7777 SPBIN=/u00/splex/sp817/prod/bin SP_SYS_VARDIR=/u00/splex/sp817/var SP_SYS_HOST_NAME=hostname01 Note: this is the local host and the original ip for local host 7. Download the 4.5.8 patch for Oracle 8i apply the 4.5.8 patches ; sp_apply 8. ora_setup and create user sp_817/splex for Oracle 8.1.7 instance
If you have two NIC cards and two different IPs with associates hostname within the same server; then, make sure that each sp_cop for 8.1.7 and sp_cop 9.2 are bind to different IP number by using associated hostnames in SP_SYS_HOST_NAME. Please Omit the Virtual hosts steps.
Please do the following if you are using one NIC card: Create a virtual IP host on your Sun/solaris server. Adding virtual hosts in Solaris IP addresses in Solaris are set by creating a hostname file for an interface and then putting the IP address for that hostname in the /etc/hosts file. Multiple interfaces require a hostname file for each interface, but each interface can have multiple hostname files allowing the creation of multiple IP addresses for the same interface. For example a machine with an interface called le0: Create a file /etc/hostname.le0 with the hostname in (can be fully qualified or not). Add an entry in etc/hosts
10.192.201.34 hostname.domain.tld To create virtual IP addresses (that is have the interface arp for more than one IP address) create hostname files /etc/hostname.le0:1 for the first virtual IP address, /etc/hostname.le0:2 for the second and so on. Hence in /etc there will now be files: hostname.le0 hostname.le0:1 the hostname entries for the virtual host created in the same way with a corresponding entry in /etc/hosts Example: more /etc/hostname.le0 host1.example.com more /etc/hostname.le0:1 host2.example.com 127.0.0.1 localhost 10.192.201.34 host1.example.com 10.192.201.35 host2.example.com -----------------------------------------------------
After creating Virtual IP
Like in my case I created hostname02: entries in /etc/hosts 127.0.0.1 localhost 192.168.1.156 hostname01 loghost 192.168.1.172 hostname02
mani@hostname01/etc> You need to only create the hostname.dmfe0:1 with new virtual ip and hostname. reboot
once you run ifconfig -a should look something like this: mani@hostname01/etc>ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 dmfe0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.1.156 netmask fffff800 broadcast 192.168.1.255 dmfe0:1: flags=1000851<UP,POINTOPOINT,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.1.172--> 192.168.1.172netmask fffff800
--------------------------------------------------------------------------------------------------------------------------------------- Now Install the shareplex for 9i binaries: cd /u00/splex/sp9204 3. cd sp9204 ; pwd /u00/splex/sp9204 4. Download Shareplex 4.5 install and patches oracle 9i 5. Uncompress and tar -xv the install binaries 6. cd SharePlex-4.5.1.240_CD1 and run splex_install make sure pointing to right vardir and proddir. In this example we are using port 7777 Make sure all these variable are exported from your shell: SP_COP_UPORT=7777 SP_COP_TPORT=7777 SPBIN=/u00/splex/sp9204/prod/bin SP_SYS_VARDIR=/u00/splex/sp9204/var SP_SYS_HOST_NAME=hostname02 #This is the key to bind sp_cop to second IP 7. Download the 4.5.8 patch for Oracle 9i apply the 4.5.8 patches ; sp_apply 8. ora_setup and create user sp_9204/splex for Oracle 9.2.0.4 instance Check the environmental variable for ora_setup SP_COP_UPORT=7777 SP_COP_TPORT=7777 SPBIN=/u00/splex/sp9204/prod/bin SP_SYS_VARDIR=/u00/splex/sp9204/var SP_SYS_HOST_NAME=hostname02 ============================================ 10. Setting paramdb for both sp_cop SP_QUE_IPCKEY and SP_SHS_IPCKEY /u00/splex/sp817/var/data/paramdb /u00/splex/sp9204/var/data/paramdb
10.1 Setting paramdb for sp_cop for Shareplex for Oracle 817 A. cd /u00/splex/sp817/var/data/ B. add these two lines to the bottom of the file vardir/data/ paramdb: SP_QUE_IPCKEY "ZAX" SP_SHS_IPCKEY "YAX"
IMPORTANT: All the Starting letters should be different on choosing the letters for all SP_QUE_IPCKEY SP_SHS_IPCKEY on the two different paramdb within the same machine. C. cd /u00/splex/sp817/rim rm *.loc *.ipc D. Export correct environment for sp_cop 817 E. start sp_cop for oracle 817
10.2 Export the 912 variable for sp_cop 9204 A. cd /u00/splex/sp9204/var/data B. add these two lines to the bottom of the file: SP_QUE_IPCKEY "LVA" # Make sure diff from SHM_IPCKEY SP_SHS_IPCKEY "GNP" C. cd /u00/splex/sp9204/rim rm *.loc *.ipx D. Export correct environment for sp_cop 9204 E. start sp_cop for oracle 9204
NOTE: All the names for ipckey must be globally unique in the system. Make sure the Letters are different . The above letter combination works. If the names are not unique then this when starting sp_cop causes this error: �queue initialization failed - exiting�
11. Now activate config with sp_ctrl of 817: Make sure you have 817 environment: SP_COP_UPORT=7777 SP_COP_TPORT=7777 SPBIN=/u00/splex/sp817/prod/bin SP_SYS_VARDIR=/u00/splex/sp817/var SP_SYS_HOST_NAME=hostname01
Sample config file might look like this example: ============================================== datasource:o.hd817
#source tables target tables routing map mani.s1 mani.s2 hostname01:qone*hostname02@o.hd920 ================================================= Once you activate for 817 sp_ctrl you should have the below:
on the source sp_ctrl should look like this: sp_ctrl (hostname01:7777)> status
Brief Status for hostname01 Process State PID Running Since --------------- ------------------------------ -------- -------------------- Cop Running 605 28-Jan-04 12:49:35 Capture Running 689 28-Jan-04 13:46:40 Read Running 690 28-Jan-04 13:46:40 Export Running 721 28-Jan-04 13:49:17 Cmd & Ctrl Running 777 28-Jan-04 14:45:33
System is used as a source machine
System summary information: A configuration file was activated/deactivated
Demo License
Destination Hosts Summary: hostname02.quest.com - Warning conditions An error has occurred
Demo License
There is 1 active configuration file
sp_ctrl (hostname01:7777)>
12. Check for correct environment variable for sp_cop for oracle 9.2:
cd $SPBIN pwd # you should be in /u00/splex/sp9204/prod/bin sp_cop -uhostname02777&
sp_ctrl (hostname02:7777)> status
Brief Status for hostname02 Process State PID Running Since --------------- ------------------------------ -------- -------------------- Cop Running 711 28-Jan-04 13:48:55 Import Running 722 28-Jan-04 13:49:17 Post Running 712 28-Jan-04 13:48:55 Cmd & Ctrl Running 779 28-Jan-04 14:45:46
System summary information: Warning conditions An error has occurred
Demo License
Destination Hosts Summary: There are no active configuration files
sp_ctrl (hostname02:7777)>
The last step is testing: Now you could do testing by inserting some rows into the source.