Monday, June 2, 2008

Change hostname, ip address of an Oracle Application Server SOA suite (chgiphost.sh)

It is possible to change the hostname ip address from a linux server where Oracle Application Server SOA suite (10.1.3.3.x) is installed.
The following steps need to be executed:
1. Stop the Oracle Application Server
opmnctl shutdown

2. Change the network linux server settings
Change hostname/ip address in /etc/hosts
Change hostname/ip address in /etc/sysconfig/network
Change ip address in /etc/sysconfig/network-scripts/ifcfg-eth0

Execute command hostname:
hostname {HOST_NAME_NEW}

3. Execute script chgiphost.sh
$ORACLE_HOME/chgip/scripts/chgiphost.sh

4. Find and replace the hostname in all the files of the ORACLE_HOME. These files can be found with the following command:
find ./ -type f -name '*' -print0  xargs -0 grep -li -e "{HOST_NAME_ORG}"

I created a script to do this for me: searchreplace


#!/bin/sh

if [ $# != 2 ];
then
echo "Start op: $0 "
exit 1
fi

REPLACE_WORD=${1}
WORD=${2}


for FILE in `find ./ -type f -name '*' -print0 | xargs -0 grep -li -e "${REPLACE_WORD}"`
do
echo "In the ${FILE} the word ${REPLACE_WORD} is replaced by ${WORD}."
cat ${FILE} | sed 's/'${REPLACE_WORD}'/'${WORD}'/g' > ${FILE}_TMP
mv ${FILE}_TMP ${FILE}
done

exit 0


5. Start Oracle Database which is used for the SOA metadata repository and Update table ORAESB.ESB_PARAMETER en DT_OC4J_HOST:

sqlplus oraesb
update oraesb.esb_parameter
set param_value='$HOST_NAME_NEW.$HOST_DOMAIN_NEW'
where param_name ='DT_OC4J_HOST';

6. Start Oracle Application Server:
opmnctl startall

11 comments:

  1. Hello

    can one tar the files from original host and untar them on the new host and run the commands that u mentioned above. will this work?

    ReplyDelete
  2. Hi,

    Yes I suppose this will work. In our case we made an master Virtual machine that we clone to a new virtual machine and we did the steps in the blog.

    The application server is working fine! So a tar should work also.

    Kind regards,

    Arjan

    ReplyDelete
  3. Thanks for the reply. Forgot to add that we are using 10.1.2.

    how about the metadata under INFRA? Will this work as well ?

    ReplyDelete
  4. also can u please point me to the correct steps of how to clone, INFRA as well a mid-tier?

    ReplyDelete
  5. This blog was for 10.1.3.x for the 10.1.2 infra this is not so easy because of the metadata repository. I do not have any experience with this version and changing ip addresses.

    ReplyDelete
  6. Thanks for the quick reply. This is causing us issues....

    Thanks anyways...

    ReplyDelete
  7. Hello

    Nice blogs... lots of good information here...

    I had a comment on Portal 10.1.4. since there was no comments section there i am putting it here. Sorry abt this...

    We use portal 10.1.4 and we are having issues doing an export/import of the personalizations. the personalizations of the WSRP portlets gets lost during the import. If we customize it in say region A (default) and i move it to tab B. After we do an import the portlet goes bak to A tab.

    Is there anything that we are missing interms of setup etc?

    ReplyDelete
  8. Im no master, however I trust you simply made a fantastic point. You unquestionably completely comprehend what youre talking about, and I can really get behind that. check my ip address

    ReplyDelete
  9. Thanks for sharing this valuable content. In my view, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. https://192-168-i-i.com

    ReplyDelete
  10. It's also easy to guess if the password is simply "password" or "admin". Make sure that this password is set to something secure to prevent unwanted access. 192.168.0.1.1

    ReplyDelete
  11. This was very helpful. Thanks a lot. You should get Mcafee antivirus to secure your device. Read steps from mcafee.com activate and follow them.

    ReplyDelete

comment