
Installgen
Features and Benefits
Installgen
Demo Available for download...

#!/bin/sh
# script: 6_sol_901_prep_copyoracle_nfs_1.sh
# Features: This shell script mounts Oracle installer CD images via NFS
# then copies the contents to the hard drive of the server.
#
# Note: This script will require customization if the oracle
# owner account path differs between the servers.
#
# Script Sequence#: 6
# Used By: run manually as root UNIX user
# Copyright 2002 by .com Solutions Inc.
#
# ---------------------- Revision History ---------------
# Date By Changes
# 9-27-2001 dsimpson Initial Release
# 9-30-2001 dsimpson Added use of environment variables for paths
# 5-06-2002 dsimpson Removed unused cd name variables.
# fixed variable name typos, now uses
# 1st additional hostname entered in the GUI as
# the NFS server, and verifies that the root user is
# running this script.
# 10-30-2002 dsimpson Added support for Oracle 9.2.0
# This output file was created by Installgen version 1.38 on Sun Nov 10 14:51:56 2002. By .com Solutions Inc. www.dotcomsolutionsinc.net
# define globally used paths/variables
#ORACLE_OWNER=oracle
ORACLE_OWNER_PATH1=/export/oracle # Source server pathname
ORACLE_OWNER_PATH2=/export/oracle # Destination server pathname
ORACLE_GROUP=dba
#ORACLE_HOME=/u01/v901
#ORACLE_SID=prod1
#define globally used paths/variables
cd1_src_directory=$ORACLE_OWNER_PATH1/901_cd1
cd2_src_directory=$ORACLE_OWNER_PATH1/901_cd2
cd3_src_directory=$ORACLE_OWNER_PATH1/901_cd3
cd1_dest_directory=$ORACLE_OWNER_PATH2/901_cd1
cd2_dest_directory=$ORACLE_OWNER_PATH2/901_cd2
cd3_dest_directory=$ORACLE_OWNER_PATH2/901_cd3
cd1_nfs_directory=$ORACLE_OWNER_PATH2/901_cd1_nfs
cd2_nfs_directory=$ORACLE_OWNER_PATH2/901_cd2_nfs
cd3_nfs_directory=$ORACLE_OWNER_PATH2/901_cd3_nfs
# make sure the root user is running this script
if [ ! $LOGNAME = "root" ]
then
# the user running this script is not root - exit
echo "You must be logged in as the root user to run this script, exiting...."
# exit immediately!
exit
fi
# create directories for the contents of the CDs
mkdir $cd1_dest_directory
mkdir $cd2_dest_directory
mkdir $cd3_dest_directory
# create directories for the NFS mount points of the CDs
mkdir $cd1_nfs_directory
mkdir $cd2_nfs_directory
mkdir $cd3_nfs_directory
# mount the directories across the network
mount -F nfs -o ro host2:$cd1_src_directory $cd1_nfs_directory
mount -F nfs -o ro host2:$cd2_src_directory $cd2_nfs_directory
mount -F nfs -o ro host2:$cd3_src_directory $cd3_nfs_directory
# copy the CD data via NFS to the OEM server's hard drive
echo "Copying Oracle 9.0.1 CD #1 via NFS.";
cd $cd1_nfs_directory; tar cf - . | (cd $cd1_dest_directory ; tar xfp -)
cd ..
echo "Copying Oracle 9.0.1 CD #2 via NFS.";
cd $cd2_nfs_directory; tar cf - . | (cd $cd2_dest_directory ; tar xfp -)
cd ..
echo "Copying Oracle 9.0.1 CD #3 via NFS.";
cd $cd3_nfs_directory; tar cf - . | (cd $cd3_dest_directory ; tar xfp -)
cd ..
# unmount the NFS shares since the data has been copied.
umount $cd1_nfs_directory
umount $cd2_nfs_directory
umount $cd3_nfs_directory

