Wednesday, June 8, 2016

How to change the hostname and/or port of the Database Tier using AutoConfig on 11i in Linux


Below Scenario Database and Applications are in different Server.

1. Deregister the current database server

The hostname and/or port will be changed, so database server node needs to be de-registered.

Use below command for deregister:

perl <RDBMS ORACLE_HOME>/appsutil/bin/adgentns.pl appspass=<APPSpwd> \
contextfile=<CONTEXT> -removeserver

We need find SYSTEM_NAME and SERVER_NAME for removing server entries in database.

Find system name:

select DB_NAME from FND_DATABASES;

Find server name:

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('hostname');

Execute below package:

begin
FND_NET_SERVICES.remove_server('<DB_NAME'>, '<NAME>');
end;
/
commit;
/

2. Update the AutoConfig Context files

Create a new context file:

perl <RDBMS ORACLE_HOME>/appsutil/bin/adclonectx.pl contextfile=$CONTEXT_FILE

This will create a new Context file of the format <SID>_<new hostname>.xml in the current working directory

Applications Tier: 

Update the existing Applications Tier Context file on all APPL_TOP nodes with new DB values as below

"Data Server Host" and "Database Port" to new value
"s_apps_jdbc_connect_descriptor" to (" ")

3. Shutdown the Applications

cd $COMMON_TOP/admin/scripts/<SID_hostname>

./adstpall.sh apps/<appspasswd>

4. Run AutoConfig on the Database and Application Nodes

Database Node:

Run AutoConfig on the database node using the following syntax :

cd <RDBMS ORACLE_HOME>/appsutil/bin/

./adconfig.sh contextfile=<RDBMS ORACLE_HOME>/appsutil/<SID>_<new_hostname>.xml

Applications Node:

Run AutoConfig on the Applications tier node using the following syntax :

cd <COMMON_TOP>/admin/scripts/<CONTEXT_NAME>

./adautocfg.sh

5. Shutdown the Listener and Database

-bash-3.2$lsnrctl stop <listener name>

-bash-3.2$ sqlplus '/as sysdba'

SQL> shut immediate

6. Change the hostname

Change old name to new name in /etc/hosts file:

127.0.0.1 localhost.localdomain
<ip_address> <node_name>.<domain_name> 

Verify that the /etc/sysconfig/network file contains an entry that is similar to the following:

Check /etc/sysconfig/network file have entry like hostname as below and change to new hostname

-bash-3.2$ ls -ltr /etc/sysconfig/network
-rw-r--r-- 1 root root 129 Sep 26  2012 /etc/sysconfig/network
-bash-3.2$ cat /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes
HOSTNAME=<node_name>.<domain_name>
GATEWAY=<IP>
GATEWAYDEV=eth0
NETWORKING_IPV6=no

Check and remove /etc/sysconfig/networking/profiles/default/network file.

Reboot the server.

7. Start the Database and listener
     Source you new environment file
    -bash-3.2$ sqlplus '/as sysdba'
     SQL> startup
    -bash-3.2$lsnrctl start <listener name>

8. Start the Applications
cd $COMMON_TOP/admin/scripts/<SID_hostname>
./adstrtal.sh apps/<appspasswd>

No comments:

Post a Comment