How to change Hostname or IP address on Oracle Server
Scenario:
You want to change Hostname or IP Address or DNS configuration
on server where Oracle is running on ASM.
The steps have been written for an installation that
splits the ownership of the “Grid Infrastructure” and the database between a
user named ORAGRID and a user named ORADB respectively. Make sure you run below
given commands from right user.
Environment:
Operating System – Redhat Enterprise Linux 6.4
Database Version – Oracle 11.2.0.4
ASM – Yes
Databases – 7 DB Instances
Step 1:
Check existing configured resources with Oracle home
[oragrid@litms####
~]$ crs_stat -t
Name Type Target State
Host
------------------------------------------------------------
ora.ASMDATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....ER.lsnr
ora....er.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....2FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....4FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....6FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....8FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....0FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....1FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....DATA.dg
ora....up.type ONLINE ONLINE litm...-new
ora....2FRA.dg
ora....up.type ONLINE ONLINE litm...-new
ora.asm ora.asm.type ONLINE
ONLINE litm...-new
ora.cssd ora.cssd.type ONLINE
ONLINE litm...-new
ora.diskmon ora....on.type OFFLINE OFFLINE
ora.evmd ora.evm.type ONLINE
ONLINE litm...-new
ora.ons ora.ons.type OFFLINE
OFFLINE
ora.rpst02.db ora....se.type ONLINE ONLINE
litm...-new
Step 2:
Before start with the Oracle Restart process you must
stop the listener:
[oragrid@litms#### ~]$ lsnrctl stop listener
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on
19-DEC-2014 09:50:57
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
Step 3:
Confirm if listener is stopped
[oragrid@litms#### ~]$ crs_stat -t
Name
Type Target State
Host
------------------------------------------------------------
ora.ASMDATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....ER.lsnr ora....er.type OFFLINE OFFLINE
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....2FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....4FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....6FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....8FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....0FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....1FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....DATA.dg ora....up.type ONLINE ONLINE
litm...-new
ora....2FRA.dg ora....up.type ONLINE ONLINE
litm...-new
ora.asm
ora.asm.type ONLINE ONLINE
litm...-new
ora.cssd
ora.cssd.type ONLINE ONLINE
litm...-new
ora.diskmon
ora....on.type OFFLINE OFFLINE
ora.evmd
ora.evm.type ONLINE ONLINE
litm...-new
ora.ons
ora.ons.type OFFLINE OFFLINE
ora.rpst02.db
ora....se.type ONLINE
ONLINE litm...-new
Step 4:
Login as ROOT
Set ORACLE_HOME as grid home
Execute below command to remove the existing oracle grid
infra configuration.
[root@litms#### ~]# $ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I
$ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl -deconfig
Using configuration parameter file:
/u01/app/grid/product/11.2.0.4/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2529: Unable to act on 'ora.cssd' because that would
require stopping or relocating 'ora.asm', but the force option was not
specified
CRS-4000: Command Stop failed, or completed with errors.
CRS-2586: Deletion of a running resource 'ora.cssd'
requires the force option
CRS-4000: Command Delete failed, or completed with
errors.
CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.ASMDATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST04DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST04FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST06DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST06FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST08DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST08FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST10DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST10FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST11DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST11FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST12DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST12FRA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.rpst02.db' on
'litmsj614-new'
CRS-2677: Stop of 'ora.RPST11FRA.dg' on 'litmsj614-new'
succeeded
CRS-2677: Stop of 'ora.RPST11DATA.dg' on 'litmsj614-new'
succeeded
CRS-2677: Stop of 'ora.ASMDATA.dg' on 'litmsj614-new'
succeeded
CRS-2677: Stop of 'ora.rpst02.db' on 'litmsj614-new'
succeeded
CRS-2673: Attempting to stop 'ora.RPST02DATA.dg' on
'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST02FRA.dg' on 'litmsj614-new'
CRS-2677: Stop of 'ora.RPST02FRA.dg' on 'litmsj614-new'
succeeded
CRS-5017: The resource action "ora.RPST12DATA.dg
stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in
"/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5017: The resource action "ora.RPST10FRA.dg
stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in
"/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5017: The resource action "ora.RPST12FRA.dg
stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in
"/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5022: Stop of resource "ora.RPST10DATA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST10DATA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST10DATA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST04DATA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST04DATA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST04DATA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST06DATA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST06DATA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST06DATA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST04FRA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST04FRA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST04FRA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST06FRA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST06FRA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST06FRA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST08FRA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST08FRA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST08FRA.dg' on
'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST08DATA.dg"
failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST08DATA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST08DATA.dg' on
'litmsj614-new'
CRS-2681: Clean of 'ora.RPST10DATA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST04DATA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST06DATA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST04FRA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST06FRA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST08DATA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST08FRA.dg' on 'litmsj614-new'
succeeded
CRS-2675: Stop of 'ora.RPST10FRA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST10FRA.dg' on
'litmsj614-new'
CRS-2675: Stop of 'ora.RPST12FRA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST12FRA.dg' on
'litmsj614-new'
CRS-2675: Stop of 'ora.RPST12DATA.dg' on 'litmsj614-new'
failed
CRS-2679: Attempting to clean 'ora.RPST12DATA.dg' on
'litmsj614-new'
CRS-2681: Clean of 'ora.RPST12FRA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST12DATA.dg' on 'litmsj614-new'
succeeded
CRS-2681: Clean of 'ora.RPST10FRA.dg' on 'litmsj614-new'
succeeded
CRS-2677: Stop of 'ora.RPST02DATA.dg' on 'litmsj614-new'
succeeded
CRS-2679: Attempting to clean 'ora.RPST02DATA.dg' on
'litmsj614-new'
CRS-2681: Clean of 'ora.RPST02DATA.dg' on 'litmsj614-new'
succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'litmsj614-new'
CRS-2675: Stop of 'ora.asm' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.asm' on
'litmsj614-new'
CRS-2681: Clean of 'ora.asm' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on
'litmsj614-new'
CRS-2677: Stop of 'ora.cssd' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on
'litmsj614-new'
CRS-2677: Stop of 'ora.evmd' on 'litmsj614-new' succeeded
CRS-2793: Shutdown of Oracle High Availability
Services-managed resources on 'litmsj614-new' has completed
CRS-4133: Oracle High
Availability Services has been stopped.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file
or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at
/u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Successfully deconfigured Oracle Restart stack
Step 5:
After removing oracle configuration you can change the
hostname of your Server
Edit /etc/sysconfig/network file
NETWORKING=yes
HOSTNAME=<New Hostname>
Edit /etc/hosts file
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost6.localdomain6
192.168.50.4 <New Hostname>
Edit network adapters IP Address configuration i.e. ifcfg-ethX
[root@### ~]# cat
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="##:##:4C:02:A3:02"
ONBOOT="yes"
IPADDR=<New IP Address>
NETMASK=255.255.255.0
GATEWAY=192.168.50.1
Step 6:
Edit Listener.ora file with new Hostname
Step 7:
Login as ROOT
Set ORACLE_HOME as grid home.
Execute below command to recreate grid infra
configuration:
[root@litms####~]# $ORACLE_HOME/perl/bin/perl -I
$ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install
$ORACLE_HOME/crs/install/roothas.pl
Using configuration parameter file:
/u01/app/grid/product/11.2.0.4/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oragrid', privgrp
'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node litmsj614 successfully pinned.
Adding Clusterware entries to upstart
litmsj614
2014/12/19 10:51:46
/u01/app/grid/product/11.2.0.4/cdata/litmsj614/backup_20141219_105146.olr
Successfully configured Oracle Grid Infrastructure
for a Standalone Server
Step 8:
Add Listener and
start it
[oragrid@litms### ~]$ srvctl add listener
[oragrid@litms#### ~]$ srvctl start listener
Step 9:
Create ASM and add Disks, and mount all diskgroups
manually
[oragrid@litms#### disks]$ srvctl add asm -d
'/dev/oracleasm/disks/*'
[oragrid@litms#### disks]$ srvctl start asm
[oragrid@litmsj614 disks]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 19
10:58:39 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
- 64bit Production
With the Automatic Storage Management option
SQL> alter diskgroup rpst02data mount;
SQL> alter diskgroup rpst04data mount;
SQL> alter diskgroup rpst06data mount;
SQL> alter diskgroup rpst08data mount;
SQL> alter diskgroup rpst10data mount;
SQL> alter diskgroup rpst12data mount;
SQL> alter diskgroup rpst11data mount;
alter diskgroup rpst02fra mount;
alter diskgroup rpst04fra mount;
alter diskgroup rpst06fra mount;
alter diskgroup rpst08fra mount;
alter diskgroup rpst10fra mount;
alter diskgroup rpst12fra mount;
alter diskgroup rpst11fra mount;
Check Status of all mounted diskgroup, like below:
[oragrid@litms#### disks]$ srvctl status diskgroup -g
rpst02data
Disk Group rpst02data is running on litmsj614
Step 10:
Configure all databases with SRVCTL (Oracle Restart), Configure
and Start your database:
[oragrid@litms#### disks]$ srvctl add database -d RPST02
-o $ORACLE_HOME -n RPST02 -p
+rpst02data/rpst02/parameterfile/spfile.279.850066205 -a RPST02DATA,RPST02FRA
[oragrid@litms#### disks]$ srvctl config database -d
DB11G
Database unique name: RPST02
Database name: RPST02
Oracle home: /u01/app/grid/product/11.2.0.4
Oracle user: oragrid
Spfile:
+rpst02data/rpst02/parameterfile/spfile.279.850066205a
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: RPST02
Disk Groups: RPST02DATA,RPST02FRA
Services:
[oragrid@litms#### disks]$ srvctl start database -d DB11G
No comments:
Post a Comment