How to reconfigure Grid Infrastructure components?
If you cloned an existing server as another server and the ASM disks and all files are moved but ohas css asm db etc. are not opening, you can reconfigure it with the following steps.
First, let’s clean up the existing configuration:
with root:
<$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force
Let’s reconfigure:
<$GRID_HOME>/root.sh
After these operations
crs_stat -t Name Type Target State Host -------------------------------------------------- ---------- ora.cssd ora.cssd.type OFFLINE OFFLINE ora.diskmon ora....on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE oradb ora.ons ora.ons.type OFFLINE OFFLINE
If you see an output like this, we will need to add some services for Oracle Restart. Also, since the ora.cssd service will not start automatically, it needs to be set to start automatically.
With the command below, you can set the Target status for ora.cssd to ONLINE.
With the grid user (or after grid variables are loaded)
crsctl modify resource ora.cssd -attr AUTO_START=always
after
crsctl stop has crsctl start has
You can see that it starts automatically with the commands.
We need to add new services for Oracle Restart:
With the grid user (or after grid variables are loaded):
To add an ASM source:
srvctl add asm -p +DATA/asm/asmparameterfile/registry.253.892568385 -d '/dev/sd*'
Here -p is the spfile path for the asm instance, and -d is the disk string parameter. If the permissions of the disks in the directory specified with the disk string are correct and the header information of the disks is correct, all disk groups will be mounted automatically.
To add a Listener source:
srvctl add listener -p 1521 -o $ORACLE_HOME
The port is specified with -p and the grid_home is specified with -o.
Setting the added services to start automatically:
crsctl modify resource ora.LISTENER.lsnr -attr AUTO_START=always crsctl modify resource ora.asm -attr AUTO_START=always
With Oracle user (or after database variables are loaded):
srvctl add database -d ORCL -o $ORACLE_HOME -a "DATA,FRA"
-d specifies db_name -o specifies db_home -a specifies the disk groups it is dependent on. Without mounting these disk groups, the DB will not be opened.
The database’s local listener is being changed. (This may not always be necessary)
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.10)(PORT=1521))' scope=both;
Latest status :
crs_stat -t Name Type Target State Host -------------------------------------------------- ---------- ora.DATA.dg ora....up.type ONLINE ONLINE oradb ora.FRA.dg ora....up.type ONLINE ONLINE oradb ora....ER.lsnr ora....er.type ONLINE ONLINE oradb ora.asm ora.asm.type ONLINE ONLINE oradb ora.cssd ora.cssd.type ONLINE ONLINE oradb ora.diskmon ora....on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE oradb ora.hope.db ora....se.type ONLINE ONLINE oradb ora.ons ora.ons.type OFFLINE OFFLINE
Reboot the server and test that all services start automatically.