Skip Headers

Oracle Internet Directory Administrator's Guide
Release 9.2

Part Number A96574-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

23
Addition of a Node by Using the Database Copy Procedure

This chapter tells how to add a new node to an existing replicating system by using the database copy procedure, also known as cold backup.


Note:

Because this procedure involves copying Oracle data files, faster performance depends on the underlying network. If the underlying network is weak, then it may be better to implement the method described in Chapter 22, "Oracle Directory Replication Server Administration", or to physically ship compressed Oracle data files on a medium such as a tape or disk. Consult your local system or network administrator for more details on the network.

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


This chapter contains these topics:

Assumptions

This document assumes that the UNIX directories are created according to Optimal Flexible Architecture (OFA), the set of configuration guidelines for efficient and reliable Oracle databases.

See Also:

The Oracle installation guide for your operating system for more information on OFA

Sponsor Directory Site Environment

Set up the environment of the sponsor site. In the example shown throughout this chapter, the host name is rst-sun.

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

New Directory Site Environment

Set up the environment for the new directory site. In the example shown throughout this chapter, the new site is on the node named dsm-sun.

      Hostname = dsm-sun
      ORACLE_BASE = /private1/oracle/app/oracle
      ORACLE_HOME = /private1/oracle/app/oracle/product/8.1.6
      ORACLE_SID  = NLDAP
      LD_LIBRARY_PATH = $ORACLE_HOME/lib
      NLS_LANG = AMERICAN_AMERICA.UTF8
         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 

Note:

After installation of the Oracle database or Oracle directory, you use Database Configuration Assistant to create data file directories. Create the new directories on the new node under various UNIX partitions as defined by OFA.


Tasks To Be Performed on the Sponsor Node

Complete the following steps on the sponsor node.

  1. At the command line prompt execute SQL*Plus.
    $ sqlplus /nolog
    SQL> connect /as sysdba
    SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    
    
    

    This command creates a trace file under the user dump destination directory (that is, /private1/oracle/app/oracle/admin/LDAP/udump).

    The file will be created in the following format:

    $ORACLE_SID_ora_processid.trc
    
    
    

    For example:

    ldap_ora_4765.trc
  2. Shutdown the LDAP and replication servers and OID Monitor processes. Make sure the ldap and replication servers are stopped before stopping the OID Monitor process.
       $ oidctl connect=net_service_name server=oidrepld instance=instance_number 
    stop
       $ oidctl connect=net_service_name server=oidldapd instance=instance_number 
    stop
       $ oidmon connect=net_service_name stop
    
    

    In these commands, net_service_name is the net service name in the node's tnsnames.ora file.

  3. On the remaining nodes, shutdown the LDAP replication server only.
    $ oidctl connect=net_service_name 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.

  4. Quiesce Oracle9i Replication by running the following script at the master definition site (MDS):
     ldaprepl.sh -quiesce

    When prompted, enter the Oracle global name and replication administration password for the MDS.


    Note:

    To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:



    Note:

    This procedure can take place only on the master definition site.


    At this point, other nodes are available for LDAP edits only, but replication will not take place.

  5. After quiescing the environment, shutdown the database and Oracle Net Services listener on the sponsor node only:
     $ lsnrctl [listener_name] stop  (By default listener name is LISTENER)
     $ sqlplus /nolog
     SQL> connect /as sysdba 
     SQL> shutdown normal 
     SQL> exit
    
    
    
  6. Copy the trace file created under Step 1 to a new file, newdb.sql, under the same directory.
    $ cd $ORACLE_BASE/admin/LDAP/udump
    $ cp ldap_ora_4765.trc newdb.sql
    
    
  7. Edit newdb.sql, using any text editor, and delete the lines up to START NOMOUNT.
    CREATE CONTROLFILE REUSE SET DATABASE database_name RESETLOG
    
    
  8. Modify the UNIX directory location of the database/logfiles to point to the new node directory. Refer to the sample file newdb.sql as follows:
    Begin newdb.sql         
    CREATE CONTROLFILE REUSE SET DATABASE "LDAP" RESETLOGS
    MAXLOGFILES 16
    MAXLOGMEMBERS 2
    MAXDATAFILES 255
    MAXINSTANCES 1
    MAXLOGHISTORY 100
    LOGFILE
    GROUP 1 '/private2/oracle/oradata/NLDAP1/log1_NLDAP.dbf'  SIZE 1M,
    GROUP 2 '/private2/oracle/oradata/NLDAP1/log2_NLDAP.dbf'  SIZE 1M
    DATAFILE
    '/private2/oracle/oradata/NLDAP1/sys0_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/rbs1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/attrs1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/dncat1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/cncat1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/objcl1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/cats1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/default1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/temp1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/iattrs1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/idncat1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/icncat1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/iobjcl1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/icats1_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/temp2_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/cats2_NLDAP.dbf',
    '/private2/oracle/oradata/NLDAP1/attrs2_NLDAP.dbf'
    ;
     End newdb.sql     
    
    
  9. Copy the files initLDAP.ora and configLDAP.ora under $ORACLE_HOME/dbs to initNLDAP.ora and configNLDAP.ora respectively.
    $cd $ORACLE_HOME/dbs
    $cp initLDAP.ora initNLDAP.ora
    $cp configLDAP.ora configNLDAP.ora
    
    
  10. Edit the copied file (initNLDAP.ora) and comment out the parameter JOB_QUEUE_PROCESS. Change the following parameter:
    db_name = LDAP  (If the parameter does not exist in the file initNLDAP.ora, then modify the file 
    configNLDAP.ora)
    ifile = UNIX_directory_location_of_the_new_config_file/ configNLDAP.ora
    
    
  11. Edit the copied file configNLDAP.ora to change the following parameters:
    cdump =  UNIX_directory_location_of_the_new_node
    udump  = UNIX_directory_location_of_the_new_node
    bdump  = UNIX_directory_location_of_the_new_node
    control_files = UNIX_directory_location_of_the_new_node
    
    
  12. Edit the tnsnames.ora file to include information pertaining to the new node. Refer to the following sample file:
    Begin tnsnames.ora
    
    ldap1.world =
       (description=
          (address=(protocol=tcp)(host=rst-sun)(port=1521))
          (connect_data=(sid=LDAP))
       )
    ldap2.world =
       (description=
          (address=(protocol=tcp)(host=eas-sun10)(port=1521))
          (connect_data=(sid=LDAP))
       )
    ldap3.world =
       (description=
          (address=(protocol=tcp)(host=dsm-sun)(port=1521))
          (connect_data=(sid=NLDAP))
       )
    
    End tnsnames.ora
    
    
  13. Copy the file listener.ora to list.bak. Edit the copied file list.bak to include the information pertaining to the new node. Refer to the following sample file:
    Begin listener.ora
    
    # The KEY value for the IPC protocol may be anything, and
    # is not related to either the TCP hostname or database SID.
    
    LISTENER =
      (ADDRESS_LIST =
            (ADDRESS=(PROTOCOL= IPC)(KEY= LDAP))
            (ADDRESS=(PROTOCOL= IPC)(KEY= PNPKEY))
            (ADDRESS=(PROTOCOL= TCP)(Host= dsm-sun)(Port= 1521))
      )
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME= dsm-sun.us.oracle.com)
          (ORACLE_HOME= /private1/oracle/app/oracle/product/8.1.6)
          (SID_NAME = NLDAP)
        )
        (SID_DESC =
          (SID_NAME = extproc)
          (ORACLE_HOME = /private1/oracle/app/oracle/product/8.1.6)
          (PROGRAM = extproc)
        )
      )
    STARTUP_WAIT_TIME_LISTENER = 0
    CONNECT_TIMEOUT_LISTENER = 10
    TRACE_LEVEL_LISTENER = OFF
    
    End listener.ora
    
    

    The files tnsnames.ora and listener.ora can reside under $ORACLE_HOME/network/admin or /var/opt/oracle or under the directory pointed to by the TNS_ADMIN environment variable.

  14. Copy the updated tnsnames.ora file to all the nodes. Be careful to copy it to the location of the current tnsnames.ora on each node. The file tnsnames.ora can be copied to other nodes using FTP. Make sure you transfer the file in ASCII mode.

    Prior to copying the file tnsnames.ora to the new node, install the Oracle database software on the new node. Also copy the files list.bak as listener.ora and sqlnet.ora from the sponsor node to the new node.

  15. Create an archive of all the data files and compress the archived file. For example:
    $ >oradb.tar
    
    

    This command will create an empty file under a directory. Make sure you have enough space in the partition where the archives will be created.

    $ find / -name *.dbf -print -exec tar rvf  absolute_path_of_the_directory_
    which_contains_oradb.tar {} \;
    
    

    This command will search for all files ending with extension.dbf from the root directory. The assumption is that there is only one instance of the database server installed on the node and data files end with *.dbf extension.

    $ find / -name *.log -print -exec tar rvf absolute_path_of_the_directory_
    which_contains_oradb.tar
    $ compress oradb.tar
    
    

    This procedure is only an example to illustrate the method to back up the files. The Oracle data files will be backed up in the absolute path using this method. It is a better idea to back up the files from the current directory, so that you have more flexibility when you want to restore the data files. Consult your system administrator before backing up the database.

Tasks To Be Performed on the New Node

Complete the following steps on the new node.

  1. Log in to the new node (dsm-sun).
  2. Edit the oratab file appropriately for the new instance, at all database nodes. See the sample file for syntax.
    Begin oratab
    
    NLDAP:/private1/oracle/app/oracle/product/8.1.6:N
    *:/private1/oracle/app/oracle/product/8.1.6:N
    
    End oratab 
    
    
  3. Make sure the environment variables are set in the new directory site.
  4. Install the Oracle database and Oracle directory server. Perform software only install of the Oracle database and directory server. Installation of Oracle database and directory software can be performed on the new node at any time before the database files are copied to the new machine. Perform post-installation (that is: root.sh) activities for the database as well as the Directory server.


    Note:

    To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:


    See Also:

    Oracle9i installation documentation

    If you have already performed Oracle database and Directory installation on the new node, then proceed to Step 5.

  5. Copy the files initNLDAP.ora and configNLDAP.ora from the sponsor node (rst-sun) to the new node under the UNIX directory
    $ORACLE_BASE/ADMIN/NLDAP/PFILE. Files can be copied to the new machine using tools such as FTP. Make sure the transfer mode is ASCII.
  6. Create a symbolic soft link from $ORACLE_HOME/DBS TO $ORACLE_BASE/ADMIN/NLDAP/PFILE.
     $ ln -s $ORACLE_BASE/admin/NLDAP/pfile/initNLDAP.ora 
            $ORACLE_HOME/dbs/initNLDAP.ora 
     $ ln -s $ORACLE_BASE/admin/NLDAP/pfile/configNLDAP.ora 
            $ORACLE_HOME/dbs/configNLDAP.ora
    
    
  7. Copy the archived file created in the sponsor node procedure, using a tool such as FTP. (You created this file in Step 15.) Set the transfer mode to binary.
    ftp> open rst-sun
    Connected to rst-sun.us.oracle.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 /private1/oracle/oradata/LDAP
    250 CWD command successful.
    ftp> binary
    200 Type set to I.
    ftp> mget oradb.tar.Z
    
    

    If the data files are huge (several gigabytes or terabytes) and the network bandwidth is low, then it may be a better idea to physically ship the compressed file on any media, such as tape or disk, from the sponsor to the new node.

  8. Copy the file newdb.sql created under Step 6 of the sponsor node setup to the background user dump destination directory. You must transfer the file newdb.sql only in ASCII mode. For example:
     $ cd /private1/oracle/app/oracle/admin/NLDAP/udump 
                    (that is::$ORACLE_BASE/admin/SID/udump)
    $ ftp
    ftp> open rst-sun
    ftp> cd /private1/oracle/app/oracle/admin/LDAP/udump
    ftp> mget newdb.sql
    
    
  9. At the UNIX shell prompt execute the following commands:
    $ sqlplus /nolog
    SQL> connect /as sysdba
    SQL> startup nomount
    SQL> @newdb.sql
    SQL> shutdown normal
    SQL> startup (uncomment the parameter job_queue_process prior to  startup)
    SQL>exit
    $ lsnrctl start
    
    
  10. Log in to the sponsor node and start up the database and listener on the sponsor node; for example, rst-sun.
    $ telnet rst-sun
    $ sqlplus /nolog
    SQL> connect /as sysdba
    SQL> startup
    SQL> exit
    $ lsnrctl start (By default listener name is LISTENER)
    $ exit
    
    
  11. If the sponsor node is a master site, then proceed to Step 12.

    If the new node is created by using backup database copy of the MDS, then the master definition catalog needs to be dropped and the underlying Oracle9i Replication catalogs must be created. To drop the definition of the MDS from the Oracle9i Replication catalog on the new node and add the Oracle9i Replication catalogs, execute the following scripts.

    $ cd $ORACLE_HOME/ldap/admin
    $ sqlplus repadmin/repadmin
    SQL> @ldapdropmds.sql
    SQL> @ldapcreindex.sql

    Specify the global name of the new node when prompted.

  12. To configure the Oracle9i Replication, at the shell prompt, execute the following command:
    $ ldaprepl.sh -addnode
    

    Note:

    To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:


  1. Update the LDAP replication agreements to include the new node.

    Sample LDIF file:

    dn: orclagreementid=000001, cn=orclreplagreements
    changetype: modify
    add: orcldirreplgroupdsas
    orcldirreplgroupdsas: dsm-sun
  2. Start up the LDAP replication server on all the nodes, including new and sponsor nodes.

    Verification Process

    Log in to the Oracle database by using SQL*Plus and specify the user name as ODS, and the password ods when prompted.

    Check the ods_chg_stat table on all nodes and see if they have correct and identical rows. The ods_chg_stat table should contain (number of nodes) x (number of nodes) rows. For example, if there were two nodes participating in Oracle9i Replication-based replication, and you added a third node, the ods_chg_stat table would contain nine rows, that is, 3 x 3, on each node. The rows are shown in the following table:

    Supplier Consumer Change Number

    Node1

    node2

    number 1

    Node1

    node3

    number 2

    Node1

    node1

    number 3

    Node2

    node1

    number 4

    Node2

    node2

    number 5

    Node2

    node2

    number 6

    Node3

    node1

    0

    Node3

    node2

    0

    Node3

    node3

    0

    The rows with consumer names identical to that of suppliers contain the last changes processed by the outbound change log processing threads at the supplier sides. The rows with different supplier and consumer names contain last change numbers already processed from the suppliers to the consumers in question.

    Since Node3 is a new node, there have been no changes supplied by Node3 yet. Therefore, the change numbers for Node3 as supplier are 0.

    There may be a time delay before all nodes contain identical rows, but this delay should not be more than two to three minutes.


Go to previous page Go to next page
Oracle
Copyright © 1999, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback