Monday, February 15, 2010

Change Domainname - Oracle EBS R12

Hi All,

Today we will discuss on how to change the domain name of a server.
Before we do this please ensure you take one complete cold backup of the system.
The domain name change described here is for EBS R12 applications.
Domain name change is accomplished in 2 parts
>< Configure the Database to the new domainname
>< Configure applications to the new domainname

One would assume that before we start changing the domainname at the database and applications the values are already set at the Operating System level
with the help of SA.

- As a DBA ensure the hostname is followed by the correct domainname in the /etc/hosts file.

Config Changes on the DB Side
=============================


1. Shutdown application services
2. Ensure all services are down.
3. On the DB server node (DB should be up and running)
4. Execute the below command

orauat server050 oracle102 > perl /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/bin/adgentns.pl appspass=apps contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml -removeserver


##########################################################################
Generate Tns Names
##########################################################################
Classpath :

:/u01/oracle/UAT/db/tech_st/10.2.0/jdbc/lib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/netcfg.jar:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/ldapjclnt10.jar

Loading ORACLE_HOME environment from /u01/oracle/UAT/db/tech_st/10.2.0
Logfile: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/log/UAT_server050/02051831/NetServiceHandler.log

adgentns.pl exiting with status 0
ERRORCODE = 0 ERRORCODE_END



5. Now login into the Database as apps user and run the below sql queries and the results should be "no rows selected"
If the below query returns rows ,then
a) Shutdown DB
b) execute step 4 above again.

orauat server050 oracle102 >

as apps

SQL> select DB_NAME from FND_DATABASES;

no rows selected



SQL> 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('server050'); 2 3

no rows selected



6. Remove the Database server entry from FND_NET services by executing the below procedure

SQL> begin
FND_NET_SERVICES.remove_server('UAT', 'server050');
end; 2 3
4 /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.




7. Now generate a New CONTEXT_FILE on the DB server .

Note:- 1. When prompted for "Do you want the inputs to be validated " say "n".
2. When it prompts for the contextfile name give a new name and take a note of the new contextfile and location

orauat server050 oracle102 > perl adclonectx.pl contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

Oracle Applications Rapid Clone

Version 12.0.0

adclonectx Version 120.18.12000000.7

Running:
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/javaoracle.apps.ad.context.CloneContext -e /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml
Enter the APPS password : apps

Log file located at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [server050] :

It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:

-If cloning a context on source system for a remote system.
-If cloning a context on a machine where the ports are taken and
you do not want to shutdown the services at this point.
-If cloning a context but the database it needs to connect is not available.

Do you want the inputs to be validated (y/n) [n] ? : n

Target Instance is RAC (y/n) [n] :

Target System Database SID : UAT

Target System Base Directory : /u01/oracle/UAT

Oracle OS User [orauat] :

Oracle OS Group [dba] :

Target System utl_file_dir Directory List : /u01/oracle/UAT/db/tech_st/10.2.0/admin/UAT_server050/tmp

Number of DATA_TOP's on the Target System [1] :

Target System DATA_TOP Directory 1 [/u01/oracle/UAT/db/apps_st/data] :

Target System RDBMS ORACLE_HOME Directory [/u01/oracle/UAT/db/tech_st/10.2.0] :

Target System Archive Log Directory [/u01/oracle/UAT/db/apps_st/data/archive] :

Do you want to preserve the Display [server050:0.0] (y/n) ? :

Invalid input value. 'y' or 'n' required.


Do you want to preserve the Display [server050:0.0] (y/n) ? : y

Target System Port Pool [0-99] : 1
Report file located at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/temp/portpool.lst
Complete port information available at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/temp/portpool.lst

New context path and file name [/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml] : /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Creating the new Database Context file from :
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/template/adxdbctx.tmp

The new database context file has been created :
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Log file located at
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log
contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Check Clone Context logfile

/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log for details.



8. Once the above command successfully completes you should see a new contextfile with the new given at the location /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

9. Copy the new contextfile to the original name /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml (UAT1 to UAT)

10. There will be a entry for the location of the context file within the Context file search for the below string and replace with (it would be reflecting new xml file name ,replace UAT1 to UAT)

<oa_context_file_loc oa_var="s_contextfile">/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml</oa_context_file_loc>

11. Save and quit

12. Run autoconfig on Database node

orauat server050 oracle102 > ./adconfig.sh
Enter the full path to the Context file: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml
Enter the APPS user password:
The log file for this session is located at: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/log/UAT_server050/02051902/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /u01/oracle/UAT/db/tech_st/10.2.0
Classpath :

:/u01/oracle/UAT/db/tech_st/10.2.0/jdbc/lib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/netcfg.jar:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/ldapjclnt10.jar

Using Context file : /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.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 db102
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.


13. Login into the Database as apps user and run the below queries to check if the node values are populated correctly

orauat server050 oracle102 > sqlplus apps

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Feb 5 19:03:35 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select DB_NAME from FND_DATABASES;

DB_NAME
--------
UAT


SQL>
SQL>
SQL> 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('server050'); 2 3

NAME SERVER_TYPE
------------------------ -----------------------------
server050_UAT_DB DB



SQL>

14. End of Configuration change on Database side


Config Changes on the Application Side
=================================


1. Take a backup of the context file .
2. Replace all the old values for the domainname with the new domainname. (Use OAM or vi editor)
3. Save and quit the contextfile
4. Run Autoconfig.
5. Start the applications and it should come up.

No comments:

Post a Comment