Documente Academic
Documente Profesional
Documente Cultură
[ajithpathiyil1::oracle]> TGT_HOST=ajithpathiyil2.lab.com
[ajithpathiyil1::oracle]>.
/u01/app/oracle/fusion/mw_1/wlserver_10.3/server/bin/setWLSEnv.sh
[ajithpathiyil1::oracle]>SRC_CLONE_DIR=${MW_HOME%/*}/clone/${TGT_HOST}
[ajithpathiyil1::oracle]>TGT_CLONE_DIR=/u01/app/oracle/fusion/clone/${TGT_HO
ST}
If this directory existed, there may be some files there left from previous cloning. You
need to delete them.
Create directory for clone files on the target environment (you are doing it from the
source environment console, enter password if needed)
[ajithpathiyil1::oracle]> ssh $TGT_HOST mkdir -p $TGT_CLONE_DIR
You must perform these actions once per WebLogic software home.
Prepare JDK for cloning (you may skip this step if you want to install JDK on the target
environment from installation package)
[ajithpathiyil1::oracle]> JAVA_CLONE_FILE=$SRC_CLONE_DIR/java.tgz
[ajithpathiyil1::oracle]> [ -f $JAVA_CLONE_FILE ] && rm $JAVA_CLONE_FILE
[ajithpathiyil1::oracle]> cd $JAVA_HOME/..
[ajithpathiyil1::oracle]> tar czf - ${JAVA_HOME##*/} > $JAVA_CLONE_FILE
You must perform these actions once per WebLogic software home. All domains you
need to clone from this WebLogic home will be prepared at once.
Set the environment variable for the file containing a domain list
[ajithpathiyil1::oracle]> DOMAIN_LIST_FILE=$SRC_CLONE_DIR/domain_list.txt
Prepare list of WebLogic domain directories in the source environment
[ajithpathiyil1::oracle]> cat /dev/null > $DOMAIN_LIST_FILE
> grep "domain location" $MW_HOME/domain-registry.xml | while read line
> do
> line=${line#*
> line=${line%\"/>}
> echo $line >> $DOMAIN_LIST_FILE
> done
[ajithpathiyil1::oracle]>
Observe your source domain directories in the prepared file; remove those you do not
want to clone.
[ajithpathiyil1::oracle]> vi $DOMAIN_LIST_FILE
Prepare the domains from the created list for cloning
[ajithpathiyil1::oracle]> cat $DOMAIN_LIST_FILE | while read DOMAIN_HOME
> do
> DOMAIN_NAME=${DOMAIN_HOME##*/}
> . $DOMAIN_HOME/bin/setDomainEnv.sh
> DOMAIN_CLONE_FILE=$SRC_CLONE_DIR/${DOMAIN_NAME}.jar
> [ -f $DOMAIN_CLONE_FILE ] && rm $DOMAIN_CLONE_FILE
> $WL_HOME/common/bin/pack.sh -domain=$DOMAIN_HOME -
template=$DOMAIN_CLONE_FILE
> -template_name=$DOMAIN_NAME
> done
[ajithpathiyil1::oracle]>
Review the prepared archives (you may need to parallelize copy process if archives size
is too large).
[ajithpathiyil1::oracle]> ll $SRC_CLONE_DIR
You must perform these actions once per WebLogic software home.
b.2.1 Environment variables
Set up the following environment variables:
JAVA_HOME – JDK home directory
[ajithpathiyil2::oracle]> JAVA_HOME=$MW_HOME/java/jdk
[ajithpathiyil2::oracle]> PATH=$JAVA_HOME/bin:$PATH
[ajithpathiyil2::oracle]> export JAVA_HOME PATH
Run restore.sh
[ajithpathiyil2::oracle]> cd $MW_HOME/utils/clone
[ajithpathiyil2::oracle]> chmod u+x ./restore.sh
[ajithpathiyil2::oracle]>./restore.sh $JAVA_HOME
You must perform these actions once per WebLogic software home except item 3.3.4
with sub-items which must be repeated for each domain.
b.3.1. Environment variables
Set server environment
[ajithpathiyil2::oracle]>. $WL_HOME/server/bin/setWLSEnv.sh
Check values of environment variables
[ajithpathiyil2::oracle]> for var in MW_HOME WL_HOME JAVA_HOME
TGT_CLONE_DIR
> do
> echo $var" = "`eval echo '$'$var`
> done
You can check the domain names existing on the target environment by
[ajithpathiyil2::oracle]> ll $MW_HOME/../user_projects/domains
Open the domain list for editing
[ajithpathiyil2::oracle]> vi $TGT_CLONE_DIR/domain_list.txt
Enter new domain names next to the domain directories listed in the file. Use space as a
delimiter.
For example
[ajithpathiyil2::oracle]>
/u01/app/oracle/otc1d_cl/wlserver/user_projects/domains/ajith_domain ajithclone
Save the domain list.
b.3.3. Restore domains
If directory $HOME/dbs does not exist, create it
[ajithpathiyil2::oracle]> mkdir $HOME/dbs
Restore all domains specified in the domain list in cycle at once.
Links to the domain environment files will also be created.
[ajithpathiyil2::oracle]> cat $TGT_CLONE_DIR/domain_list.txt | while read
DOMAIN_LINE
> do
> SRC_DOMAIN_HOME=`echo $DOMAIN_LINE | cut -d' ' -f 1`
> SRC_DOMAIN_NAME=${SRC_DOMAIN_HOME##*/}
> TGT_DOMAIN_NAME=`echo $DOMAIN_LINE | cut -d' ' -s -f 2`
> TGT_DOMAIN_NAME=${TGT_DOMAIN_NAME:-$SRC_DOMAIN_NAME}
>
TGT_DOMAIN_HOME=${MW_HOME%/*}/user_projects/domains/$TGT_DOMAIN
_NAME.
> echo "Unpacking domain "$SRC_DOMAIN_NAME" as "$TGT_DOMAIN_NAME" to
"$TGT_DOMAIN_HOME
> $WL_HOME/common/bin/unpack.sh -domain=$TGT_DOMAIN_HOME
> -template=$TGT_CLONE_DIR/${SRC_DOMAIN_NAME}.jar
> ln -s $TGT_DOMAIN_HOME/bin/setDomainEnv.sh ~/dbs/init_`echo
${TGT_DOMAIN_NAME}
> | tr [:lower:][:upper:]`_wl.sh
> done
Sample output
Unpacking domain ajith_domain1 as ajithclone to
/u01/app/oracle/fusion/user_projects/domains/ajithclone
<< read template from "/u01/app/oracle/fusion/clone/ajith_domain_apps.jar"
>> succeed: read template from
"/u01/app/oracle/fusion/clone/ajith_domain_apps.jar"
<< write Domain to "/u01/app/oracle/fusion/user_projects/domains/ajithclone"
...............................................................................................
>> succeed: write Domain to
"/u01/app/oracle/fusion/user_projects/domains/ajithclone"
<< close template
>> succeed: close template
3. Click 'myrealm'
9. Click 'Save'
6. Enter the new Node Manager password into the fields 'NodeManager Password' and
'Confirm NodeManager Password'
7. Click 'Save'
9. Click 'Save'
6. You may click on button to periodically refresh the table and observe the status of the
starting servers.