This is an excerpt from the bestselling book
Oracle Grid & Real Application Clusters. To get immediate
access to the code depot of working RAC scripts, buy it
directly from the publisher and save more than 30%.
An UNIX utility, known as fuser,
verifies if a file is open or closed. If an archive log is being
written, UNIX will allow it to be copied, deleted, or have just
about anything else done to it. Therefore, using fuser before
copying an archive file will ensure all files are complete and
usable for recovery. Any script written on a UNIX or Linux box for
copying archive logs should use fuser to verify that a log is not
being written before attempting to copy it.
About the only advantage of the
raw configuration is the ability to parallel the archive log portion
of the backup, if multiple tapes, one on each node, are used.
If only a single tape drive is
available, the NFS mount scheme must be used. If the NFS mount is
lost along with archive logs, the database may not be fully
The initialization parameters
should be set similar to:
By using the NFS mount scheme,
either node can backup the archive logs in the other. On Linux, an
explanation of the process to set up an NFS-mounted drive follows.
Configure the services such that
the NFS services are running:
Figure 13.4 shows the Service
Configuration GUI with these services checked.
Figure 13.4: Service
Configuration Screen with NFS services selected.
The NFS server must be
configured on each node. Figure 13.5 shows the NFS Server GUI
configuration screen for Linux.
Figure 13.5: Example NFS
The root user performs the
configuration for NFS mounts as follows.
1. On each RAC node, create the
mount point directory exactly as it appears on each remote node. For
example, for the server AULTLINUX2, the command to create the mount
directory for the archive directory on AULTLINUX 1 would be:
$ mkdir /usr/backup/ault_rac1/archives1
2. On each RAC node, the
MOUNT command would be used to mount the NFS drive(s) from the other
nodes. This is done using the mount directory created in the
previous step. The example setup would be:
Once the directories are
cross-mounted, the process can then continue.
The configuration of NFS mount
points on Solaris 9 would be done using manual commands:
1. Start the NFS server:
2. Set up the shares:
# share -F
nfs -o rw=v10gsolaris2 /usr/backup/ault_rac1/archives1
3. Verify the shares are
available on the target box:
# dfshares -F
4. On the target box, start the
5. On the target box, create the
required mount directory:
# mkdir /usr/backup/ault_rac1/archives1
6. On the target, mount the
# mount -F
nfs -o rw v10gsolaris1:/usr/backup/ault_rac1/archives1
Make sure the mount directory is
created with the owner and group that will have access to the
cross-mounted directory tree.
In Windows2000, the drives are
shared across the network to achieve the same functionality.
The log_archive_format parameter
determines the format of the archive logs that have been generated.
It must be the same on all clustered nodes. The format strings
allowed for log_archive_format are:
%T -- Thread number,
left-zero-padded so LOG_ARCHIVE_FORMAT = ault_%T would be ault_0001
%t -- Thread number,
non-left-zero-padded so LOG_ARCHIVE_FORMAT = ault_%t would be ault_1
%S -- Log sequence number,
left-zero-padded, so LOG_ARCHIVE_FORMAT = ault_%S would be
%s -- Log sequence number,
non-left-zero_padded, so LOG_ARCHIVE_FORMAT = ault_%s would be
The format strings can be
combined to show both thread and sequence number. The %T or %t
parameters are required for RAC archive logs.
In order to perform a complete
recovery, a database, whether it is a normal database or a RAC
database, must use archive logging. In order to turn on archive
logging in RAC, the following procedure should be used:
1. Shut down all instances
associated with the RAC database.
2. Choose one instance in the
RAC cluster. In its unique initialization parameter file set the
cluster_database parameter to false. If a server parameter
file is being used, <sid.> should be appended to the parameter.
3. In the instance parameter
file, the log_archive_dest_n, log_archive_format and
log_archive_start parameters should be set for the example
v10g2.LOG_ARCHIVE_DEST_2 = "LOCATION=/u01/backup/ault_rac2
LOG_ARCHIVE_FORMAT = ault_%T_%s
LOG_ARCHIVE_START = TRUE
4. Start the instance.
$ sqlplus /nolog
SQL> connect / as sysdba
Connected to an idle instance
5. Execute the following command
from the SQL*PLUS session:
6. Shut down the instance.
7. Edit the instance
initialization parameter file or server parameter file to reset
cluster_database to TRUE.
Restart the instances.