首页 > 商品管理 > RMS 12 安装日志

RMS 12 安装日志

/*********************************************************************
======                Hand Co,ltd                            =========
======                Copy Right 2008-2009 Reserved          =========
======                RMS安装日志                            =========
–Created by       :  yunfang.shang@hand-china.com
–Creation Date    :  2008-9-11
–Version          :  1.0 
======                Update History                         =========
–2008-9-11  version 1.0  created

**********************************************************************/
1\ 安装oracle Enterprise linux 4.4 x86_64
   注意点:
   1.1 交换分区根据Oracle 的要求:2G<内存<=4G 时;交换分区大小=内存大小。
   内存>8G  时;交换分区大小=内存大小*0.75 ;在后来安装数据库时这会作为一个检察点。
   1.2 安装时选择关闭防火墙;关闭SElinux;Selinu会阻止启动数据库的sqlplus运行。
   1.3 完成后,要上传文件,远程Sftp要求使用SecureFX6.0 好用,速度快,无2G大小限制。(WS_FTP太差了)

2\ 安装oracle Database 10GR2 ,一定要10GR2这个版本,不能安装11G;因为RMS数据库提供init.ora是针对 10GR2 的 。
   这步安装没有特别要说明的。按照安装包中自带的快速安装指南进行即可,所有的package都能在光盘上找到。
   标准安装说明文档中在pre-install 中对64位的DB安装需要的Package 要求说明不太清楚。这里强调2点:
   1)基本上,和C ,C++相关的Package 都要求64位和32位的Package同时存在。
   2)实际安装的是否发现快速指南中还是漏了几个Package. 标准说明文档中在pre-install 章节 漏了N个package libaio-0.3.105-2
      和xorg-x11-deprecated-libs-6.8.2-31.i386.rpm 后一个在安装的时候,使用图形化安装,它会自动检查关联性,并提示插入第一章光盘。
      这个package 中有个库是OUI要用到的,否则安装到第一步就不能继续了。
    
   为了方便再次安装,把这些容易遗漏的package 都整理在rpms目录中了。 

3\ 打数据库patch 从10.2.0.1 升级到 10.2.0.3

   10.2.0.3 是个补丁,超大有1G多。p5337014_10203_Linux-x86-64.zip
   按照补丁中的文档进行安装即可;一般没什么问题(先备份,然后再安装)
   postinstall部分主要参考 7.2 Upgrading Oracle Database 10g Release 10.2.0.x to Oracle Database 10g Release 10.2.0.3 把orcl数据库升级一下(看看效果);
   特别注意更改权限这一步是必须做的。其他不用做。
   cd $ORACLE_HOME/install
   ./changePerm.sh
   
   升级完成后,默认的数据库是启动状态的;可以使用web版的dbconsole察看http://hostname:1158/em (sys/hello 登陆)进入后可以看到升级后的orcl数据库版本是10.2.0.3

   安装完成后,启动,关闭数据库; 启动关闭web版的dbconsole 的脚本均在$ORACLE_HOME/bin目录下。运行前要先export ORACLE_HOME 和 ORACLE_SID 变量。
   关闭数据库:
   $ cd $ORACLE_HOME/bin
   $ ./emctl stop dbconsole
   $ ./isqlplusctl stop
   $ ./sqlplus ‘/as sysdba’
   sql> shutdown immediate
   $ ./lsnrctl stop

4\ 打数据库Patch 5397953

   按照Patch中的Readme操作即可.
   注意: 使用opatch需要export $ORACLE_HOME
  
  
  
  
5\ 安装RMS

   5.1 安装 Oracle application Server (Forms Services and Reports Services)
       选择 edelivery 下载 B24489-01.zip Oracle application Forms Services and Reports Services 10.1.2.0.2
       按照 ddelivery 下载的文档B25260-01中的安装指南进行安装。
       备注,因为我们的Demo环境是在同一台机器上安装数据库和application Server; 安装数据库是所做的Pre-install动作已经完全满足application Server的pre-install. 所以,安装application Server 时如果还是以oracle用户进行,就基本不需要再考虑pre-install动作.
       只需要注意一下两点:
   
       a) 检查 /etc/sysctl.conf 文件, 如果缺少或者小于如下配置,则修改或加入如下参数:
            kernel.msgmnb = 65535
            kernel.msgmni = 2878
            kernel.shmmax = 4294967295
            kernel.sem = 256 32000 100 142
           
       b) 添加一个package  openmotif21-2.1.30-11.RHEL4.6.i386.rpm          
      

       可以到安装目录直接开始安装. 唯一要考虑的问题是各种服务的端口问题.这个可以参考安装文档. 我认为下面在安装rpm的时候需要 更高版本的application server ,也就是需要在同一台机器上安装多个application server,所以在下面安装rpm需要的application server时 必须使用自定义的端口,否则很容易引起冲突. 我认为一个偷懒的办法是: 在安装下一个application Server以前,先把前几个application Server 打开. 这样相应的端口都全部在占用中,新的安装会自动选择别的端口.

       在/d01/app/ 下建立一个oracleas 目录用于安装application server
       到安装目录,开始安装.

       指定instance name 的时候,输入formreportsvr,hello1,hello1

      

   5.2 安装 RMS Database

      5.2.1 根据RMS安装文档(rms-120-ig.pdf)进行安装。

      5.2.2 对于Linux平台的安装,在安装前,使用Patch 5985761 更新安装文件;根据patch 中的seed_data/readme/readme.txt 文件进行 更新。(参考rms-120-ig-addendum.pdf)
  
      5.2.3安装RMS数据库时,对于linux平台,按照文档下载的patch 5985761 运行./partition.ksh 报错,产生分区表的DDL,
      注意这个脚本要运行成功必须先根据Excel的分区策略中描述的算法先完成配置文件partition_attributes.cfg的填写
      和数据定义文件的填写。这个工作量还是有点大的。如果不这么做,配置文件内容不完整,脚本运行肯定是失败的。
      对于测试坏境,因为基本不涉及性能问题,所以可以不运行这个脚本,但是对于正式环境是必须的。

      5.2.4 创建RMS数据库;按照RMS12的安装指南进行到 “Create the RMS Database(安装RMS数据库)”时,
      转到补充安装文档rms-120-ig-addendum.pdf的 Database Installation Tasks Update 章节。
     
            创建目录,/d01/app/retail/rms/db,把rms12dbserver.zip 上传到此目录,解压缩。
            因为是linux安装,有些脚本需要被Patch中的脚本替代,具体可参考  rms-120-ig-addendum.pdf Page14-16 
     
            5.2.4.1  SID 设置为SID=retl
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            cp $INSTALL_DIR/create_db/init102_release.ora $ORACLE_HOME/dbs/initRETL.ora
           
            创建OFA目录
            cd $ORACLE_HOME/admin
            mkdir retl
            cd retl
            mkdir adump
            mkdir bdump
            mkdir cdump
            mkdir dpdump
            mkdir pfile
            mkdir udump
            mkdir utl_file_tmp
            cd $ORACLE_HOME
            cd ./oradata    
            mkdir retl
        
           
            编辑initRETL.ora
            替换相应的目录
            端口设置为1521 (HOST=syfr12)(PORT=1521
            db_name=RETL
            备注:修改要仔细,确保Notes说明部分提到的需要修改的内容 都改了。
           
            编辑INSTALL_DIR/create_db/crdb1.sql  按脚本文件中的头上的要求操作即可
           
            sqlplus 登陆:
            cd $INSTALL_DIR/create_db
            $ORACLE_HOME/bin/sqlplus ‘/as sysdba’
            SQL>@crdb1.sql
           
            然后分别执行credb2.sql; credb3.sql
            最后,配置listen
            10g 默认使用的是动态注册,每个实例在启动的时候会根据initSID.ora中的local_listener进行动态注册。
            但前提是已经启动的listener,并且已经启动的linstener 的侦听端口与initSID.ora中的local_listener中描述的是一致的,否则动态注册不成功。
           
            (注意,先启动linstener,然后再启动实例,实例启动后要检查listener是否已经开始侦听可以使用lsnrctl status察看。)
           
            APPENDIX B 中提供的listener.ora 是错误的。缺少(ORACLE_HOME = …)
            正确的应该是这样的:      
#################################################################
# File: listener.ora
# Desc: Oracle Net8 listener file.
# Notes: Modify <hostname>
#################################################################

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =(SID_NAME = extproc_agent)
      (ORACLE_HOME = /d01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc) 
      (ENVS=’EXTPROC_DLLS=ANY’)
    )
  )
LISTENER =
 (DESCRIPTION_LIST =
  (DESCRIPTION =
    (PROTOCOL_STACK =(PRESENTATION = TTC)(SESSION = NS))
    (ADDRESS =(PROTOCOL = tcp)(HOST = syfr12)(PORT = 1521))
    (ADDRESS =(PROTOCOL = IPC)(KEY = extproc_key)))
  )
 
tnsname.ora 按要求改成了如下样子:
#################################################################
# File: tnsnames.ora
# Desc: Net Services configuration file.
# Note: Change these values: <service_name>, <oracle_sid>, <hostname>,
# <global_name>
#################################################################

EXTPROC_CONNECTION_DATA =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(Key = extproc_key)))
   (CONNECT_DATA = (SID = extproc_agent)))
EXTPROC_CONNECTION_DATA.world =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(Key = extproc_key)))
   (CONNECT_DATA = (SID = extproc_agent)))
ORCL =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(host = syfr12)(Port = 1521)))
   (CONNECT_DATA = (SID = orcl) (GLOBAL_NAME = orcl.world)))
ORCL.world =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(host = syfr12)(Port = 1521)))
   (CONNECT_DATA = (SID = orcl) (GLOBAL_NAME = orcl.world)))
RETL =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(host = syfr12)(Port = 1521)))
   (CONNECT_DATA = (SID = RETL) (GLOBAL_NAME = RETL.world)))
RETL.world =
 (DESCRIPTION =
   (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(host = syfr12)(Port = 1521)))
   (CONNECT_DATA = (SID = RETL) (GLOBAL_NAME = RETL.world)))
  
            
             创建Tablespace 按安装文档进行。无特殊说明
             创建RMS12DEV Schema  按安装文档进行。无特殊说明
            
            
       因为是linux安装,有些脚本需要被Patch中的脚本替代,具体可参考  rms-120-ig-addendum.pdf Page14-16   
 
           
       5.2.5 创建 RIB objects
      
             Create RIB Tables and Types:             
             cd $INSTALL_DIR/rib_objects/ddl
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rib12ddl.sql
            
             Create RIB Objects:
             cd $INSTALL_DIR/rib_objects/db_objects
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rms12rib.sql 
            
             Loading RIB Data: 这一步按照linux补充安装说明文档的要求,不要执行。
            
       5.2.6 创建 Pricing Objects    
      
             cd $INSTALL_DIR/pricing/types
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rpm12type.sql
             成功
            
             cd $INSTALL_DIR/pricing/ddl
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rpm12.sql            
             成功
            
             cd $INSTALL_DIR/pricing/db_objects
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rpm12dbo.sql  
             失败,大多数pacakge 编译通不过,打开文件看,原因是Type或者表不存在
             比如 type 定义 :OBJ_RPM_SYSTEM_OPTIONS_REC 不存在
             表 :item_master 不存在
             使用查找命令看是否存在于哪个文件中:
             find $INSTALL_DIR -type f -print | xargs grep “OBJ_RPM_SYSTEM_OPTIONS_REC”
            
             发现其定义在 $INSTALL_DIR/types/promo_api_objects.sql 中 但安装文档中是在下一章节安装RMS的时候才会安装这个脚本。
             看来需要先安装RMS对象,然后再回来运行一次@rpm12dbo.sql;
             或者是另一个办法更可行:因为这些对象虽然没有编译成功,但是都已经进入数据库,只是其状态为invalid;可以在完成RMS数据库对象安装后,再编译所有无效对象来解决这个问题.
             在多个模块安装,并且对象之间有相互依赖关系时,也只能这样处理了.
            
            
            
       5.2.7 创建 RMS Objects       
            
             cd $INSTALL_DIR/types
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rms12type.sql            
             成功
            
             cd $INSTALL_DIR/ddl
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rms12.sql            
             成功            
                      
             cd $INSTALL_DIR/db_objects
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rms12dbo.sql            
             成功             
           
             cd $INSTALL_DIR/ddl
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rms12b.sql            
             成功              
           
           
             编译所有无效对象,这一步可以解决无效对象问题,包括5.2.6中第3步的问题.
             cd $INSTALL_DIR/utility
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@inv_obj_comp.sql
            
             执行完后,用如下语句检查效果
             SELECT * FROM all_objects WHERE  owner=’RMS12DEV’ AND status =’INVALID’
             如果还有无效对象,则再次运行,直到无效对象数量为0            
             成功 
            
             Insert Data for Pricing:
            
             cd $INSTALL_DIR/pricing/data
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rpm12ctl.sql 
            
             Insert Data for RMS: (从这里开始,Page17-pg19 转到补充安装文档: rms-120-ig-addendum.pdf page16-page18)
             相关的脚本更新动作在所有脚本安装前已经完成.
            
             cd $INSTALL_DIR/data
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rmsseeddata.sql              

  有错误:            
  ‘Starting File: ribdoctypes.sql’
  Enter the username and password(username/password@database): rms12dev/rms12dev@RETL
  /bin/bash: sqlldr: command not found  
  
  Is Vat on? Y or N: Y
  What is the owner schema? rms12dev
  Is Vat_Class on? Y or N: Y
  Enter value for role_to_add: DEVELOPER
  Enter Calendar type to be used. (4)454 calendar. (C)Standard calendar. (4/C): C
  Enter week start – week end option. (1)Sat-Fri. (2)Sun-Sat. (3)Mon-Sun. (1/2/3): 2
  Enter date to be set as transaction date (vdate as DD-MON-YYYY): 11-SEP-2008
  Would you like to turn RTM on? Y or N – Y  
  second language : zhs
  prime language :  空格  ( 表示英语)
  
  结束,共一个错误:  sqlldr 没有找到,所以数据加载未成功,打开ribdoctypes.sql,可见其实际执行的动作:
  sqlldr &loginid control=rib_doctypes_rms.ctl data=rib_doctypes_rms.dat
  可以手工执行这个动作
  $ORACLE_HOME/bin/sqlldr rms12dev/rms12dev@RETL control=rib_doctypes_rms.ctl data=rib_doctypes_rms.dat
  
  这步完成后,全部成功.
  
      Insert Demo Data for RMS:
     
      备注:在运行这个脚本前,现执行如下语句,否则脚本运行时若干地方会出现主键或者唯一索引冲突。
      这个问题是安装时发现的,安装指南中未提及。
     
      CREATE TABLE system_options_bak AS SELECT * FROM system_options;
             DELETE FROM system_options WHERE base_country_id =’CN’;
             DELETE FROM doc_link where doc_type in (‘AI’,’BI’,’CS’);
             DELETE FROM cost_zone_group WHERE zone_group_id =1000;
     
             cd $INSTALL_DIR/data
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
             SQL>@rmsdemodata.sql  
            
                Enter the Base Country Id (2 characters): cn
  Enter the Primary currency: CNY
  Is Multi-channel on? Y or N: Y
  Is Bracket Costing on? Y or N: Y
  What is the owner schema? rms12dev
  Number of items to create:2000
  Transaction level: 1
  
             运行完毕,检查log ,如果有错误,需要根据错误,查看脚本进行更正。因为脚本逻辑比较简单,更正相对比较简单。就是费点时间。
            
             Insert Role Data into RMS: 这部分不需要做什么工作,相关的data在前面的步骤中已经完整,这里只是说明一下。
                       
  
        5.2.8 创建 Compile RMS batch libraries and programs
       
            这一步,是安装RMS Batch, 按照 rms-120-ig-addendum.pdf 说明,在RMS12.0.3 版本以前在Linux平台是不被支持的。
            需要下载 12.0.1,12.0.2,12.0.3 三个patch 分别完成代码拷贝后再按照rms-120-ig.pdf 进行。
            建立目录/d01/app/retail/rms/12.0.1 上传p5630151_1200_GENERIC.zip 解压缩
            建立目录/d01/app/retail/rms/12.0.2 上传p5858105_1200_GENERIC.zip 解压缩
            建立目录/d01/app/retail/rms/12.0.3 上传p5916780_1200_GENERIC.zip 解压缩
            分别完成代码拷贝(batch代码和Form,report,toolset代码,其中后者是为下面的Form,report,toolset安装服务的,
            Form,report这些文件如果没有更新到12.0.3版本,虽然编译都能通过,但使用时会遇到错误:
            打开任何一个Form,都报错 CONTOF@3LABL is not a member of %s2 (%s3))。
           
            which make makedepend
            makedepend找不到,安装xorg-x11-devel可以把这个添加到系统( 安装时依赖关系比较麻烦的建议使用图形化的install pacakge进行安装,可自动查找依赖关系,并提示插入第几张安装光盘,比使用rpm -ivh要方便很多)
           
            [Set Environment Variables]:
            su oretail
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            MMHOME=$INSTALL_DIR/rms
            export MMHOME
            MMUSER=rms12dev
            PASSWORD=rms12dev
            export MMUSER
            export PASSWORD
            LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH
            export LD_LIBRARY_PATH
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
            LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LIBRARY_PATH
            export LIBRARY_PATH
                  
           
            [Configure Make File]:
            su root
            chown -R oretail:dev /d01/app/retail
            su oretail
            cd $INSTALL_DIR/rms/oracle/lib/src
            cp platform_linux_oel_x86_64.mk platform.mk
            ./oramake
           
            #备注:假设前面数据库10.2.0.3patchse打完后没有在postinstall步骤运行changePerm.sh,那么会报错:
            #$ORACLE_HOME/precomp/lib/env_precomp.mk 没有读权限。因为这个文件的打数据库的10.2.0.3 patchset的时候,访问被受限了。
            su oracle
            cd $ORACLE_HOME/install
            ./changePerm.sh
            大约2分钟运行完毕。
           
            #再次运行
            ./oramake  成功
           
            #[Create Batch Libraries in Database]:
             
             cd $INSTALL_DIR/db_objects 
             $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                .. SQL> @createordlib.sql
  .. SQL> @dealinclib.sql
  .. SQL> @dealordlib.sql
  .. SQL> @scllib.sql
  3. Exit SQL*Plus  
  
      cd $INSTALL_DIR/utility
      $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
      .. SQL> @inv_obj_comp.sql
     
     # [Compile Batch Libraries ]
           
           
            cd $INSTALL_DIR/rms/oracle/lib/src

            make –f retek.mk depend 2>&1 | tee libdpnd.log(这句话需要key进去,不能copy)
            # 结果是 stddef 和 stdarg.h 未找到
        makedepend: warning:  sacode.c (reading /usr/include/libio.h, line 53): cannot find include file “stdarg.h”
        not in ./stdarg.h
        not in /d01/app/retail/rms/db/rms/oracle/lib/src/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/precomp/public/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/rdbms/public/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/plsql/public/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/sqllib/public/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/network/public/stdarg.h
        not in /d01/app/oracle/product/10.2.0/db_1/rdbms/demo/stdarg.h
        not in /d01/app/retail/rms/db/rms/oracle/proc/src/stdarg.h
        not in /usr/local/lib/gcc-include/stdarg.h
        not in /usr/include/stdarg.h
        not in /usr/lib/gcc/i386-redhat-linux/3.4.6/include/stdarg.h           
           
            find / -name stddef.h
            结果:
            /usr/lib/gcc/x86_64-redhat-linux/3.4.3/include/stddef.h
     /usr/include/linux/stddef.h
     /usr/src/kernels/2.6.9-42.0.0.0.1.EL-smp-x86_64/include/linux/stddef.h
     /usr/src/kernels/2.6.9-42.0.0.0.1.EL-largesmp-x86_64/include/linux/stddef.h
     /usr/src/kernels/2.6.9-42.0.0.0.1.EL-x86_64/include/linux/stddef.h
            find /usr -name stdarg.h
            结果:
            /usr/lib/gcc/x86_64-redhat-linux/3.4.3/include/stdarg.h
            # 这两个文件在 /usr/lib/gcc/x86_64-redhat-linux/3.4.3/include 都存在,可偏偏makedepend没去这个路径查找。
            解决方法:
            make 文件指定的include 配置文件是/d01/app/oracle/product/10.2.0/db_1/precomp/admin/pcscfg.cfg
            其内容是:
            sys_include=(/build/s023/precomp/public,/usr/include,/opt/gcc33/lib64/gcc-lib/x86_64-suse-linux/3.3/include,/usr/lib/gcc-lib/
            x86_64-redhat-linux/3.2.3/include,/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/include)
            ltype=short
            define=__x86_64__
            没有包含/usr/lib/gcc/x86_64-redhat-linux/3.4.3/include目录,所以找不到stddef.h 和 stdarg.h
            把这个路径添加到pcscfg.cfg 中。
            vi /d01/app/oracle/product/10.2.0/db_1/precomp/admin/pcscfg.cfg
            添加/usr/lib/gcc/x86_64-redhat-linux/3.4.3/include
           
            执行make
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            结果:
            dealordlib.pc 有问题 执行sql sl_deal_ct 出问题了。
  Error at line 1965, column 4 in file dealordlib.pc
     EXEC SQL FOR :sl_deal_ct
  …1
  PLS-S-00201, identifier ‘ORDER_DEAL_BUILD’ must be declared
  Error at line 1965, column 4 in file dealordlib.pc
     EXEC SQL FOR :sl_deal_ct   
    
            查看代码发现是:
  EXEC SQL FOR :sl_deal_ct
        INSERT INTO order_deal_build
                    (deal_id,
                     deal_detail_id)
              VALUES(:oa_deal->deal_id,
                     :oa_deal->deal_detail_id);
            表 order_deal_build 不存在。 难道是这张表在12.0.1-12.0.3 的patch中,而我没有打?
            解决方法:把12.0.1-12.0.3 的db patch全部打上()。
           
            su oracle
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
           
            ================= db patch for 12.0.1==========================================
            STAGING_AREA=/d01/app/retail/rms/12.0.1/dbserverunix
            export STAGING_AREA
            cd $STAGING_AREA/rib/db_objects
            echo @patch1201rib.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                      
            cd $STAGING_AREA/pricing/types
            echo @pricing1201types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                       
            cd $STAGING_AREA/pricing/dbcs                   
            echo @pricing1201dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           

            cd $STAGING_AREA/pricing/db_objects                   
            echo @pricing1201rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1201ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/types
            echo @patch1201types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL(这里 install guilder是错误的  sql文件名错误)
           
            cd $STAGING_AREA/dbcs
            echo @patch1201dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/db_objects
            echo @patch1201rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1201ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/form_menu_elements (这里 instal guilder 的目录名错误)
            echo @patch1201forms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang
            echo @patch1201ctl_zhs_sec.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            =================== db patch for 12.0.2=================================
            STAGING_AREA=/d01/app/retail/rms/12.0.2/dbserverunix
            export STAGING_AREA
           
            cd $STAGING_AREA/pricing/types
            echo @pricing1202types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL (这里 instal guilder 的文件名错误)
           
            cd $STAGING_AREA/pricing/dbcs 
            echo @pricing1202dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/db_objects
            echo @pricing1202rms.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1202ctl.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/dbcs
            echo @patch1202dbcs.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/db_objects
            echo @patch1202rms.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1202ctl.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang
            echo @patch1202ctl_zhs_sec.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            =================== db patch for 12.0.3=================================
            STAGING_AREA=/d01/app/retail/rms/12.0.3/dbserverunix
            export STAGING_AREA   
           
            cd $STAGING_AREA/pricing/types
            echo @pricing1203types.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL(这里 install guilder 的文件名错误)
           
            cd $STAGING_AREA/pricing/dbcs
            echo @pricing1203dbcs.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/db_objects
            echo @pricing1203rms.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1203ctl.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/dbcs
            echo @patch1203dbcs.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            #ERROR at line 1:
            #ORA-02443: Cannot drop constraint  – nonexistent constraint
            #代码执行中断了,patch1203dbcs.sql执行不完整。
            #分析,s5523696.sql的唯一动作就是删除一个constraint,既然这个constraint不存在,那么不需要这个sql;
            #从patch1203dbcs.sql 中去掉对s5523696.sql的调用,然后再执行
           
            #’Starting File: s5718867.sql’
     #Dropping Constraints
     #ALTER TABLE SYSTEM_OPTIONS DROP CONSTRAINT CHK_SOP_AIP_IND
     #                                           *
     #ERROR at line 1:
     #ORA-02443: Cannot drop constraint  – nonexistent constraint
     #发现是权限问题,实际上这些约束是存在的,只是没有权限,所以无法删除,这显然是不对的
     #因为rms12dev是这个schema的所有者,
     #注释掉这句话 把drop 跟sop有关的constraint的语句全部去掉。再执行
    
     #ERROR at line 418:
            #ORA-00904: “TSF_AUTO_CLOSE_WH”: invalid identifier
            #这个错误是因为脚本试图SELECT TSF_AUTO_CLOSE_WH FROM dbc_system_options 但不存在
            #解决方法在select 中给个’N’
            #脚本无法重复运行,从这里开始手工运行。。。
            #更改patch1203dbcs.sql 注释掉已经完成的部分。再运行
           
           
    

           
            cd $STAGING_AREA/db_objects
            echo @patch1203rms.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1203ctl.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang/ZHS
            echo @patch1203ctl_zhs_sec.sql  | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL (Install guilder 在这里文件名和路径均错误)  
           
            ====
            上述patch版本的db patch打完后,表 ORDER_DEAL_BUILD 就有了.   
                  
            执行make
            su oretail
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log           
            新的错误:
               precompiling dealordlib.pc
               proc: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory           
[root@syfr12 include]# find / -name libclntsh.so.10.1
/d01/app/oracleas/OraHome_1/lib/libclntsh.so.10.1
/d01/app/oracle/product/10.2.0/db_1/lib32/libclntsh.so.10.1
/d01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1
/d01/bak/oracleas/OraHome_1/lib/libclntsh.so.10.1
/d01/bak/app/oracle/product/10.2.0/db_1/lib32/libclntsh.so.10.1
/d01/bak/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1
            看来, LD_LIBRARY_PATH 没起作用. LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH          
            env | grep LD
            居然没有,重新设置:
            LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH
            export LD_LIBRARY_PATH
            再尝试Make
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
           
            还有makedend 警告,这次是 sacode.c 找不到stddef.h
            找错地方了: /usr/lib/gcc/i386-redhat-linux/3.4.6/include/
            它为什么不找 /usr/lib/gcc/x86_64-redhat-linux/3.4.3/include 目录呢?
[oretail@syfr12 src]$ which gcc
/usr/bin/gcc
[oretail@syfr12 src]$ gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –enable-shared –enable-threads=posix –disable-checking –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –enable-java-awt=gtk –host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3.1)
            可见gcc的配置是指向/usr/lib/gcc/x86_64-redhat-linux的 , makedepned的警告可以不处理.
           
            但是编译satrat.c的时候有错误.
             satrat.c:12: error: `TRAT_OPEN’ undeclared here (not in a function)
代码中如下一段在编译有错误
static TOKENMAP pa_tokentable[] = {
   { TRAT_OPEN,   TRATTT_OPEN   },
   { TRAT_NOSALE, TRATTT_NOSALE },
   { TRAT_VOID,   TRATTT_VOID   },
   { TRAT_PVOID,  TRATTT_PVOID  },
   { TRAT_SALE,   TRATTT_SALE   },
   { TRAT_RETURN, TRATTT_RETURN },
   { TRAT_PAIDIN, TRATTT_PAIDIN },
   { TRAT_PAIDOU, TRATTT_PAIDOU },
   { TRAT_PULL,   TRATTT_PULL   },
   { TRAT_LOAN,   TRATTT_LOAN   },
   { TRAT_COND,   TRATTT_COND   },
   { TRAT_CLOSE,  TRATTT_CLOSE  },
   { TRAT_REFUND, TRATTT_REFUND },
   { TRAT_TOTAL,  TRATTT_TOTAL  },
   { TRAT_ERR,    TRATTT_ERR    },
   { TRAT_TERM,   TRATTT_TERM   },
   { TRAT_METER,  TRATTT_METER  },
   { TRAT_PUMPT,  TRATTT_PUMPT  },
   { TRAT_TANKDP, TRATTT_TANKDP },
   { TRAT_DCLOSE, TRATTT_DCLOSE },
   { NULL,        0 }
};
   这些常量没有声明
  
   grep ‘TRAT_TERM’ /d01/app/retail -r
   在整个retail目录下也没找到这个字符串. google ,metalink 搜索均无结果.
[root@syfr12 include]# grep ‘TRAT_TERM’ /d01/app/retail -r
/d01/app/retail/rms/db/rms/oracle/lib/src/libretek.log:satrat.c:27: error: `TRAT_TERM’ undeclared here (not in a function)
/d01/app/retail/rms/db/rms/oracle/lib/src/satrat.c:   { TRAT_TERM,   TRATTT_TERM   },
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlog_sqlldr.c:   CPYSTRFXL( thead.tran_type, TRAT_TERM, FT_VARCHAR);
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlog_insert.pc:   CPYSTRFXL( thead.tran_type, TRAT_TERM, FT_VARCHAR);
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.pc:         AND th.tran_type           = :TRAT_TERM
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.pc:            AND th.tran_type NOT IN (:TRAT_TERM, :TRAT_DCLOSE, :TRAT_TOTAL, :TRAT_ERR)
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.pc:            AND th.tran_type NOT IN (:TRAT_TERM, :TRAT_DCLOSE, :TRAT_TOTAL, :TRAT_ERR)
  
   经过分析上述文件均include salib.h
   只需要在salib.h中定义即可.
  
   TRAT_OPEN 应给是字符串常量,TRATTT_OPEN 应该是整数
/* added by yunfang.shang for pass compile satrat.c */  
#define TRAT_OPEN            “TRAT_OPEN”
#define TRAT_NOSALE          “TRAT_NOSALE”
#define TRAT_VOID            “TRAT_VOID”
#define TRAT_PVOID           “TRAT_PVOID”
#define TRAT_SALE            “TRAT_SALE”
#define TRAT_RETURN          “TRAT_RETURN”
#define TRAT_PAIDIN          “TRAT_PAIDIN”
#define TRAT_PAIDOU          “TRAT_PAIDOU”
#define TRAT_PULL            “TRAT_PULL”
#define TRAT_LOAN            “TRAT_LOAN”
#define TRAT_COND            “TRAT_COND”
#define TRAT_CLOSE           “TRAT_CLOSE”
#define TRAT_REFUND          “TRAT_REFUND”
#define TRAT_TOTAL           “TRAT_TOTAL”
#define TRAT_ERR             “TRAT_ERR”
#define TRAT_TERM            “TRAT_TERM”
#define TRAT_METER           “TRAT_METER”
#define TRAT_PUMPT           “TRAT_PUMPT”
#define TRAT_TANKDP          “TRAT_TANKDP”
#define TRAT_DCLOSE          “TRAT_DCLOSE”

#define TRATTT_OPEN          1
#define TRATTT_NOSALE        2
#define TRATTT_VOID          3
#define TRATTT_PVOID         4
#define TRATTT_SALE          5
#define TRATTT_RETURN        6
#define TRATTT_PAIDIN        7
#define TRATTT_PAIDOU        8
#define TRATTT_PULL          9
#define TRATTT_LOAN          10
#define TRATTT_COND          11
#define TRATTT_CLOSE         12
#define TRATTT_REFUND        13
#define TRATTT_TOTAL         14
#define TRATTT_ERR           15
#define TRATTT_TERM          16
#define TRATTT_METER         17                       
#define TRATTT_PUMPT         18         
#define TRATTT_TANKDP        19 
#define TRATTT_DCLOSE        20
cd $INSTALL_DIR/rms/oracle/lib/src
vi salib.h

            再次执行make
            su oretail
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
           
            satrat.c 编译通过
            出现新的错误:语义误差:
Semantic error at line 166, column 95, file sacrstdy.pc:
      SELECT sd.store_day_seq_no, sd.store, sd.day, std.system_code, NVL(MAX(el.
seq_no), 1), :SAES_R, NULL
……………………………………………………………………..
…………..1
PCC-S-02322, found undefined identifier
Semantic error at line 174, column 29, file sacrstdy.pc:
      AND    std.imp_exp = :IMEX_E
……………………….1
PCC-S-02322, found undefined identifier
Semantic error at line 210, column 71, file sacrstdy.pc:
      SELECT sd.store_day_seq_no, sd.store, sd.day, std.system_code, :SAIS_R, NU
LL
     
      分析:可能是proc程序中用到的常量未定义:IMEX_E,SAIS_R
[root@syfr12 include]# grep ‘IMEX_E’ /d01/app/retail -r
/d01/app/retail/rms/db/rms/oracle/lib/src/sacrstdy.lis:   174        AND    std.imp_exp = :IMEX_E
/d01/app/retail/rms/db/rms/oracle/lib/src/sacrstdy.pc:      AND    std.imp_exp = :IMEX_E
/d01/app/retail/rms/db/rms/oracle/lib/src/libretek.log:      AND    std.imp_exp = :IMEX_E
[root@syfr12 include]#
      未找到定义; 从其用途来看,这些常量应该是Retail自己定义,不是调用Oracle数据库里面的.h文件中的内容。
      既然整个retail目录都找不到定义,那么只有自己定义了。根据猜测 这些常量的定义如下:
      IMEX_E 对应的数据库字段是VARCHAR2(6) , SAIS_R,SACD_S对应的数据库字段是VARCHAR2(1)
      由于proc 不支持 #define宏定义,需要分配内存空间的常量。
      备注:写成extern 的定义形式是因为多个c或者pc文件include salib.h ;要避免在ld的时候多重定义错误。
/* added by yunfang.shang for pass compile sacrstdy.pc */ 
extern char *IMEX_E;
extern char *IMEX_I;
extern char *SAIS_R;
extern char *SACD_S;
extern char *SACD_R;
extern char *SACD_A;
extern char *SAES_R;
extern char *SASS_W;
extern char *SASS_C;
extern char *SAST_P;
extern char *SAAS_H;
extern char *SAAS_A;
extern char *SAAS_S;
extern char *SAAS_U;
extern char *SADS_R;
extern char *SADS_F;
extern char *YSNO_N;
extern char *YSNO_Y;
extern char *SAFD_P;
extern char *SAFD_N;
extern char *SALT_W;
extern char *SALT_R;
extern char *SAES_E;
extern char *SAST_D;
extern char *SAST_V;
extern char *SPCTY_R;
extern char *SPCTY_C;
extern char *SPCTY_P;
extern char *PCTY_R;
extern char *PCTY_C;
extern char *PCTY_P;
extern char *SAAS_R;
extern char *SAVS_I;
extern char *SAVS_E;
extern char *SAVS_N;
extern char *SYSE_ACH;
extern char *SYSI_POS;
SIGN_P
添加一个c文件 :salib.c     
const char *IMEX_E=”E”;
const char *IMEX_I=”I”;
const char *SAIS_R=”R”;
const char *SACD_S=”S”;
const char *SACD_R=”R”;
const char *SACD_A=”A”;
const char *SAES_R=”R”;
const char *SASS_W=”W”;
const char *SASS_C=”C”;
const char *SAST_P=”P”;
const char *SAAS_H=”H”;
const char *SAAS_A=”A”;
const char *SAAS_S=”S”;
const char *SAAS_U=”U”;
const char *SADS_R=”R”;
const char *SADS_F=”F”;
const char *YSNO_N=”N”;
const char *YSNO_Y=”Y”;
const char *SAFD_P=”P”;
const char *SAFD_N=”N”;
const char *SALT_W=”W”;
const char *SALT_R=”R”;
const char *SAES_E=”E”;
const char *SAST_D=”D”;
const char *SAST_V=”V”;
const char *SPCTY_R=”R”;
const char *SPCTY_C=”C”;
const char *SPCTY_P=”P”;
const char *PCTY_R=”R”;
const char *PCTY_C=”C”;
const char *PCTY_P=”P”;
const char *SAAS_R=”R”;
const char *SAVS_I=”I”;
const char *SAVS_E=”E”;
const char *SAVS_N=”N”;
const char *SYSE_ACH=”A”;
const char *SYSI_POS=”P”;
SIGN_P
void main()
{
int i;
i=0;
}

 

       将这些定义添加到salib.h
       vi salib.h  添加到文件尾。
            再次执行make
            su oretail
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            一直做make , 直到把所有需要定义的产量都找出来(大概Make了10次) 终于完成make ;
           
       #[To install batch libraries]
       make –f retek.mk install  
      
       #[Compile Batch Source Code]
       cd $INSTALL_DIR/rms/oracle/proc/src
       make -f mts.mk rms-depend recs-depend rtm-depend resa-depend 2>&1 | tee srcdpnd.log (key 进去)
       会有警告 stddef.h 找不到,不用管它,是makedepend 本身的搜索路径有问题,gcc没有问题。
       make -f rms.mk PRODUCT_PROCFLAGS=dynamic=ansi ditinsrt(key 进去)
       make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log(key 进去)         
错误:
precompiling storeadd.pc
Pro*C/C++: Release 10.2.0.3.0 – Production on Sun Sep 14 03:19:16 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
System default option values taken from: /d01/app/oracle/product/10.2.0/db_1/precomp/admin/pcscfg.cfg
Error at line 153, column 7 in file storeadd.pc
      SELECT s.elc_ind,
……1
PLS-S-00414, no column ‘RPM_RIB_IND’ in table
Error at line 153, column 7 in file storeadd.pc
      SELECT s.elc_ind,
     
      system_options 表没有RPM_RIB_IND字段。
      grep ‘RPM_RIB_IND’ /d01/app/retail -r
      找到添加该字段的脚本:
      /d01/app/retail/rms/12.0.3/dbserverunix/dbcs/s5718867.sql:–    COLUMNS ADDED:                          RPM_RIB_IND
      运行/d01/app/retail/rms/12.0.3/dbserverunix/dbcs/patch1203dbcs.sql 可以更改此表。
      按理说这一步在打12.0.3的dbpatch的时候已经执行了。为什么还没有效果呢?     
      把12.0.3的dbpatch再执行一边。 刚才的错误就没有了。不过又出现一些常量未定义,比如: SAVS_I ,处理方法跟以前一样。
      google SYSE_ACH 得到一个结果,在RMS 11版本的 操作指南中有提到这个东西。但是在R12的ug he pg中均未提到。
      无法猜测SYSE_ACH应该是个什么值,但如果是遗留的无用代码,仅仅影响编译的话给个”A”就可以了。
      如果出现多重定义错误,则是因为前面没有使用extern定义变量的方式,重新编译lib 和proc
      rm /d01/app/retail/rms/db/rms/oracle/lib/src/*.o
      rm /d01/app/retail/rms/db/rms/oracle/lib/bin/*.*
      rm /d01/app/retail/rms/db/rms/oracle/proc/bin/*.*
      rm /d01/app/retail/rms/db/rms/oracle/proc/src/*.o
     
      重新进行:
            su oretail
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            make –f retek.mk install 
            成功
            cd $INSTALL_DIR/rms/oracle/proc/src
            make -f mts.mk rms-depend recs-depend rtm-depend resa-depend 2>&1 | tee srcdpnd.log
            make -f rms.mk PRODUCT_PROCFLAGS=dynamic=ansi ditinsrt        
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log
            提示有如下错误:
saescheat.o(.text+0x353): In function `IsCompanyStateEscheat’:
: undefined reference to `YSNO_Y’
saescheat.o(.text+0x200b): In function `AdjustVoucher’:
: undefined reference to `SAVS_N’
            分析: .o文件已经生成,说明编译已经通过。估计是要找外部定义的时候没找到
            解决方法:
            尝试把 salib.c 编译成salib.o 再ar成库文件(静态库),然后出错的的那个条gcc命令中添加-lsalib 单独执行这条命令。
           
            rm $INSTALL_DIR/rms/oracle/lib/src/salib.o
            rm $INSTALL_DIR/rms/oracle/lib/src/libsalib.a
            rm $INSTALL_DIR/rms/oracle/lib/bin/libsalib.a           
            cd $INSTALL_DIR/rms/oracle/lib/src
            gcc -c salib.c
            ar -r libsalib.a salib.o                    
            cp libsalib.a $INSTALL_DIR/rms/oracle/lib/bin             
            cd $INSTALL_DIR/rms/oracle/proc/src
            gcc -o `basename saescheat` `echo saescheat.o saescheat_nextesn.o | xargs -n1 basename` -L. -L/d01/app/retail/rms/db/rms/oracle/lib/bin -lresa -lsalib -L/d01/app/retail/rms/db/rms/oracle/lib/bin  -lretek -L/d01/app/oracle/product/10.2.0/db_1/lib/ -lclntsh `cat /d01/app/oracle/product/10.2.0/db_1/lib/ldflags`   `cat /d01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm    -O3    -fPIC -DPRECOMP -I/d01/app/oracle/product/10.2.0/db_1/precomp/hdrs  -I/d01/app/oracle/product/10.2.0/db_1/precomp/public -I/d01/app/oracle/product/10.2.0/db_1/precomp/include   -I/d01/app/oracle/product/10.2.0/db_1/oracore/include -I/d01/app/oracle/product/10.2.0/db_1/oracore/public -I/d01/app/oracle/product/10.2.0/db_1/oracore/port/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/public -I/d01/app/oracle/product/10.2.0/db_1/nlsrtl/include   -I/d01/app/oracle/product/10.2.0/db_1/slax/include   -I.  -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-aliasing
            通过
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log
            报另一个错误:
precompiling sagetref.pc
proc: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
make[1]: *** [sagetref.o] Error 127

[root@syfr12 ld.so.conf.d]# find /d01/app/oracle -name libclntsh.so.10.1
/d01/app/oracle/product/10.2.0/db_1/lib32/libclntsh.so.10.1
/d01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1
[root@syfr12 ld.so.conf.d]# 
[root@syfr12 ld.so.conf.d]#  env | grep LD
没设置,晕 ,设置一下
            LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH
            export LD_LIBRARY_PATH
            #再Make
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log
            #出现错误,又是常量没定义。把这些常量补上
            :SYSI_POS(在上文统一添加的地方添加)
            接下来出现的一些错误都是一些跟上面类似的错误,用类似的方法解决。
            gcc -o `basename saescheat` `echo saescheat.o saescheat_nextesn.o | xargs -n1 basename` -L. -L/d01/app/retail/rms/db/rms/oracle/lib/bin -lresa -lsalib -L/d01/app/retail/rms/db/rms/oracle/lib/bin -lretek -L/d01/app/oracle/product/10.2.0/db_1/lib/ -lclntsh `cat /d01/app/oracle/product/10.2.0/db_1/lib/ldflags`   `cat /d01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm    -O3    -fPIC -DPRECOMP -I/d01/app/oracle/product/10.2.0/db_1/precomp/hdrs  -I/d01/app/oracle/product/10.2.0/db_1/precomp/public -I/d01/app/oracle/product/10.2.0/db_1/precomp/include   -I/d01/app/oracle/product/10.2.0/db_1/oracore/include -I/d01/app/oracle/product/10.2.0/db_1/oracore/public -I/d01/app/oracle/product/10.2.0/db_1/oracore/port/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/public -I/d01/app/oracle/product/10.2.0/db_1/nlsrtl/include   -I/d01/app/oracle/product/10.2.0/db_1/slax/include   -I. -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-aliasing
            #再Make
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log           
            出错
            gcc -o `basename sagetref` `echo sagetref.o | xargs -n1 basename` -L. -L/d01/app/retail/rms/db/rms/oracle/lib/bin -lresa -lsalib -L/d01/app/retail/rms/db/rms/oracle/lib/bin -lretek -L/d01/app/oracle/product/10.2.0/db_1/lib/ -lclntsh `cat /d01/app/oracle/product/10.2.0/db_1/lib/ldflags`   `cat /d01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm    -O3    -fPIC -DPRECOMP -I/d01/app/oracle/product/10.2.0/db_1/precomp/hdrs  -I/d01/app/oracle/product/10.2.0/db_1/precomp/public -I/d01/app/oracle/product/10.2.0/db_1/precomp/include   -I/d01/app/oracle/product/10.2.0/db_1/oracore/include -I/d01/app/oracle/product/10.2.0/db_1/oracore/public -I/d01/app/oracle/product/10.2.0/db_1/oracore/port/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/include -I/d01/app/oracle/product/10.2.0/db_1/xdk/public -I/d01/app/oracle/product/10.2.0/db_1/nlsrtl/include   -I/d01/app/oracle/product/10.2.0/db_1/slax/include   -I. -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-aliasing
            依然提示 SYSI_POS 未定义。研究发现sagetref.c 也是由sagetref.pc生成的。
            这种情况下在连接的时候即使给他指定正确的定义库文件依然无用,不知道是为什么。但YSNO_Y也是在pc中却没有这个问题。
            无奈之下,直接把SYSI_POS定义从salib.h中去掉,直接加到sagetref.pc ,然后make通过。
            接下来还会发现一些需要处理的未定义变量和文件关系:
            saimpadj.pc SIGN_P
            saimptlog_ccval.c CCVT_MOD10
            我突然产生一个疑问,这么多常量定义未找到,真的是oracle Retail安装包制作的问题?还是我自己的问题?
            在/d01/app/retail下grep 找不到还有一种可能是:因为我的这个目录已经更新过。rms12.0.0版本的文件已经被替换。可能这些常量定义在12.0.0
            所以就 grep ‘CCVT_MOD10’ /d01/rms_stage -r
            结果找到了 在sacodes.h中有定义,而sacodes.h是被salib.h include 进来的。
[root@syfr12 lib]# grep ‘SAES_E’ /d01/rms_stage -r
/d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.h:extern const char SAES_E     [NULL_CODE];   /* Exported */
/d01/rms_stage/rms12dbserver/rms/oracle/lib/src/samrkstdyexp.pc:               SET status = :SAES_E,
/d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.c:const char SAES_E     [NULL_CODE] = “E”;   /* Exported */
/d01/rms_stage/rms12dbserver/rms/oracle/proc/src/saprepost.pc:         AND el.status = :SAES_E
/d01/rms_stage/rms12dbserver/rms/oracle/proc/src/saexpach.pc:         SET status   = :SAES_E,

            在看/d01/app/retail/rms/db/rms/oracle/lib/src/sacodes.h 文件很小;确实了很多常量定义。
            怎么会这样?我又没有更改过这个文件。看来batch目录下的文件组织有问题。
            重新组织:
rm -f /d01/app/retail/rms/db/rms/oracle/lib/src/*
rm -f /d01/app/retail/rms/db/rms/oracle/lib/bin/*
rm -f /d01/app/retail/rms/db/rms/oracle/proc/src/*
rm -f /d01/app/retail/rms/db/rms/oracle/proc/bin/*
           
           
cp -f /d01/rms_stage/rms12dbserver/rms/oracle/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/
cp -f /d01/rms_stage/rms12dbserver/rms/oracle/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/
cp -f /d01/app/retail/rms/12.0.1/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/
cp -f /d01/app/retail/rms/12.0.2/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/
cp -f /d01/app/retail/rms/12.0.3/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/          
cp -f /d01/app/retail/rms/12.0.1/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/
cp -f /d01/app/retail/rms/12.0.2/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/
cp -f /d01/app/retail/rms/12.0.3/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/ 

           再按照正常的步骤编译和安装batch
                   
            # [Set Environment Variables]:
            su oretail
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            MMHOME=$INSTALL_DIR/rms
            export MMHOME
            MMUSER=rms12dev
            PASSWORD=rms12dev
            export MMUSER
            export PASSWORD
            LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH
            export LD_LIBRARY_PATH
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
            LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LIBRARY_PATH
            export LIBRARY_PATH
           
            # [Configure Make File]:
            cd $INSTALL_DIR/rms/oracle/lib/src
            cp platform_linux_oel_x86_64.mk platform.mk
            ./oramake
           
     # [Compile Batch Libraries ]
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk depend 2>&1 | tee libdpnd.log(这句话需要key进去,不能copy 忽略警告)
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            #又出错了,           
            #satrat.c:12: error: `TRAT_OPEN’ undeclared here (not in a function)
            #satrat.c:12: error: initializer element is not constant 
            #不过这次总算明白了,在make的过程中,make过程自己把sacodes.h 和sacodes.c 改掉了,
            #从2个500多k的文件改成了两个2k的文件,真是搞笑。很多常量定义都消失了。
            #把这两个文件再copy回来
            cp -f /d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.h  /d01/app/retail/rms/db/rms/oracle/lib/src/
            cp -f /d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.c  /d01/app/retail/rms/db/rms/oracle/lib/src/
            #再make
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            #可惜,这该死的make 每次都会先把这两个文件给改掉。而且你禁止写权限,不让它改,make就终止,所以使用make成了一个死结。
            #解决办法:
            cp -f /d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.h  /d01/app/retail/rms/db/rms/oracle/lib/src/sacodes2.h
            cp -f /d01/rms_stage/rms12dbserver/rms/oracle/lib/src/sacodes.c  /d01/app/retail/rms/db/rms/oracle/lib/src/sacodes2.c
            #在salib.h 把sacodes2.h include进来。
            #更改sacodes2.h 在开头部分更改成:
            #ifdef  _CODE_TYPES2_H
            #define _CODE_TYPES2_H
            #再次make 顺利通过
           
            #[To install batch libraries]
            make –f retek.mk install
             
            #[Compile Batch Source Code]
            cd $INSTALL_DIR/rms/oracle/proc/src
            make -f mts.mk rms-depend recs-depend rtm-depend resa-depend 2>&1 | tee srcdpnd.log (key 进去)
            #会有警告 stddef.h 找不到,不用管它,是makedepend 本身的搜索路径有问题,gcc没有问题。
            make -f rms.mk PRODUCT_PROCFLAGS=dynamic=ansi ditinsrt(key 进去)
     #会有错误,找不到库文件,因为gcc命令行只是包含了libresa.a 和libretek.a 两个库。
    
     #saescheat.o(.text+0x353): In function `IsCompanyStateEscheat’:
     #: undefined reference to `YSNO_Y’
     #saescheat.o(.text+0x200b): In function `AdjustVoucher’:
     #: undefined reference to `SAVS_N’
     #我们尝试需要把sacodes2.c 编译后追加到其中的一个库文件          
            cd $INSTALL_DIR/rms/oracle/lib/src/
            gcc -c sacodes2.c                               
            cp sacodes2.o $INSTALL_DIR/rms/oracle/lib/bin/   
            cd $INSTALL_DIR/rms/oracle/lib/bin/
            cp libresa.a libresa_bak.a
            ar -r libresa.a  sacodes2.o         
            cd $INSTALL_DIR/rms/oracle/proc/src/
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log(key 进去)
            #新的情况
saimptlog_rounding.pc: In function `get_rounding_rule’:
saimptlog_rounding.pc:242: error: `SART_THTEND’ undeclared (first use in this function)
saimptlog_rounding.pc:242: error: (Each undeclared identifier is reported only once
saimptlog_rounding.pc:242: error: for each function it appears in.)
saimptlog_rounding.pc:314: error: `SART_THTTSA’ undeclared (first use in this function)
make[1]: *** [saimptlog_rounding.o] Error 1
make[1]: Leaving directory `/d01/app/retail/rms/db/rms/oracle/proc/src’
            #分析
[root@syfr12 kk]# grep  ‘SART_THTEND’ /d01/app/retail -r
grep  ‘SART_THTEND’ /d01/app/retail -r
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlog_rounding.c:      WrBadTranError( INVLD_TENDER_ENDING, TranSeqNo, -1, -1, SART_THTEND, “”, 0);
/d01/app/retail/rms/db/rms/oracle/proc/src/srcall.log:saimptlog_rounding.pc:242: error: `SART_THTEND’ undeclared (first use in this function)
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlog_rounding.pc:      WrBadTranError( INVLD_TENDER_ENDING, TranSeqNo, -1, -1, SART_THTEND, “”, 0);
[root@syfr12 kk]# grep ‘SART_THTEND’ /d01/rms_stage -r
/d01/rms_stage/rms12dbserver/rms/oracle/proc/src/saimptlog_rounding.pc:      WrBadTranError( INVLD_TENDER_ENDING, TranSeqNo, -1, -1, SART_THTEND, “”, 0);
[root@syfr12 kk]#
             #这回可真找不到定义了。得,把源代码改一下,把变量申明给加上,先过去再说。
             #在saimptlog_rounding.pc中添加
             #const char *SART_THTEND=”E”;
             #const char *SART_THTTSA=”S”;
             #再make
             #make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log
             #新情况:saimptlogfin.pc 找不到定义 SYSI_MLA
[root@syfr12 kk]# grep ‘SYSI_MLA’ /d01/app/retail -r
/d01/app/retail/rms/db/rms/oracle/proc/src/srcall.log:         AND system_code = : SYSI_MLA;
/d01/app/retail/rms/db/rms/oracle/proc/src/srcall.log:         AND system_code = : SYSI_MLA;
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.pc:         AND system_code = : SYSI_MLA;
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.lis:  1178           AND system_code = : SYSI_MLA;
/d01/app/retail/rms/db/rms/oracle/proc/src/saimptlogfin.lis:  1178           AND system_code = : SYSI_MLA;
             #只能在  saimptlogfin.pc 中添加
             #saimptlogfin.pc中添加
             #const char *SYSI_MLA=”M”;
             #再make
             #make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log
             #出现5个常规问题解决掉就可以了
             #新问题
             #saprepost.pc 中没有include salib.h 直接include sacodes.h了。所以编译失败
             #更正,把对sacodes.h的include 更改成对salib.h的include.
             #再make
             #make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log   
             #成功 OK
            
             #[To install batch programs ]
             make –f mts.mk rms-install recs-install resa-install rtm-install  
             #成功   
            

 

 
   5.3 安装 RMS Application

            ORACLE_HOME=/d01/app/oracleas/OraHome_1
            export ORACLE_HOME
           
            #oracle 用户登陆
            cd ORACLE_HOME/network/admin
            vi tnsnames.ora
            #把RETL数据库的TNS配置进去,然后
            cd ORACLE_HOME/bin
            ./sqlplus rms12dev/rms12dev@RETL #进行连接测试,通过。(备注,如果一切配置正常而老是提示名字解析错误,请考虑是否在tnsnames.ora中存在不可见字符,这种字符只有使用vi能看出来,more,linux下的图形文本编辑器和windows平台上的文本编辑器都看不出来,这种隐蔽的问题很容易浪费时间)
            #查看端口占用情况:netstat -ntlp
           
            cd $ORACLE_HOME/guicommon/tk/admin
            cp Tk2Motif.rgb Tk2Motif.rgb_ORIG
           
  [oracle@syfr12 admin]$ grep -F ‘Tk2Motif*fontMapCs’ Tk2Motif.rgb
  !Tk2Motif*fontMapCs: iso8859-2=EE8ISO8859P2
  !Tk2Motif*fontMapCs: iso8859-15=WE8ISO8859P15 
     vi Tk2Motif.rgb
     #找到 !Tk2Motif*fontMapCs: iso8859-2=EE8ISO8859P2 ,去掉! 改成 Tk2Motif*fontMapCs: iso8859-2=UTF8
     #vi 命令模式下 输入/Tk2Motif 回车,按n 往下查找,直到找到Tk2Motif*fontMapCs 把它修改掉。
    
     su oretail
    
     DISPLAY=syfr12:1.0
     export DISPLAY
    
    
 INSTALL_DIR=/d01/app/retail/rms/app
 export INSTALL_DIR    
 PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/forms10gr2_scripts:$PATH
 CLASSPATH=$ORACLE_HOME/jlib/importer:$ORACLE_HOME/jlib/debugger.jar:$ORACLE_HOME/jlib/utj.jar:$ORACLE_HOME/jlib/ewt3.jar:$ORACLE_HOME/jlib/share.jar:$ORACLE_HOME/jlib/dfc.jar:$ORACLE_HOME/jlib/help4.jar:$ORACLE_HOME/jlib/oracle_ice.jar:$ORACLE_HOME/jlib/jewt4.jar
 FORMS_BUILDER_CLASSPATH=$CLASSPATH
 FORMS_PATH=$INSTALL_DIR/toolset/bin:$INSTALL_DIR/rms/forms/bin:$ORACLE_HOME/forms
 REPORTS_PATH=$INSTALL_DIR/rms/reports/bin:$ORACLE_HOME/forms
 TK_UNKNOWN==$ORACLE_HOME/guicommon/tk/admin
 UP=rms12dev/rms12dev@RETL
 LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/jdk/jre/lib/sparc:$ORACLE_HOME/jdk/jre/lib/sparc/native_threads
 export PATH CLASSPATH FORMS_BUILDER_CLASSPATH FORMS_PATH REPORTS_PATH TK_UNKNOWN UP LD_LIBRARY_PATH         

            #[RMS Toolset Installation]:
            cp $INSTALL_DIR/toolset/src/*.pll $INSTALL_DIR/toolset/bin
           
            #因为f10gr2plsqlconv_pll_stand45 需要执行$ORACLE_HOME/bin/frmplsqlconv.sh ,所以需要更改权限。
            usermod -g oinstall oretail
            su oracle
            chmod -R 755 /d01/app/oracleas
            su oretail
           
            cd $INSTALL_DIR/toolset/bin
            f10gr2plsqlconv_pll_stand45
            rm stand45.pld
           
            pll2plx10gr2_toolset
            rm *.plx
           
            cp $INSTALL_DIR/toolset/src/*.fmb $INSTALL_DIR/toolset/bin
            fmb2fmx10gr2_fm
            rm fm_*.fmx
            fmb2fmx10gr2
           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm $PROGNAME
  > done
  
  
            cp $INSTALL_DIR/toolset/src/*.mmb $INSTALL_DIR/toolset/bin
            mmb2mmx10gr2
            rm *.mmb
           
           
            #[RMS Forms Installation]:
            cp $INSTALL_DIR/rms/forms/src/*.pll $INSTALL_DIR/rms/forms/bin
            cd $INSTALL_DIR/rms/forms/bin
            pll2plx10gr2_forms
            rm *.plx

            cp $INSTALL_DIR/rms/forms/src/*.fmb $INSTALL_DIR/rms/forms/bin           
            fmb2fmx10gr2_fm
            rm fm_*.fmx
            fmb2fmx10gr2
           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm $PROGNAME
  > done          
           
            cp $INSTALL_DIR/rms/forms/src/*.mmb $INSTALL_DIR/rms/forms/bin           
            mmb2mmx10gr2
            rm *.mmb
           
            #[RMS Reports Installation]
            cd $INSTALL_DIR/rms/reports
            mkdir bin
            cp $INSTALL_DIR/rms/reports/src/rep25lib.pll $INSTALL_DIR/rms/reports/bin
            cd $INSTALL_DIR/rms/reports/bin          
            pll2plx10gr2_reports
            rm rep25lib.plx
           
            cp $INSTALL_DIR/rms/reports/src/*.rdf $INSTALL_DIR/rms/reports/bin
            rdf2rep10gr2
            rm *.rdf
           
            #[Configure Oracle Application Server 10g for RMS]
            su oracle
            cp $ORACLE_HOME/forms/server/default.env $ORACLE_HOME/forms/server/rms.env
            vi $ORACLE_HOME/forms/server/rms.env
            #更改如下:
            FORMS_PATH=/d01/app/retail/rms/app/toolset/bin:/d01/app/retail/rms/app/rms/forms/bin:/d01/app/oracleas/OraHome_1/forms
            #添加如下
            NLS_DATE_FORMAT=YYYY-MM-DD
     NLS_LANG=AMERICAN_AMERICA.UTF8
     FORMS_REJECT_GO_DISABLED_ITEM=FALSE
    
     vi $ORACLE_HOME/network/admin/tnsnames.ora
     #添加
     REP_RMS12 =  (ADDRESS = (PROTOCOL = tcp)(HOST = syfr12)(PORT = 1951))
     cd $ORACLE_HOME/bin
     ./rwserver.sh server=REP_RMS12
     ctrl+Z
     cd $ORACLE_HOME/reports/conf
     ls
         
     vi $ORACLE_HOME/bin/reports.sh
     #找到REPORTS_PATH=的地方,添加/d01/app/retail/rms/app/rms/reports/bin::
     REPORTS_PATH=/d01/app/retail/rms/app/rms/reports/bin:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo:$ORACLE_HOME/reports/integ:$ORACLE_HOME/reports/printers
           
            sqlplus rms12dev/rms12dev@RETL
            SQL> update lang set WEBHELP_SERVER=’http://syfr12:7778′ where lang=1;
     SQL> update lang set REPORTS_SERVER=’REP_RMS12′ where lang=1;
     SQL> update lang set WEBREPORTS_SERVER=’reports/rwservlet’ where lang=1;
     SQL> update lang set APP_SERVER=’http://syfr12:7778/’ where lang=1;     
    
    
     vi $ORACLE_HOME/forms/server/formsweb.cfg   
     #添加
         [rms]
  envfile=rms.env
  width=850
  height=585
  separateFrame=true
  form=rtkstrt.fmx
            # 注释掉文件开头的两行
            ## baseHTMLjinitiator=basejini.htm
            ## baseHTMLjpi=basejpi.htm
            #在single-sign-on 下面添加如下内容
           
###############################################################
## added for Java 1.4.1+
## Use this classid to allow users to use any 1.4.X plugin
jinit_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
jinit_mimetype=application/x-java-applet;jpiversion=1.4.1_03
legacy_lifecycle=true
## end Java plug-in additions
###############################################################

            vi $ORACLE_HOME/forms/java/oracle/forms/registry/Registry.dat
            找到default.icons.iconpath=
            default.icons.iconpath=/web_gif/
           
            cp $INSTALL_DIR/sample_files/fmrweb_utf8.res $ORACLE_HOME/forms/admin/resource/US
            这一步无法完成,因为fmrweb_utf8.res不存在
            cp $INSTALL_DIR/sample_files/rms12unix.conf $ORACLE_HOME/Apache/Apache/conf
            vi $ORACLE_HOME/Apache/Apache/conf/rms12unix.conf
            #按照步骤11更改。
            vi $ORACLE_HOME/Apache/Apache/conf/httpd.conf
            #在最后添加
            # Include the rms12unix.conf
            include “/d01/app/oracleas/OraHome_1/Apache/Apache/conf/rms12unix.conf”
           
            http://syfr12:1156 把http Server重新启动一下。
            接下来按步骤操作,可以正常看到RMS的登陆界面。
            http://syfr12:7778/forms/frmservlet?config=rms
           
            #关闭和启动服务器
            #关闭
           

            #关闭
            su oracle
            ORACLE_HOME=/d01/app/oracleas/OraHome_1
            export ORACLE_HOME
            $ORACLE_HOME/bin/emctl stop iasconsole
            $ORACLE_HOME/opmn/bin/opmnctl stopall                                  
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            $ORACLE_HOME/bin/lsnrctl stop
            echo shutdown immediate | $ORACLE_HOME/bin/sqlplus ‘/as sysdba’
                    
           
            #启动
            xhost +
            #su oracle
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            $ORACLE_HOME/bin/lsnrctl start
            echo startup | $ORACLE_HOME/bin/sqlplus ‘/as sysdba’
            ORACLE_HOME=/d01/app/oracleas/OraHome_1
            export ORACLE_HOME
            $ORACLE_HOME/opmn/bin/opmnctl startall
            $ORACLE_HOME/opmn/bin/opmnctl status
           
Processes in Instance: formreportsvr.syfr12
——————-+——————–+———+———
ias-component      | process-type       |     pid | status 
——————-+——————–+———+———
DSA                | DSA                |     N/A | Down   
LogLoader          | logloaderd         |     N/A | Down   
HTTP_Server        | HTTP_Server        |   25541 | Alive  
dcm-daemon         | dcm-daemon         |     N/A | Down   
WebCache           | WebCache           |   25571 | Alive  
WebCache           | WebCacheAdmin      |   25542 | Alive  
OC4J               | home               |   25544 | Alive  
OC4J               | OC4J_BI_Forms      |   25550 | Alive 
                       
           
            $ORACLE_HOME/bin/emctl start iasconsole 

[oracle@syfr12 bin]$ $ORACLE_HOME/bin/emctl start iasconsole
TZ set to PRC
Oracle Enterprise Manager 10g Application Server Control Release 10.1.2.0.2 
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://syfr12:1156/emd/console/aboutApplication
Starting Oracle Enterprise Manager 10g Application Server Control ………………………
 No response, checking logs for initialization activity.
waiting for response from console …………… started successfully.

#备注:有时遇到Form Server 启动失败
#查
cd $ORACLE_HOME/opmn/logs/
more OC4J~OC4J_BI_Forms~default_island~1
到最后一页,显示错误:jms.xml: port 12607 already in use
su root
netstat -lntp
发现12607倒是没有被用掉,但12601-12605 全部被用掉了,这是jms端口。
#解决方法,把jms端口的范围配置到另一个范围上去。
组件    原端口范围      更改后端口范围
JMS     12601-12700     13601-13700
AJP     12501-12600     13501-13600
RMIS    12701-12800     13701-13800
RMI     12401-12500     13401-13500
可以按照 application server document 中的Managing Ports 进行修改。
cp $ORACLE_HOME/opmn/conf/opmn.xml $ORACLE_HOME/opmn/conf/opmn.xml.bak20080920
vi $ORACLE_HOME/opmn/conf/opmn.xml
定位到 <process-type id=”OC4J_BI_Forms” module-id=”OC4J”>
找到端口配置处:
               <port id=”ajp” range=”12501-12600″/>
               <port id=”rmi” range=”12401-12500″/>
               <port id=”jms” range=”12601-12700″/>
更改为:
               <port id=”ajp” range=”13501-13600″/>
               <port id=”rmi” range=”13401-13500″/>
               <port id=”jms” range=”13601-13700″/>
保存
重加载配置             
$ORACLE_HOME/opmn/bin/opmnctl reload    
启动
$ORACLE_HOME/opmn/bin/opmnctl stopall
$ORACLE_HOME/opmn/bin/opmnctl startall 
$ORACLE_HOME/opmn/bin/opmnctl status -l

============= ==========================
2008-9-22 RMS在迁移到公司服务器后 启动成功
          oracleas10gr3 的多个oc4j启动失败,log显示时端口被使用
          为此,为不同的oc4j指定不同的端口范围如下
          home
               <port id=”ajp” range=”14501-14200″/>
               <port id=”rmi” range=”14401-14500″/>
               <port id=”jms” range=”14601-14700″/>         
          rsm
               <port id=”ajp” range=”15501-15600″/>
               <port id=”rmi” range=”15401-15500″/>
               <port id=”jms” range=”15601-15700″/>  
          rpm
               <port id=”ajp” range=”16501-16600″/>
               <port id=”rmi” range=”16401-16500″/>
               <port id=”jms” range=”16601-16700″/>  
          alloc
               <port id=”ajp” range=”17501-17600″/>
               <port id=”rmi” range=”17401-17500″/>
               <port id=”jms” range=”17601-17700″/>  
          reim                                      
               <port id=”ajp” range=”18501-18600″/>  
               <port id=”rmi” range=”18401-18500″/> 
               <port id=”jms” range=”18601-18700″/>  

 ============== =========================
 启动:
 $ORACLE_HOME/opmn/bin/opmnctl reload
 $ORACLE_HOME/opmn/bin/opmnctl start
 $ORACLE_HOME/opmn/bin/opmnctl stopall
 $ORACLE_HOME/opmn/bin/opmnctl startall
 $ORACLE_HOME/opmn/bin/opmnctl status -l
 $ORACLE_HOME/opmn/bin/opmnctl @cluster startproc ias-component=default_group
 
 
 备注:迁移到公司,opmn 启动失败,提示端口已经被占用,但 netstat查询时世纪没有被占用,考虑查看hosts文件,是否配置错误
 正确应该是:
 127.0.0.1  localhost.domain.com localhost
 192.168.11.41 syfr12
 
 另外:在opmn.xml中 对OC4j 组件有变量:
       <variable id=”DISPLAY” value=”localhost:0″/>
       这句话是要改掉了,因为我们用root用户启了一个vncserver 其Display = localhost:1
       登陆vnc桌面,后用root用户执行xhost + ,以便于其他客户端能够连接这个Display.
      
       启动时还发现一个奇怪现象,opmn启动失败,提示端口2003已经被占用
       但是 netstat -ln | grep 2003 没有任何结果。说明2003端口没有程序在侦听
       但是 netstat -alntp | grep 2003 是由结果的 ,所有端口都被local.localhost.domain:6101 所绑定。
       解决:先把6101 的那个opmn stopall
       再检查发现 2003上的opmn端口却没有去绑定其他所有端口,再启动6101上的opmn 这样就把两个opmn都启动了,
       但是可惜6101的opmn只要一启动就立即绑定所有其他端口,这样等到启动oc4j的时候又没有剩余端口可以被绑定了
       结论: 6101的那个opmn有问题,为什么要启动有绑定所有其他端口?Bug ;你看人家2003上的opmn根本就不会去绑定不该绑的端口。 而且6101上的opmn服务不稳定。
       尝试:把原来6101的那个opmn的opmn.xml改成3003,3002,3001 ons.conf 中端口改成3002
       然后再启动,除了apache外,其他都启来了,apache没起来:可以手工启一下
       /d01/app/oracleas/OraHome_1/Apache/Apache/bin/apachectl start
            
      
      
      
      
      
      
       
 
 
 =======================================
         
            
            #备注:最好在执行vncserver 前先启动这些服务,逐条执行。
            #有的时候启动的时候出现如下现象:
            #1 OPMN 启动很慢,日志有端口冲突情况 ;EMC 启动不了,日志有端口冲突情况
            #  系统的X和VNC SERVER 使用的端口主要是5801,5901,6001,6009
            #  错误日志显示:
            #  Error starting JMS-Server: jms.xml: port 12601 already in use
            #  Error starting ORMI-Server.  Unable to bind socket: Address already in use
            #  Warning: Error reading transaction-log file (/d01/app/oracleas/OraHome_1/j2ee/home/persistence/home_default_island_1/transaction.state) for recovery: premature end of file   
            #  已经在安装时使用的端口可以查看: ORACLE_HOME/install/portlist.ini
            #  jms port:12601 不是tcp 端口,怎么重复的呢? 另外 xml文件中配置的端口一般是个范围,as服务启动的时候,一般会从最小的端口开始尝试,如果不行会自动使用更高的端口,这可以大大降低端口冲突的可能性.            
            #  在AS文档中有关于端口管理的详细解释,请参考: 4 Managing Ports
           
           
            #  成功启动后有几个问题:
           
            
            1) 登陆进去以后,所有的按钮上的图标都没有。
            解决方法: 检查发现$INSTALL_DIR/web_html/ 目录下没有图标,
            但在RMS12.0.1的目录下是看到gif目录了。copy过来以后,客户端重新登陆,图标就正常了。
           
            2) 打开任何一个Form,都报错 CONTOF@3LABL is not a member of %s2 (%s3)
            解决方法: 考虑到batch安装未成功以及问题1的解决方法,估计在能够正式使用前必须先把Patch打到12.0.7
            明天继续。
            此问题在google,metalink均无答案,估计是安装的数据库对象等有问题。
           
            要重新安装进行如下动作:
========================================           
            #准备源文件
            rm -f /d01/app/retail/rms/app/toolset/src/*
            rm -f /d01/app/retail/rms/app/toolset/bin/*
            rm -f /d01/app/retail/rms/app/rms/forms/src/*
            rm -f /d01/app/retail/rms/app/rms/forms/bin/*
            rm -f /d01/app/retail/rms/app/rms/reports/src/*
            rm -f /d01/app/retail/rms/app/rms/reports/bin/*
            #rms 12.0.0
            cp -f /d01/rms_stage/rms12appserver/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/rms_stage/rms12appserver/rms/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            cp -f /d01/rms_stage/rms12appserver/rms/reports/src/* /d01/app/retail/rms/app/rms/reports/src/
            #rms 12.0.1
            cp -f /d01/app/retail/rms/12.0.1/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.1/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            #rms 12.0.2
            cp -f /d01/app/retail/rms/12.0.2/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            #rms 12.0.3
            cp -f /d01/app/retail/rms/12.0.3/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.3/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
           
            #环境变量
            ORACLE_HOME=/d01/app/oracleas/OraHome_1
            export ORACLE_HOME   
     DISPLAY=syfr12:1.0
     INSTALL_DIR=/d01/app/retail/rms/app
     export INSTALL_DIR    
     PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/forms10gr2_scripts:$PATH
     CLASSPATH=$ORACLE_HOME/jlib/importer:$ORACLE_HOME/jlib/debugger.jar:$ORACLE_HOME/jlib/utj.jar:$ORACLE_HOME/jlib/ewt3.jar:$ORACLE_HOME/jlib/share.jar:$ORACLE_HOME/jlib/dfc.jar:$ORACLE_HOME/jlib/help4.jar:$ORACLE_HOME/jlib/oracle_ice.jar:$ORACLE_HOME/jlib/jewt4.jar
     FORMS_BUILDER_CLASSPATH=$CLASSPATH
     FORMS_PATH=$INSTALL_DIR/toolset/bin:$INSTALL_DIR/rms/forms/bin:$ORACLE_HOME/forms
     REPORTS_PATH=$INSTALL_DIR/rms/reports/bin:$ORACLE_HOME/forms
     TK_UNKNOWN==$ORACLE_HOME/guicommon/tk/admin
     UP=rms12dev/rms12dev@RETL
     LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/jdk/jre/lib/sparc:$ORACLE_HOME/jdk/jre/lib/sparc/native_threads
     export DISPLAY PATH CLASSPATH FORMS_BUILDER_CLASSPATH FORMS_PATH REPORTS_PATH TK_UNKNOWN UP LD_LIBRARY_PATH         
           
            su root
            xhost +
           
            #[RMS Toolset Installation]:
            su oretail
            cp $INSTALL_DIR/toolset/src/*.pll $INSTALL_DIR/toolset/bin
            cd $INSTALL_DIR/toolset/bin
            f10gr2plsqlconv_pll_stand45
            rm stand45.pld           
            pll2plx10gr2_toolset
            rm -f *.plx           
            cp $INSTALL_DIR/toolset/src/*.fmb $INSTALL_DIR/toolset/bin
            fmb2fmx10gr2_fm
            rm -f fm_*.fmx
            fmb2fmx10gr2           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm -f $PROGNAME
  > done  
            cp $INSTALL_DIR/toolset/src/*.mmb $INSTALL_DIR/toolset/bin
            mmb2mmx10gr2
            rm -f *.mmb
           
           
            #[RMS Forms Installation]:
            cp $INSTALL_DIR/rms/forms/src/*.pll $INSTALL_DIR/rms/forms/bin
            cd $INSTALL_DIR/rms/forms/bin
            pll2plx10gr2_forms
            rm -f *.plx
            cp $INSTALL_DIR/rms/forms/src/*.fmb $INSTALL_DIR/rms/forms/bin           
            fmb2fmx10gr2_fm
            rm -f fm_*.fmx
            fmb2fmx10gr2           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm -f $PROGNAME
  > done
            cp $INSTALL_DIR/rms/forms/src/*.mmb $INSTALL_DIR/rms/forms/bin           
            mmb2mmx10gr2
            rm -f *.mmb
           
            #[RMS Reports Installation]
            cd $INSTALL_DIR/rms/reports
            mkdir bin
            cp $INSTALL_DIR/rms/reports/src/rep25lib.pll $INSTALL_DIR/rms/reports/bin
            cd $INSTALL_DIR/rms/reports/bin          
            pll2plx10gr2_reports
            rm -f rep25lib.plx           
            cp $INSTALL_DIR/rms/reports/src/*.rdf $INSTALL_DIR/rms/reports/bin
            rdf2rep10gr2
            rm -f *.rdf
           
            2) 打开任何一个Form,都报错 CONTOF@3LABL is not a member of %s2 (%s3)
            解决方法: 考虑到batch安装未成功以及问题1的解决方法,估计在能够正式使用前必须先把Patch打到12.0.7
            打到12.0.3 这个问题依然存在
           
[root@syfr12 bin]# grep ‘is not a member of’ /d01/app/retail -r
/d01/app/retail/rms/db/data/rtk_errors.sql:’BL’, ‘INV_CODE_OR_CODE_DESC’, 1, ‘The specified code %s1 or description %s2 is not a member of %s3.’
/d01/app/retail/rms/db/data/rtk_errors.sql:’BL’, ‘MISSING_CODE’, 1, ‘%s1 is not a member of %s2 (%s3).’, ‘RETEK’, ‘Y’);
[root@syfr12 bin]#
            grep ‘MISSING_CODE’ /d01/app/retail -r
/d01/app/retail/rms/db/db_objects/languagb.pls:      O_error_message := sql_lib.create_msg(‘MISSING_CODE’, I_code, L_code_type_desc , I_code_type);
            涉及到使用MISSING_CODE的地方就此一处。
            打开 package LANGUAGE_SQL 查找MISSING_CODE; 看代码。
            引起这个错误的原因是因为到表code_detail中没有查询到需要的内容。
            估计是insert seed data 和 language data 的脚本没有运行完整。
           
            使用sql trace可以看到用户选择某个文件夹的时候执行了 sql:
            plsqldeveloper中找到来自host的rms12dev 的session
            529
            启用被session的trace
            #Event4 :binds          
            #EXECUTE SYS.DBMS_SYSTEM.SET_EV(sid,serial#,10046,EventNumber,”);
            EXECUTE SYS.DBMS_SYSTEM.SET_EV(529,14,10046,4,’rms12dev’);
            执行动作
           
            结束trace
            #EXECUTE SYS.DBMS_SYSTEM.SET_EV(sid,serial#,10046,0,”);
            EXECUTE SYS.DBMS_SYSTEM.SET_EV(529,14,10046,0,’rms12dev’);
            查看trace 文件
           
Select a.spid, a.TERMINAL, a.PROGRAM, a.username, b.OSUSER, b.PROCESS,
       b.username, b.machine, b.SID, b.MODULE, b.action, b.CLIENT_INFO,
       b.logon_time, b.sid, b.serial#, c.SQL_TEXT
From v$process a, v$session b, v$sql c
Where a.ADDR = b.PADDR
And b.sql_address = c.address(+)
And b.sid = 529
           
                
            trace 显示确实有对CODE_HEAD表和CODE_DETAIL表的访问
            select * from CODE_HEAD 表只有一条记录。
            grep ‘CODE_HEAD’ /d01/app/retail -r
            发现有SQL /d01/app/retail/rms/db/data/codes.sql 对这张表的记录做初始化。里面insert了很多记录。
            而系统中只有一条记录,显然是系统数据不完整。
            把codes.sql 重新运行一下,这个问题也就解决了,不过这个问题表明我初始化数据的时候有遗漏。           
           
            看来需要重建系统数据:
            按照pg15- rms-120-ig-addendum.pdf 进行,完成12.0.3 的hotfix部分;
            注意每一步的完成log,确保正确执行,没有中断过,以免漏数据。
            # 确保操作系统字符集被正确设置,否则seeddata中的中文会是乱码
            # 默认情况下OS,DB,SQL文件都是UTF8,但是安装后依然是乱码。可能是未设置客户端的NLS_LANG
            # env | grep NLS_LANG
            # 如果没有,需要设置一下:
            # NLS_LANG=AMERICAN_AMERICA.UTF8
            # export NLS_LANG
            # 在安装之前,可以先尝试如下insert 脚本
            # echo @mc_rejection_reasons_zhs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            # 然后在plsqldeveloper中查看中文是否正确。如果正确则说明unix的nls_lang设置是对的。
           
            unzip 5985761.zip
           
            STAGING_AREA=/d01/app/retail/rms/12.0.3/linux_hotfix
            export STAGING_AREA  
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            NLS_LANG=AMERICAN_AMERICA.UTF8
            export NLS_LANG
           
            #脚本准备
            cd $STAGING_AREA/seed_data/rms_scripts
            cp -f $STAGING_AREA/seed_data/rms_scripts/*  $INSTALL_DIR/data/
            cp -f $STAGING_AREA/seed_data/rib_scripts/*  $INSTALL_DIR/data/
            cp -rf $STAGING_AREA/seed_data/form_menu_elements $INSTALL_DIR/data/           
            #先删除
            cd $STAGING_AREA/seed_data/delete_scripts
            echo @removeRmsDemoData.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            echo @removeRmsSeedData.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #echo @delete_check.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            在PLSQLDEVELOPER 中 执行delete_check.sql 然后看output 中尚未删除的表
  #RPM_RIB_PROPERTIES             table has 3          row(s)
  #RPM_WORKSHEET_VIEW             table has 1          row(s)
  #RPM_MBC_LOV_VALUES             table has 3          row(s)
  #RPM_WORKSHEET_COLUMN           table has 118        row(s)
  #ALERT_STATUS                   table has 3          row(s)
  #TASK_STATE                     table has 4          row(s)
  #SYS_PROC_TYP                   table has 1          row(s)
  #TASK_ALERT_MODE                table has 3          row(s)
  #NAV_SERVER                     table has 1          row(s)
  #NAV_ELEMENT                    table has 184        row(s)
  #NAV_COMPONENT                  table has 2          row(s)
  #NAV_FOLDER_BASE                table has 130        row(s)
         #如果无法删除,一般是由外健引用,可用Toad的Schema browser 看表的referential 查看相关外键,先删除引用表的数据
         #解决所有未删除的数据,知道删除干净。
         #查找外键语句:SELECT * FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE=’R’ and table_name=表名
         #失效外健可用如下语句:ALTER TABLE RPM_WORKSHEET_VIEW_COL DISABLE CONSTRAINT RWC_RWN_FK;
           
            #检查 delete_check.log
            #再重建
            cd $INSTALL_DIR/data
            rm -f *.log
            $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            SQL>@rmsseeddata.sql
            SQL>username/password@database? rms12dev/rms12dev@RETL
            SQL>is vat on? Y
            SQL>What is the owner schema? RMS12DEV
            SQL>is vat_classon ? Y
            SQL>Role to add?  DEVELOPER           
            SQL>Enter Calendar type to be used? C
            SQL>Enter week start – week end option?3
            SQL>Enter date to be set as transaction date?
            SQL>Enter date to be set as transaction date (vdate as DD-MON-YYYY): 01-MAR-2008
            SQL>second language?zhs
            SQL>primy language? zhs           
            SQL>Base_contry_id ? CN
            SQL>Primy Currency ? CNY
           
            检查RmsSeedData.log发现如下错误
1)           
ORA-01400: cannot insert NULL into
(“RMS12DEV”.”SYSTEM_OPTIONS”.”INCREASE_TSF_QTY_IND”)
解决,把SYSTEM_OPTIONS.INCREASE_TSF_QTY_IND,RPM_RIB_IND,RTM_SIMPLIFIED_IND,TSF_AUTO_CLOSE_STORE
,TSF_AUTO_CLOSE_WH  更改成可以为NULL;

2)code.sql 执行失败(code.sql 只最主要的seeddata)
分析:失败原因在于ribdata.sql 执行不成攻,而不成功的原因是未找到sqlldr
解决:
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
           
            #检查log 确保脚本被全部执行完毕。
            echo @rmsdemodata.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #检查log 确保脚本被全部执行完毕。
           
            #再次重建
            #按照上面的先删除,后重建的步骤进行。注意环境变量的完整性。
           
            STAGING_AREA=/d01/app/retail/rms/12.0.3/linux_hotfix
            export STAGING_AREA  
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            NLS_LANG=AMERICAN_AMERICA.UTF8
            export NLS_LANG
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
           
            #再次重建失败,原因:虽然sqlldr已经显示成功,但是SELECT * FROM rib_doctypes只有一条记录,显然实际没有装载完整。
            #rib_doctypes_rms.dat 中有很多条记录,但是sqlldr只能加载一条就完了。
            #rib_doctypes 表中第一条记录的doc_type_data 字段显示 <Value Error>
            解决方法:安装文档提供的sqlldr的控制文件有问题,即使直接使用sqlldr也不能成功导如入。
            可做如下修改:
            1) 采用secondfile方式进行sqlldr,制作两个dat 文件,修改控制文件。
            2)更改 ribdoctypes.sql 的内容使之符合刚才更改后的sqlldr命令。
            #再次重建 成功
            #成功的标志是检查rmsseeddata.log没有一个ORA错误。在没有错误的情况下,界面汉化是完整的,如果出现部分错误,汉化可能不完整,系统加载也可能出现各种错误。
           
           
            #$ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #SQL>@rmsdemodata.sql 
            #Demo Data暂时不安装,先把patch打到12.0.7 再安装
            #因为Retail的多语言支持不是通过fmb,而是在数据库里面存储界面上的多语言标签的,所以各版本的的patch虽然有多个语言版本,但实际上只要下载generic版即可。(其他语言的patch 和 gereric实际是一样的,形式主义。)
           
============================================================
            #接下来把patch从12.0.4 – 12.0.7 的patch全部打完
            #先打DB Patch
            #再打App Patch
           
            su oracle
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            NLS_LANG=AMERICAN_AMERICA.UTF8
            export NLS_LANG
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
           
           
            ================= db patch for 12.0.4==========================================
            STAGING_AREA=/d01/app/retail/rms/12.0.4/dbserverunix
            export STAGING_AREA
                      
            cd $STAGING_AREA/pricing/xml(这里安装文档是错误的,安装文档说是/pricing/types)
            echo @pricing1204type.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                       
            cd $STAGING_AREA/pricing/dbcs                   
            echo @pricing1204dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           

            cd $STAGING_AREA/pricing/db_objects                   
            echo @pricing1204rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1204ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1204rsm.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #错误:named_permission_dsc 表不存在
            #grep ‘named_permission_dsc’ /d01/app/retail/rsm -r
            #未找到,说明rms安装时不会drop这张表。那么这张表怎么缺失的呢?
            #grep ‘named_permission_dsc’ /d01/app/retail/rms -r > find_named_permission_dsc.log
            #找到一大堆,select * from all_objects 发现named_permission_dsc 在 rsm12dev schema中
            #解决 :改为rsm12dev登陆
            echo @pricing1204rsm.sql | $ORACLE_HOME/bin/sqlplus rsm12dev/rsm12dev@RETL
            #还有错误,原因是named_permission表中数据太少
            #解决方法:运行 /d01/app/retail/rms/db/pricing/rsm/rsm12rpm.sql 进行初始化(在安装文档中未提到这一点)
            cd /d01/app/retail/rms/db/pricing/rsm
            echo @rsm12rpm.sql | $ORACLE_HOME/bin/sqlplus rsm12dev/rsm12dev@RETL
            #错误:final_named_permission_dsc 表不存在,其他insert正常。
            grep ‘final_named_permission_dsc’ /d01/app/retail/rms/db/pricing/ddl -r
            #没有结果
            #从表结构看 final_named_permission_dsc 与 named_permission_dsc 是一样的,
            #如果named_permission_dsc 是 final_named_permission_dsc 的替代品的话 final_named_permission_dsc 的insert错误可以忽略
            #再执行 12.0.4 的rsm data:
            cd $STAGING_AREA/pricing/data
            echo @pricing1204rsm.sql | $ORACLE_HOME/bin/sqlplus rsm12dev/rsm12dev@RETL
            #基本成功(就一条错误,忽略)
            #小结:如果是在没有安装RSM前打RMS12.0.4的patch,则pricing1204rsm.sql 应该可以不执行
            #因为这个sql 依赖于rsm12dev Schema ,这必须在rsm安装后才能有的。
           
           
            cd $STAGING_AREA/dbcs
            echo @patch1204dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/db_objects
            echo @patch1204rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1204ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang/ZHS
            echo @patch1204ctl_zhs_sec.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
           
           
            ================= db patch for 12.0.5==========================================
            STAGING_AREA=/d01/app/retail/rms/12.0.5/dbserverunix
            export STAGING_AREA
                      
            cd $STAGING_AREA/pricing/types
            echo @pricing1205types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                       
            cd $STAGING_AREA/pricing/dbcs                   
            echo @pricing1205dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           

            cd $STAGING_AREA/pricing/db_objects                   
            echo @pricing1205rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/dbcs
            echo @patch1205dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #错误:s6119605_add_cc_sec_policy.sql  错误 invalid column “ORIG_CC_NO” (基于vpd的策略函数) SA_ERROR 表中没有 ORIG_CC_NO 列
            #      patch1205dbcs.sql 在执行到 s6119605_add_cc_sec_policy.sql时中断,解决问题后需要手工从这里再开始
            #
            grep ‘ORIG_CC_NO’  /d01/app/retail/rms -r   
            #找到 /d01/app/retail/rms/12.0.5/dbserverunix/dbcs/s6119605_sa_error.sql:ALTER TABLE SA_ERROR ADD ORIG_CC_NO VARCHAR2(40) 
            #晕倒,在patch1205dbcs.sql 中 s6119605_sa_error.sql 居然排在 s6119605_add_cc_sec_policy.sql 后面
            #解决方法:编辑patch1205dbcs.sql ,把顺序排正确,把s6119605_add_cc_sec_policy.sql 和 s6119605_add_cc_sec_fga_policy.sql
            #排到最后一个s6119605开头的sql后面。前面已经执行完的语句去掉。
            cp patch1205dbcs.sql patch1205dbcs.sql.bak
            vi patch1205dbcs.sql
           
spool patch1205dbcs.log;

— Startall —
prompt ‘Starting File: s6119605_sa_error_rev.sql’;
@@s6119605_sa_error_rev.sql;
prompt ‘Starting File: s6119605_sa_error.sql’;
@@s6119605_sa_error.sql;
prompt ‘Starting File: s6119605_sa_error_temp.sql’;
@@s6119605_sa_error_temp.sql;
prompt ‘Starting File: s6119605_sa_error_wksht.sql’;
@@s6119605_sa_error_wksht.sql;
prompt ‘Starting File: s6119605_sa_system_options.sql’;
@@s6119605_sa_system_options.sql;
prompt ‘Starting File: s6119605b_sa_system_options.sql’;
@@s6119605b_sa_system_options.sql;
prompt ‘Starting File: s6119605_v_sa_error_all.sql’;
@@s6119605_v_sa_error_all.sql;
prompt ‘Starting File: s6119605_add_cc_sec_policy.sql’;
@@s6119605_add_cc_sec_policy.sql;
prompt ‘Starting File: s6119605_add_cc_sec_fga_policy.sql’;
@@s6119605_add_cc_sec_fga_policy.sql;
prompt ‘Starting File: s6124934_terms_detail.sql’;
@@s6124934_terms_detail.sql;
prompt ‘Starting File: s6137471_sups.sql’;
@@s6137471_sups.sql;
prompt ‘Starting File: s6153829_mrt.sql’;
@@s6153829_mrt.sql;
prompt ‘Starting File: s6156382_item_loc_hist_mth.sql’;
@@s6156382_item_loc_hist_mth.sql;
prompt ‘Starting File: s6199940_sa_error.sql’;
@@s6199940_sa_error.sql;
prompt ‘Starting File: s6236684_pos_merch_criteria.sql’;
@@s6236684_pos_merch_criteria.sql;
prompt ‘Starting File: s6269890_item_supp_country_loc.sql’;
@@s6269890_item_supp_country_loc.sql;
prompt ‘Starting File: s6276228_ce_ord_item.sql’;
@@s6276228_ce_ord_item.sql;
prompt ‘Starting File: s6317116_pk_index.sql’;
@@s6317116_pk_index.sql;
prompt ‘Starting File: rms_table_ald_aiudr.trg’;
@@rms_table_ald_aiudr.trg;
prompt ‘Starting File: rms_table_rpm_itl_aiudr.trg’;
@@rms_table_rpm_itl_aiudr.trg;
spool off;

exit; 
           
            #再执行
            echo @patch1205dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #又错啦,策略重复。
            #解决:编辑 s6119605_add_cc_sec_policy.sql 把刚才已经完成的策略去掉
            cp s6119605_add_cc_sec_policy.sql s6119605_add_cc_sec_policy.sql.bak
            vi s6119605_add_cc_sec_policy.sql
            编辑patch1205dbcs.sql 把刚才已经执行过的语句去掉
            cp patch1205dbcs.sql patch1205dbcs.sql.bak2
            vi patch1205dbcs.sql
— Startall —
prompt ‘Starting File: s6119605_add_cc_sec_policy.sql’;
@@s6119605_add_cc_sec_policy.sql;
prompt ‘Starting File: s6119605_add_cc_sec_fga_policy.sql’;
@@s6119605_add_cc_sec_fga_policy.sql;
prompt ‘Starting File: s6124934_terms_detail.sql’;
@@s6124934_terms_detail.sql;
prompt ‘Starting File: s6137471_sups.sql’;
@@s6137471_sups.sql;
prompt ‘Starting File: s6153829_mrt.sql’;
@@s6153829_mrt.sql;
prompt ‘Starting File: s6156382_item_loc_hist_mth.sql’;
@@s6156382_item_loc_hist_mth.sql;
prompt ‘Starting File: s6199940_sa_error.sql’;
@@s6199940_sa_error.sql;
prompt ‘Starting File: s6236684_pos_merch_criteria.sql’;
@@s6236684_pos_merch_criteria.sql;
prompt ‘Starting File: s6269890_item_supp_country_loc.sql’;
@@s6269890_item_supp_country_loc.sql;
prompt ‘Starting File: s6276228_ce_ord_item.sql’;
@@s6276228_ce_ord_item.sql;
prompt ‘Starting File: s6317116_pk_index.sql’;
@@s6317116_pk_index.sql;
prompt ‘Starting File: rms_table_ald_aiudr.trg’;
@@rms_table_ald_aiudr.trg;
prompt ‘Starting File: rms_table_rpm_itl_aiudr.trg’;
@@rms_table_rpm_itl_aiudr.trg;

spool off;

exit;           
            #再执行
            echo @patch1205dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #执行到 s6199940_sa_error.sql 又错了:
  Updating Indexes on ‘SA_ERROR’
  DROP INDEX SA_ERROR_I5
             *
  ERROR at line 1:
  ORA-01418: specified index does not exist
           #解决:编辑 s6199940_sa_error.sql ,去掉drop index语句;再编辑patch1205dbcs.sql,从s6199940_sa_error.sql开始。
           vi s6199940_sa_error.sql
           vi patch1205dbcs.sql
            #再执行
            echo @patch1205dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           #错误:s6317116_pk_index.sql
          
  Creating Primary Key on ‘ITEM_SUPP_COUNTRY_LOC’
  ALTER TABLE ITEM_SUPP_COUNTRY_LOC
  *
  ERROR at line 1:
  ORA-14016: underlying table of a LOCAL partitioned index must be partitioned 

           #原因是Primary key的创建语句使用了USING INDEX LOCAL ,这要求表和索引是分区的,但我们的Demo环境没有进行分区。
           #解决方法,去掉里面的LOCAL语句
           #接下来的sql个执行
           cp s6317116_pk_index.sql s6317116_pk_index.sql.bak
           vi s6317116_pk_index.sql
           #去掉local
           echo @s6317116_pk_index.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           echo @rms_table_ald_aiudr.trg | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           echo @rms_table_rpm_itl_aiudr.trg | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
          
           #全部完成                             
           
            cd $STAGING_AREA/db_objects
            echo @patch1205rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1205ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang/ZHS
            echo @patch1205ctl_zhs_sec.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            #完成
           
            ================= db patch for 12.0.6==========================================
           
            STAGING_AREA=/d01/app/retail/rms/12.0.6/dbserverunix
            export STAGING_AREA
                      
            cd $STAGING_AREA/pricing/types
            echo @pricing1206types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                       
            cd $STAGING_AREA/pricing/dbcs                   
            echo @pricing1206dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           

            cd $STAGING_AREA/pricing/db_objects                   
            echo @pricing1206rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/pricing/data
            echo @pricing1206ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL      
           
            cd $STAGING_AREA/dbcs
            echo @patch1206dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/db_objects
            echo @patch1206rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1206ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data/lang/ZHS
            echo @patch1206ctl_zhs_sec.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            #顺利完成
           
           
            ================= db patch for 12.0.7==========================================
            STAGING_AREA=/d01/app/retail/rms/12.0.7/dbserverunix
            export STAGING_AREA
                      
            cd $STAGING_AREA/pricing/types
            echo @pricing1207types.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
                       
            cd $STAGING_AREA/pricing/dbcs                   
            echo @pricing1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           

            cd $STAGING_AREA/pricing/db_objects                   
            echo @pricing1207rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL           
           
            cd $STAGING_AREA/dbcs
            echo @patch1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #有问题:
  ALTER TABLE SYSTEM_OPTIONS DROP CONSTRAINT CHK_SYS_OPT_ELC_IND
                                             *
  ERROR at line 1:
  ORA-02443: Cannot drop constraint  – nonexistent constraint
            #停在SQL s6401279a_system_options.sql
            #解决方法:编辑s6401279a_system_options.sql 去掉语句:ALTER TABLE SYSTEM_OPTIONS DROP CONSTRAINT CHK_SYS_OPT_ELC_IND
            #编辑patch1207dbcs.sql ,去掉s6401279a_system_options.sql以前的语句
            cp s6401279a_system_options.sql s6401279a_system_options.sql.bak
            vi s6401279a_system_options.sql
            cp patch1207dbcs.sql patch1207dbcs.sql.bak
            vi patch1207dbcs.sql
            echo @patch1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #有问题
            #停在:s6694465e_SYSTEM_OPTIONS.sql   constraint CHK_SOP_AIP_IND 不存在
            #解决方法:把这个文件中的drop constaint语句全部去掉,其他同上
            vi s6694465e_SYSTEM_OPTIONS.sql
            vi patch1207dbcs.sql
            echo @patch1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #有问题 ,往system_option  表回插数据的时候,有些字段不能为NULL,但实际数据是NULL的。
            把system_option表中的如下字段设置为Null ,然后接着执行。
            INCREASE_TSF_QTY_IND
            RPM_RIB_IND
            RTM_SIMPLIFIED_IND,
            TSF_AUTO_CLOSE_STORE
            TSF_AUTO_CLOSE_WH
            vi s6694465e_SYSTEM_OPTIONS.sql
            vi patch1207dbcs.sql
            echo @patch1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #又出错啦,sql停在 s6766707a_ALLOC_STATUS_TRIGGER.sql ;原因ORA-04080: trigger ‘ALLOC_STATUS_TRIGGER’ does not exist
            #解决方法:编辑s6766707a_ALLOC_STATUS_TRIGGER.sql 去掉这条语句
            #          编辑vi patch1207dbcs.sql 去掉 s6766707a_ALLOC_STATUS_TRIGGER.sql前的所有语句。
            cp s6766707a_ALLOC_STATUS_TRIGGER.sql s6766707a_ALLOC_STATUS_TRIGGER.sql.bak
            vi s6766707a_ALLOC_STATUS_TRIGGER.sql
            vi patch1207dbcs.sql
            echo @patch1207dbcs.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #OK 完成!           
           
            cd $STAGING_AREA/db_objects
            echo @patch1207rms.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/utility
            echo @inv_obj_comp.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            cd $STAGING_AREA/data
            echo @patch1207ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #出错啦
            #出错文件:c6694465d_nav_folder_base.sql :语句:
   insert into nav_folder_base(folder,
   *
   ERROR at line 1:
   ORA-02291: integrity constraint (RMS12DEV.NFB_NFB_FK) violated – parent key not
   found
            #解决方法:把c6694465d_nav_folder_base.sql 放到sqldeveloper中单独执行:
            #结果其他语句都正常,唯有这一句失败
            insert into nav_folder_base(folder,
                            folder_name,
                            parent_folder)
                    values(‘REPLENISHMENT’,
                           ‘Replenishment’,
                           ‘ITEM_RELATED’
                          );
            #完整性外健约束是因为字段 PARENT_FOLDER 上有外健,引用的是本表的FOLDER字段,那么如果是第一条记录
            #肯定是不符合外健约束的了,解决方法:去掉这个约束。
            #编辑 patch1207ctl.sql ,去掉包括c6694465d_nav_folder_base.sql 以前的所有语句。
            vi patch1207ctl.sql
            echo @patch1207ctl.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #完成
          
            cd $STAGING_AREA/data/lang/ZHS
            echo @patch1207ctl_zhs_sec.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            #全部完成
           
============================================================
            #从12.0.4 – 12.0.7 的AppPatch
                      
            #准备源文件(各版本的patch)
           
            rm -f /d01/app/retail/rms/app/toolset/bin/*           
            rm -f /d01/app/retail/rms/app/rms/forms/bin/*           
            rm -f /d01/app/retail/rms/app/rms/reports/bin/*

            #rms 12.0.4
            cp -f /d01/app/retail/rms/12.0.4/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.4/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            #rms 12.0.5
            cp -f /d01/app/retail/rms/12.0.5/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.5/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            #rms 12.0.6
            cp -f /d01/app/retail/rms/12.0.6/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.6/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
            cp -f /d01/app/retail/rms/12.0.6/appserverunix/reports/src/* /d01/app/retail/rms/app/rms/forms/src/
            #rms 12.0.7
            cp -f /d01/app/retail/rms/12.0.7/appserverunix/toolset/src/* /d01/app/retail/rms/app/toolset/src/
            cp -f /d01/app/retail/rms/12.0.7/appserverunix/forms/src/* /d01/app/retail/rms/app/rms/forms/src/
           
            #环境变量
            ORACLE_HOME=/d01/app/oracleas/OraHome_1
            export ORACLE_HOME   
     DISPLAY=syfr12:1.0
     INSTALL_DIR=/d01/app/retail/rms/app
     export INSTALL_DIR    
     PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/forms10gr2_scripts:$PATH
     CLASSPATH=$ORACLE_HOME/jlib/importer:$ORACLE_HOME/jlib/debugger.jar:$ORACLE_HOME/jlib/utj.jar:$ORACLE_HOME/jlib/ewt3.jar:$ORACLE_HOME/jlib/share.jar:$ORACLE_HOME/jlib/dfc.jar:$ORACLE_HOME/jlib/help4.jar:$ORACLE_HOME/jlib/oracle_ice.jar:$ORACLE_HOME/jlib/jewt4.jar
     FORMS_BUILDER_CLASSPATH=$CLASSPATH
     FORMS_PATH=$INSTALL_DIR/toolset/bin:$INSTALL_DIR/rms/forms/bin:$ORACLE_HOME/forms
     REPORTS_PATH=$INSTALL_DIR/rms/reports/bin:$ORACLE_HOME/forms
     TK_UNKNOWN==$ORACLE_HOME/guicommon/tk/admin
     UP=rms12dev/rms12dev@RETL
     LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/jdk/jre/lib
     export DISPLAY PATH CLASSPATH FORMS_BUILDER_CLASSPATH FORMS_PATH REPORTS_PATH TK_UNKNOWN UP LD_LIBRARY_PATH   
            #注意:这里不要多此一举的去设置NLS_LANG参数,否则会出现错误: can’t start/complete ….
           
           
            su root
            xhost +
           
            #[RMS Toolset Installation]:
            su oretail
            cp $INSTALL_DIR/toolset/src/*.pll $INSTALL_DIR/toolset/bin
            cd $INSTALL_DIR/toolset/bin        
            pll2plx10gr2_toolset
            rm -f *.plx           
            cp $INSTALL_DIR/toolset/src/*.fmb $INSTALL_DIR/toolset/bin
            fmb2fmx10gr2_fm
            rm -f fm_*.fmx
            fmb2fmx10gr2           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm -f $PROGNAME
  > done  
            cp $INSTALL_DIR/toolset/src/*.mmb $INSTALL_DIR/toolset/bin
            mmb2mmx10gr2
            rm -f *.mmb
           
           
            #[RMS Forms Installation]:
            cp $INSTALL_DIR/rms/forms/src/*.pll $INSTALL_DIR/rms/forms/bin
            cd $INSTALL_DIR/rms/forms/bin
            pll2plx10gr2_forms
            rm -f *.plx
            cp $INSTALL_DIR/rms/forms/src/*.fmb $INSTALL_DIR/rms/forms/bin           
            fmb2fmx10gr2_fm
            rm -f fm_*.fmx
            fmb2fmx10gr2           
                for PROG in `ls *.fmb | grep -v fm_`
  > do PROGNAME=`echo $PROG`
  > rm -f $PROGNAME
  > done
            cp $INSTALL_DIR/rms/forms/src/*.mmb $INSTALL_DIR/rms/forms/bin           
            mmb2mmx10gr2
            rm -f *.mmb
           
            #[RMS Reports Installation]
            cd $INSTALL_DIR/rms/reports
            mkdir bin
            cp $INSTALL_DIR/rms/reports/src/rep25lib.pll $INSTALL_DIR/rms/reports/bin
            cd $INSTALL_DIR/rms/reports/bin          
            pll2plx10gr2_reports
            rm -f rep25lib.plx           
            cp $INSTALL_DIR/rms/reports/src/*.rdf $INSTALL_DIR/rms/reports/bin
            rdf2rep10gr2
            rm -f *.rdf
           
            2) 打开任何一个Form,都报错 CONTOF@3LABL is not a member of %s2 (%s3)
            解决方法: 考虑到batch安装未成功以及问题1的解决方法,估计在能够正式使用前必须先把Patch打到12.0.7
            打到12.0.3 这个问题依然存在

============================================================
            #从12.0.4 – 12.0.7 的Batch Patch

rm -f /d01/app/retail/rms/db/rms/oracle/lib/bin/*
rm -f /d01/app/retail/rms/db/rms/oracle/proc/bin/*
           
           
su oretail
cp -f /d01/app/retail/rms/12.0.4/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/
cp -f /d01/app/retail/rms/12.0.5/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/
cp -f /d01/app/retail/rms/12.0.6/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/ 
cp -f /d01/app/retail/rms/12.0.7/dbserverunix/batch/lib/src/*  /d01/app/retail/rms/db/rms/oracle/lib/src/        
cp -f /d01/app/retail/rms/12.0.4/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/
cp -f /d01/app/retail/rms/12.0.5/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/
cp -f /d01/app/retail/rms/12.0.6/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/ 
cp -f /d01/app/retail/rms/12.0.7/dbserverunix/batch/proc/src/*  /d01/app/retail/rms/db/rms/oracle/proc/src/ 

           再按照正常的步骤编译和安装batch
                   
            # [Set Environment Variables]:
            su oretail
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            MMHOME=$INSTALL_DIR/rms
            export MMHOME
            MMUSER=rms12dev
            PASSWORD=rms12dev
            export MMUSER
            export PASSWORD
            LD_LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LD_LIBRARY_PATH
            export LD_LIBRARY_PATH
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
            LIBRARY_PATH=$ORACLE_HOME/lib:$MMHOME/oracle/lib/bin:$LIBRARY_PATH
            export LIBRARY_PATH
           
            # [Configure Make File]:
            cd $INSTALL_DIR/rms/oracle/lib/src
            cp -f platform_linux_oel_x86_64.mk platform.mk
            ./oramake
           
     # [Compile Batch Libraries ]
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk depend 2>&1 | tee libdpnd.log(这句话需要key进去,不能copy 忽略警告)
            cd $INSTALL_DIR/rms/oracle/lib/src
            make -f retek.mk -r retek rms resa 2>&1 | tee libretek.log
            #这次make 一次性通过,居然没有出什么错误。 早知道这样,就应该在开始的时候,一次性的把12.0.0-12.0.7 的原文件全部累堆在一起。
                       
            #[To install batch libraries]
            make –f retek.mk install
             
            #[Compile Batch Source Code]
            cd $INSTALL_DIR/rms/oracle/proc/src
            make -f mts.mk rms-depend recs-depend rtm-depend resa-depend 2>&1 | tee srcdpnd.log (key 进去)
            #会有警告 stddef.h 找不到,不用管它,是makedepend 本身的搜索路径有问题,gcc没有问题。
            make -f rms.mk PRODUCT_PROCFLAGS=dynamic=ansi ditinsrt(key 进去)
            #正常。
           
           
            cd $INSTALL_DIR/rms/oracle/proc/src/
            make -f mts.mk rms-ALL recs-ALL resa-ALL rtm-ALL 2>&1 | tee srcall.log(key 进去)
            #出现错误:file : sacrypt.pc ; statement : PLS-S-00201, identifier ‘DBMS_CRYPTO.ENCRYPT_AES128’ must be declared
            #分析ENCRYPT_AES128 是 package DBMS_CRYPTO中声明的常量。
            #在DBMS_CRYPTO package 中可以查到:
            #ENCRYPT_AES128     CONSTANT PLS_INTEGER            :=     6;  — 0x0006
            #以rms12dev 执行 SELECT DBMS_CRYPTO.ENCRYPT_AES128 FROM dual 时也报无效的标识符错误。
            #权限问题
            #$ORACLE_HOME/bin/sqlplus ‘/as sysdba’
            SQL>grant execute on DBMS_CRYPTO to rms12dev with grant option;
            再执行Make
            #又出问题啦:
            #SART_THTEND 重复定义;原因:这是以前版本在build的时候因为缺少这个定义而自己加进去的,现在新版本的
            #make已经修正了,所以这自己添加的内容得去掉。
            vi saimptlog_rounding.pc
     #去掉 const char *SART_THTEND=”E”;  #const char *SART_THTTSA=”S”;
     vi saimptlogfin.pc
     #去掉 #const char *SYSI_MLA=”M”;
            #再执行Make
            #这回成功了。
            #小结,如果一开始 就直接对batch的源文件堆叠到12.0.7的话,应该只需要执行grant execute on DBMS_CRYPTO to rms12dev with grant option; 就可以顺利make 通过了,不需要走那么多弯路。
           
            #[To install batch programs ]
            make -f mts.mk rms-install recs-install resa-install rtm-install
            #成功完成
              
============================================================
            #安装种子数据(基本设置)
            #原来已经装好了,但是因为打了DBpatch,所以又要重装了.
            unzip 5985761.zip
           
            STAGING_AREA=/d01/app/retail/rms/12.0.3/linux_hotfix
            export STAGING_AREA  
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            NLS_LANG=AMERICAN_AMERICA.UTF8
            export NLS_LANG
            PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$INSTALL_DIR/rms/oracle/lib/src:$PATH
            export PATH
           
            确认如下条件成立:
            1) SYSTEM_OPTIONS.INCREASE_TSF_QTY_IND,RPM_RIB_IND,RTM_SIMPLIFIED_IND,TSF_AUTO_CLOSE_STORE,TSF_AUTO_CLOSE_WH  更改成可以为NULL;
            2) ribdoctypes.sql 是经过更改后的, 使用两个数据文件进行sqlldr的. (把$INSTALL_DIR/cux-seed-rib-data/* 覆盖到$INSTALL_DIR/data/)
           
            #脚本准备(已完成 参考上文的seeddata安装)
            #先删除
            cd $STAGING_AREA/seed_data/delete_scripts
            echo @removeRmsDemoData.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            echo @removeRmsSeedData.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            #echo @delete_check.sql | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            在PLSQLDEVELOPER 中 执行delete_check.sql 然后看output 中尚未删除的表
            如果存在则手工删除(truncate 或者 delete from)
         #如果无法删除,一般是由外健引用,可用Toad的Schema browser 看表的referential 查看相关外键,先删除引用表的数据
         #解决所有未删除的数据,知道删除干净。
         #查找外键语句:SELECT * FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE=’R’ and table_name=表名
         #失效外健可用如下语句:ALTER TABLE RPM_WORKSHEET_VIEW_COL DISABLE CONSTRAINT RWC_RWN_FK;

            #重建
            cd $INSTALL_DIR/data
            rm -f *.log
            $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            SQL>@rmsseeddata.sql
            SQL>username/password@database? rms12dev/rms12dev@RETL
            SQL>is vat on? Y
            SQL>What is the owner schema? RMS12DEV
            SQL>is vat_classon ? Y
            SQL>Role to add?  DEVELOPER           
            SQL>Enter Calendar type to be used? C
            SQL>Enter week start – week end option?3
            SQL>Enter date to be set as transaction date?
            SQL>Enter date to be set as transaction date (vdate as DD-MON-YYYY): 01-MAR-2008
            SQL>second language?zhs
            SQL>primy language? zhs           
            SQL>Base_contry_id ? CN
            SQL>Primy Currency ? CNY
           
            检查RmsSeedData.log
            #成功的标志是检查rmsseeddata.log没有一个ORA错误。
            #在没有错误的情况下,界面汉化是完整的,如果出现部分错误,汉化可能不完整,系统加载也可能出现各种错误。
            #因为Retail的多语言支持不是通过fmb,而是在数据库里面存储界面上的多语言标签的,所以各版本的的patch虽然有多个语言版本,但实际上只要下载generic版即可。(其他语言的patch 和 gereric实际是一样的,形式主义。)
============================================================
            #安装演示数据(Demo数据)
            #demo 的数据主要在 general_data_installb.pls 中 ,该文件只是在12.0.1-12.0.2 patch 和 12.0.3 hotfix中存在,在以后的patch中都不存在。
            #general_data_installb.pls的最新版本是在12.0.3 hotfix中的。
           
            su oretail
           
            INSTALL_DIR=/d01/app/retail/rms/db
            export INSTALL_DIR
            ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
            export ORACLE_HOME
            ORACLE_SID=RETL
            export ORACLE_SID
            NLS_LANG=AMERICAN_AMERICA.UTF8
            export NLS_LANG
           
            cd /d01/rms_stage/5985761/seed_data/db_objects/           
            echo @general_data_installs.pls | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            echo @general_data_installb.pls | $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
           
            #备注;在前面的步骤中 rmsdemodata.sql 已经从12.0.3的linux hotfix(patch 5985761)中Copy 到$INSTALL_DIR/data中了)
            cd $INSTALL_DIR/data
            $ORACLE_HOME/bin/sqlplus rms12dev/rms12dev@RETL
            SQL>@rmsdemodata.sql
                Enter the Base Country Id (2 characters): CN
  Enter the Primary currency: CNY
  Is Multi-channel on? Y or N: Y
  Is Bracket Costing on? Y or N: Y
  What is the owner schema? rms12dev
  Number of items to create: 2000
  Transaction level: 1
         #成功完成
            
            
            
      =========DEMO数据安装完成===========================
     
     
==============
帮助文件配置
==============
                   
      HELP_DIR=/d01/app/retail/rms/app/web_html
      APACHE_CONF=/d01/app/oracleas/OraHome_1/Apache/Apache/conf
      vi /d01/app/oracleas/OraHome_1/Apache/Apache/conf/httpd.conf
      在文件末添加如下行:
     

#PerlRequire
<Location /java/help>
SetHandler perl-script
PerlHandler Apache::Registry
AddHandler perl-script .pl
Options +ExecCGI
PerlSendHeader On
</Location>     
Alias /java/help/ “/d01/app/retail/rms/app/web_html/help/”     
Alias /web_gif/ “/d01/app/retail/rms/app/web_html/gif/”
Alias /en/ “/d01/app/retail/rms/app/web_html/helpfiles/english/”
Alias /EN/ “/d01/app/retail/rms/app/web_html/helpfiles/english/”
Alias /zhs/ “/d01/app/retail/rms/app/web_html/helpfiles/english/”
Alias /ZHS/ “/d01/app/retail/rms/app/web_html/helpfiles/english/”
Alias /english/ “/d01/app/retail/rms/app/web_html/helpfiles/english/”
Alias /temp/ “/d01/app/retail/rms/app/web_html/temp/”     
     
      重启动Apache
      ORACLE_HOME=/d01/app/oracleas/OraHome_1
      export ORACLE_HOME
      $ORACLE_HOME/opmn/bin/opmnctl status -l
     
      $ORACLE_HOME/opmn/bin/opmnctl @cluster restartproc ias-component=WebCache
      $ORACLE_HOME/opmn/bin/opmnctl @cluster restartproc ias-component=HTTP_Server
      $ORACLE_HOME/opmn/bin/opmnctl @cluster startproc ias-component=HTTP_Server
      http://syfr12:7777/forms/frmservlet?config=rms

 

 

关于作者:

昵称:商云方
档案信息:顾问, HAND张江技术中心
联系方式:你可以通过yunfang.shang@hand-china.com联系作者
点击查看发表过的所有文章...
本文永久链接: http://blog.retailsolution.cn/archives/34

 

 

对本文的评价:

 

 

分类: 商品管理 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
您必须在 登录 后才能发布评论.