Oracle EBS 更改主機名/web端口/監聽端口 -- 通過autoconfig

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章