ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 利用UNIX的SHELL文件进行EBS客制化程序安装

利用UNIX的SHELL文件进行EBS客制化程序安装

Linux操作系统 作者:zangchangyu 时间:2015-09-10 14:01:30 0 删除 编辑
SHELL文件可帮助DBA直接在UNIX SHELL中进行自助安装,简便快捷。
首先,开发人员需准备安装所需的各项源文件,包括如下:
1. FMB 文件(FORM源文件):用来生成编译文件
2. SQL 文件(数据库对象安装文件):用来安装数据库对象,包知表,序列,视图,同义词,过程,包等
3. LDT 文件(FNDLOAD生产的文件):用来安装EBS中注册信息
把上述文件全部上传到一个目录中,一般可选择客制化应用目录中的INSTALL中.这中间要注意如下事项:
1. FMB 以BINARY 方式上传.其它文件以ASCII方式上传
2. SQL文件中需在最后加上EXIT;,用来退出.
3.目录及文件需赋予相应的读写权限(chmod 664 xxxx.ldt)
 
然后建立SHELL文件,主要完成如下事项:
1.执行SQL文件,生成数据库对象
2.拷贝FMB至AU_TOP,编译后的FMX文件放入客制应用的FORM/US目录
3.UPLOAD LDT文件
 
最后由DBA执行SHELL文件:
>sh xxxx.sh
 
下面是SHELL文件的一个示例:
#!/usr/bin/sh
# +==================================================================================+
# |                           ABeam Consulting                                                         |
# |==================================================================================|
# |                                                                                                              |
# | Name       : XXARDREMIT_INSTALL.sh                                                     |
# |                                                                                                              |
# | Description: This script. will move all the files to their respective directories.    |
# |              It will execute the package creation and Upload LDT for Agent       |
# |              Portfolio Assignment form.                                                          |
# |                                                                                                              |
# | Change History:                                                                                      |
# | ---------------                                                                                              |
# | Version    Date        Author                Remarks                                          |
# | --------  -----------  -------------------   ----------------------------------                              |
# | 1.0       20-Mar-2008  Tony  Liu          Baseline                                         |
# |                                                                                                              |
# +==================================================================================+
LOG_DIR=$XXAR_TOP/log
OUT_DIR=$XXAR_TOP/out
SQL_DIR=$XXAR_TOP/sql
BIN_DIR=$XXAR_TOP/bin
FORMS_DIR=$XXAR_TOP/forms/US
BIN_DIR=$XXAR_TOP/bin
COMP_DIR=$AU_TOP/forms/US
INSTALL_DIR=$XXAR_TOP/install/CASH204

echo `date` > $INSTALL_DIR/XXARDREMIT_INSTALL.out
# ************************************************************************************
#  Copying files to respective directories
# ************************************************************************************
cp $INSTALL_DIR/XXARDREMIT.fmb    $COMP_DIR/XXARDREMIT.fmb
# ************************************************************************************
#  Copying files to respective directories
# ************************************************************************************

# ************************************************************************************
#  Assigning permission to respective files
# ************************************************************************************
chmod 664 $INSTALL_DIR/XXARDREMIT_VIEW.sql
chmod 664 $INSTALL_DIR/XXARDREMIT_FUNC.ldt
chmod 664 $INSTALL_DIR/XXARDREMIT_MENU.ldt
# ************************************************************************************
#  Function to Check the validity of loginids and password.
# ************************************************************************************
CHKLOGIN(){
     if sqlplus -s /nolog </dev/null 2>&1
          WHENEVER SQLERROR EXIT 1;
          CONNECT $1 ;
   EXIT;
!
    then
        echo OK
    else
        echo NOK
    fi
}

XXARID="$1"
APPSID="$2"
# ************************************************************************************
#  Check if APPS Login Id is entered else prompt to get it
# ************************************************************************************
while [ "$APPSID" = "" -o `CHKLOGIN "$APPSID"` = "NOK" ]
do
    if [ "$APPSID" = "" ];then
            echo "Enter APPS Userid/Passwd : \c"
            read APPSID
    else
        echo "Enter APPS Userid/Passwd : \c"
        APPSID=""
    fi
done
# ************************************************************************************
#  Check if XXAR Login Id is entered else prompt to get it
# ************************************************************************************
#while [ "$XXARID" = "" -o `CHKLOGIN "$XXARID"` = "NOK" ]
#do
#   if [ "$XXARID" = "" ];then
#            echo "Enter XXAR Userid/Passwd : \c"
#            read XXARID
#    else
#        echo "Enter XXAR Userid/Passwd : \c"
#        XXARID=""
#    fi
#done
# ************************************************************************************
#  Call SQL Script. to create Package Specification XXARDREMIT_VIEW.sql in APPS
# ************************************************************************************
echo " "
echo " Installing Database Objects XXARDREMIT_VIEW.sql"
if sqlplus -s $APPSID @$INSTALL_DIR/XXARDREMIT_VIEW.sql >> $INSTALL_DIR/XXARDREMIT_VIEW.out
then
    echo " Installation of Create Database Objects for Remittance Maintenance Screen successful"
    echo " "
  
else
    echo "Installation of Create Database Objects for Remittance Maintenance Screen not successful"
    echo "Any of the Login ids: $XXARID, $APPSID"
    echo "Please check and rerun"
    echo "Aborting......"
    exit 1
fi

# ************************************************************************************
#  Compiling FMB under AU TOP directories
# ************************************************************************************
cd $AU_TOP/forms/US
echo " "
echo " Compiling form. XXARDREMIT.fmb......."
if f60gen userid=$APPSID module=XXARDREMIT.fmb module_type=form. batch=yes compile_all=special >> $INSTALL_DIR/XXARDREMIT_INSTALL.out
then
   echo " "
   echo " Form. XXARDREMIT.fmb Compiled successfully"
   echo " "
else
   echo " "
   echo "Error in compiling the XXARDREMIT.fmb Form."
   echo "Any of the Login ids: $XXARID, $APPSID"
   echo "Please check and rerun"
   echo "Aborting......"
   exit 1
fi
# *******************************************************************
# Copy the FMX to $XXAR_TOP/forms/US directory
# *******************************************************************
echo " "
echo " Copying executable Form. file......."
if mv $AU_TOP/forms/US/XXARDREMIT.fmx $XXAR_TOP/forms/US/XXARDREMIT.fmx
then
   echo " "
   echo " Copied the form. XXARDREMIT.fmx from AU_TOP to XXAR_TOP"
   echo " "
else
   echo " "
   echo "Error in Copying the form. XXARDREMIT.fmx from AU_TOP to XXAR_TOP."
   echo "Any of the Login ids: $XXARID, $APPSID"
   echo "Please check and rerun"
   echo "Aborting......"
   exit 1
fi
# *******************************************************************
# Uploading  Form. & Function LDT
# *******************************************************************
echo " "
echo " Uploading Form. Function LDT for Remittance Maintenance Screen Form......."
if FNDLOAD $APPSID 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct  $INSTALL_DIR/XXARDREMIT_FUNC.ldt - CUSTOM_MODE=FORCE >> $XXARDREMIT_INSTALL.out
then
    echo " "
    echo "  Uploading of Remittance Maintenance Screen Form. Function LDT successful!"
    echo " "
 
else
    echo " "
    echo "  Error in Uploading Remittance Maintenance Screen Form. Function LDT."
    echo "Any of the Login ids: $XXARID, $APPSID"
    echo "Please check and rerun"
    echo "Aborting......"
    exit 1
fi
# *******************************************************************
# Uploading  Menu LDT
# *******************************************************************
echo " "
echo " Uploading Menu LDT for Remittance Maintenance Screen Form......."
if FNDLOAD $APPSID 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct  $INSTALL_DIR/XXARDREMIT_MENU.ldt - CUSTOM_MODE=FORCE >> $XXARDREMIT_INSTALL.out
then
    echo " "
    echo "  Uploading of Remittance Maintenance Screen Menu LDT successful!"
    echo " "
 
else
    echo " "
    echo "  Error in Uploading Remittance Maintenance Screen Menu LDT."
    echo "Any of the Login ids: $XXARID, $APPSID"
    echo "Please check and rerun"
    echo "Aborting......"
    exit 1
fi
# *******************************************************************
#  End of Installation Script
# *******************************************************************

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26373197/viewspace-1796354/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-09-01

  • 博文量
    42
  • 访问量
    24972