7 升级Oracle数据库到11gR2
7.1 先打补丁7303030_zhs,9062910,8919489,8919489_ZHS ,9868229,10163753,11071569,9738085,9852070,12686610(貌似批量打补丁时查询麻烦,所以不用AD Merge Patch)
停应用:
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
等待几分钟,确认相关进程已终止。
开启维护模式:
adadmin 5 1
传 p7303030_R12_zhs.zip,p9062910_12.1.0_R12_GENERIC.zip,p8919489_R12.TXK.B_R12_GENERIC.zip,p8919489_R12.TXK.B_R12_zhs.zip,p9868229_R12.BOM.C_R12_GENERIC.zip,p10163753_R12.BIV.B_R12_GENERIC.zip,p11071569_R12.TXK.B_R12_GENERIC.zip,p9738085_R12.TXK.B_R12_GENERIC.zip,p9852070_R12.TXK.B_R12_GENERIC.zip,p12686610_R12.TXK.B_R12_GENERIC.zip 到/stage/patch下
(用appltest用户及环境变量)
cd /stage/patch
unzip p7303030_R12_zhs.zip
unzip p9062910_12.1.0_R12_GENERIC.zip
unzip p8919489_R12.TXK.B_R12_GENERIC.zip
unzip p8919489_R12.TXK.B_R12_zhs.zip
unzip p9868229_R12.BOM.C_R12_GENERIC.zip
unzip p10163753_R12.BIV.B_R12_GENERIC.zip
unzip p11071569_R12.TXK.B_R12_GENERIC.zip
unzip p9738085_R12.TXK.B_R12_GENERIC.zip
unzip p9852070_R12.TXK.B_R12_GENERIC.zip
unzip p12686610_R12.TXK.B_R12_GENERIC.zip
一
cd /stage/patch/7303030_ZHS
adpatch
7303030_ZHS.log
manager
确认补丁目录/stage/patch/7303030_ZHS
Please enter the name of your AutoPatch driver file输入driver文件名u7303030.drv
This Patch seems to have been applied already.Would you like to continue anyway [N] ? Y回车
(安装后默认打了p7303030_R12_GENERIC补丁,7303030_ZHS似乎没打)
等待几个小时
二
cd /stage/patch/9062910
adpatch
9062910.log
manager
确认目录/stage/patch/9062910
u9062910.drv
等待几分钟
三
cd /stage/patch/8919489
adpatch
8919489.log
manager
确认目录/stage/patch/8919489
u8919489.drv
yes
等待几分钟
四
cd /stage/patch/8919489_ZHS
adpatch
8919489_ZHS.log
manager
确认目录/stage/patch/8919489_ZHS
u8919489.drv
等待几分钟
五
cd /stage/patch/9868229
adpatch
9868229.log
manager
确认目录/stage/patch/9868229
u9868229.drv
等待几分钟
六
cd /stage/patch/10163753
adpatch
10163753.log
manager
确认目录/stage/patch/10163753
u10163753.drv
等待几分钟
七
cd /stage/patch/11071569
adpatch
11071569.log
manager
确认目录/stage/patch/11071569
u11071569.drv
等待几分钟
八
cd /stage/patch/9738085
adpatch
9738085.log
manager
确认目录/stage/patch/9738085
u9738085.drv
等待几分钟
九
cd /stage/patch/9852070
adpatch
9852070.log
manager
确认目录/stage/patch/9852070
u9852070.drv
等待几分钟
十
cd /stage/patch/12686610
adpatch
12686610.log
manager
确认目录/stage/patch/12686610
u12686610.drv
等待几分钟
关闭维护模式,启应用
adadmin 5 2
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
7.2 Redeploy Forms如果启应用时出现
Latest formsapp.ear has NOT been deployed
We have determined that you need to redeploy Forms (using txkChkFormsDeployment.pl).
But could not do it automatically for you, due to some issues.
则先停应用,确认没有java进程
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
ps -ef | grep java
$FND_TOP/bin/txkrun.pl -script=CfgOC4JApp
forms
输入oc4jadmin用户的密码oafm或secret或welcome
no
(
如果密码错误则按下面方法改密码后再重试
备份oc4j配置文件
cp $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml.backup
修改oc4jadmin密码
vi $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml
找到
oc4jadmin
OC4J Administrator
OC4J Administrator
{903}n9uT0UYwlniXTEJGXhIgZn4y9hBgt1YH
将name为oc4jadmin下面的一行改为
!oc4jadmin
叹号后面是明文密码,保存退出vi。
)
(如果出现下面错误:
Command error: = 512, = /u01/TEST/apps/tech_st/10.1.3/opmn/bin/opmnctl start
STACK TRACE
TXK::Error::abort(‘TXK::Error’,'HASH(0x83b8174)’) called at /u01/TEST/ap
ps/apps_st/appl/au/12.0.0/perl/TXK/Common.pm line 299
TXK::Common::doError(‘TXK:rocess=HASH(0×9282584)’,'Command error:
= 32512, = /u01/TEST/apps/tech_…’,'undef’) called at /u01/TEST/apps
/apps_st/appl/au/12.0.0/perl/TXK/Common.pm line 314
TXK::Common::setError(‘TXK::Process=HASH(0×9282584)’,'Command error:
t/appl/au/12.0.0/perl/TXK/Process.pm line 449
TXK::Process::run(‘TXK::Process=HASH(0×9282584)’,'HASH(0x8829fcc)’) call
ed at /u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JApp.pl line
1587
TXK::RunScript::execOPMNControl(‘HASH(0x8b493cc)’) called at /u01/TEST/a
pps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JApp.pl line 599
require /u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JA
pp.pl called at /u01/TEST/apps/apps_st/appl/au/12.0.0/perl/TXK/RunScript.pm line
105
TXK::RunScript::require(‘TXK::RunScript’,'/u01/TEST/apps/apps_st/appl/fn
d/12.0.0/patch/115/bin/txkCfgOC…’) called at /u01/TEST/apps/apps_st/appl/au/12
.0.0/perl/TXK/Script.pm line 177
eval {…} called at /u01/TEST/apps/apps_st/appl/au/12.0.0/perl/TXK/Scri
pt.pm line 177
TXK::Script::run(‘TXK::Script=HASH(0x8c38e74)’,'/u01/TEST/inst/apps/TEST
_test/logs/appl/rgf/TXK’,'/u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/t
xkCfgOC…’) called at /u01/TEST/apps/apps_st/appl/fnd/12.0.0/bin/txkrun.pl line
174
可以尝试这个方法:
vi /u01/TEST/apps/tech_st/10.1.3/opmn/bin/opmnctl
将下面三行
ORACLE_HOME=/nfs/bld/d26/PRDXBLD9/apps/tech_st/10.1.3; export ORACLE_HOME
NLS_LANG=${NLS_LANG=”AMERICAN_AMERICA.WE8MSWIN1252″}; export NLS_LANG
TNS_ADMIN=${TNS_ADMIN=”/nfs/bld/d26/PRDXBLD9/apps/tech_st/10.1.3/network/admin”}
; export TNS_ADMIN
改为
ORACLE_HOME=/u01/TEST/apps/tech_st/10.1.3; export ORACLE_HOME
NLS_LANG=${NLS_LANG=”American_America.ZHS16GBK”}; export NLS_LANG
TNS_ADMIN=${TNS_ADMIN=”/u01/TEST/inst/apps/TEST_test/ora/10.1.2/network/admin”}; export TNS_ADMIN
)
结束后运行应用AutoConfig
$ADMIN_SCRIPTS_HOME/adautocfg.sh
输入apps用户的密码apps
再启应用
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
启动过程中可以看到
Latest formsapp.ear has been deployed
7.3 安装11gR2数据库7.3.1 安装11gR2database用vnc或者直接在虚拟机上操作,不要用ssh连接
su – root
xhost +
(如果不运行次命令,则以root用户登录后切换到oratest用户再运行图形化安装界面则会报错No protocol specified)
su – oratest
新建ORACLE_HOME目录
mkdir /u01/oracle/TEST/db/tech_st/11.2.0
把p10404530_112030_LINUX_1of7.zip,p10404530_112030_LINUX_2of7.zip,p10404530_112030_LINUX_6of7.zip三个文件传到patch目录下
(继续用上面的oratest用户)
cd /stage/patch
unzip p10404530_112030_LINUX_1of7.zip
unzip p10404530_112030_LINUX_2of7.zip
unzip p10404530_112030_LINUX_6of7.zip
用图形界面在桌面新建一个fallback文件夹,把zysong.ttf传到此文件夹
用归档管理器打开
/stage/patch/database/stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/filegroup2.jar
然后进入/jdk/jre/lib/fonts/
把fallback目录拖进来
设置base目录和新home的环境变量
su – oratest(不加载env文件环境变量)
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
cd /stage/patch/database
./runInstaller
在弹出的图形界面中,取消勾选接收安全更新,下一步:
是:
跳过,下一步:
是:
仅安装数据库软件,下一步:
单实例数据库安装,下一步:
简体中文,英语,下一步:
企业版,选择选项:
勾选需要安装的组件(这里保持默认),确定,下一步
确认home和base目录,下一步:
没有建统一的/etc/oraInst.loc,所以会提示指定产品清单目录:
确认osdba组,下一步:
确认信息后,安装:
等待几十分钟,可以点击详细资料看具体进度:
直到提示用root用户运行脚本:
另外打开一个终端窗口,按提示运行脚本
su – root
cd /u01/oracle/oraInventory
./orainstRoot.sh
cd /u01/oracle/TEST/db/tech_st/11.2.0
./root.sh
回车确认linux的bin目录
在之前的提示窗口上点击确定,关闭:
安装11gR2database结束。
7.3.2 安装11gR2examples有的文档说必装,有的说如果需要下面这些产品或功能就安装:
Oracle JDBC Development Drivers
Oracle Database Examples
Oracle Text Knowledge Base
Various Oracle product demonstrations
用归档管理器打开
/stage/patch/examples/stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/filegroup2.jar
然后进入/jdk/jre/lib/fonts/
把之前在桌面建的fallback目录(含zysong.ttf)拖进来
如果之前oratest用户窗口没有关闭则直接到下面cd /stage/patch/examples一步
(su – root
xhost +
su – oratest
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0)
cd /stage/patch/examples
./runInstaller
跳过软件更新,下一步:
是:
选择11gR2的软件位置(ORACLE_HOME,不要选到11.1.0),确认基目录(ORACLE_BASE),下一步:
确认信息,安装:
等待几分钟,可以点击详细资料查看具体进度:
关闭:
安装11gR2examples结束。
7.3.3 设置环境变量su – oratest
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/binORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
用env命令检查环境变量。
设置好之后进行下面步骤。
7.3.4 创建nls/data/9idata目录在上面设置好环境变量后
perl $ORACLE_HOME/nls/data/old/cr9idata.pl
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
7.3.5 打11.2.0.3数据库附加补丁停应用和数据库:
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.1.0/appsutil/scripts/TEST_test
./addlnctl.sh stop TEST
./addbctl.sh stop immediate
打additional 11.2.0.3 RDBMS patches:
先升级opatch
把p6880880_112000_LINUX.zip传到/stage/patch目录下
继续用上面的oratest用户及11gR2环境变量(或者重新运行su – oratest和“设置环境变量”、“创建nls/data/9idata目录”两节的export命令)
cd /stage/patch
unzip p6880880_112000_LINUX.zip
用echo $ORACLE_HOME命令确认是否11gR2目录/u01/oracle/TEST/db/tech_st/11.2.0
用$ORACLE_HOME/OPatch/opatch version查看opatch版本OPatch Version: 11.2.0.1.7
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatchBackup
mv /stage/patch/OPatch $ORACLE_HOME
再用$ORACLE_HOME/OPatch/opatch version查看版本OPatch Version: 11.2.0.3.4
把 p4247037_112030_Generic.zip,p9858539_112030_Generic.zip,p12942119_112030_LINUX.zip,p12960302_112030_LINUX.zip,p12985184_112030_LINUX.zip,p13001379_112030_Generic.zip,p13004894_112030_LINUX.zip,p13258936_112030_Generic.zip,p13366268_112030_Generic.zip 传到/stage/patch目录下
cd /stage/patch
unzip p4247037_112030_Generic.zip
unzip p9858539_112030_Generic.zip
unzip p12942119_112030_LINUX.zip
unzip p12960302_112030_LINUX.zip
unzip p12985184_112030_LINUX.zip
unzip p13001379_112030_Generic.zip
unzip p13004894_112030_LINUX.zip
unzip p13258936_112030_Generic.zip
unzip p13366268_112030_Generic.zip
用echo $ORACLE_HOME命令确认是11gR2的目录/u01/oracle/TEST/db/tech_st/11.2.0
一
cd /stage/patch/4247037
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
二
cd /stage/patch/9858539
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
三
cd /stage/patch/12942119
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
四
cd /stage/patch/12960302
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
五
cd /stage/patch/12985184
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
六
cd /stage/patch/13001379
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
七
cd /stage/patch/13004894
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
八
cd /stage/patch/13258936
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
九
cd /stage/patch/13366268
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
检查已经安装的补丁
$ORACLE_HOME/OPatch/opatch lsinventory
7.4 升级数据库7.4.1 启11gR1数据库只启数据库不启数据库监听
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.1.0/appsutil/scripts/TEST_test
./addbctl.sh start TEST
7.4.2 删除11gR1索引enabled$indexes,REPCAT$_AUDIT_COLUMN_IDX1su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
drop table sys.enabled$indexes;
drop index system.REPCAT$_AUDIT_COLUMN_IDX1;
quit
(略)禁用Vault
没用Vault,这一步略过
If you have Database Vault installed, perform steps 1 to 6 of Part 2 of document 1091083.1 on My Oracle Support to disable Database Vault.
https://support.oracle.com/epmos/faces/ui/km/DocContentDisplay.jspx?id=1091083.1
7.4.3 编辑oratab文件确认oratab文件中包含老数据库home目录
格式:$ORACLE_SID:$ORACLE_HOME:
Y或N代表开机启动
vi /etc/oratab
找到或加入下面这行:
TEST:/u01/oracle/TEST/db/tech_st/11.1.0:N
7.4.4 用Pre-Upgrade Information Tool检查将utlu112i_5.sql传到/stage/patch目录下
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SPOOL upgrade_info.log
@/stage/patch/utlu112i_5.sql
SPOOL OFF
quit
less upgrade_info.log
查看相关信息并处理
一
WARNING: –> CTXD tablespace is not large enough for the upgrade.
WARNING: –> SYSAUX tablespace is not large enough for the upgrade.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
select file_name,bytes/1024/1024 M from dba_data_files where tablespace_name=’CTXD’;
alter database datafile ‘/u01/oracle/TEST/db/apps_st/data/ctxd01.dbf’ resize 30M;
select file_name,bytes/1024/1024 M from dba_data_files where tablespace_name=’SYSAUX’;
alter database datafile ‘/u01/oracle/TEST/db/apps_st/data/sysaux02.dbf’ resize 400M;
quit
二
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
–> plsql_native_library_dir 11.2 OBSOLETE
–> plsql_native_library_subdir_ 11.2 OBSOLETE
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
vi $ORACLE_HOME/dbs/initTEST.ora
注释下面两行
plsql_native_library_dir
plsql_native_library_subdir_count
三
WARNING: –> Database is using a timezone file older than version 14.
等下用DBUA处理,或者根据977512.1手动用DBMS_DST处理
四
WARNING: –> Your recycle bin contains 12 object(s).
…. It is REQUIRED that the recycle bin is empty prior to upgrading
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
PURGE DBA_RECYCLEBIN;
quit
五
WARNING: –> Database contains schemas with objects dependent on DBMS_LDAP package.
…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
…. USER APPS has dependent objects.
不用处理,略过This warning can be ignored for APPS objects.
六
Oracle recommends gathering dictionary statistics prior to upgrading the database.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
EXECUTE dbms_stats.gather_dictionary_stats;
quit
等待一个小时左右
七
Oracle recommends removing all hidden parameters prior to upgrading.
略过,dbua升级过程中会自动处理掉。
手动处理方法:
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SELECT name,description from SYS.V$PARAMETER WHERE name LIKE ‘_%’ ESCAPE ‘’;
quit
vi $ORACLE_HOME/dbs/initTEST.ora
注释掉查询出来的行
八
Oracle recommends reviewing any defined events prior to upgrading.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SELECT (translate(value,chr(13)||chr(10),’ ‘)) FROM sys.v$parameter2 WHERE UPPER(name) =’EVENT’ AND isdefault=’FALSE’;
SELECT (translate(value,chr(13)||chr(10),’ ‘)) from sys.v$parameter2 WHERE UPPER(name) = ‘_TRACE_EVENTS’ AND isdefault=’FALSE’;
quit
九
The DMSYS schema exists in the database. Prior to performing an upgrade Oracle recommends that the DMSYS schema, and its associated objects be removed from the database.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
DROP USER DMSYS CASCADE;
quit
重新运行Pre-Upgrade Information Tool
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SPOOL upgrade_info.log
@/stage/patch/utlu112i_5.sql;
SPOOL OFF
quit
less upgrade_info.log
7.4.5 用DBUA升级Database Upgrade Assistant提供图形界面进行升级。
将zysong.ttf复制到
/u01/oracle/TEST/db/tech_st/11.2.0/jdk/jre/lib/fonts/fallback
否则图形界面会乱码
如果出现ORA-01408错误,参考“删除索引enabled$indexes,REPCAT$_AUDIT_COLUMN_IDX1”一节
虚拟机做个snapshot
su – oratest
(切换用户后,不加载环境变量,手动进入11gR2的home目录下的bin目录)
cd /u01/oracle/TEST/db/tech_st/11.2.0/bin
./dbua -initParam “_disable_fast_validate=TRUE”
下一步:
选择oratab文件里面定义的老数据库目录,下一步:
等待几分钟:
检查这些警告,确认可以略过后点击是:
等待几秒:
勾选“在升级结束后重新编译无效对象”、“升级时区版本。。。”,新数据库就不备份了,下一步:
不移动,下一步:
勾选指定快速恢复区,容量先设个80G左右,下一步:
不用OEM,下一步:
浏览一遍信息,完成:
等待几个小时:
查看是否全部打勾通过,确定:
确认升级的所有信息,关闭:
dbua升级结束。
7.4.6 创建11gR2的listener.ora和tnsnames.orasu – oratest
cp -r /u01/oracle/TEST/db/tech_st/11.1.0/network/admin/TEST_test /u01/oracle/TEST/db/tech_st/11.2.0/network/admin
cd /u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
把文件中的11.1.0改成11.2.0
vi listener.ora
vi sqlnet.ora
vi tnsnames.ora
替换方法:
:%s/11.1.0/11.2.0/g
7.4.7 修改11gR2初始化参数su – oratest
cp /u01/oracle/TEST/db/tech_st/11.1.0/dbs/TEST_test_ifile.ora /u01/oracle/TEST/db/tech_st/11.2.0/dbs
vi /u01/oracle/TEST/db/tech_st/11.2.0/dbs/initTEST.ora
把11.1.0都改成11.2.0
替换方法:
:%s/11.1.0/11.2.0/g
参考配置文件(100用户以内),注意后面写着11gR2del的应该被注释掉
############## general
db_name=”TEST”
control_files = /u01/oracle/TEST/db/apps_st/data/cntrl01.dbf,/u01/oracle/TEST/db/apps_st/data/cntrl02.dbf,/u01/oracle/TEST/db/apps_st/data/cntrl03.dbf
db_block_size = 8192 #MP
_system_trig_enabled = TRUE #MP
o7_dictionary_accessibility = FALSE #MP
#### nls_language = american #11gR2del
nls_territory = america
nls_date_format = DD-MON-RR #MP
nls_numeric_characters = “.,”
nls_sort = binary #MP
nls_comp = binary #MP
nls_length_semantics = BYTE #MP
# audit_trail = TRUE
#### user_dump_dest = /ebiz/prodr12/udump #11gR2del
#### background_dump_dest = /ebiz/prodr12/bdump #11gR2del
#### core_dump_dest = /ebiz/prodr12/cdump #11gR2del
max_dump_file_size = 20480
#### timed_statistics = TRUE #11gR2del
_trace_files_public = TRUE
processes = 200
sessions = 400
db_files = 512
dml_locks = 10000
cursor_sharing = EXACT #MP
open_cursors = 600
session_cached_cursors = 500
sga_target = 2G #MP
db_block_checking = FALSE
db_block_checksum = TRUE
log_checkpoint_timeout = 1200
log_checkpoint_interval = 100000
log_buffer = 10485760
log_checkpoints_to_alert = TRUE
shared_pool_size = 400M
shared_pool_reserved_size = 40M
#### _shared_pool_reserved_min_alloc = 4100 #11gR2del
# cursor_space_for_time = FALSE
utl_file_dir=/usr/tmp, /usr/tmp, /u01/oracle/TEST/db/tech_st/11.2.0/appsutil/outbound/TEST_test, /usr/tmp
aq_tm_processes = 1
job_queue_processes = 2
LOG_ARCHIVE_DEST_1 = ‘LOCATION=/u01/archive’
#LOG_ARCHIVE_DEST_2 = ‘SERVICE=standby1′
parallel_max_servers = 4
parallel_min_servers = 0
_sort_elimination_cost_ratio =5 #MP
_like_with_bind_as_equality = TRUE #MP
_fast_full_scan_enabled = FALSE #MP
_b_tree_bitmap_plans = FALSE #MP
optimizer_secure_view_merging = FALSE #MP
#### _sqlexec_progression_cost = 2147483647 #MP #11gR2del
cluster_database = FALSE
pga_aggregate_target = 2G
workarea_size_policy = AUTO #MP
olap_page_pool_size = 4194304
############## 11gR2
compatible = 11.2.0
diagnostic_dest=/u01/oracle/TEST/db/tech_st/11.2.0/admin/TEST_test
undo_management=AUTO #MP
undo_tablespace=APPS_UNDOTS1
#plsql_code_type = NATIVE
_optimizer_autostats_job=FALSE #MP
parallel_force_local=TRUE #MP
sec_case_sensitive_logon = FALSE
db_recovery_file_dest=/u01/oracle/TEST/fast_recovery_area
db_recovery_file_dest_size=86696263680
##############
IFILE=/u01/oracle/TEST/db/tech_st/11.2.0/dbs/TEST_test_ifile.ora
##############
然后使用此配置文件:
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
mkdir -p /u01/oracle/TEST/db/tech_st/11.2.0/admin/TEST_test
sqlplus / as sysdba
shutdown immediate
create spfile=’/u01/oracle/TEST/db/tech_st/11.2.0/dbs/spfileTEST.ora’ from pfile=’/u01/oracle/TEST/db/tech_st/11.2.0/dbs/initTEST.ora’;
startup
select value from v$parameter where name=’spfile’;
quit
7.4.8 执行补丁安装后操作“打11gR2数据库补丁”一节打了一个opatch程序更新补丁和另外9个补丁4247037,9858539,12942119,12960302,12985184,13001379,13004894,13258936,13366268
其中13001379和13366268的后续操作已经在数据库升级过程中执行了,查看其他补丁的readme文件,进行opatch后操作。
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
一
4247037
sqlplus / as sysdba
drop user mgdsys cascade;
@/u01/oracle/TEST/db/tech_st/11.2.0/md/admin/catmgdidcode.sql
@/u01/oracle/TEST/db/tech_st/11.2.0/md/support/patchset_mgdsys_validity.sql
(没有发现无效对象,如果有则运行$ORACLE_HOME/rdbms/admin/utlrp.sql)
quit
二
9858539
cd /u01/oracle/TEST/db/tech_st/11.2.0/rdbms/admin
sqlplus / as sysdba
@@catnomtt.sql
@@catnomta.sql
@@dbmsmeta.sql
@@dbmsmeti.sql
@@dbmsmetu.sql
@@dbmsmetb.sql
@@dbmsmetd.sql
@@dbmsmet2.sql
@@catmeta.sql
@@prvtmeta.plb
@@prvtmeti.plb
@@prvtmetu.plb
@@prvtmetb.plb
@@prvtmetd.plb
@@prvtmet2.plb
@@catmet2.sql
alter package dbms_metadata_int compile plsql_ccflags = ‘ku$xml_enabled:true’;
alter package dbms_metadata_util compile plsql_ccflags = ‘ku$xml_enabled:true’;
quit
三
12942119
无后续操作
四
12960302
无后续操作
五
12985184
无后续操作
六
13004894
无后续操作
七
13258936
cd $ORACLE_HOME/ctx/admin/ctxpatch/
sqlplus / as sysdba
@ctxpatch11203.sql
quit
(略)Natively compile PL/SQL code (optional)
You can choose to run Oracle E-Business Suite 12.1 PL/SQL database objects in natively compiled mode with Oracle Database 11g. See the “Compiling PL/SQL Program Units for Native Execution” section of Chapter 12 of Oracle Database PL/SQL Language Reference 11g Release 2 (11.2).
7.5 升级数据库后(开两个终端窗口,其中一个切换到appltest用户加载环境变量,另外一个切换到oratest用户加载环境变量,就不用重复切换用户和加载环境变量了。)
7.5.1 启11gR2数据库监听如果监听没启动则启动监听
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
lsnrctl start TEST
7.5.2 执行adgrants.sqlsu – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $APPL_TOP
/u01/TEST/apps/apps_st/appl
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/apps/apps_st/appl/admin/adgrants.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus / as sysdba
@adgrants.sql apps
7.5.3 赋予CTXSYS创建过程权限su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $AD_TOP
/u01/TEST/apps/apps_st/appl/ad/12.0.0
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adctxprv.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus apps/apps
@adctxprv.sql manager CTXSYS
7.5.4 设置CTXSYS参数继续用上面的oratest用户和环境变量
sqlplus / as sysdba
exec ctxsys.ctx_adm.set_parameter(‘file_access_role’, ‘public’);
quit
7.5.5 验证工作流规则集su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $FND_TOP
/u01/TEST/apps/apps_st/appl/fnd/12.0.0
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
sqlplus apps/apps
@/u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/wfaqupfix.sql APPLSYS APPS
(略)Deregister the current database server (conditional)
If you plan to change the database port, host, SID, or database name parameter on the database server, you must also update AutoConfig on the database tier and deregister the current database server node.
Use SQL*Plus to connect to the database as APPS and run the following command:
$ sqlplus apps/[APPS password]
SQL> exec fnd_conc_clone.setup_clean;
7.5.6 运行autoconfig复制AutoConfig 到RDBMS ORACLE_HOME
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
perl $AD_TOP/bin/admkappsutil.pl
结果应显示
output located at /u01/TEST/inst/apps/TEST_test/admin/out/appsutil.zip
MakeAppsUtil completed successfully.
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/inst/apps/TEST_test/admin/out/appsutil.zip $ORACLE_HOME
cd $ORACLE_HOME
unzip -o appsutil.zip
(略)在数据库层安装JRE
按照下面的步骤,确保应用层和数据库层的JRE 版本至少是1.5或更高版本:
若您使用的是”完全认证” 平台, 请参阅My Oracle Support文件 418664.1 在目录/appsutil 下安装jre.
若您使用的是 ” 只是数据库层” 平台, 请参阅My Oracle Support文件 456197.1 在目录/appsutil 下安装jre.
生成数据库层上下文文件
继续用上面oratest用户和环境变量
perl $ORACLE_HOME/appsutil/bin/adbldxml.pl
输入apps的密码apps
结果应显示
The context file has been created at:
/u01/oracle/TEST/db/tech_st/11.2.0/appsutil/TEST_test.xml
在数据库层运行AutoConfig
(没启应用,如果应用启了停掉,确认数据库和数据库监听都启动)
继续用上面oratest用户和环境变量
$ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=/u01/oracle/TEST/db/tech_st/11.2.0/appsutil/TEST_test.xml
输入apps的密码apps
结果应显示
AutoConfig completed successfully.
如果出现错误,重新运行一遍试试。
7.5.7打ECX补丁9151516(ebs12.1)把p9151516_R12.ECX.B_R12_GENERIC.zip传到/stage/patch目录下
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
cd /stage/patch
unzip p9151516_R12.ECX.B_R12_GENERIC.zip
开启维护模式
adadmin 5 1
cd /stage/patch/9151516
adpatch
9151516.log
manager
确认补丁目录/stage/patch/9151516
u9151516.drv
等待几分钟
关闭维护模式adadmin 5 2
7.5.8 收集SYS统计信息用oratest用户和11gR2环境变量
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
确认默认临时表有1.5G空闲空间然后继续
修改原来临时表
sqlplus / as sysdba
ALTER DATABASE TEMPFILE ‘/u01/oracle/TEST/db/apps_st/data/temp01.dbf’ AUTOEXTEND ON NEXT 50M MAXSIZE 4G;
ALTER DATABASE TEMPFILE ‘/u01/oracle/TEST/db/apps_st/data/temp02.dbf’ AUTOEXTEND ON NEXT 50M MAXSIZE 4G;
quit
(
或者加临时表
create temporary tablespace TEMP3
tempfile ‘ /u01/oracle/TEST/db/apps_st/data/temp03.dbf’ size 1600M reuse
tablespace group TEMP
extent management local
uniform size 128K;
)
将$APPL_TOP/admin/adstats.sql复制到数据库目录$ORACLE_HOME:
(用oratest用户和11gR2环境变量)
cp /u01/TEST/apps/apps_st/appl/admin/adstats.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus / as sysdba
alter system enable restricted session;
@adstats.sql
等待半个小时
sqlplus / as sysdba
alter system disable restricted session;
quit
(略)Create Demantra privileges (conditional)
If you are using Demantra, perform the steps in document 730883.1 on My Oracle Support.
(略)Re-create custom database links (conditional)
没改监听,略过
If the Oracle Net listener in the 11.2.0 Oracle home is defined differently than the one used by the old Oracle home, you
must re-create any custom self-referential database links that exist in the Applications database instance. To check for
the existence of database links, use SQL*Plus on the database server node to connect to the Applications database instance as APPS and run the following query:
$ sqlplus apps/[apps password ]
SQL> select db_link from all_db_links;
The EDW_APPS_TO_WH and APPS_TO_APPS database links, if they exist, should have been updated with the new port number by AutoConfig in the previous step.
If you have custom self-referential database links in the database instance, use the following commands to drop and re-create them:
$ sqlplus apps/[apps password ]
SQL> drop database link [ custom database link ];
SQL> create database link [custom database link ] connect to
[user] identified by [password ] using
‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=[hostname ])
(PORT=[port number]))(CONNECT_DATA=(SID=[ ORACLE_SID ])))’;
where [custom database link], [user], [password], [hostname], [port number], and [ORACLE_SID] reflect the new Oracle Net listener for the database instance.
7.5.9 重建apps授权和同义词su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
adadmin 4 2
等待几分钟
(略)Enable Database Vault (conditional)
If you disabled Database Vault, enable it by performing step 7 of Part 2 of document 1091083.1 on My Oracle Support.
7.5.10重启应用和数据库su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
su – oratest
. /u01/oracle/TEST/db/tech_st/11.2.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.2.0/appsutil/scripts/TEST_test
./addlnctl.sh stop TEST
./addbctl.sh stop immediate
./addbctl.sh start
./addlnctl.sh start TEST
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
7.5.11 同步工作流视图启动数据库和应用后
浏览器打开http://test.ebs.local:8001/OA_HTML/AppsLogin
sysadmin/sysadmin
进入系统管理员职责
并发-请求
提交新请求,单个请求,确定
请求名称:工作流目录服务用户/职责验证
参数:10000 是是 否 (留空)
提交
等待几十秒完成。
(如果提示默认值错误可以忽略,或者手动修改:
并发-方案-定义
F11搜索 程序:工作流目录服务用户/职责验证
参数
选择p_Check_Dangling,默认值改为“否”
选择p_Check_Missing_URA,默认值改为“否”
选择p_UpdateWho,默认值改为“否”)
7 升级Oracle数据库到11gR2
7.1 先打补丁7303030_zhs,9062910,8919489,8919489_ZHS ,9868229,10163753,11071569,9738085,9852070,12686610(貌似批量打补丁时查询麻烦,所以不用AD Merge Patch)
停应用:
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
等待几分钟,确认相关进程已终止。
开启维护模式:
adadmin 5 1
传 p7303030_R12_zhs.zip,p9062910_12.1.0_R12_GENERIC.zip,p8919489_R12.TXK.B_R12_GENERIC.zip,p8919489_R12.TXK.B_R12_zhs.zip,p9868229_R12.BOM.C_R12_GENERIC.zip,p10163753_R12.BIV.B_R12_GENERIC.zip,p11071569_R12.TXK.B_R12_GENERIC.zip,p9738085_R12.TXK.B_R12_GENERIC.zip,p9852070_R12.TXK.B_R12_GENERIC.zip,p12686610_R12.TXK.B_R12_GENERIC.zip 到/stage/patch下
(用appltest用户及环境变量)
cd /stage/patch
unzip p7303030_R12_zhs.zip
unzip p9062910_12.1.0_R12_GENERIC.zip
unzip p8919489_R12.TXK.B_R12_GENERIC.zip
unzip p8919489_R12.TXK.B_R12_zhs.zip
unzip p9868229_R12.BOM.C_R12_GENERIC.zip
unzip p10163753_R12.BIV.B_R12_GENERIC.zip
unzip p11071569_R12.TXK.B_R12_GENERIC.zip
unzip p9738085_R12.TXK.B_R12_GENERIC.zip
unzip p9852070_R12.TXK.B_R12_GENERIC.zip
unzip p12686610_R12.TXK.B_R12_GENERIC.zip
一
cd /stage/patch/7303030_ZHS
adpatch
7303030_ZHS.log
manager
确认补丁目录/stage/patch/7303030_ZHS
Please enter the name of your AutoPatch driver file输入driver文件名u7303030.drv
This Patch seems to have been applied already.Would you like to continue anyway [N] ? Y回车
(安装后默认打了p7303030_R12_GENERIC补丁,7303030_ZHS似乎没打)
等待几个小时
二
cd /stage/patch/9062910
adpatch
9062910.log
manager
确认目录/stage/patch/9062910
u9062910.drv
等待几分钟
三
cd /stage/patch/8919489
adpatch
8919489.log
manager
确认目录/stage/patch/8919489
u8919489.drv
yes
等待几分钟
四
cd /stage/patch/8919489_ZHS
adpatch
8919489_ZHS.log
manager
确认目录/stage/patch/8919489_ZHS
u8919489.drv
等待几分钟
五
cd /stage/patch/9868229
adpatch
9868229.log
manager
确认目录/stage/patch/9868229
u9868229.drv
等待几分钟
六
cd /stage/patch/10163753
adpatch
10163753.log
manager
确认目录/stage/patch/10163753
u10163753.drv
等待几分钟
七
cd /stage/patch/11071569
adpatch
11071569.log
manager
确认目录/stage/patch/11071569
u11071569.drv
等待几分钟
八
cd /stage/patch/9738085
adpatch
9738085.log
manager
确认目录/stage/patch/9738085
u9738085.drv
等待几分钟
九
cd /stage/patch/9852070
adpatch
9852070.log
manager
确认目录/stage/patch/9852070
u9852070.drv
等待几分钟
十
cd /stage/patch/12686610
adpatch
12686610.log
manager
确认目录/stage/patch/12686610
u12686610.drv
等待几分钟
关闭维护模式,启应用
adadmin 5 2
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
7.2 Redeploy Forms如果启应用时出现
Latest formsapp.ear has NOT been deployed
We have determined that you need to redeploy Forms (using txkChkFormsDeployment.pl).
But could not do it automatically for you, due to some issues.
则先停应用,确认没有java进程
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
ps -ef | grep java
$FND_TOP/bin/txkrun.pl -script=CfgOC4JApp
forms
输入oc4jadmin用户的密码oafm或secret或welcome
no
(
如果密码错误则按下面方法改密码后再重试
备份oc4j配置文件
cp $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml.backup
修改oc4jadmin密码
vi $INST_TOP/ora/10.1.3/j2ee/forms/config/system-jazn-data.xml
找到
oc4jadmin
OC4J Administrator
OC4J Administrator
{903}n9uT0UYwlniXTEJGXhIgZn4y9hBgt1YH
将name为oc4jadmin下面的一行改为
!oc4jadmin
叹号后面是明文密码,保存退出vi。
)
(如果出现下面错误:
Command error: = 512, = /u01/TEST/apps/tech_st/10.1.3/opmn/bin/opmnctl start
STACK TRACE
TXK::Error::abort(‘TXK::Error’,'HASH(0x83b8174)’) called at /u01/TEST/ap
ps/apps_st/appl/au/12.0.0/perl/TXK/Common.pm line 299
TXK::Common::doError(‘TXK:rocess=HASH(0×9282584)’,'Command error:
= 32512, = /u01/TEST/apps/tech_…’,'undef’) called at /u01/TEST/apps
/apps_st/appl/au/12.0.0/perl/TXK/Common.pm line 314
TXK::Common::setError(‘TXK::Process=HASH(0×9282584)’,'Command error:
t/appl/au/12.0.0/perl/TXK/Process.pm line 449
TXK::Process::run(‘TXK::Process=HASH(0×9282584)’,'HASH(0x8829fcc)’) call
ed at /u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JApp.pl line
1587
TXK::RunScript::execOPMNControl(‘HASH(0x8b493cc)’) called at /u01/TEST/a
pps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JApp.pl line 599
require /u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkCfgOC4JA
pp.pl called at /u01/TEST/apps/apps_st/appl/au/12.0.0/perl/TXK/RunScript.pm line
105
TXK::RunScript::require(‘TXK::RunScript’,'/u01/TEST/apps/apps_st/appl/fn
d/12.0.0/patch/115/bin/txkCfgOC…’) called at /u01/TEST/apps/apps_st/appl/au/12
.0.0/perl/TXK/Script.pm line 177
eval {…} called at /u01/TEST/apps/apps_st/appl/au/12.0.0/perl/TXK/Scri
pt.pm line 177
TXK::Script::run(‘TXK::Script=HASH(0x8c38e74)’,'/u01/TEST/inst/apps/TEST
_test/logs/appl/rgf/TXK’,'/u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/t
xkCfgOC…’) called at /u01/TEST/apps/apps_st/appl/fnd/12.0.0/bin/txkrun.pl line
174
可以尝试这个方法:
vi /u01/TEST/apps/tech_st/10.1.3/opmn/bin/opmnctl
将下面三行
ORACLE_HOME=/nfs/bld/d26/PRDXBLD9/apps/tech_st/10.1.3; export ORACLE_HOME
NLS_LANG=${NLS_LANG=”AMERICAN_AMERICA.WE8MSWIN1252″}; export NLS_LANG
TNS_ADMIN=${TNS_ADMIN=”/nfs/bld/d26/PRDXBLD9/apps/tech_st/10.1.3/network/admin”}
; export TNS_ADMIN
改为
ORACLE_HOME=/u01/TEST/apps/tech_st/10.1.3; export ORACLE_HOME
NLS_LANG=${NLS_LANG=”American_America.ZHS16GBK”}; export NLS_LANG
TNS_ADMIN=${TNS_ADMIN=”/u01/TEST/inst/apps/TEST_test/ora/10.1.2/network/admin”}; export TNS_ADMIN
)
结束后运行应用AutoConfig
$ADMIN_SCRIPTS_HOME/adautocfg.sh
输入apps用户的密码apps
再启应用
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
启动过程中可以看到
Latest formsapp.ear has been deployed
7.3 安装11gR2数据库7.3.1 安装11gR2database用vnc或者直接在虚拟机上操作,不要用ssh连接
su – root
xhost +
(如果不运行次命令,则以root用户登录后切换到oratest用户再运行图形化安装界面则会报错No protocol specified)
su – oratest
新建ORACLE_HOME目录
mkdir /u01/oracle/TEST/db/tech_st/11.2.0
把p10404530_112030_LINUX_1of7.zip,p10404530_112030_LINUX_2of7.zip,p10404530_112030_LINUX_6of7.zip三个文件传到patch目录下
(继续用上面的oratest用户)
cd /stage/patch
unzip p10404530_112030_LINUX_1of7.zip
unzip p10404530_112030_LINUX_2of7.zip
unzip p10404530_112030_LINUX_6of7.zip
用图形界面在桌面新建一个fallback文件夹,把zysong.ttf传到此文件夹
用归档管理器打开
/stage/patch/database/stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/filegroup2.jar
然后进入/jdk/jre/lib/fonts/
把fallback目录拖进来
设置base目录和新home的环境变量
su – oratest(不加载env文件环境变量)
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
cd /stage/patch/database
./runInstaller
在弹出的图形界面中,取消勾选接收安全更新,下一步:
是:
跳过,下一步:
是:
仅安装数据库软件,下一步:
单实例数据库安装,下一步:
简体中文,英语,下一步:
企业版,选择选项:
勾选需要安装的组件(这里保持默认),确定,下一步
确认home和base目录,下一步:
没有建统一的/etc/oraInst.loc,所以会提示指定产品清单目录:
确认osdba组,下一步:
确认信息后,安装:
等待几十分钟,可以点击详细资料看具体进度:
直到提示用root用户运行脚本:
另外打开一个终端窗口,按提示运行脚本
su – root
cd /u01/oracle/oraInventory
./orainstRoot.sh
cd /u01/oracle/TEST/db/tech_st/11.2.0
./root.sh
回车确认linux的bin目录
在之前的提示窗口上点击确定,关闭:
安装11gR2database结束。
7.3.2 安装11gR2examples有的文档说必装,有的说如果需要下面这些产品或功能就安装:
Oracle JDBC Development Drivers
Oracle Database Examples
Oracle Text Knowledge Base
Various Oracle product demonstrations
用归档管理器打开
/stage/patch/examples/stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/filegroup2.jar
然后进入/jdk/jre/lib/fonts/
把之前在桌面建的fallback目录(含zysong.ttf)拖进来
如果之前oratest用户窗口没有关闭则直接到下面cd /stage/patch/examples一步
(su – root
xhost +
su – oratest
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0)
cd /stage/patch/examples
./runInstaller
跳过软件更新,下一步:
是:
选择11gR2的软件位置(ORACLE_HOME,不要选到11.1.0),确认基目录(ORACLE_BASE),下一步:
确认信息,安装:
等待几分钟,可以点击详细资料查看具体进度:
关闭:
安装11gR2examples结束。
7.3.3 设置环境变量su – oratest
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/binORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
用env命令检查环境变量。
设置好之后进行下面步骤。
7.3.4 创建nls/data/9idata目录在上面设置好环境变量后
perl $ORACLE_HOME/nls/data/old/cr9idata.pl
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
7.3.5 打11.2.0.3数据库附加补丁停应用和数据库:
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.1.0/appsutil/scripts/TEST_test
./addlnctl.sh stop TEST
./addbctl.sh stop immediate
打additional 11.2.0.3 RDBMS patches:
先升级opatch
把p6880880_112000_LINUX.zip传到/stage/patch目录下
继续用上面的oratest用户及11gR2环境变量(或者重新运行su – oratest和“设置环境变量”、“创建nls/data/9idata目录”两节的export命令)
cd /stage/patch
unzip p6880880_112000_LINUX.zip
用echo $ORACLE_HOME命令确认是否11gR2目录/u01/oracle/TEST/db/tech_st/11.2.0
用$ORACLE_HOME/OPatch/opatch version查看opatch版本OPatch Version: 11.2.0.1.7
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatchBackup
mv /stage/patch/OPatch $ORACLE_HOME
再用$ORACLE_HOME/OPatch/opatch version查看版本OPatch Version: 11.2.0.3.4
把 p4247037_112030_Generic.zip,p9858539_112030_Generic.zip,p12942119_112030_LINUX.zip,p12960302_112030_LINUX.zip,p12985184_112030_LINUX.zip,p13001379_112030_Generic.zip,p13004894_112030_LINUX.zip,p13258936_112030_Generic.zip,p13366268_112030_Generic.zip 传到/stage/patch目录下
cd /stage/patch
unzip p4247037_112030_Generic.zip
unzip p9858539_112030_Generic.zip
unzip p12942119_112030_LINUX.zip
unzip p12960302_112030_LINUX.zip
unzip p12985184_112030_LINUX.zip
unzip p13001379_112030_Generic.zip
unzip p13004894_112030_LINUX.zip
unzip p13258936_112030_Generic.zip
unzip p13366268_112030_Generic.zip
用echo $ORACLE_HOME命令确认是11gR2的目录/u01/oracle/TEST/db/tech_st/11.2.0
一
cd /stage/patch/4247037
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
二
cd /stage/patch/9858539
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
三
cd /stage/patch/12942119
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
四
cd /stage/patch/12960302
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
五
cd /stage/patch/12985184
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
六
cd /stage/patch/13001379
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
七
cd /stage/patch/13004894
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
八
cd /stage/patch/13258936
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
九
cd /stage/patch/13366268
$ORACLE_HOME/OPatch/opatch apply
直接回车然后y不接受邮件
y
检查已经安装的补丁
$ORACLE_HOME/OPatch/opatch lsinventory
7.4 升级数据库7.4.1 启11gR1数据库只启数据库不启数据库监听
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.1.0/appsutil/scripts/TEST_test
./addbctl.sh start TEST
7.4.2 删除11gR1索引enabled$indexes,REPCAT$_AUDIT_COLUMN_IDX1su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
drop table sys.enabled$indexes;
drop index system.REPCAT$_AUDIT_COLUMN_IDX1;
quit
(略)禁用Vault
没用Vault,这一步略过
If you have Database Vault installed, perform steps 1 to 6 of Part 2 of document 1091083.1 on My Oracle Support to disable Database Vault.
https://support.oracle.com/epmos/faces/ui/km/DocContentDisplay.jspx?id=1091083.1
7.4.3 编辑oratab文件确认oratab文件中包含老数据库home目录
格式:$ORACLE_SID:$ORACLE_HOME:
Y或N代表开机启动
vi /etc/oratab
找到或加入下面这行:
TEST:/u01/oracle/TEST/db/tech_st/11.1.0:N
7.4.4 用Pre-Upgrade Information Tool检查将utlu112i_5.sql传到/stage/patch目录下
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SPOOL upgrade_info.log
@/stage/patch/utlu112i_5.sql
SPOOL OFF
quit
less upgrade_info.log
查看相关信息并处理
一
WARNING: –> CTXD tablespace is not large enough for the upgrade.
WARNING: –> SYSAUX tablespace is not large enough for the upgrade.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
select file_name,bytes/1024/1024 M from dba_data_files where tablespace_name=’CTXD’;
alter database datafile ‘/u01/oracle/TEST/db/apps_st/data/ctxd01.dbf’ resize 30M;
select file_name,bytes/1024/1024 M from dba_data_files where tablespace_name=’SYSAUX’;
alter database datafile ‘/u01/oracle/TEST/db/apps_st/data/sysaux02.dbf’ resize 400M;
quit
二
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
–> plsql_native_library_dir 11.2 OBSOLETE
–> plsql_native_library_subdir_ 11.2 OBSOLETE
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
vi $ORACLE_HOME/dbs/initTEST.ora
注释下面两行
plsql_native_library_dir
plsql_native_library_subdir_count
三
WARNING: –> Database is using a timezone file older than version 14.
等下用DBUA处理,或者根据977512.1手动用DBMS_DST处理
四
WARNING: –> Your recycle bin contains 12 object(s).
…. It is REQUIRED that the recycle bin is empty prior to upgrading
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
PURGE DBA_RECYCLEBIN;
quit
五
WARNING: –> Database contains schemas with objects dependent on DBMS_LDAP package.
…. Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
…. USER APPS has dependent objects.
不用处理,略过This warning can be ignored for APPS objects.
六
Oracle recommends gathering dictionary statistics prior to upgrading the database.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
EXECUTE dbms_stats.gather_dictionary_stats;
quit
等待一个小时左右
七
Oracle recommends removing all hidden parameters prior to upgrading.
略过,dbua升级过程中会自动处理掉。
手动处理方法:
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SELECT name,description from SYS.V$PARAMETER WHERE name LIKE ‘_%’ ESCAPE ‘’;
quit
vi $ORACLE_HOME/dbs/initTEST.ora
注释掉查询出来的行
八
Oracle recommends reviewing any defined events prior to upgrading.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SELECT (translate(value,chr(13)||chr(10),’ ‘)) FROM sys.v$parameter2 WHERE UPPER(name) =’EVENT’ AND isdefault=’FALSE’;
SELECT (translate(value,chr(13)||chr(10),’ ‘)) from sys.v$parameter2 WHERE UPPER(name) = ‘_TRACE_EVENTS’ AND isdefault=’FALSE’;
quit
九
The DMSYS schema exists in the database. Prior to performing an upgrade Oracle recommends that the DMSYS schema, and its associated objects be removed from the database.
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
DROP USER DMSYS CASCADE;
quit
重新运行Pre-Upgrade Information Tool
su – oratest
. /u01/oracle/TEST/db/tech_st/11.1.0/TEST_test.env
sqlplus / as sysdba
SPOOL upgrade_info.log
@/stage/patch/utlu112i_5.sql;
SPOOL OFF
quit
less upgrade_info.log
7.4.5 用DBUA升级Database Upgrade Assistant提供图形界面进行升级。
将zysong.ttf复制到
/u01/oracle/TEST/db/tech_st/11.2.0/jdk/jre/lib/fonts/fallback
否则图形界面会乱码
如果出现ORA-01408错误,参考“删除索引enabled$indexes,REPCAT$_AUDIT_COLUMN_IDX1”一节
虚拟机做个snapshot
su – oratest
(切换用户后,不加载环境变量,手动进入11gR2的home目录下的bin目录)
cd /u01/oracle/TEST/db/tech_st/11.2.0/bin
./dbua -initParam “_disable_fast_validate=TRUE”
下一步:
选择oratab文件里面定义的老数据库目录,下一步:
等待几分钟:
检查这些警告,确认可以略过后点击是:
等待几秒:
勾选“在升级结束后重新编译无效对象”、“升级时区版本。。。”,新数据库就不备份了,下一步:
不移动,下一步:
勾选指定快速恢复区,容量先设个80G左右,下一步:
不用OEM,下一步:
浏览一遍信息,完成:
等待几个小时:
查看是否全部打勾通过,确定:
确认升级的所有信息,关闭:
dbua升级结束。
7.4.6 创建11gR2的listener.ora和tnsnames.orasu – oratest
cp -r /u01/oracle/TEST/db/tech_st/11.1.0/network/admin/TEST_test /u01/oracle/TEST/db/tech_st/11.2.0/network/admin
cd /u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
把文件中的11.1.0改成11.2.0
vi listener.ora
vi sqlnet.ora
vi tnsnames.ora
替换方法:
:%s/11.1.0/11.2.0/g
7.4.7 修改11gR2初始化参数su – oratest
cp /u01/oracle/TEST/db/tech_st/11.1.0/dbs/TEST_test_ifile.ora /u01/oracle/TEST/db/tech_st/11.2.0/dbs
vi /u01/oracle/TEST/db/tech_st/11.2.0/dbs/initTEST.ora
把11.1.0都改成11.2.0
替换方法:
:%s/11.1.0/11.2.0/g
参考配置文件(100用户以内),注意后面写着11gR2del的应该被注释掉
############## general
db_name=”TEST”
control_files = /u01/oracle/TEST/db/apps_st/data/cntrl01.dbf,/u01/oracle/TEST/db/apps_st/data/cntrl02.dbf,/u01/oracle/TEST/db/apps_st/data/cntrl03.dbf
db_block_size = 8192 #MP
_system_trig_enabled = TRUE #MP
o7_dictionary_accessibility = FALSE #MP
#### nls_language = american #11gR2del
nls_territory = america
nls_date_format = DD-MON-RR #MP
nls_numeric_characters = “.,”
nls_sort = binary #MP
nls_comp = binary #MP
nls_length_semantics = BYTE #MP
# audit_trail = TRUE
#### user_dump_dest = /ebiz/prodr12/udump #11gR2del
#### background_dump_dest = /ebiz/prodr12/bdump #11gR2del
#### core_dump_dest = /ebiz/prodr12/cdump #11gR2del
max_dump_file_size = 20480
#### timed_statistics = TRUE #11gR2del
_trace_files_public = TRUE
processes = 200
sessions = 400
db_files = 512
dml_locks = 10000
cursor_sharing = EXACT #MP
open_cursors = 600
session_cached_cursors = 500
sga_target = 2G #MP
db_block_checking = FALSE
db_block_checksum = TRUE
log_checkpoint_timeout = 1200
log_checkpoint_interval = 100000
log_buffer = 10485760
log_checkpoints_to_alert = TRUE
shared_pool_size = 400M
shared_pool_reserved_size = 40M
#### _shared_pool_reserved_min_alloc = 4100 #11gR2del
# cursor_space_for_time = FALSE
utl_file_dir=/usr/tmp, /usr/tmp, /u01/oracle/TEST/db/tech_st/11.2.0/appsutil/outbound/TEST_test, /usr/tmp
aq_tm_processes = 1
job_queue_processes = 2
LOG_ARCHIVE_DEST_1 = ‘LOCATION=/u01/archive’
#LOG_ARCHIVE_DEST_2 = ‘SERVICE=standby1′
parallel_max_servers = 4
parallel_min_servers = 0
_sort_elimination_cost_ratio =5 #MP
_like_with_bind_as_equality = TRUE #MP
_fast_full_scan_enabled = FALSE #MP
_b_tree_bitmap_plans = FALSE #MP
optimizer_secure_view_merging = FALSE #MP
#### _sqlexec_progression_cost = 2147483647 #MP #11gR2del
cluster_database = FALSE
pga_aggregate_target = 2G
workarea_size_policy = AUTO #MP
olap_page_pool_size = 4194304
############## 11gR2
compatible = 11.2.0
diagnostic_dest=/u01/oracle/TEST/db/tech_st/11.2.0/admin/TEST_test
undo_management=AUTO #MP
undo_tablespace=APPS_UNDOTS1
#plsql_code_type = NATIVE
_optimizer_autostats_job=FALSE #MP
parallel_force_local=TRUE #MP
sec_case_sensitive_logon = FALSE
db_recovery_file_dest=/u01/oracle/TEST/fast_recovery_area
db_recovery_file_dest_size=86696263680
##############
IFILE=/u01/oracle/TEST/db/tech_st/11.2.0/dbs/TEST_test_ifile.ora
##############
然后使用此配置文件:
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
mkdir -p /u01/oracle/TEST/db/tech_st/11.2.0/admin/TEST_test
sqlplus / as sysdba
shutdown immediate
create spfile=’/u01/oracle/TEST/db/tech_st/11.2.0/dbs/spfileTEST.ora’ from pfile=’/u01/oracle/TEST/db/tech_st/11.2.0/dbs/initTEST.ora’;
startup
select value from v$parameter where name=’spfile’;
quit
7.4.8 执行补丁安装后操作“打11gR2数据库补丁”一节打了一个opatch程序更新补丁和另外9个补丁4247037,9858539,12942119,12960302,12985184,13001379,13004894,13258936,13366268
其中13001379和13366268的后续操作已经在数据库升级过程中执行了,查看其他补丁的readme文件,进行opatch后操作。
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
一
4247037
sqlplus / as sysdba
drop user mgdsys cascade;
@/u01/oracle/TEST/db/tech_st/11.2.0/md/admin/catmgdidcode.sql
@/u01/oracle/TEST/db/tech_st/11.2.0/md/support/patchset_mgdsys_validity.sql
(没有发现无效对象,如果有则运行$ORACLE_HOME/rdbms/admin/utlrp.sql)
quit
二
9858539
cd /u01/oracle/TEST/db/tech_st/11.2.0/rdbms/admin
sqlplus / as sysdba
@@catnomtt.sql
@@catnomta.sql
@@dbmsmeta.sql
@@dbmsmeti.sql
@@dbmsmetu.sql
@@dbmsmetb.sql
@@dbmsmetd.sql
@@dbmsmet2.sql
@@catmeta.sql
@@prvtmeta.plb
@@prvtmeti.plb
@@prvtmetu.plb
@@prvtmetb.plb
@@prvtmetd.plb
@@prvtmet2.plb
@@catmet2.sql
alter package dbms_metadata_int compile plsql_ccflags = ‘ku$xml_enabled:true’;
alter package dbms_metadata_util compile plsql_ccflags = ‘ku$xml_enabled:true’;
quit
三
12942119
无后续操作
四
12960302
无后续操作
五
12985184
无后续操作
六
13004894
无后续操作
七
13258936
cd $ORACLE_HOME/ctx/admin/ctxpatch/
sqlplus / as sysdba
@ctxpatch11203.sql
quit
(略)Natively compile PL/SQL code (optional)
You can choose to run Oracle E-Business Suite 12.1 PL/SQL database objects in natively compiled mode with Oracle Database 11g. See the “Compiling PL/SQL Program Units for Native Execution” section of Chapter 12 of Oracle Database PL/SQL Language Reference 11g Release 2 (11.2).
7.5 升级数据库后(开两个终端窗口,其中一个切换到appltest用户加载环境变量,另外一个切换到oratest用户加载环境变量,就不用重复切换用户和加载环境变量了。)
7.5.1 启11gR2数据库监听如果监听没启动则启动监听
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
lsnrctl start TEST
7.5.2 执行adgrants.sqlsu – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $APPL_TOP
/u01/TEST/apps/apps_st/appl
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/apps/apps_st/appl/admin/adgrants.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus / as sysdba
@adgrants.sql apps
7.5.3 赋予CTXSYS创建过程权限su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $AD_TOP
/u01/TEST/apps/apps_st/appl/ad/12.0.0
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adctxprv.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus apps/apps
@adctxprv.sql manager CTXSYS
7.5.4 设置CTXSYS参数继续用上面的oratest用户和环境变量
sqlplus / as sysdba
exec ctxsys.ctx_adm.set_parameter(‘file_access_role’, ‘public’);
quit
7.5.5 验证工作流规则集su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
echo $FND_TOP
/u01/TEST/apps/apps_st/appl/fnd/12.0.0
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
sqlplus apps/apps
@/u01/TEST/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/wfaqupfix.sql APPLSYS APPS
(略)Deregister the current database server (conditional)
If you plan to change the database port, host, SID, or database name parameter on the database server, you must also update AutoConfig on the database tier and deregister the current database server node.
Use SQL*Plus to connect to the database as APPS and run the following command:
$ sqlplus apps/[APPS password]
SQL> exec fnd_conc_clone.setup_clean;
7.5.6 运行autoconfig复制AutoConfig 到RDBMS ORACLE_HOME
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
perl $AD_TOP/bin/admkappsutil.pl
结果应显示
output located at /u01/TEST/inst/apps/TEST_test/admin/out/appsutil.zip
MakeAppsUtil completed successfully.
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
cp /u01/TEST/inst/apps/TEST_test/admin/out/appsutil.zip $ORACLE_HOME
cd $ORACLE_HOME
unzip -o appsutil.zip
(略)在数据库层安装JRE
按照下面的步骤,确保应用层和数据库层的JRE 版本至少是1.5或更高版本:
若您使用的是”完全认证” 平台, 请参阅My Oracle Support文件 418664.1 在目录/appsutil 下安装jre.
若您使用的是 ” 只是数据库层” 平台, 请参阅My Oracle Support文件 456197.1 在目录/appsutil 下安装jre.
生成数据库层上下文文件
继续用上面oratest用户和环境变量
perl $ORACLE_HOME/appsutil/bin/adbldxml.pl
输入apps的密码apps
结果应显示
The context file has been created at:
/u01/oracle/TEST/db/tech_st/11.2.0/appsutil/TEST_test.xml
在数据库层运行AutoConfig
(没启应用,如果应用启了停掉,确认数据库和数据库监听都启动)
继续用上面oratest用户和环境变量
$ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=/u01/oracle/TEST/db/tech_st/11.2.0/appsutil/TEST_test.xml
输入apps的密码apps
结果应显示
AutoConfig completed successfully.
如果出现错误,重新运行一遍试试。
7.5.7打ECX补丁9151516(ebs12.1)把p9151516_R12.ECX.B_R12_GENERIC.zip传到/stage/patch目录下
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
cd /stage/patch
unzip p9151516_R12.ECX.B_R12_GENERIC.zip
开启维护模式
adadmin 5 1
cd /stage/patch/9151516
adpatch
9151516.log
manager
确认补丁目录/stage/patch/9151516
u9151516.drv
等待几分钟
关闭维护模式adadmin 5 2
7.5.8 收集SYS统计信息用oratest用户和11gR2环境变量
su – oratest
export ORACLE_SID=TEST
export ORACLE_BASE=/u01/oracle/TEST
export ORACLE_HOME=/u01/oracle/TEST/db/tech_st/11.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export TNS_ADMIN=/u01/oracle/TEST/db/tech_st/11.2.0/network/admin/TEST_test
确认默认临时表有1.5G空闲空间然后继续
修改原来临时表
sqlplus / as sysdba
ALTER DATABASE TEMPFILE ‘/u01/oracle/TEST/db/apps_st/data/temp01.dbf’ AUTOEXTEND ON NEXT 50M MAXSIZE 4G;
ALTER DATABASE TEMPFILE ‘/u01/oracle/TEST/db/apps_st/data/temp02.dbf’ AUTOEXTEND ON NEXT 50M MAXSIZE 4G;
quit
(
或者加临时表
create temporary tablespace TEMP3
tempfile ‘ /u01/oracle/TEST/db/apps_st/data/temp03.dbf’ size 1600M reuse
tablespace group TEMP
extent management local
uniform size 128K;
)
将$APPL_TOP/admin/adstats.sql复制到数据库目录$ORACLE_HOME:
(用oratest用户和11gR2环境变量)
cp /u01/TEST/apps/apps_st/appl/admin/adstats.sql /u01/oracle/TEST/db/tech_st/11.2.0
cd /u01/oracle/TEST/db/tech_st/11.2.0
sqlplus / as sysdba
alter system enable restricted session;
@adstats.sql
等待半个小时
sqlplus / as sysdba
alter system disable restricted session;
quit
(略)Create Demantra privileges (conditional)
If you are using Demantra, perform the steps in document 730883.1 on My Oracle Support.
(略)Re-create custom database links (conditional)
没改监听,略过
If the Oracle Net listener in the 11.2.0 Oracle home is defined differently than the one used by the old Oracle home, you
must re-create any custom self-referential database links that exist in the Applications database instance. To check for
the existence of database links, use SQL*Plus on the database server node to connect to the Applications database instance as APPS and run the following query:
$ sqlplus apps/[apps password ]
SQL> select db_link from all_db_links;
The EDW_APPS_TO_WH and APPS_TO_APPS database links, if they exist, should have been updated with the new port number by AutoConfig in the previous step.
If you have custom self-referential database links in the database instance, use the following commands to drop and re-create them:
$ sqlplus apps/[apps password ]
SQL> drop database link [ custom database link ];
SQL> create database link [custom database link ] connect to
[user] identified by [password ] using
‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=[hostname ])
(PORT=[port number]))(CONNECT_DATA=(SID=[ ORACLE_SID ])))’;
where [custom database link], [user], [password], [hostname], [port number], and [ORACLE_SID] reflect the new Oracle Net listener for the database instance.
7.5.9 重建apps授权和同义词su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
adadmin 4 2
等待几分钟
(略)Enable Database Vault (conditional)
If you disabled Database Vault, enable it by performing step 7 of Part 2 of document 1091083.1 on My Oracle Support.
7.5.10重启应用和数据库su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstpall.sh apps/apps
su – oratest
. /u01/oracle/TEST/db/tech_st/11.2.0/TEST_test.env
cd /u01/oracle/TEST/db/tech_st/11.2.0/appsutil/scripts/TEST_test
./addlnctl.sh stop TEST
./addbctl.sh stop immediate
./addbctl.sh start
./addlnctl.sh start TEST
su – appltest
. /u01/TEST/apps/apps_st/appl/APPSTEST_test.env
$ADMIN_SCRIPTS_HOME/adstrtal.sh apps/apps
7.5.11 同步工作流视图启动数据库和应用后
浏览器打开http://test.ebs.local:8001/OA_HTML/AppsLogin
sysadmin/sysadmin
进入系统管理员职责
并发-请求
提交新请求,单个请求,确定
请求名称:工作流目录服务用户/职责验证
参数:10000 是是 否 (留空)
提交
等待几十秒完成。
(如果提示默认值错误可以忽略,或者手动修改:
并发-方案-定义
F11搜索 程序:工作流目录服务用户/职责验证
参数
选择p_Check_Dangling,默认值改为“否”
选择p_Check_Missing_URA,默认值改为“否”
选择p_UpdateWho,默认值改为“否”)