1. 克隆环境
1.1. 准备源环境
首先在源环境的应用和数据库结点执行AutoConfig,以DEV环境为例:
先登录数据库服务器:
su - oradev
cd $ORACLE_HOME/appsutil/scripts/DEV_cass01
adautocfg.sh
perl adpreclone.pl dbTier
然后再登录应用服务器:
su – appldev
cd $ADMIN_SCRIPTS_HOME
adautocfg.sh
cd $INST_TOP/admin/scripts
perl adpreclone.pl appsTier
1.2. 复制文件
如果是数据覆盖,不需要Clone应用结点,那么只需要复制所有的数据文件到目标服务器中。如果是全部克隆,则需要把所有的应用结点和数据库结点的文件复制到目标服务器相应的位置。如果用cp命令复制,请注意符号链接一定要保留,请用cp –RH <source> <destination>。若在不同的服务器,可以用tar命令压缩后,用ftp上传到目标服务器上,再解压。
tar cvf - app | gzip > app_
tar cvf - db | gzip > db_
若需要则创建新的用户:
cloneuseradd -u 10005 -g 10000 -d /export/home/oraptch -m oraptch
useradd -u 10105 -g 10001 -d /export/home/applptch -m applptch
若需要则解压缩对应的文件,在目标目录下执行:
gunzip -c /export/home/erp_install/app_ | tar xvf -
gunzip -c /export/home/erp_install/db_ | tar xvf -
等所有的文件都复制到指定的位置以后,需要更改文件命名和文件所属者,以DEV克隆到PTCH为例:
cd /u02/ptch/ora
mv TEST PTCH
cd /u02/ptch/
chown -R oraptch:dba ora
cd /u02/ptch/app/
mv DEV PTCH
cd /u02/ptch
chown -R applptch:applmgr app
若在更改所属者过程中报错说文件不到,则需要重新做链接(注意更改其路径)
对数据库,以oraptch执行如下:
cd /u02/cln2/db/oracle/CLN2/db/tech_st/11.1.0/lib
mv hsdb_inf.so hsdb_inf.so.0425
mv hsdb_odbc.so hsdb_odbc.so.0425
mv hsdb_oing.so hsdb_oing.so.0425
mv hsdb_ora.so hsdb_ora.so.0425
mv hsdb_syb.so hsdb_syb.so.0425
mv libnavhoa.a libnavhoa.a.0425
mv libclntsh.so.10.1 libclntsh.so.10.1.0425
ln -sf ../lib32/hsdb_inf.so hsdb_inf.so
ln -sf ../lib32/hsdb_odbc.so hsdb_odbc.so
ln -sf ../lib32/hsdb_oing.so hsdb_oing.so
ln -sf ../lib32/hsdb_ora.so hsdb_ora.so
ln -sf ../lib32/hsdb_syb.so hsdb_syb.so
ln -sf ../lib32/libnavhoa.a libnavhoa.a
ln -sf libclntsh.so libclntsh.so.10.1
cd /u02/cln2/db/oracle/CLN2/db/tech_st/11.1.0/lib32
mv ldflags ldflags.0425
mv libclntsh.so.10.1 libclntsh.so.10.1.0425
ln -sf ../lib/ldflags ldflags
ln -sf libclntsh.so libclntsh.so.10.1
cd /u02/cln2/db/oracle/CLN2/db/tech_st/11.1.0/instantclient32
mv libclntsh.so.11.1 libclntsh.so.11.1.0425
mv libnnz11.so libnnz11.so.0425
mv libheteroxa11.so libheteroxa11.so.0425
mv libocci.so.11.1 libocci.so.11.1.0425
mv libocijdbc11.so libocijdbc11.so.0425
mv libskgxp11.so libskgxp11.so.0425
ln -sf ../lib32/libclntsh.so.11.1 libclntsh.so.11.1
ln -sf ../lib32/libheteroxa11.so libheteroxa11.so
ln -sf ../lib32/libnnz11.so libnnz11.so
ln -sf ../lib32/libocci.so.11.1 libocci.so.11.1
ln -sf ../lib32/libocijdbc11.so libocijdbc11.so
ln -sf ../lib32/libskgxp11.so libskgxp11.so
cd /u02/cln2/db/oracle/CLN2/db/tech_st/11.1.0/bin
mv lbuilder lbuilder.0425
ln -sf ../nls/lbuilder/lbuilder lbuilder
cd /u02/cln2/db/oracle/CLN2/db/tech_st/11.1.0/precomp/public32
mv ORACA.FOR ORACA.FOR.0425
ln -sf ../public/oraca.for ORACA.FOR
对应用,以applptch执行如下:
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.3/lib32
mv ldflags ldflags.0427
mv libocci.so libocci.so.0427
ln -sf ../lib/ldflags ldflags
ln -sf libocci.so.10.1 libocci.so
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.2/lib32
mv ldflags ldflags.0427
mv libocci.so libocci.so.0427
ln -sf ../lib/ldflags ldflags
ln -sf libocci.so.10.1 libocci.so
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.3/lib
mv hsdb_inf.so hsdb_inf.so.0427
mv hsdb_odbc.so hsdb_odbc.so.0427
mv hsdb_oing.so hsdb_oing.so.0427
mv hsdb_ora.so hsdb_ora.so.0427
mv hsdb_syb.so hsdb_syb.so.0427
mv libnavhoa.a libnavhoa.a.0427
ln -sf ../lib32/hsdb_inf.so hsdb_inf.so
ln -sf ../lib32/hsdb_odbc.so hsdb_odbc.so
ln -sf ../lib32/hsdb_oing.so hsdb_oing.so
ln -sf ../lib32/hsdb_ora.so hsdb_ora.so
ln -sf ../lib32/hsdb_syb.so hsdb_syb.so
ln -sf ../lib32/libnavhoa.a libnavhoa.a
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.2/lib
mv hsdb_inf.so hsdb_inf.so.0427
mv hsdb_odbc.so hsdb_odbc.so.0427
mv hsdb_oing.so hsdb_oing.so.0427
mv hsdb_ora.so hsdb_ora.so.0427
mv hsdb_syb.so hsdb_syb.so.0427
mv libnavhoa.a libnavhoa.a.0427
ln -sf ../lib32/hsdb_inf.so hsdb_inf.so
ln -sf ../lib32/hsdb_odbc.so hsdb_odbc.so
ln -sf ../lib32/hsdb_oing.so hsdb_oing.so
ln -sf ../lib32/hsdb_ora.so hsdb_ora.so
ln -sf ../lib32/hsdb_syb.so hsdb_syb.so
ln -sf ../lib32/libnavhoa.a libnavhoa.a
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.3/bin
mv lbuilder lbuilder.0427
ln -sf ../nls/lbuilder/lbuilder lbuilder
cd /u02/cln2/app/oracle/CLN2/apps/tech_st/10.1.2/bin
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论