Hello friends, in today’s post we will see the steps to change the public hostname for a Standalone Grid Infrastructure. It is very useful if we want to set up an environment in parallel, and then swap Production. It can also be used to clone environments with different names and purposes. It is a simple procedure where practically everything is done by the engine, we just guide it.
The steps to carry out the operation are as follows:
1. We stop the has
$ GRID_HOME / bin / crsctl stop has
2 . We pass the deconfig tool (with root user)
export GRID_HOME = / app / oracle / product / 12.1.0.2 / grid $ GRID_HOME / crs / install / roothas.pl -deconfig -force [root@oraclehost1 ~]# /app/oracle/product/12.1.0.2/grid/crs/install/roothas.pl -deconfig -force Using configuration parameter file: /app/oracle/product/12.1.0.2/grid/crs/install/crsconfig_params 2019/10/09 13:19:13 CLSRSC-337: Successfully deconfigured Oracle Restart stack
In Windows environments the file is located at:
\ app \ oracle \ product \ 12.2.0 \ grid \ crs \ config \ gridconfig.bat
3. We execute the reconfig script with the root user
export GRID_HOME = / app / oracle / product / 12.1.0.2 / grid $ GRID_HOME / root.sh [root@oraclehost1 grid]# /app/oracle/product/12.1.0.2/grid/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER = oracle ORACLE_HOME = /app/oracle/product/12.1.0.2/grid Enter the full pathname of the local bin directory:[/usr/local/bin] : The contents of "dbhome" have not changed. No need to overwrite. The contents of "oraenv" have not changed. No need to overwrite. The contents of "coraenv" have not changed. No need to overwrite. Entries will be added to the / etc / oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Using configuration parameter file: /app/oracle/product/12.1.0.2/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 oraclehost1 successfully pinned. 2019/10/09 13:24:00 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service' oraclehost1 2019/10/09 13:24:30 /app/oracle/product/12.1.0.2/grid/cdata/oraclehost1/backup_20211019_131230.olr 1721139106 CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oraclehost1' CRS-2673: Attempting to stop 'ora.evmd' on 'oraclehost1' CRS-2677: Stop of 'ora.evmd' on 'oraclehost1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oraclehost1' has completed CRS-4133: Oracle High Availability Services has been stopped. CRS-4123: Oracle High Availability Services has been started. 2019/10/09 13:27:28 CLSRSC-327: Successfully configured Oracle Restart for a standalone server.
4. We log in as the owner of the grid and modify the following css property
$ $ GRID_HOME / bin / crsctl modify resource "ora.cssd" -init -attr "AUTO_START = 1" -unsupported
5. We restart the has
$ $ GRID_HOME / bin / crsctl stop has CRS-2791: Starting shutdown of Oracle High Availability Servic es-managed resources on 'oraclehost1' CRS-2673: Attempting to stop 'ora.evmd' on 'oraclehost1' CRS-2677: Stop of 'ora.evmd' on 'oraclehost1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oraclehost1' has completed CRS-4133: Oracle High Availability Services has been stopped. $ $ GRID_HOME / bin / crsctl start has CRS-4123: Oracle High Availability Services has been started.
6. We check the status of the resources:
cd $ GRID_HOME / bin $ ./crsctl check has CRS-4638: Oracle High Availability Services is online $ ./crsctl check css CRS-4529: Cluster Synchronization Services is online $ ./crsctl stat resource NAME = ora.cssd TYPE = ora.cssd.type TARGET = ONLINE STATE = ONLINE on oraclehost1 NAME = ora.diskmon TYPE = ora.diskmon.type TARGET = OFFLINE STATE = OFFLINE NAME = ora.evmd TYPE = ora.evm.type TARGET = ONLINE STATE = ONLINE on oraclehost1 NAME = ora.ons TYPE = ora.ons.type TARGET = OFFLINE STATE = OFFLINE $ ./crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ons OFFLINE OFFLINE oraclehost1 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE oraclehost1 STABLE ora.diskmon 1 OFFLINE OFFLINE STABLE ora.evmd 1 ONLINE ONLINE oraclehost1 STABLE -------------------------------------------------------------------------------- $
7. We configure the listener
We are using the default port, so we will execute:
srvctl add listener srvctl start listener
8. We prepare and create the + ASM instance
create the asm pfile as below: $ cat init + ASM.ora + ASM1 .__ oracle_base = '/ gridapp / app / oracle' # ORACLE_BASE set from in memory value * .asm_diskstring = '/ dev / oracleasm / disks / *' * .asm_power_limit = 16 * .large_pool_size = 12M * .instance_type = 'asm' start the asm instance: SQL> startup pfile = init + ASM.ora SQL> select instance_name, status from gv $ Instance; INSTANCE_NAME STATUS ---------------- ------------ + ASM STARTED SQL> select path from v $ asm_disk; PATH -------------------------------------------------------------------------------- / dev / oracleasm / disks / MGMTD SQL> create spfile from pfile; File created. Modify asm properties. $ srvctl modify asm -p /app/oracle/product/12.1.0.2/grid/dbs/spfile+ASM.ora $ srvctl modify asm -l LISTENER $ srvctl config asm ASM home: Password file: ASM listener: LISTENER Spfile: /app/oracle/product/12.1.0.2/grid/dbs/spfile+ASM.ora ASM diskgroup discovery string: / dev / oracleasm / disks / *
9. Once we have everything, we restart the has completely to see that everything starts well.
$ GRID_HOME / bin / crsctl stop has $ GRID_HOME / bin / crsctl start has
With this last restart we would already have our environment with the new name change and working normally.
More information in: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ntdbi/troubleshooting-host-name-changes-and-css.html#GUID-80D61C9B-5520-4492-AE69-F2DD8866A837
We hope it has been useful to you, if you need a hand or advice on DB, do not hesitate to contact us .
More information about Oracle at: https://www.gpsos.es/category/bases-de-datos/oracle/
Still do not know Query Performance ? Find out how it can help you in your Oracle environment. More information on their page LinkedIn .
Follow GPS on LinkedIn
Steps to change the public hostname for a Standalone Grid infrastructure