Oracle Internet Directory Administrator's Guide Release 9.0.2 Part Number A95192-01 |
|
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 23, "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:
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.
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.UTF8 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
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
Complete the following steps on the sponsor node.
$ sqlplus /nolog SQL> connect /as sysdba SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
The above command will create 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
$ 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.
$ oidctl connect=net_service_name server=oidrepld instance=instance_number stop
Repeat the above procedure on all nodes except the sponsor node. Specify appropriate net service names for the corresponding nodes.
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:
|
At this point, other nodes are available for LDAP edits only, but replication will not take place.
$ lsnrctl [listener_name] stop (By default listener name is LISTENER) $ sqlplus /nolog SQL> connect /as sysdba SQL> shutdown normal SQL> exit
newdb.sql
, under the same directory.
$ cd $ORACLE_BASE/admin/LDAP/udump $ cp ldap_ora_4765.trc newdb.sql
newdb.sql
, using any text editor, and delete the lines up to START NOMOUNT.
CREATE CONTROLFILE REUSE SET DATABASE database_name RESETLOG
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
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
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
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
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
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.
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.
$ >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.
Complete the following steps on the new node.
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
root.sh
) activities for the database as well as the Directory server.
To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:
Note:
If you have already performed Oracle database and Directory installation on the new node, then proceed to Step 5.
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.
$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
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.
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
$ 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
$ telnet rst-sun $ sqlplus /nolog SQL> connect /as sysdba SQL> startup SQL> exit $ lsnrctl start (By default listener name is LISTENER) $ exit
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.
$ ldaprepl.sh -addnode
Note: To run shell script tools on the Windows operating system, you need one of the following UNIX emulation utilities:
|
Sample LDIF file:
dn: orclagreementid=000001, cn=orclreplagreements changetype: modify add: orcldirreplgroupdsas orcldirreplgroupdsas: dsm-sun
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.
|
Copyright © 1999, 2002 Oracle Corporation. All Rights Reserved. |
|