Oracle EBS版本 R12.1.3
参考文档:
341322.1 11i: How To Change the Hostname of an Applications Tier using AutoConfig (Doc ID 341322.1)
338003.1 Rel 11i: How to change the hostname and/or port of the Database Tier using AutoConfig (Doc ID 338003.1)
-- 在修改过程中,应用是关闭的,数据库和监听是启动的。
应用的contextfile
/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr121.xml
数据库的contextfile
/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr121.xml
-- 旧域名 ebsr121.local 新域名 ebsr123.local
-- 将数据库从EBS中注册掉
[oraprod@ebsr121 ~]$ /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/bin/adgentns.pl appspass=apps contextfile=/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr121.xml -removeserver
##########################################################################
Generate Tns Names
##########################################################################
Classpath : :/d01/oracle/PROD/db/tech_st/11.1.0/jdbc/lib/ojdbc6.jar:/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/java/xmlparserv2.jar:/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/java:/d01/oracle/PROD/db/tech_st/11.1.0/jlib/netcfg.jar:/d01/oracle/PROD/db/tech_st/11.1.0/jlib/ldapjclnt11.jar
Loading ORACLE_HOME environment from /d01/oracle/PROD/db/tech_st/11.1.0
Logfile: /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/log/PROD_ebsr121/03311327/NetServiceHandler.log
adgentns.pl exiting with status 0
ERRORCODE = 0 ERRORCODE_END
[oraprod@ebsr121 ~]$
-- 连接到数据库,进行查询,查询不到数据,说明执行成功
select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('ebsr121'); -- 这里是主机名
-- 复制一份$CONTEXT_FILE ,修改新文件,将机器名替换为新的机器名
cp /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr121.xml /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr123.xml
vi PROD_ebsr123.xml
使用类似这样的格式替换:%s#ebsr121#ebsr123#g (如文件内有#,可用/替换,:%s/abc/123/g)
-- 修改/etc/hosts, /etc/sysconfig/network (注意,修改后要重启下机器。因为这个时候hostname显示的还是旧机器名。另外在ap节点autoconfig的时候会有告警)
-- 回到数据库用户oraprod下,运行autoconfig
[root@ebsr121 ~]# su - oraprod
[oraprod@ebsr121 ~]$ cd $ORACLE_HOME/appsutil/bin
[oraprod@ebsr121 bin]$
[oraprod@ebsr121 bin]$ ./adconfig.sh contextfile=/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr123.xml
[oraprod@ebsr121 bin]$ ./adconfig.sh contextfile=/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr123.xml
Enter the APPS user password:
The log file for this session is located at: /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/log/PROD_ebsr123/03311347/adconfig.log
AutoConfig is configuring the Database environment...
AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /d01/oracle/PROD/db/tech_st/11.1.0
Classpath : :/d01/oracle/PROD/db/tech_st/11.1.0/jdbc/lib/ojdbc6.jar:/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/java/xmlparserv2.jar:/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/java:/d01/oracle/PROD/db/tech_st/11.1.0/jlib/netcfg.jar:/d01/oracle/PROD/db/tech_st/11.1.0/jlib/ldapjclnt11.jar
Using Context file : /d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr123.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Updating rdbms version in Context file to db111
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...
AutoConfig completed successfully.
[oraprod@ebsr121 bin]$
-- 再次查询(有查询结果,说明修改成功了)
select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('ebsr123');
-- db的修改,到此为止
-- 修改ap的节点
-- 在EBS中删除掉AP节点的注册
perl $AD_TOP/bin/adgentns.pl appspass=apps contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr121.xml -removeserver
[applprod@ebsr121 ~]$ perl $AD_TOP/bin/adgentns.pl appspass=apps contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr121.xml -removeserver
##########################################################################
Generate Tns Names
##########################################################################
Logfile: /d01/oracle/PROD/inst/apps/PROD_ebsr121/admin/log/03311355/NetServiceHandler.log
Classpath : /d01/oracle/PROD/apps/apps_st/comn/java/lib/appsborg2.zip:/d01/oracle/PROD/apps/apps_st/comn/java/classes
Updating s_tnsmode to 'generateTNS'
UpdateContext exited with status: 0
Tools tnsnames.ora instantiated
Web tnsnames.ora instantiated
adgentns.pl exiting with status 0
ERRORCODE = 0 ERRORCODE_END
[applprod@ebsr121 ~]$
-- 查看de-register是否成功
select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='APPS' and FND_NODES.NODE_NAME=upper('ebsr121');
--复制一份$CONTEXT_FILE ,修改新文件,将机器名替换为新的机器名 (如果里面有文件或者文件夹,不要替换。否则autoconfig会出错)
cp /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr121.xml /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml
vi /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml -- 注意 更改里面的hostname(如果有错误,注意查看log)
-- 执行autoconfig (这里有error,注意上面提到的不要修改文件和文件夹,只修改类似hostname对应的值)
cd $AD_TOP/bin
./adconfig.sh contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml appspass=apps
[applprod@ebsr121 bin]$ ./adconfig.sh contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml appspass=apps
The log file for this session is located at: /d01/oracle/PROD/inst/apps/PROD_ebsr121/admin/log/03311434/adconfig.log
AutoConfig is configuring the Applications environment...
AutoConfig will consider the custom templates if present.
Using CONFIG_HOME location : /d01/oracle/PROD/inst/apps/PROD_ebsr121
Classpath : /d01/oracle/PROD/apps/apps_st/comn/java/lib/appsborg2.zip:/d01/oracle/PROD/apps/apps_st/comn/java/classes
Using Context file : /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Configuring templates from all of the product tops...
Configuring AD_TOP........COMPLETED
Configuring FND_TOP.......COMPLETED
Configuring ICX_TOP.......COMPLETED
Configuring MSC_TOP.......COMPLETED
Configuring IEO_TOP.......COMPLETED
Configuring BIS_TOP.......COMPLETED
Configuring AMS_TOP.......COMPLETED
Configuring CCT_TOP.......COMPLETED
Configuring WSH_TOP.......COMPLETED
Configuring CLN_TOP.......COMPLETED
Configuring OKE_TOP.......COMPLETED
Configuring OKL_TOP.......COMPLETED
Configuring OKS_TOP.......COMPLETED
Configuring CSF_TOP.......COMPLETED
Configuring IGS_TOP.......COMPLETED
Configuring IBY_TOP.......COMPLETED
Configuring JTF_TOP.......COMPLETED
Configuring MWA_TOP.......COMPLETED
Configuring CN_TOP........COMPLETED
Configuring CSI_TOP.......COMPLETED
Configuring WIP_TOP.......COMPLETED
Configuring CSE_TOP.......COMPLETED
Configuring EAM_TOP.......COMPLETED
Configuring FTE_TOP.......COMPLETED
Configuring ONT_TOP.......COMPLETED
Configuring AR_TOP........COMPLETED
Configuring AHL_TOP.......COMPLETED
Configuring OZF_TOP.......COMPLETED
Configuring IES_TOP.......COMPLETED
Configuring CSD_TOP.......COMPLETED
Configuring IGC_TOP.......COMPLETED
AutoConfig completed with errors.
[applprod@ebsr121 bin]$
--重新启动主机后,再次autoconfig(之前没有重启主机,导致hostname显示的还是旧机器名)
[applprod@ebsr123 bin]$ ./adconfig.sh contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml appspass=apps
The log file for this session is located at: /d01/oracle/PROD/inst/apps/PROD_ebsr121/admin/log/03311511/adconfig.log
AutoConfig is configuring the Applications environment...
AutoConfig will consider the custom templates if present.
Using CONFIG_HOME location : /d01/oracle/PROD/inst/apps/PROD_ebsr121
Classpath : /d01/oracle/PROD/apps/apps_st/comn/java/lib/appsborg2.zip:/d01/oracle/PROD/apps/apps_st/comn/java/classes
Using Context file : /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Configuring templates from all of the product tops...
Configuring AD_TOP........COMPLETED
Configuring FND_TOP.......COMPLETED
Configuring ICX_TOP.......COMPLETED
Configuring MSC_TOP.......COMPLETED
Configuring IEO_TOP.......COMPLETED
Configuring BIS_TOP.......COMPLETED
Configuring AMS_TOP.......COMPLETED
Configuring CCT_TOP.......COMPLETED
Configuring WSH_TOP.......COMPLETED
Configuring CLN_TOP.......COMPLETED
Configuring OKE_TOP.......COMPLETED
Configuring OKL_TOP.......COMPLETED
Configuring OKS_TOP.......COMPLETED
Configuring CSF_TOP.......COMPLETED
Configuring IGS_TOP.......COMPLETED
Configuring IBY_TOP.......COMPLETED
Configuring JTF_TOP.......COMPLETED
Configuring MWA_TOP.......COMPLETED
Configuring CN_TOP........COMPLETED
Configuring CSI_TOP.......COMPLETED
Configuring WIP_TOP.......COMPLETED
Configuring CSE_TOP.......COMPLETED
Configuring EAM_TOP.......COMPLETED
Configuring FTE_TOP.......COMPLETED
Configuring ONT_TOP.......COMPLETED
Configuring AR_TOP........COMPLETED
Configuring AHL_TOP.......COMPLETED
Configuring OZF_TOP.......COMPLETED
Configuring IES_TOP.......COMPLETED
Configuring CSD_TOP.......COMPLETED
Configuring IGC_TOP.......COMPLETED
AutoConfig completed successfully.
[applprod@ebsr123 bin]$
-- 全部修改完毕后,查看视图验证
select home_url from apps.icx_parameters
select profile_option_value from apps.fnd_profile_option_values where profile_option_value like '%local%'
SYS@PROD>select home_url from apps.icx_parameters;
HOME_URL
--------------------------------------------------------------------------------
http://ebsr123.local:8000/OA_HTML/AppsLogin
SYS@PROD>
SYS@PROD>select profile_option_value from apps.fnd_profile_option_values where profile_option_value like '%local%';
PROFILE_OPTION_VALUE
--------------------------------------------------------------------------------
http://ebsr123.local:8000/pls/PROD
http://ebsr123.local:8000/forms/frmservlet
http://ebsr123.local:8000/OA_HTML/configurator/UiServlet
http://ebsr123.local:8000/OA_HTML
http://ebsr123.local:8000/OA_HTML
http://ebsr123.local:8000
local
http://ebsr123.local:8000/mapviewer/omserver
http://ebsr123.local:8000/OA_HTML/ibyecapp
http://ebsr123.local:8000
local
PROFILE_OPTION_VALUE
--------------------------------------------------------------------------------
http://ebsr123.local:8000
http://ebsr123.local:8000/OA_HTML/ibyecapp
local
http://ebsr123.local:8000/OA_HTML/pricing
http://ebsr123.local:8000/OA_HTML/
16 rows selected.
SYS@PROD>
-- 在OAM上查看context file
-- 在OAM上查看机器名
END
-- 2020-04-01 add ,修改访问EBS的端口
参考文档 :760590.1 How to change the Web Listener Port number in Oracle E-Business Suite Release 12? (Doc ID 760590.1)
修改端口,查询出是8000,修改为8001
SYS@PROD>select home_url from apps.icx_parameters;
HOME_URL
--------------------------------------------------------------------------------
http://ebsr123.local:8000/OA_HTML/AppsLogin
SYS@PROD>
-- 应用下的xml文件, 修改里面的8000为8001 。
vi PROD_ebsr123.xml
-- 运行autoconfig
cd $AD_TOP/bin
./adconfig.sh contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml appspass=apps
[applprod@ebsr123 bin]$ ./adconfig.sh contextfile=/d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml appspass=apps
The log file for this session is located at: /d01/oracle/PROD/inst/apps/PROD_ebsr121/admin/log/04011044/adconfig.log
AutoConfig is configuring the Applications environment...
AutoConfig will consider the custom templates if present.
Using CONFIG_HOME location : /d01/oracle/PROD/inst/apps/PROD_ebsr121
Classpath : /d01/oracle/PROD/apps/apps_st/comn/java/lib/appsborg2.zip:/d01/oracle/PROD/apps/apps_st/comn/java/classes
Using Context file : /d01/oracle/PROD/inst/apps/PROD_ebsr121/appl/admin/PROD_ebsr123.xml
Context Value Management will now update the Context file
Updating Context file...COMPLETED
Attempting upload of Context file and templates to database...COMPLETED
Configuring templates from all of the product tops...
Configuring AD_TOP........COMPLETED
Configuring FND_TOP.......COMPLETED
Configuring ICX_TOP.......COMPLETED
Configuring MSC_TOP.......COMPLETED
Configuring IEO_TOP.......COMPLETED
Configuring BIS_TOP.......COMPLETED
Configuring AMS_TOP.......COMPLETED
Configuring CCT_TOP.......COMPLETED
Configuring WSH_TOP.......COMPLETED
Configuring CLN_TOP.......COMPLETED
Configuring OKE_TOP.......COMPLETED
Configuring OKL_TOP.......COMPLETED
Configuring OKS_TOP.......COMPLETED
Configuring CSF_TOP.......COMPLETED
Configuring IGS_TOP.......COMPLETED
Configuring IBY_TOP.......COMPLETED
Configuring JTF_TOP.......COMPLETED
Configuring MWA_TOP.......COMPLETED
Configuring CN_TOP........COMPLETED
Configuring CSI_TOP.......COMPLETED
Configuring WIP_TOP.......COMPLETED
Configuring CSE_TOP.......COMPLETED
Configuring EAM_TOP.......COMPLETED
Configuring FTE_TOP.......COMPLETED
Configuring ONT_TOP.......COMPLETED
Configuring AR_TOP........COMPLETED
Configuring AHL_TOP.......COMPLETED
Configuring OZF_TOP.......COMPLETED
Configuring IES_TOP.......COMPLETED
Configuring CSD_TOP.......COMPLETED
Configuring IGC_TOP.......COMPLETED
AutoConfig completed successfully.
[applprod@ebsr123 bin]$
-- 查看结果
SYS@PROD>select home_url from apps.icx_parameters;
HOME_URL
--------------------------------------------------------------------------------
http://ebsr123.local:8001/OA_HTML/AppsLogin
SYS@PROD>
SYS@PROD>select profile_option_value from apps.fnd_profile_option_values where profile_option_value like '%local%';
PROFILE_OPTION_VALUE
--------------------------------------------------------------------------------
http://ebsr123.local:8001/pls/PROD
http://ebsr123.local:8001/forms/frmservlet
http://ebsr123.local:8001/OA_HTML/configurator/UiServlet
http://ebsr123.local:8001/OA_HTML
http://ebsr123.local:8001/OA_HTML
http://ebsr123.local:8001
local
http://ebsr123.local:8001/mapviewer/omserver
http://ebsr123.local:8001/OA_HTML/ibyecapp
http://ebsr123.local:8001
local
PROFILE_OPTION_VALUE
--------------------------------------------------------------------------------
http://ebsr123.local:8001
http://ebsr123.local:8001/OA_HTML/ibyecapp
local
http://ebsr123.local:8001/OA_HTML/pricing
http://ebsr123.local:8001/OA_HTML/
16 rows selected.
SYS@PROD>
-- 启动应用,进行验证(略)
END
-- 2020-04-02 add
-- 修改监听器端口1521 - 1522
-- 修改db层面的监听端口,将PROD_ebsr123.xml里面的1521替换成1522
/d01/oracle/PROD/db/tech_st/11.1.0/appsutil/PROD_ebsr123.xml
-- 修改db层面的listener.ora,tnsnames.ora,将里面的1521修改为1523
--运行autoconfig (略)
-- 修改应用层面的监听端口,将PROD_ebsr123.xml里面的1521修改为1522
-- 运行autoconfig (略)
-- 验证
-- 客户端tnsping(要把客户端的tnsnames.ora里面也修改成1522)
C:\Users\jinming>tnsping ebs
TNS Ping Utility for 64-bit Windows: Version 19.0.0.0.0 - Production on 02-4月 -2020 10:36:55
Copyright (c) 1997, 2019, Oracle. All rights reserved.
已使用的参数文件:
D:\app\client\jinming\product\19.0.0\client_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.50)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = PROD)))
OK (10 毫秒)
C:\Users\jinming>
-- 在服务器上查看监听状态
LSNRCTL> status prod
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ebsr123.local)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias PROD
Version TNSLSNR for Linux: Version 11.1.0.7.0 - Production
Start Date 02-APR-2020 09:41:44
Uptime 0 days 1 hr. 42 min. 56 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /d01/oracle/PROD/db/tech_st/11.1.0/network/admin/PROD_ebsr123/listener.ora
Listener Log File /d01/oracle/PROD/db/tech_st/11.1.0/log/diag/tnslsnr/ebsr123/prod/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ebsr123.local)(PORT=1522)))
Services Summary...
Service "PROD" has 1 instance(s).
Instance "PROD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
END