OUD – get replication status

# Run the below command for missing changes :


$ dsreplication status \
          --hostname localhost \
          --port 4444 \
          --dataToDisplay missing-changes \
          --adminUID admin \
          --adminPasswordFile ~/pwd.txt \
          --trustAll \
          --no-prompt

Advertisements

Setting up of DSEE and OUD Replicated Env

$ export ORACLE_HOME=/scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/
$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME:$PATH
$ export JAVA_HOME=/appl/binaries/jdk/jdk1.7.0_79
$ export PATH=$JAVA_HOME/bin:$PATH

# create the first DS instanceS at 1389/4444 but do not start

oud-setup --cli --adminConnectorPort 4444 --ldapPort 1389 --rootUserDN cn="Directory Manager" --rootUserPasswordFile /home/oracle/pass.txt --serverTuning jvm-default --offlineToolsTuning jvm-default --no-prompt --noPropertiesFile --doNotStart -b dc=Example,dc=com

# create the second DS instance at 2389/5444 but do not start

oud-setup --cli --adminConnectorPort 5444 --ldapPort 2389 --rootUserDN cn="Directory Manager" --rootUserPasswordFile /home/oracle/pass.txt --serverTuning jvm-default --offlineToolsTuning jvm-default --no-prompt --noPropertiesFile --doNotStart -b dc=Example,dc=com

# create the first RS instance at 3389/6444 but do not start

oud-setup --cli --adminConnectorPort 6444 --ldapPort 3389 --rootUserDN cn="Directory Manager" --rootUserPasswordFile /home/oracle/pass.txt --serverTuning jvm-default --offlineToolsTuning jvm-default --no-prompt --noPropertiesFile --doNotStart

# create the second RS instance at 4389/7444 but do not start

oud-setup --cli --adminConnectorPort 7444 --ldapPort 4389 --rootUserDN cn="Directory Manager" --rootUserPasswordFile /home/oracle/pass.txt --serverTuning jvm-default --offlineToolsTuning jvm-default --no-prompt --noPropertiesFile --doNotStart

# start the DS instances

/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/start-ds
/scratch/appl/oracle/fmw-oudr2ps3/asinst_2/OUD/bin/start-ds

# now start the replication server

/scratch/appl/oracle/fmw-oudr2ps3/asinst_3/OUD/bin/start-ds
/scratch/appl/oracle/fmw-oudr2ps3/asinst_4/OUD/bin/start-ds

# enable replication from asinst_1 to asinst_3 and check status

/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication enable --bindDN1 cn="Directory Manager" --bindPasswordFile1 /home/oracle/pass.txt --host1 localhost --port1 4444 --noReplicationServer1 --bindDN2 cn="Directory Manager" --bindPasswordFile2 /home/oracle/pass.txt --host2 localhost --port2 6444 --onlyReplicationServer2 --replicationPort2 8989 --baseDN dc=Example,dc=com --adminUID admin --adminPasswordFile /home/oracle/pass.txt -X -n

/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication status -h localhost -p 4444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X

# enable replication from asinst_1 to asinst_4 and check status
date
/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication enable --bindDN1 cn="Directory Manager" --bindPasswordFile1 /home/oracle/pass.txt --host1 localhost --port1 4444 --noReplicationServer1 --bindDN2 cn="Directory Manager" --bindPasswordFile2 /home/oracle/pass.txt --host2 localhost --port2 7444 --onlyReplicationServer2 --replicationPort2 8990 --baseDN dc=Example,dc=com --adminUID admin --adminPasswordFile /home/oracle/pass.txt -X -n

/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication status -h localhost -p 4444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X

# enable replication from asinst_2 to asinst_3 and check status
date
/scratch/appl/oracle/fmw-oudr2ps3/asinst_2/OUD/bin/dsreplication enable --bindDN1 cn="Directory Manager" --bindPasswordFile1 /home/oracle/pass.txt --host1 localhost --port1 5444 --noReplicationServer1 --bindDN2 cn="Directory Manager" --bindPasswordFile2 /home/oracle/pass.txt --host2 localhost --port2 6444 --onlyReplicationServer2 --replicationPort2 8989 --baseDN dc=Example,dc=com --adminUID admin --adminPasswordFile /home/oracle/pass.txt -X -n

/scratch/appl/oracle/fmw-oudr2ps3/asinst_2/OUD/bin/dsreplication status -h localhost -p 5444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X

# initialize asinst_2 from asinst_1
date
/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication initialize-all -h localhost -p 4444 --baseDN dc=Example,dc=com --adminUID admin --adminPasswordFile /home/oracle/pass.txt
/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication status -h localhost -p 4444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X


# Add Root Branch
$ /scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/ldapmodify -a -p 1389 -D "cn=Directory Manager" -w Welcome1 

dn: dc=Example,dc=com
objectclass: top
objectclass: domain
dc: Example

# Add People Branch 
$ /scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/ldapmodify -a -p 1389 -D "cn=Directory Manager" -w Welcome1 

dn: ou=People,dc=Example,dc=com
changetype: add
objectclass: top
objectclass: organizationalUnit
ou: People

# add an antry and check replication status afterwards
date
/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/ldapmodify -a -p 1389 -D "cn=Directory Manager" -w Welcome1 
dn: uid=ste,ou=People,dc=Example,dc=com
postalAddress: Schwielowsee
postalCode: 14548
uid: ste
description: This is the description for stefan0
userPassword: password
employeeNumber: 23
initials: SW
givenName: Stefan
objectClass: person
objectClass: inetorgperson
objectClass: organizationalperson
objectClass: top
pager: +1 724 334 4454
mobile: +1 699 006 9072
cn: Stefan W
sn: W
roomNumber: 123
telephoneNumber: 456
street: Auf dem Franzensberg
homePhone: +1 698 343 6105
l: Potsdam
mail: stefan@maildomain.net
st: BR

# Check the replication Status

/scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication status -h localhost -p 4444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X

#---------------DSEE ------------ #

# http://docs.oracle.com/cd/E19316-01/820-2763/fxcfe/index.html
# http://docs.oracle.com/cd/E19424-01/820-4806/gaduf/index.html

export PATH=/scratch/binaries/dsee7//ODSEE_ZIP_Distribution/dsee7/bin:/scratch/binaries/dsee7//ODSEE_ZIP_Distribution/dsee7/dsrk/bin:$PATH

####################
#Instance Creation
####################

dsadm create -p 10389 -P 10636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-master1
dsadm create -p 11389 -P 11636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-master2
dsadm create -p 12389 -P 12636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-replica1
dsadm create -p 13389 -P 13636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-hub1
dsadm create -p 14389 -P 14636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-replica2
dsadm create -p 15389 -P 15636 -w ~/pass.txt /scratch/appl/oracle/fmw-dsee7/ins-hub2

sleep 5

# start an instance 

dsadm start /scratch/appl/oracle/fmw-dsee7/ins-master1
dsadm start /scratch/appl/oracle/fmw-dsee7/ins-master2
dsadm start /scratch/appl/oracle/fmw-dsee7/ins-replica1
dsadm start /scratch/appl/oracle/fmw-dsee7/ins-replica2
dsadm start /scratch/appl/oracle/fmw-dsee7/ins-hub1
dsadm start /scratch/appl/oracle/fmw-dsee7/ins-hub2

# Create a suffix 

dsconf create-suffix -p 10389 -w ~/pass.txt -e dc=example,dc=com
dsconf create-suffix -p 11389 -w ~/pass.txt -e dc=example,dc=com
dsconf create-suffix -p 12389 -w ~/pass.txt -e dc=example,dc=com
dsconf create-suffix -p 13389 -w ~/pass.txt -e dc=example,dc=com
dsconf create-suffix -p 14389 -w ~/pass.txt -e dc=example,dc=com
dsconf create-suffix -p 15389 -w ~/pass.txt -e dc=example,dc=com

# Populate the suffix with LDIF data.

dsconf import -p 10389 -i -w ~/pass.txt -e /scratch/binaries/dsee7//ODSEE_ZIP_Distribution/dsee7/resources/ldif/Example.ldif dc=example,dc=com

sleep 5

# Search for data in the new instance

ldapsearch -p 10389 -b dc=example,dc=com "(uid=ajensen)" mail



####################
#Replcation
####################

# Import Self-Signed Certificate on other masters  

dsadm show-cert -F der -o certfile-m1 /scratch/appl/oracle/fmw-dsee7/ins-master1 defaultCert
dsadm show-cert -F der -o certfile-m2 /scratch/appl/oracle/fmw-dsee7/ins-master2 defaultCert

dsadm show-cert -F der -o certfile-rep1 /scratch/appl/oracle/fmw-dsee7/ins-replica1 defaultCert
dsadm show-cert -F der -o certfile-rep2 /scratch/appl/oracle/fmw-dsee7/ins-replica2 defaultCert

dsadm show-cert -F der -o certfile-hub1 /scratch/appl/oracle/fmw-dsee7/ins-hub1 defaultCert
dsadm show-cert -F der -o certfile-hub2 /scratch/appl/oracle/fmw-dsee7/ins-hub2 defaultCert

dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-master1 "ds2 Repl Manager Cert m2" certfile-m2
dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-master1 "ds2 Repl Manager Cert hub1" certfile-hub1

dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-master2 "ds1 Repl Manager Cert m1" certfile-m1
dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-master2 "ds2 Repl Manager Cert hub2" certfile-hub2

dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-hub1 "ds1 Repl Manager Cert m1" certfile-m1
dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-hub1 "ds1 Repl Manager Cert rep1" certfile-rep1


dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-hub2 "ds1 Repl Manager Cert m2" certfile-m2
dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-hub2 "ds1 Repl Manager Cert rep2" certfile-rep2


dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-replica1 "ds1 Repl Manager Cert hub" certfile-hub1
dsadm add-cert --ca /scratch/appl/oracle/fmw-dsee7/ins-replica2 "ds1 Repl Manager Cert hub" certfile-hub2


dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-master1
dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-master2
dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-hub1
dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-hub2
dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-replica1
dsadm restart /scratch/appl/oracle/fmw-dsee7/ins-replica2

sleep 5

# Enable Replication

dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 10389 -d 1 master dc=example,dc=com
dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 11389 -d 2 master dc=example,dc=com
dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 12389  consumer dc=example,dc=com
dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 13389 hub dc=example,dc=com
dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 14389  consumer dc=example,dc=com
dsconf enable-repl -i -D "cn=directory manager" -w ~/pass.txt -p 15389 hub dc=example,dc=com

sleep 5

# Create Replication Agreements between masters 1 to master2 and other replicas.
  
dsconf create-repl-agmt -i -p 10389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:11636
dsconf create-repl-agmt -i -p 10389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:13636


dsconf create-repl-agmt -i -p 11389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:10636
dsconf create-repl-agmt -i -p 11389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:15636

dsconf create-repl-agmt -i -p 13389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:12636
dsconf create-repl-agmt -i -p 15389 -D "cn=directory manager" -w ~/pass.txt --auth-protocol "ssl-simple" "dc=example,dc=com" localhost:14636


sleep 5 

# Init

dsconf init-repl-dest -i -p 10389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com localhost:11636
dsconf init-repl-dest -i -p 10389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com localhost:13636

sleep 5 

dsconf init-repl-dest -i -p 11389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com localhost:15636

sleep 5 

dsconf init-repl-dest -i -p 13389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com localhost:12636
dsconf init-repl-dest -i -p 15389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com localhost:14636


sleep 10

# Check Replication

dsconf list-repl-agmts -i -p 10389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com
dsconf list-repl-agmts -i -p 11389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com
dsconf list-repl-agmts -i -p 13389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com
dsconf list-repl-agmts -i -p 15389 -D "cn=directory manager" -w ~/pass.txt -v dc=example,dc=com


######

#-------------------------------------------------------------- #


# Initialize the DSCC registry.

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccsetup ads-create

# Create the WAR file for DSCC.

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccsetup war-file-create
Created /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dscc7.war

# Note the port and the path assigned to DSCC registry.
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccsetup status
***
DSCC Registry has been created
Path of DSCC registry is /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/ads
Port of DSCC registry is 3998
***

# To create server instances on the same host on which DSCC is deployed, add the DSCC agent to the DSCC registry.
# Create a DSCC agent.

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccagent create
DSCC agent will use the following port: 3997
Enter DSCC agent password:
Confirm the password:
Agent instance /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent has been created successfully
Run the following command to register the agent in the registry : /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-agent /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent

# Add the new DSCC agent to the DSCC registry.

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-agent /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
Enter DSCC agent "/scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent" password:
Enter DSCC administrator's password:
Agent instance has been registered in DSCC on den00acg
You can now run dsccagent start to start the agent

# Start the DSCC agent.
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccagent start
The agent /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent has been started

# Register the server instance with DSCC:

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-master1
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-master2
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-replica1
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-hub1
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-replica2
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg add-server /scratch/appl/oracle/fmw-dsee7/ins-hub2

# List all the servers and agents that are currently registered into DSCC: 

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsccreg list-servers -h localhost -p 3998 --agent
Enter DSCC administrator's password:
Hostname                Port   sPort  Type  Owner   Flags  iPath                                        Agent Port  Agent Path
----------------------  -----  -----  ----  ------  -----  -------------------------------------------  ----------  ------------------------------------------------------------------
den00acg.us.oracle.com  12389  12636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-replica1  3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
den00acg.us.oracle.com  11389  11636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-master2   3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
den00acg.us.oracle.com  10389  10636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-master1   3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
den00acg.us.oracle.com  13389  13636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-hub1      3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
den00acg.us.oracle.com  15389  15636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-hub2      3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
den00acg.us.oracle.com  14389  14636  DS    oracle  -      /scratch/appl/oracle/fmw-dsee7/ins-replica2  3997        /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dcc/agent
6 server instance(s) found in DSCC on localhost.

# Deploy the war file ( /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/var/dscc7.war ) on webserver like weblogic/apache/glassfish server.
# I have deployed in the weblogic, hence the following link : 
# Access DSCC by using http://den00acg.us.oracle.com:7001/dscc7

# Enable MODDN on DSEE

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 10389 moddn-enabled:on
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 11389 moddn-enabled:on

# Verify the Moddn suffix
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/dsrk/bin/ldapsearch -h localhost -p 10389 -D "cn=Directory manager" -w Welcome1 -b "" -s base objectclass=* moddnenabledsuffixes
version: 1
dn:
moddnenabledsuffixes: dc=example,dc=com

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/dsrk/bin/ldapsearch -h localhost -p 11389 -D "cn=Directory manager" -w Welcome1 -b "" -s base objectclass=* moddnenabledsuffixes
version: 1
dn:
moddnenabledsuffixes: dc=example,dc=com

# Enabled the OUD Replication Gateway: 
  
$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/oud-replication-gateway-setup --cli --hostname localhost --adminConnectorPort 8444 --replicationPortForLegacy 5389 --rootUserDN "cn=Directory Manager" --rootUserPasswordFile ~/pass.txt --baseDN dc=Example,dc=com --hostNameLegacy localhost --portLegacy 10389 --doNotUpdateTrustStoreWithLegacyCertsArg --bindDNLegacy "cn=Directory Manager" --bindPasswordFileLegacy ~/pass.txt --dsccHostLegacy localhost --dsccPortLegacy 3998 --dsccAdminUidLegacy admin --dsccPasswordFileLegacy ~/pass.txt --hostNameNg localhost --portNg 6444 --adminUID admin --adminPasswordFile ~/pass.txt --trustAll --no-prompt --noPropertiesFile
OUD Instance location successfully created - /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/../asinst_5"

Oracle Unified Directory 11.1.2.3.0
Please wait while the replication gateway setup program initializes ..... Done.

Once the setup of the replication gateway will be completed (if not already
done) you have to initialize the contents of the Oracle Unified Directory
servers with the contents of the ODSEE server for replication to work.

You can follow these steps to synchronize the contents of the replicated base
DNs:
1. Run the following command in the ODSEE host (localhost):
dsadm export \
          -f opends-export \
          /scratch/appl/oracle/fmw-dsee7/ins-master1 \
          dc=Example,dc=com \
          {exportedLDIFPath}
Where {exportedLDIFPath} is the path of the resulting LDIF file containing the
replicated data.

2. Run the following command:
asinst/OUD/bin/dsreplication pre-external-initialization \
          --hostname localhost \
          --port 6444 \
          --adminUID admin \
          --adminPasswordFile ****** \
          --baseDN dc=Example,dc=com \
          --trustAll \
          --no-prompt \
          --noPropertiesFile

3. Copy the LDIF file generated in the first step in a directory accessible by
the Oracle Unified Directory servers and run the following command for every
Oracle Unified Directory server that contains data to be replicated:
asinst/OUD/bin/import-ldif \
          --hostname {Oracle\ Unified\ Directory\ hostName} \
          --port {Oracle\ Unified\ Directory\ adminPort} \
          --bindDN cn=admin,cn=Administrators,cn=admin\ data \
          --bindPasswordFile ****** \
          --includeBranch dc=Example,dc=com \
          --ldifFile {exportedLDIFPath} \
          --clearBackend \
          --trustAll \
          --noPropertiesFile

4. Run the following command:
asinst/OUD/bin/dsreplication post-external-initialization \
          --hostname localhost \
          --port 6444 \
          --adminUID admin \
          --adminPasswordFile ****** \
          --baseDN dc=Example,dc=com \
          --trustAll \
          --no-prompt \
          --noPropertiesFile

Check the documentation to find more information about the procedure to be
followed

The equivalent command-lines displayed above can be found in the following
file:
/scratch/appl/oracle/fmw-oudr2ps3/asinst_5/OUD/logs/oud-replication-gateway-setup-equivalent
See /scratch/appl/oracle/fmw-oudr2ps3/asinst_5/OUD/logs/oud-setup for a
detailed log of this operation.

Initializing basic replication gateway configuration ..... Done.
Starting Replication Gateway ....... Done.
Updating Registration Information ..... Done.
Configuring Oracle Unified Directory server localhost:6444 ..... Done.
Initializing Registration Information ..... Done.
Configuring Replication Gateway ..... Done.
Configuring ODSEE server localhost:10389 ..... Done.
The replication gateway setup has completed successfully

# ------------------------------------------- End of Output of Replication Gateway ------------------------------------------------- #

-bash-3.2$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf export -f opends-export -h localhost -p 10389 dc=example,dc=com ~/odsee-data.ldif
Certificate "CN=den00acg, CN=10636, CN=Directory Server, O=Sun Microsystems" presented by the server is not trusted.
Type "Y" to accept, "y" to accept just once, "n" to refuse, "d" for more details: Y
Enter "cn=Directory Manager" password:
## Beginning export of 'example'
## example: Start processing.
## example: Processed 161 entries (100%), 161.0 entries/sec average, 161 exported.
## Export finished.

Task completed (slapd exit code: 0).

# Verify the migration : 

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf pwd-compat -h localhost -p 10389 -c -D "cn=Directory  Manager" -w ~/pass.txt to-DS6-migration-mode 
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf pwd-compat -h localhost -p 11389 -c -D "cn=Directory  Manager" -w ~/pass.txt to-DS6-migration-mode        

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf pwd-compat -h  localhost -p 10389 -c -D "cn=Directory Manager" -w ~/pass.txt to-DS6-mode
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf pwd-compat -h  localhost -p 10389 -c -D "cn=Directory Manager" -w ~/pass.txt to-DS6-mode

# make sure no warning are there

$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/ds2oud --diagnose -h localhost -p 10389 -D  "cn=Directory manager" -j ~/pass.txt

# check export ldif for consistent 

$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/ds2oud --ldifDBFile ~/odsee-data.ldif

# Delete user the following attributes : 

# nsSizeLimit, nsTimeLimit, nsLookThroughLimit, nsIdleTimeout

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/dsrk/bin/ldapdelete  -h localhost -p 10389 -D "cn=Directory manager" -w Welcome1
 uid=kvaughan, ou=People, dc=example,dc=com
-bash-3.2$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/dsrk/bin/ldapdelete  -h localhost -p 10389 -D "cn=Directory manager" -w Welcome1
uid=rdaugherty, ou=People, dc=example,dc=com
-bash-3.2$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/dsrk/bin/ldapdelete  -h localhost -p 10389 -D "cn=Directory manager" -w Welcome1
uid=hmiller, ou=People, dc=example,dc=com

# Export the data again : 

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf export -f opends-export -h localhost -p 10389 dc=example,dc=com ~/odsee-data.ldif

# check export ldif for consistent 

$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/ds2oud --ldifDBFile ~/odsee-data.ldif


*******************************************************************************
* Diagnose ODSEE LDIF data file : /home/oracle/odsee-data.ldif
*******************************************************************************

The data were validated successfully regarding the OUD schema

# Run the following commands as per replication gateway recommendation : 

 $ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/dsreplication pre-external-initialization --hostname localhost --port 4444 --adminUID admin --adminPasswordFile ~/pass.txt --baseDN dc=Example,dc=com --trustAll --no-prompt --noPropertiesFile
 
 $ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/dsreplication pre-external-initialization --hostname localhost --port 5444 --adminUID admin --adminPasswordFile ~/pass.txt --baseDN dc=Example,dc=com --trustAll --no-prompt --noPropertiesFile
 
# Initialization of the data : 

$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/import-ldif --hostname localhost --port 4444 --bindDN cn=admin,cn=Administrators,cn=admin\ data --bindPasswordFile ~/pass.txt --includeBranch dc=Example,dc=com --ldifFile ~/odsee-data.ldif --clearBackend --trustAll --noPropertiesFile

$ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/import-ldif --hostname localhost --port 5444 --bindDN cn=admin,cn=Administrators,cn=admin\ data --bindPasswordFile ~/pass.txt --includeBranch dc=Example,dc=com --ldifFile ~/odsee-data.ldif --clearBackend --trustAll --noPropertiesFile
		  
# Run the following commands as per replication gateway recommendation : 		  
 
 $ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/dsreplication post-external-initialization --hostname localhost --port 4444 --adminUID admin --adminPasswordFile ~/pass.txt --baseDN dc=Example,dc=com --trustAll --no-prompt --noPropertiesFile
 
 $ /scratch/appl/oracle/fmw-oudr2ps3/Oracle_OUD1/bin/dsreplication post-external-initialization --hostname localhost --port 5444 --adminUID admin --adminPasswordFile ~/pass.txt --baseDN dc=Example,dc=com --trustAll --no-prompt --noPropertiesFile		  
		  
		  
# --------

# Trying by disabling the moddn on dsee servers : 

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 10389 moddn-enabled:off
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 11389 moddn-enabled:off

# Check the replication status : 

$  /scratch/appl/oracle/fmw-oudr2ps3/asinst_1/OUD/bin/dsreplication status -h localhost -p 4444 --adminUID admin --adminPasswordFile /home/oracle/pass.txt --dataToDisplay compat-view -X
		  
# ----------------------------------- #		  

# Enabling the moddn on dsee servers : 

$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 10389 moddn-enabled:on
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 11389 moddn-enabled:on
$ /scratch/binaries/dsee7/ODSEE_ZIP_Distribution/dsee7/bin/dsconf set-server-prop -h localhost -p 11389 moddn-enabled:on

ODSEE : Replications Setup

# Set Path

$ export PATH=/appl/ldap/dsee7/bin:/appl/ldap/dsee7/dsrk/bin:$PATH

#Instance Creation

$ dsadm create -p 10389 -P 10636 -w ~/dirt /appl/ldap/master1
$ dsadm create -p 11389 -P 11636 -w ~/dirt /appl/ldap/master2
$ dsadm create -p 12389 -P 12636 -w ~/dirt /appl/ldap/replica1
$ dsadm create -p 13389 -P 13636 -w ~/dirt /appl/ldap/hub1
$ dsadm create -p 14389 -P 14636 -w ~/dirt /appl/ldap/replica2
$ dsadm create -p 15389 -P 15636 -w ~/dirt /appl/ldap/hub2

# Start an instance

$ dsadm start /appl/ldap/master1
$ dsadm start /appl/ldap/master2
$ dsadm start /appl/ldap/replica1
$ dsadm start /appl/ldap/replica2
$ dsadm start /appl/ldap/hub1
$ dsadm start /appl/ldap/hub2

# Create a suffix

$ dsconf create-suffix -p 10389 -w ~/dirt -e dc=example,dc=com
$ dsconf create-suffix -p 11389 -w ~/dirt -e dc=example,dc=com
$ dsconf create-suffix -p 12389 -w ~/dirt -e dc=example,dc=com
$ dsconf create-suffix -p 13389 -w ~/dirt -e dc=example,dc=com
$ dsconf create-suffix -p 14389 -w ~/dirt -e dc=example,dc=com
$ dsconf create-suffix -p 15389 -w ~/dirt -e dc=example,dc=com

# Populate the suffix with LDIF data.

$ dsconf import -p 10389 -i -w ~/dirt -e /appl/ldap/dsee7/resources/ldif/Example.ldif dc=example,dc=com

# Search for data in the new instance

$ ldapsearch -p 10389 -b dc=example,dc=com “(uid=ajensen)” mail

# Import Self-Signed Certificate on other masters

$ dsadm show-cert -F der -o certfile-m1 /appl/ldap/master1 defaultCert
$ dsadm show-cert -F der -o certfile-m2 /appl/ldap/master2 defaultCert
$ dsadm show-cert -F der -o certfile-rep1 /appl/ldap/replica1 defaultCert
$ dsadm show-cert -F der -o certfile-rep2 /appl/ldap/replica2 defaultCert
$ dsadm show-cert -F der -o certfile-hub1 /appl/ldap/hub1 defaultCert
$ dsadm show-cert -F der -o certfile-hub2 /appl/ldap/hub2 defaultCert
$ dsadm add-cert –ca /appl/ldap/master1 “ds2 Repl Manager Cert m2″ certfile-m2
$ dsadm add-cert –ca /appl/ldap/master1 “ds2 Repl Manager Cert hub1″ certfile-hub1
$ dsadm add-cert –ca /appl/ldap/master2 “ds1 Repl Manager Cert m1″ certfile-m1
$ dsadm add-cert –ca /appl/ldap/master2 “ds2 Repl Manager Cert hub2″ certfile-hub2
$ dsadm add-cert –ca /appl/ldap/hub1 “ds1 Repl Manager Cert m1″ certfile-m1
$ dsadm add-cert –ca /appl/ldap/hub1 “ds1 Repl Manager Cert rep1″ certfile-rep1
$ dsadm add-cert –ca /appl/ldap/hub2 “ds1 Repl Manager Cert m2″ certfile-m2
$ dsadm add-cert –ca /appl/ldap/hub2 “ds1 Repl Manager Cert rep2″ certfile-rep2
$ dsadm add-cert –ca /appl/ldap/replica1 “ds1 Repl Manager Cert hub” certfile-hub1
$ dsadm add-cert –ca /appl/ldap/replica2 “ds1 Repl Manager Cert hub” certfile-hub2
$ dsadm restart /appl/ldap/master1
$ dsadm restart /appl/ldap/master2
$ dsadm restart /appl/ldap/hub1
$ dsadm restart /appl/ldap/hub2
$ dsadm restart /appl/ldap/replica1
$ dsadm restart /appl/ldap/replica2

# Enable Replication

$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 10389 -d 1 master dc=example,dc=com
$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 11389 -d 2 master dc=example,dc=com
$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 12389 consumer dc=example,dc=com
$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 13389 hub dc=example,dc=com
$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 14389 consumer dc=example,dc=com
$ dsconf enable-repl -i -D “cn=directory manager” -w ~/dirt -p 15389 hub dc=example,dc=com

# Create Replication Agreements between masters 1 to master2 and other replicas.

$ dsconf create-repl-agmt -i -p 10389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:11636
$ dsconf create-repl-agmt -i -p 10389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:13636
$ dsconf create-repl-agmt -i -p 11389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:10636
$ dsconf create-repl-agmt -i -p 11389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:15636
$ dsconf create-repl-agmt -i -p 13389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:12636
$ dsconf create-repl-agmt -i -p 15389 -D “cn=directory manager” -w ~/dirt –auth-protocol “ssl-simple” “dc=example,dc=com” localhost:14636

# Initialize

$ dsconf init-repl-dest -i -p 10389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com localhost:11636
$ dsconf init-repl-dest -i -p 10389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com localhost:13636
$ dsconf init-repl-dest -i -p 11389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com localhost:15636
$ dsconf init-repl-dest -i -p 13389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com localhost:12636
$ dsconf init-repl-dest -i -p 15389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com localhost:14636

# Check Replication

$ dsconf list-repl-agmts -i -p 10389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com
$ dsconf list-repl-agmts -i -p 11389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com
$ dsconf list-repl-agmts -i -p 13389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com
$ dsconf list-repl-agmts -i -p 15389 -D “cn=directory manager” -w ~/dirt -v dc=example,dc=com