Wednesday, June 7, 2017

RDBMS -- Changing hostname of a Standalone Oracle Restart environment

Today, I implemented the alternative disaster recovery solution that I explained in one of my earlier blog post (http://ermanarslan.blogspot.com.tr/2017/05/rac-asm-disaster-recovery-solution.html), for building a real disaster environment.

The solution worked perfectly, as documented in the blog post, but this time; I had to do one more thing..

That is, changing the IP address and hostname of the DR host.

I had to do this because, customer wanted its DR host to have the same hostname and the IP address as the primary.

Note that, there were no risks for this, because the network between Primary and DR sites were totally seperated. (except the network between the primary and DR storage tiers.. -- bytheway, storage tier network is not a concern of us.. It won't break the sqlnet communication)

The primary environment was built on a 2 node RAC env and the Disaster site was built on a single node env. (both environment were using ASM)

The client, the codes and the application servers were using the scan hostname to connect to the primary database server.

So, the customer wanted to have the scan hostname of the primary environment, to be set as the hostname of the DR database server.

Although, having the scan hostname directly set as a server's hostname looks a little weird; this was okay for this DR environment, as it was built on a single node database server.

However, changing the hostname of a database server, which is hosting an ASM instance, was a little costly.

Also, this DR environment wasn't RAC, but it had to be Oracle Restart enabled.

The DR database server was replicated using VM techniques. (it was a virtual machine). It was a one time VM replication for having the virtual machine up & running on the DR site. (actually, for getting away from the need to install a new Operating System)

So, during the replication, the Oracle Restart home is replicated as is. So the DR server was provisioned with a preconfigured Oracle Restart home.

Well, in order to change the hostname and IP address of this replicated machine, I started with the OS prompt.

I implemented the standard Linux IP and hostname change routines, but when it came to Oracle Restart Home, I did the following; (in sequence)

Note that, the following actions were required because we changed the hostname..
In other words; changing the IP address alone, does not require any of these actions. (or any actions at all:)

  • As root user , deconfigured the system using roothas per script.

<GRID_HOME>/crs/install/roothas.pl -deconfig -force
  • As grid user reconfigured the system using roothas perl script
<GRID_HOME>/crs/install/roothas.pl
  • Made cssd auto start enabled
<GRID_HOME>/bin/crsctl modify resource "ora.cssd" -init -attr "AUTO_START=1"
  • Restarted the high availability services.
<GRID_HOME>/bin/crsctl stop has

<GRID_HOME>/bin/crsctl start has
  • recreated the default listener.
srvctl add listener

srvctl start listener
  • Created init.ora for ASM with the following contents;
asm_diskgroups= 'FRA'
asm_diskstring= ''
instance_type='asm'
large_pool_size=12M

  • Added the asm instance to the repo and made it auto_start enabled.
<GRID_HOME>/bin/srvctl add asm

<GRID_HOME>/bin/crsctl modify resource "ora.asm" -attr "AUTO_START=1"
  • Checked the disks using kfod;
<GRID_HOME>/bin/kfod asm_diskstring='ORCL:*' disks=all
  • After this, I started the ASM instance; using sqlplus "/as sysasm" 
Note that, I also created spfile in this step and modified the repository accordingly;

<GRID_HOME>/bin/srvctl modify asm -p <spfile full path>

<GRID_HOME>/bin/srvctl modify asm -l LISTENER
  • Lastly, I restarted the services and checked them to ensure that all is well.
<GRID_HOME>/bin/crsctl stop has

<GRID_HOME>/bin/crsctl start has

<GRID_HOME>/bin/crsctl stat res

<GRID_HOME>/bin/crsctl stat res -t

No problems encountered , no reboots required :)

These steps and actions were actually already documented in Oracle Support Document named : "How to change Hostname / IP for a Grid Infrastructure Oracle Restart Standalone Configuration (SIHA) (Doc ID 1552810.1)", so I ensured they were working as documented. 

No comments :

Post a Comment