L Adding a Directory Node by Using the Database Copy Procedure

This appendix explains how to add a new node to an existing replicating system by using the database copy procedure, also known as cold backup. This procedure works only for Oracle Internet Directory. Do not employ this procedure if other Oracle Identity Management components, such as Oracle Single Sign-On, are installed. You can use the database copy procedure to create a new directory replication group (DRG) if you have a standalone Oracle Internet Directory node. This procedure is applicable for an Oracle Database Advanced Replication-based replica and for a full LDAP-based replica.

This appendix contains the following sections:

L.1 Definitions

The sponsor site refers to the site or host or node where Oracle Internet Directory and its repository, the Oracle database, are installed. The sponsor site is also referred to as sponsor node.

The new site refers to the site or host or node to which you are copying the Oracle Internet Directory repository. The new site is also referred to as the new node.

L.2 Prerequisites

Your computing environment must meet the following prerequisites before you start this procedure:

  1. The operating system, version, and patch level of the new directory site must be the same as that of the sponsor directory site. This procedure might not work if the patch levels of the operating systems differ.

  2. Oracle strongly recommends that you back up the sponsor directory's repository before you employ this procedure.

  3. Because this procedure involves copying Oracle data files, performance depends on the underlying network. If the underlying network is slow, consider using one of the methods described in Chapter 39, "Setting Up Replication" or Appendix C, "Setting Up Oracle Database Advanced Replication-Based Replication" to set up a replication group. Alternatively, you could physically transfer compressed Oracle data files on removable media. Consult your local system or network administrator for information about the network.

  4. Only a person familiar with the Oracle database should perform this procedure.

  5. If the sponsor site is already a part of an Advanced Replication group, the sponsor node must be the Master definition site (MDS).

L.3 Sponsor Directory Site Environment

In the example shown throughout this chapter, the sponsor directory site's environment is as follows:

Hostname = rst-sun
Domain name = example.com
ORACLE_BASE = /private/oracle/app/oracle
ORACLE_HOME = /private/oracle/app/oracle/product/OraHome_1
ORACLE_SID  = LDAP
LD_LIBRARY_PATH = $ORACLE_HOME/lib
NLS_LANG = AMERICAN_AMERICA.AL32UTF8 
datafile location = /private/oracle/oradata/LDAP
Dump destination =  /private/oracle/app/oracle/admin/LDAP/pfile,
                    /private/oracle/app/oracle/admin/LDAP/bdump,
                    /private/oracle/app/oracle/admin/LDAP/cdump, 
                    /private/oracle/app/oracle/admin/LDAP/udump,
                    /private/oracle/app/oracle/admin/LDAP/create

L.4 New Directory Site Environment

In the example shown throughout this chapter, the new directory site's environment is as follows:

Hostname = dsm-sun
Domain name = example.com
ORACLE_BASE = /private1/oracle/app/oracle
ORACLE_HOME = /private1/oracle/app/oracle/product/OraHome_1
ORACLE_SID  = NLDAP
LD_LIBRARY_PATH = $ORACLE_HOME/lib
NLS_LANG = AMERICAN_AMERICA.AL32UTF8
datafile location = /private1/oracle/oradata/NLDAP
Dump destination =  /private1/oracle/app/oracle/admin/NLDAP/pfile,
                    /private1/oracle/app/oracle/admin/NLDAP/bdump,
                    /private1/oracle/app/oracle/admin/NLDAP/cdump, 
                    /private1/oracle/app/oracle/admin/NLDAP/udump,
                    /private1/oracle/app/oracle/admin/NLDAP/create
 

Everything except the hostname and domain name is created during installation of the Oracle Database in Step 10.

L.5 Addition of a Directory Node

  1. Install the node and check its status, as follows:

    1. Install Identity Management with the Oracle Internet Directory component on the sponsor node. See Oracle Fusion Middleware Installation Guide for Oracle Identity Management

    2. To check the status of Oracle Internet Directory, type:

      $ cd ORACLE_INSTANCE/bin
      $ ./opmnctl status
      

      The status should be Alive.

  1. Shut down Oracle Internet Directory and all other opmn processes on the sponsor node, as follows:

    $ cd ORACLE_INSTANCE/bin 
    $ opmnctl stopall
     
    
  2. Perform the following steps on the sponsor node.

    1. At the command line prompt execute the following SQL*Plus commands:

      $ sqlplus /nolog  
      SQL> connect / as sysdba 
      SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS; 
      

      This command sequence creates a trace file under the user dump destination directory.

      To determined the location of the user dump destination directory, execute following command:

      SQL> show parameter user_dump_dest;
      

      The name of the newly-created trace file is of the form:

      ORACLE_SID_ora_processid.trc
      
    2. Shut down the database and Oracle Net Services listener on the sponsor node. By default, the listener name is LISTENER. Type:

      $ lsnrctl stop 
      $ sqlplus /nolog 
      SQL> connect / as sysdba  
      SQL> shutdown  
      SQL> exit 
      
    3. If the copied node is part of an Advanced Replication-based DRG, perform the following steps:

      • On other nodes of the DRG, shut down the LDAP replication server only.

        $ oidctl connect=connect_string server=oidrepld \
           instance=instance_number stop   
        

        Repeat this procedure on all nodes except the sponsor node. Specify appropriate net service names for the corresponding nodes.

      • If you are adding a node to an existing DRG, quiesce Oracle Database Advanced Replication by using SQL*Plus. Execute the following commands at the master definition site (MDS) only:

        $ cd ORACLE_HOME/ldap/admin 
        $ sqlplus /nolog SQL> connect repadmin/repadmin_password;  
        SQL> @oidrsusp.sql 
          
        

        Note:

        Perform this SQL*Plus procedure only on the master definition site.

      Now that you have stopped replication, you can safely modify other nodes.

    4. Rename the trace file created in Step 3a to newdb.sql, under the same directory.

      $ cp ORACLE_SID_ora_processid.trc newdb.sql
      
  3. On the sponsor node, open newdb.sql in a text editor and delete all the lines except the STARTUP NOMOUNT and CREATE CONTROLFILE statements. After deleting those lines, newdb.sql should look like this:

    STARTUP NOMOUNT
    CREATE CONTROLFILE REUSE SET DATABASE "LDAP" RESETLOGS  NOARCHIVELOG
        MAXLOGFILES 16
        MAXLOGMEMBERS 3
        MAXDATAFILES 100    MAXINSTANCES 8
        MAXLOGHISTORY 454
    LOGFILE
      GROUP 1 '/private/oracle/oradata/LDAP/redo01.log'  SIZE 10M,
      GROUP 2 '/private/oracle/oradata/LDAP/redo02.log'  SIZE 10M,
      GROUP 3 '/private/oracle/oradata/LDAP/redo03.log'  SIZE 10M
    -- STANDBY LOGFILE
    DATAFILE
      '/private/oracle/oradata/LDAP/system01.dbf',
      '/private/oracle/oradata/LDAP/sysaux01.dbf',
      '/private/oracle/oradata/LDAP/users01.dbf',
      '/private/oracle/oradata/LDAP/dcm.dbf',
      '/private/oracle/oradata/LDAP/portal.dbf',
      '/private/oracle/oradata/LDAP/ptldoc.dbf',
      '/private/oracle/oradata/LDAP/ptlidx.dbf',
      '/private/oracle/oradata/LDAP/ptllog.dbf',
      '/private/oracle/oradata/LDAP/oca.dbf',
      '/private/oracle/oradata/LDAP/discopltc1.dbf',
      '/private/oracle/oradata/LDAP/discopltm1.dbf',
      '/private/oracle/oradata/LDAP/oss_sys01.dbf',
      '/private/oracle/oradata/LDAP/wcrsys01.dbf',
      '/private/oracle/oradata/LDAP/uddisys01.dbf',
      '/private/oracle/oradata/LDAP/b2b_dt.dbf',
      '/private/oracle/oradata/LDAP/b2b_rt.dbf',
      '/private/oracle/oradata/LDAP/b2b_idx.dbf',
      '/private/oracle/oradata/LDAP/b2b_lob.dbf',
      '/private/oracle/oradata/LDAP/bam.dbf',
      '/private/oracle/oradata/LDAP/orabpel.dbf',
      '/private/oracle/oradata/LDAP/attrs1_oid.dbf',
      '/private/oracle/oradata/LDAP/battrs1_oid.dbf',
      '/private/oracle/oradata/LDAP/gcats1_oid.dbf',
      '/private/oracle/oradata/LDAP/gdefault1_oid.dbf',
      '/private/oracle/oradata/LDAP/svrmg1_oid.dbf',
      '/private/oracle/oradata/LDAP/ias_meta01.dbf',
      '/private/oracle/oradata/LDAP/undotbs.dbf'
    CHARACTER SET AL32UTF8
    ;
    
  4. Continue editing the file newdb.sql on the sponsor node, as follows:

    1. Change the line:

      CREATE CONTROLFILE REUSE DATABASE "LDAP" RESETLOGS  NOARCHIVELOG
      

      to:

      CREATE CONTROLFILE REUSE SET DATABASE "NLDAP" RESETLOGS  NOARCHIVELOG
      
    2. Modify the UNIX directory location of the database and logfiles to point to the new node site's directory.

    In our example, after these modifications, newdb.sql should look like this:

    STARTUP NOMOUNT
    CREATE CONTROLFILE REUSE SET DATABASE "NLDAP" RESETLOGS  NOARCHIVELOG
        MAXLOGFILES 16
        MAXLOGMEMBERS 3
        MAXDATAFILES 100
        MAXINSTANCES 8
        MAXLOGHISTORY 454
    LOGFILE
      GROUP 1 '/private1/oracle/oradata/NLDAP/redo01.log'  SIZE 10M,
      GROUP 2 '/private1/oracle/oradata/NLDAP/redo02.log'  SIZE 10M,
      GROUP 3 '/private1/oracle/oradata/NLDAP/redo03.log'  SIZE 10M
    -- STANDBY LOGFILE
    DATAFILE
      '/private1/oracle/oradata/NLDAP/system01.dbf',
      '/private1/oracle/oradata/NLDAP/sysaux01.dbf',
      '/private1/oracle/oradata/NLDAP/users01.dbf',
      '/private1/oracle/oradata/NLDAP/dcm.dbf',
      '/private1/oracle/oradata/NLDAP/portal.dbf',
      '/private1/oracle/oradata/NLDAP/ptldoc.dbf',
      '/private1/oracle/oradata/NLDAP/ptlidx.dbf',
      '/private1/oracle/oradata/NLDAP/ptllog.dbf',
      '/private1/oracle/oradata/NLDAP/oca.dbf',
      '/private1/oracle/oradata/NLDAP/discopltc1.dbf',
      '/private1/oracle/oradata/NLDAP/discopltm1.dbf',
      '/private1/oracle/oradata/NLDAP/oss_sys01.dbf',
      '/private1/oracle/oradata/NLDAP/wcrsys01.dbf',
      '/private1/oracle/oradata/NLDAP/uddisys01.dbf',
      '/private1/oracle/oradata/NLDAP/b2b_dt.dbf',
      '/private1/oracle/oradata/NLDAP/b2b_rt.dbf',
      '/private1/oracle/oradata/NLDAP/b2b_idx.dbf',
      '/private1/oracle/oradata/NLDAP/b2b_lob.dbf',
      '/private1/oracle/oradata/NLDAP/bam.dbf',
      '/private1/oracle/oradata/NLDAP/orabpel.dbf',
      '/private1/oracle/oradata/NLDAP/attrs1_oid.dbf',
      '/private1/oracle/oradata/NLDAP/battrs1_oid.dbf',
      '/private1/oracle/oradata/NLDAP/gcats1_oid.dbf',
      '/private1/oracle/oradata/NLDAP/gdefault1_oid.dbf',
      '/private1/oracle/oradata/NLDAP/svrmg1_oid.dbf',
      '/private1/oracle/oradata/NLDAP/ias_meta01.dbf',
      '/private1/oracle/oradata/NLDAP/undotbs.dbf'
    CHARACTER SET AL32UTF8
    ;
    
  5. Copy the initialization parameter file init$ORACLE_SID.ora from the sponsor directory's database to init$ORACLE_SID_NEW_DIR_DB.ora. The default location of the initialization parameter file is $ORACLE_HOME/dbs on UNIX or Linux and %ORACLE_HOME%\database on Windows. In our example, copy /private/oracle/app/oracle/product/OraHome_1/dbs/initLDAP.ora to /private/oracle/app/oracle/product/OraHome_1/dbs/initNLDAP.ora as shown here:

    $ cd ORACLE_HOME/dbs
    $ cp initLDAP.ora initNLDAP.ora
    

    If you are using the server parameter file spfile$ORACLE_SID.ora or spfile.ora instead of an initialization parameter file, create an initialization parameter file from the server parameter file. For example, if spfile$ORACLE_SID.ora is located in the default location $ORACLE_HOME/dbs you would type:

    $ sqlplus /nolog
    SQL> connect / as sysdba
    SQL> create pfile from spfile
    SQL> shutdown immediate
    

    This sequence of commands creates an initLDAP.ora file at /private/oracle/app/oracle/product/OraHome_1 from spfileLDAP.ora. If the server parameter file is not located in the default location, you must include the complete path, as shown in the following example:

    SQL> connect / as sysdba
    SQL> create pfile='/private/oracle/initLDAP.ora' from
     spfile=/private/oracle/initLDAP.ora
    SQL> shutdown immediate
    

    After you create the initialization file parameter file, create a copy of it as explained at the beginning of this step.

  6. In the new initialization parameter file on the sponsor, make the following changes:

    1. Comment out the parameter JOB_QUEUE_PROCESSES, if it exists.

    2. Change the parameter dbname from LDAP to NLDAP.

    3. If the new site's domain name is different from the sponsor directory's domain name, alter the parameter db_domain also.

    4. Alter the location of the following parameters to point to the location of the new site.

      background_dump_dest
      core_dump_dest
      user_dump_dest
      control_files
      db_recovery_file_dest
      
    5. In addition to the parameters listed in Step 7d, if your initialization parameter file has any parameters that are node specific, such as DB_RECOVERY_FILE_DEST and DB_CREATE_FILE_DEST, alter those parameters as well.

    In our example, the initialization parameter file initNLDAP.ora looks like this after these modifications:

    *.aq_tm_processes=1
    *.background_dump_dest='/private1/oracle/app/oracle/admin/NLDAP/bdump'
    *.compatible='10.1.0.2.0'
    *.control_files='/private1/oracle/app/oracle/admin/NLDAP/control01.ctl',
           '/private1/oracle/app/oracle/admin/NLDAP/control02.ctl',
    '/private1/oracle/app/oracle/admin/NLDAP/control03.ctl'
    *.core_dump_dest='/private1/oracle/app/oracle/admin/NLDAP/cdump'
    *.db_block_size=8192*.db_cache_size=50331648
    *.db_domain='example.com'
    *.db_file_multiblock_read_count=16
    *.db_name='NLDAP'*.db_recovery_file_dest='/private/oracle1/app/oracle/flash_recovery_area'
    *.db_recovery_file_dest_size=2147483648
    *.dispatchers='(PROTOCOL=TCP)(PRE=oracle.aurora.server.GiopServer)',
                  '(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)'
    *.java_pool_size=67108864#*.job_queue_processes=5
    *.large_pool_size=8388608
    *.max_commit_propagation_delay=0
    *.open_cursors=300
    *.pga_aggregate_target=33554432*.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.sessions=400
    *.shared_pool_size=150994944
    *.undo_management='AUTO'
    *.undo_tablespace='UNDOTBS'
    *.user_dump_dest='/private1/oracle/app/oracle/admin/NLDAP/udump'
    
  7. Edit the tnsnames.ora file to include connection details for the new node. Refer to the following sample file:

    LDAP.ACME.COM =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = rst-sun)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ldap.acme.com)
        )
      )
    NLDAP.ACME.COM =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = dsm-sun)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = nldap.acme.com)    )
      )
    
  8. Create an archive of all the data files and compress the archived file. Be sure to include all the files listed under DATAFILE in newdb.sql.

    As an example, you could use the following commands to go to the database file location and generate a compressed archive called OID_DB.tar.Z:

    $ cd $ORACLE_BASE/oradata/$ORACLE_SID  
    $ tar -cvf OID_db.tar *.dbf   
    $ compress OID_db.tar   
    
  9. Install Oracle Database on the new node using the software only option. See the Oracle Database Installation Guide for your platform and Oracle Fusion Middleware Installation Guide for Oracle Identity Management.

  10. When the software-0nly install on the new node has completed, the following directory exists:

    /private1/oracle/app/oracle/product/OraHome_1/diag/rdbms

    Create the following directories on the new node:

    • Datafile location: /private1/oracle/app/oracle/oradata/NLDAP

    • Dump destinations:

      /private1/oracle/app/oracle/admin/NLDAP/adump

      /private1/oracle/app/oracle/admin/NLDAP/udump

      /private1/oracle/app/oracle/flash_recovery_area

    • Trace file location: /private1/oracle/app/oracle/product/OraHome_1/diag/rdbms/nldap/nldap/trace

  11. Copy the archived file created on the sponsor node in Step 9 to the new node, using FTP or another appropriate tool. Change directory to the database file location on the new node, then use FTP to copy the archived file from rst-sun.

    $ cd /private1/oracle/app/oracle/oradata/NLDAP
    $ ftp
    ftp> open rst-sun
    Connected to rst-sun.us.example.com.
    220 rst-sun FTP server (UNIX(r) System V Release 4.0) ready.
    Name (rst-sun:oracle): 
    331 Password required for oracle.
    Password:
    230 User oracle logged in.
    ftp> cd /private/oracle/oradata/LDAP
    250 CWD command successful.
    ftp> binary
    200 Type set to I.
    ftp> mget oradb.tar.Z
    

    If the data files are very large (several gigabytes or terabytes) and the network bandwidth is low, consider using media, such as tape or disk, to move the compressed file from the sponsor to the new node.

    Extract the archived file on the new node. For example:

    $ uncompress oradb.tar.Z
    $ tar xvf oradb.tar
    

    Ensure that the data files are extracted to the correct directory. In our example, it is /private1/oracle/oradata/NLDAP

  12. If the sponsor node is part of an Advanced replication group, then perform the following steps:

    1. Copy the initialization parameter file initLDAP.ora from the sponsor node (rst-sun) to the new node under the UNIX directory $ORACLE_HOME/dbs using a tool such as FTP. Rename the file to initNLDAP.ora.

      Ensure that the contents of the copied file initLDAP.ora are valid after copying.

      Edit the file initLDAP.ora. Change:

      .db_name='NLDAP'
      

      to

      .db_name='LDAP' 
      
    2. Using a tool such as FTP, copy the file newdb.sql you created on the sponsor node in Step 5 to the new node. Rename newdb.sql to olddb.sql.

      Edit olddb.sql. Change:

      CREATE CONTROLFILE REUSE SET DATABASE "NLDAP" RESETLOGS  NOARCHIVELOG
      

      to:

      CREATE CONTROLFILE REUSE SET DATABASE "LDAP" RESETLOGS  NOARCHIVELOG 
      
    3. Make a copy of tnsnames.ora called tnsnames.ora.bk.

      Edit tnsnames.ora. Change:

      LDAP.ACME.COM =
       (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = rst-sun)(PORT = 1521))
         (CONNECT_DATA =
           (SERVER = DEDICATED)
           (SERVICE_NAME = ldap.acme.com)
         )
       )
      NLDAP.ACME.COM =
       (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = dsm-sun)(PORT = 1521))
         (CONNECT_DATA =
           (SERVER = DEDICATED)
           (SERVICE_NAME = nldap.acme.com)    )
       )
       
      

      to:

      LDAP.ACME.COM =
       (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = dsm-sun)(PORT = 1521))
         (CONNECT_DATA =
           (SERVER = DEDICATED)
           (SERVICE_NAME = ldap.acme.com)    )
       )
       
      
    4. At the shell prompt on the new node, set the ORACLE_BASE, ORACLE_HOME, and ORACLE_SID environment variables. For example (using the C shell):

      $ setenv ORACLE_BASE /private1/oracle/app/oracle
      $ setenv ORACLE_HOME /private1/oracle/app/oracle/product/OraHome_1
      $ setenv ORACLE_SID LDAP
       
      
    5. In the same shell, execute olddb.sql using SQL*Plus as shown in the following example:

      cd /private1/oracle/app/oracle/admin/NLDAP/udump
      $ sqlplus /nolog
      SQL> connect / as sysdba
      SQL> @olddb.sql
      SQL> shutdown normal
      SQL>exit
      
    6. Start up the database and listener as follows:

      $ sqlplus /nolog
      SQL> connect / as sysdba
      SQL> startup mount
      SQL> alter database open resetlogs
      SQL> exit
      $ lsnrctl start
       
      
    7. If you have performed a database copy from a node that has Advanced replication configured with another node, you must delete the LDAP_REP replication group in the new node. To do so, execute the following commands:

      sqlplus / as sydba
      SQL> dbms_defer_sys.delete_tran(null,null);
      SQL> dbms_defer_sys.delete_error(null,null);
      SQL> dbms_repcat.purge_master_log(null,null,null);
      SQL> exit
      
      sqlplus rep_admin_db_account_name/password
      SQL> exec dbms_repcat.drop_master_repgroup( gname => 'LDAP_REP' )
      SQL> shutdown immediate
       
      
  13. Copy the initialization parameter file initLDAP.ora from the sponsor node (rst-sun) to the new node under the UNIX directory $ORACLE_HOME/dbs using FTP or another appropriate tool. Ensure that the contents of the copied file initLDAP.ora are valid after copying.

    In addition, also copy the database password file orclpwORACLE_SID from the sponsor node to the new node.

  14. On the new node, ensure that the following files do not exist in the directory $ORACLE_HOME/dbs on UNIX or ORACLE_HOME\database in Windows:

    • spfileNLDAP.ora

    • spfile.ora

    If either of these files exists, the Oracle database uses that file instead of the initNLDAP.ora file you copied from the sponsor node.

  15. Using FTP or another appropriate tool, copy the file newdb.sql you created on the sponsor node in Step 5 to the new node. For example:

    $ cd /private1/oracle/app/oracle/admin/NLDAP/udump 
    $ ftp
    ftp> open rst-sun
    ftp> cd /private1/oracle/app/oracle/admin/LDAP/udump
    ftp> mget newdb.sql
    
  16. At the UNIX shell prompt on the new node, set ORACLE_BASE, ORACLE_HOME and ORACLE_SID environment variables. For example (using the C shell):

    $ setenv ORACLE_BASE /private1/oracle/app/oracle
    $ setenv ORACLE_HOME /private1/oracle/app/oracle/product/OraHome_1
    $ setenv ORACLE_SID NLDAP
    
  17. In the same UNIX shell, execute newdb.sql using SQL*Plus as shown in the following example:

    $ sqlplus /nolog
    SQL> connect / as sysdba
    SQL> @newdb.sql
    SQL> shutdown normal
    SQL>exit
    
  18. Complete the changes on the new node.

    1. Start up the database and listener as follows:

      $ sqlplus /nolog 
      SQL> connect / as sysdba 
      SQL> startup mount 
      SQL> alter database open resetlogs 
      SQL> exit 
      $ lsnrctl start 
      
    2. Change the global database name of the new node.

      SQL> connect / as sysdba 
      SQL> alter database rename global_name to NLDAP;  
      SQL> exit
      

      Note that the new node ORACLE_SID IS NLDAP.

    3. Add a temporary file to the tablespace using the following command:

      SQL> connect / as sysdba  
      SQL> ALTER TABLESPACE TEMP ADD TEMPFILE 'temp01.dbf' size 2000k; 
      SQL> exit
      

    The value 2000K is just an example. Determine your own value based on the requirements of your environment.

  19. Configure Oracle Internet Directory on the new node

    1. Install WebLogic Server. See Oracle Fusion Middleware Installation Guide for Oracle WebLogic Server.

    2. Install Oracle Internet Directory. See Oracle Fusion Middleware Installation Guide for Oracle Identity Management.

      Note:

      When you configure Oracle Internet Directory on the new node, you must specify the information for the new node database (created in Step 10).

    3. Stop Oracle Internet Directory by using opmnctl.

  20. On the new node, delete the wallet files oidpwdlldap1 and oidpwdr* at the new node and reset the ODS password

    $ cd $ORACLE_HOME/OID/admin 
    $ rm oidpwdlldap1 oidpwdr*
    
  21. On the new node, reset the password and start the Oracle Internet Directory processes.

    oidpasswd connect=nldap create_wallet=true 
    

    you are prompted to provide the current database password, enter a new database password, and confirm the new password.

    Start Oracle Internet Directory on the new node by using the opmnctl command.

    $opmnctl startproc ias-component=oid1 
    
  22. At this point, Oracle Internet Directory on the new node is up and running. The replicaid value in new Oracle Internet Directory node, however, still has the replica id of the sponsor's node. Therefore, you must reset new node's replicaid. The new value of replicaid must be of the form hostname_sid where:

    • hostname is the host name of the new node, without the domain name

    • sid is the ORACLE_SID of the new node database

    Ensure that all letters of the replicaid are in lower case.

    1. Create a file, chgrid.ldif, with the following contents:

      dn:
      changetype: modify
      replace: orclreplicaid
      orclreplicaid: new_replicaid
      
    2. Using the ldapmodify tool, change the replicaid:

      $ORACLE_HOME/bin/ldapmodify -h new_node_host -p port_ldap_server -f chgrid.ldif
      
  23. Because the replica id of the new node was changed in Step 23, you must re-create the relative replica entries for the new node, as follows:

    $ remtool -pcleanup -bind "new_node_host:new_node_port/new_node_repl_pswd"  
    

    The remtool command does report an error and prompt for input because there are no replica entries that correspond with the new replica id yet. The remtool command uses your responses to rectify the error. Here is an example, with user input shown in boldface:

    remtool -pcleanup -bind "new_node_host:new_node_port/new_node_repl_pswd" 
    Error occurred while getting replication configuration information.  
    This tool will try to rectify the problem if super user DN and password are provided.  
    Do you want to continue? [y/n] : y 
    Enter superuser DN                           : cn=orcladmin 
    Enter superuser password                     :   
    Enter new password of replication DN     :   
    Reenter new password of replication DN  :    
    DRG identified by replica ldap://new_node_host:new_node_port (new_replicaid) will be cleaned up.    
    Do you want to continue? [y/n] : y  
    ------------------------------------------------------------------------------  
    ------------------------------------------------------------------------------  
    Replica replica ldap://new_node_host:new_node_port (new_replicaid) has been cleaned up.
    
  24. ) In addition to renaming the replica subentry, you must change the orclreplicauri, orclreplicasecondaryuri and orclreplicastate attributes of the replica subentry. You must modify the orclreplicauri and orclreplicasecondaryuri attributes to contain the URI of the new node's LDAP server. You must set the orclreplicastate attribute must be set to 6, which specifies to remtool that this a database copy-based addnode. To change the values, proceed as follows.

    1. Create an LDIF file, modsubentry.ldif, with the following contents:

      dn: orclreplicaid=new_replicaid,cn=replication configuration  
      changetype: modify  
      replace: orclreplicauri 
      # Use your host name and port number  
      # where ldap server is listening  
      orclreplicauri: ldap://new_node_host:new_node_port/  ---  
      replace:orclreplicasecondaryuri  
      # Use your fully qualified host name and  
      # the port number where ldap server is listening  orclreplicasecondaryuri:  
      ldap://new_node_host_with_domain_name:new_node_port/  ----  
      replace:orclreplicastate  
      orclreplicastate: 6  
       
      
    2. Using the ldapmodify tool, apply the changes to the directory:

      $ ldapmodify -h new_node_host -p port_of_ldap_server -f modsubentry.ldif
      
  25. Stop Oracle Internet Directory processes.

    $opmnctl stopproc ias-component=oid1
    
  26. Clean up the changelog tables at the new node.

    $ sqlplus /nolog  
    SQL> connect ods/ods_password;  
    SQL> truncate table ods.ods_chg_log;  
    SQL> truncate table ods.ods_chg_stat;  
    SQL> truncate table ods.asr_chg_log;
    
  27. If the new node is part of an Advanced Replication-based DRG, proceed as follows.

    1. To configure Oracle Database Advanced Replication, if you are adding new node to an existing DRG, at the shell prompt, execute the following command:

      $ remtool -addnode 
      

      To configureOracle Database Advanced Replication, if you are creating a new DRG consisting of sponsor node and new node, at the shell prompt, execute the following command:

      $ remtool -asrsetup 
      
    2. Start up Oracle Internet Directory and the replication server on all the nodes, including the new node and the sponsor node.

      Use the following command to start replication server:

      oidctl connect=nldap server=OIDREPLD instance=1 \
         flags="-p new_node_port -h new_node_host" start
      

      Then execute resumeasr or oidrrsme.sql.

  28. If the new node is a full LDAP-based replication replica, configure LDAP-based Replication and add the full replica as fan-out, as follows:

    1. Make sure that the database and Oracle Internet Directory server is running at the sponsor node.

      On the sponsor node, type:

      $ sqlplus /nolog 
      SQL> connect / as sysdba 
      SQL> startup 
      SQL> exit 
      $ lsnrctl start 
      Start OID 
      $opmnctl startproc ias-component=oid1 
        
      

      Check the status of Oracle Internet Directory by typing:

      $opmnctl status 
      
    2. Configure LDAP-based replication using remtool, as follows:

       remtool -paddnode 
      
    3. Initialize the replication change status of the new replication agreement.

      • Get the maximum used change number from the sponsor node:

        $ ldapsearch -h sponsor_node_host -p sponor_node_port -b " " \
           -s base "objectclass=*" lastchangenumber 
        
      • Create an LDIF file chgstatus.ldif, with the following contents:

        dn: orclagreementid=new_agreement_id,orclreplicaid=new_replicaid,cn=replication configuration
        changetype: modify 
        replace: orcllastappliedchangenumber;transport$sponsor_replicaid$new_replicaid
        orcllastappliedchangenumber;transport$sponsor_replicaid$new_replicaid: Number_from_ldapsearch
        -
        replace: orcllastappliedchangenumber;apply$sponsor_replicaid$new_replicaid
        orcllastappliedchangenumber;apply$sponsor_replicaid$new_replicaid: Number_from_ldapsearch
         
        

        where Number_from_ldapsearch refers to the maximum change number from the sponsor node that you obtained using the ldapsearch command.

      • Using ldapmodify, apply the change to both the sponsor node and the new node:

        ldapmodify -p sponsor_node_port -h sponsor_node_host -v \
           -f chgstatus.ldif 
        ldapmodify -p new_node_port -h new_node_host -v -f chgstatus.ldif 
        
    4. Start up Oracle Internet Directory and the replication server on all the nodes. For one-way replication, you only need to start the replication server on the consumer node.