Shell Script
to migrate all technical components in a single step
to migrate all technical components in a single step
The
below query will help us to migrate all the components from one instance to
another instance.
below query will help us to migrate all the components from one instance to
another instance.
Basically
we need to the below steps before executing the Shell script which is defined
as Reusable component.
we need to the below steps before executing the Shell script which is defined
as Reusable component.
- Create all the LDT
Files for the concurrent programs, data definition - Copy the DB
Objects/LDT Files/Form Personalization or any scripts which we are going
to migrate in UNIX Server. - Create directory as
in the shell script in the server so that it will pick the objects and
execute from the server - Execute the below shell
script. - It will prompt for
Custom Schema and Database Schema(APPS) - Once provided it will
execute all the scripts one by one
#=======================================================================
#
#
MODULE NAME : MIG_SCR.sh
MODULE NAME : MIG_SCR.sh
#
DESCRIPTION : This script is used to register DB Objects/Reports Concurrent
Program/Data Definition
DESCRIPTION : This script is used to register DB Objects/Reports Concurrent
Program/Data Definition
#
#
#
Change Record:
Change Record:
#
=============
=============
#
VERSION DATE AUTHOR(S) Remarks
VERSION DATE AUTHOR(S) Remarks
#
======== ============ =============== ============
======== ============ =============== ============
#
#===============================================================================+
CURRDIR=`’pwd’`
#——————————————————————————-+
#
Database Login Check Function |
Database Login Check Function |
#——————————————————————————-+
DBLOGINCHECK(){
oradata=`sqlplus -s <<-EOI
$1
set
echo off;
echo off;
set
feedback off;
feedback off;
set
verify off;
verify off;
whenever
oserror exit failure;
oserror exit failure;
whenever
sqlerror exit failure;
sqlerror exit failure;
select
sysdate from dual;
sysdate from dual;
exit;
EOI`
sqlerr=$?
if [ $sqlerr -ne 0 ]; then
echo “N”
else
if ! [
“$oradata” ]; then
“$oradata” ]; then
echo
“N”
“N”
else
echo
“Y”
“Y”
fi
fi
}
custlogin=”$1″
#——————————————————————————-+
#
Checking the Csutom Schema Login details
|
Checking the Csutom Schema Login details
|
#——————————————————————————-+
while
[ “$custlogin” = “” -o `DBLOGINCHECK
“$custlogin”` = “N” ]
[ “$custlogin” = “” -o `DBLOGINCHECK
“$custlogin”` = “N” ]
do
if [ “$custlogin” = “”
];then
];then
echo “Enter Custom Schema
Login Userid/Passwd : “
Login Userid/Passwd : “
read custlogin
else
echo “XXCUST Login Userid and
Password entered is not CORRECT”
Password entered is not CORRECT”
custlogin=””
fi
done
echo
“XXCUST Connection Successful”
“XXCUST Connection Successful”
dblogin=”$1″
#——————————————————————————-+
#
Checking the APPS Login details |
Checking the APPS Login details |
#——————————————————————————-+
while
[ “$dblogin” = “” -o `DBLOGINCHECK “$dblogin”` =
“N” ]
[ “$dblogin” = “” -o `DBLOGINCHECK “$dblogin”` =
“N” ]
do
if [ “$dblogin” = “”
];then
];then
echo “Enter APPS Login
Userid/Passwd : c”
Userid/Passwd : c”
read dblogin
else
echo “APPS Login Userid and
Password entered is not CORRECT”
Password entered is not CORRECT”
dblogin=””
fi
done
echo
“APPS Connection Successful”
“APPS Connection Successful”
#——————————————————————————-+
# DB
Objects Creation -View |
Objects Creation -View |
#——————————————————————————-+
if
sqlplus -s $dblogin @$CURRDIR/View/XX_AP_UNAPP_VIEW.sql $dblogin
sqlplus -s $dblogin @$CURRDIR/View/XX_AP_UNAPP_VIEW.sql $dblogin
then
echo “XX_AP_UNAPP_VIEW View Creation
is successful ”
is successful ”
else
echo “XX_AP_UNAPP_VIEW View Creation
is not successful”
is not successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
#——————————————————————————-+
#
Package Creation |
Package Creation |
#——————————————————————————-+
if
sqlplus -s $custlogin @$CURRDIR/Package/PackageSpecification/XX_FIN_REP_PKG.pks
$custlogin
sqlplus -s $custlogin @$CURRDIR/Package/PackageSpecification/XX_FIN_REP_PKG.pks
$custlogin
then
echo “XX_FIN_REP_PKG.pks Package Spec
Creation is successful ”
Creation is successful ”
else
echo “XX_FIN_REP_PKG.pks Package
creation is not successful”
creation is not successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
if
sqlplus -s $custlogin @$CURRDIR/Package/PackageBody/XX_FIN_REP_PKG.pkb $custlogin
sqlplus -s $custlogin @$CURRDIR/Package/PackageBody/XX_FIN_REP_PKG.pkb $custlogin
then
echo “XX_FIN_REP_PKG.pkb Package Body
Creation is successful ”
Creation is successful ”
else
echo “XX_FIN_REP_PKG.pkb Package Body
creation is not successful”
creation is not successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit
1
1
fi
#——————————————————————————-+
#
Sample Step to create Concurrent program
Sample Step to create Concurrent program
#——————————————————————————-+
echo
“Starting upload of Concurrent definitions for BR Report”
“Starting upload of Concurrent definitions for BR Report”
if
FNDLOAD $dblogin 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
./LDTFiles/Reports/XXBRREP_CP.ldt – WARNING=YES UPLOAD_MODE=REPLACE
CUSTOM_MODE=FORCE
FNDLOAD $dblogin 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
./LDTFiles/Reports/XXBRREP_CP.ldt – WARNING=YES UPLOAD_MODE=REPLACE
CUSTOM_MODE=FORCE
then
echo
echo “Successfully uploaded concurrent
program definition for: BR Report”
program definition for: BR Report”
echo
else
echo
echo “Failed while uploading the
concurrent program definition for: BR
Report”
concurrent program definition for: BR
Report”
echo
fi
#——————————————————————————-+
# Upload
all the Data Definition and Templates |
all the Data Definition and Templates |
#——————————————————————————-+
echo
“Starting upload of Data Definition and Template”
“Starting upload of Data Definition and Template”
if
FNDLOAD $dblogin 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct
./LDTFiles/DataDefn/XX_CUSTOM_TAXPRNDEF.ldt
FNDLOAD $dblogin 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct
./LDTFiles/DataDefn/XX_CUSTOM_TAXPRNDEF.ldt
then
echo
echo “Successfully uploaded Data
Definition and Template for: Tax Report “
Definition and Template for: Tax Report “
echo
else
echo
echo “Failed while uploading the Data
Definition and Template for: Tax
Report”
Definition and Template for: Tax
Report”
echo
fi
#——————————————————————————-+
#
Upload Function |
Upload Function |
#——————————————————————————-+
if
sqlplus -s $custlogin @$CURRDIR/Function/XX_AMOUNT_TO_WORDS.fnc $custlogin
sqlplus -s $custlogin @$CURRDIR/Function/XX_AMOUNT_TO_WORDS.fnc $custlogin
then
echo “Function creation is successful
”
”
else
echo “Function creation is not
successful”
successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo
“Aborting……”
“Aborting……”
exit 1
fi
#——————————————————————————-+
#
Execute DB Objects |
Execute DB Objects |
#——————————————————————————-+
if
sqlplus -s $custlogin @$CURRDIR/DBObjects/XX_TABLE.sql $custlogin
sqlplus -s $custlogin @$CURRDIR/DBObjects/XX_TABLE.sql $custlogin
then
echo “Table creation is successful
”
”
else
echo “Table creation is not
successful”
successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
#——————————————————————————-+
#
Upload Procedure |
Upload Procedure |
#——————————————————————————-+
if
sqlplus -s $custlogin @$CURRDIR/Procedure/XX_PROC.prc $custlogin
sqlplus -s $custlogin @$CURRDIR/Procedure/XX_PROC.prc $custlogin
then
echo “Procedure creation is successful
”
”
else
echo “Procedure creation is not
successful”
successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
#——————————————————————————-+
#
Grants
|
Grants
|
#——————————————————————————-+
if
sqlplus -s $custlogin @$CURRDIR/Grants/grants.sql $custlogin
sqlplus -s $custlogin @$CURRDIR/Grants/grants.sql $custlogin
then
echo “grants is successful ”
else
echo “grants is not successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
#——————————————————————————-+
#
Synonyms
|
Synonyms
|
#——————————————————————————-+
if
sqlplus -s $dblogin @$CURRDIR/Synonyms/synonym.sql $dblogin
sqlplus -s $dblogin @$CURRDIR/Synonyms/synonym.sql $dblogin
then
echo “Synonyms is successful
”
”
else
echo “Synonyms is not successful”
echo “In the Login id: $dblogin”
echo “Please check and rerun”
echo “Aborting……”
exit 1
fi
Sheeba Satish
Recent Posts