Home » Oracle » Oracle Database » Oracle Restart Configuration: How to change Hostname

Oracle Restart Configuration: How to change Hostname

We have a Grid Infrastructure Oracle Restart  configuration on one oracle database server and Now we want to change the host-name of the server. Here we will be seeing the steps required to perform it without any loss of the database.

Configuration

Old Host Name: techgo

New Host name: techgo-new

  1. Stop all the services
$<11.2 Grid Infrastructure Oracle Home>/bin/crsctl stop has
  1. Change the Hostname from techgo to techgo-new

  2. Reboot the box

4.  Now Configure the CSS & OHAS services as root user as follows:

First we need to deconfigure the previous configuration

# <11.2 Grid Infrastructure Oracle Home>/crs/install/roothas.pl -deconfig -force

# /abc/oracle/ASM/11.2.0/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /abc/oracle/ASM/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CLSU-00100: Operating System function: opendir failed with error data: 2
CLSU-00101: Operating System error message: No such file or directory
CLSU-00103: error location: scrsearch1
CLSU-00104: additional error information: cant open scr home dir scls_scr_getval
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully deconfigured Oracle Restart stack

Now we need to re-configure the Oracle Restart configuration

<11.2 Grid Infrastructure Oracle Home>/crs/install/roothas.pl

# /abc/oracle/ASM/11.2.0/grid/crs/install/roothas.pl
Using configuration parameter file: /abc/oracle/ASM/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', 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 techgo-new successfully pinned.
Adding Clusterware entries to /etc/inittab

techgo-new 2017/01/10 05:08:19 /abc/oracle/ASM/11.2.0/grid/cdata/techgo-new/backup_20170110_061819.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

5) Please perform the next steps as oracle or grid OS user (as the Grid Infrastructure OS owner):

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl modify resource "ora.cssd" -attr "AUTO_START=1"

6) Restart the OHAS stack as grid or oracle OS user (as the Grid Infrastructure OS owner):

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl stop has

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl start has

 

See also  How to check the status/stop/start Workflow Notification Mailer from Backend

7) Check the CSS & OHAS state as grid or oracle OS user (as the Grid Infrastructure OS owner):

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl check has

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl check css

$> <11.2 Grid Infrastructure Oracle Home>/bin/ crsctl stat resource

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl stat res -t

 

Note: If the CSS & OHAS service did NOT start, then you will need to reboot the Linux/unix box and check them again.

8) Recreate the default listener (LISTENER) using port 1521 (or using your desired port), thru the NETCA GUI located on the new Grid Infrastructure Oracle Home (or manually if you do not have graphical access) as grid or oracle OS user (as the Grid Infrastructure OS owner):

$> srvctl add listener

$> srvctl start listener

 

9) Now comes the process of starting Oracle ASM.

Disk are intact as we have not performed any changes on them and all the data is intact on them which means all the ASM configuration and database are present in it

We can reuse the ASM parameter files present in the ASM home

or

We can create the ASM parameter files

asm_diskgroups= <list of diskgroups>

asm_diskstring= '/dev/disks/*'

instance_type='asm'

large_pool_size=12M

 

10) Add the ASM instance as grid or oracle OS user (as the Grid Infrastructure OS owner):

srvctl add asm

 

11) Enable ASM instance Auto Start as grid or oracle OS user (as the Grid Infrastructure OS owner) as follow:

> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl modify resource "ora.asm" -attr "AUTO_START=1"

 

 

See also  Recover drop/truncate/delete table on primary using flashback on standby database

12) startup the ASM instance as grid or oracle OS user (as the Grid Infrastructure OS owner) as follow:

Source the ASM environment

$> export ORACLE_SID=+ASM

$> <11.2 Grid Infrastructure Oracle Home>/bin/sqlplus “/as sysasm”

SQL> startup pfile=init+ASM.ora

SQL> show parameter asm

13) Validate that the candidate asm disks are being discovered:

SQL> select path from v$asm_disk;

 

14) Create a new ASM instance spfile from pfile:

SQL> create spfile from pfile;

 

15) Add the new ASM spfile and listener to the new ASM instance resource:

$> <11.2 Grid Infrastructure Oracle Home>/bin/srvctl modify asm -p <spfile full path>

$> <11.2 Grid Infrastructure Oracle Home>/bin/srvctl modify asm -l LISTENER

 

16) Validate the OHAS (Oracle Restart) services start as follows:

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl stop has

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl start has

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl stat res

$> <11.2 Grid Infrastructure Oracle Home>/bin/crsctl stat res -t

17) Now we are done with configuration recreation till ASM

Now you can add the database to the OCR and get then started

srvctl add database -d TEST1

srvctl start database -d TEST1

Hope you like this post on How to change Hostname for a Grid Infrastructure Oracle Restart Standalone Configuration

Related Articles

How to recreate central OraInventory in Oracle RAC

What is Oracle Clusterware?

why-database-not-startup-automatic in 11gR2 cluster

Cluster command in Oracle clusterware 10g and 11g

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top