Oracle Performance Tuning Interview Questions

What are the major focuses of Performance tuning?
Performance tuning focuses primarily on writing efficient SQL, allocating appropriate computing resources, and analyzing wait events and contention in a system.
How does Oracle aid performance tuning?
Oracle provides several options to aid performance tuning, such as partitoning lar tables, using materialized views, storing plan outlines, using tools like Automatic Optimizer statistics collection feature, ckages like DBMS_STATS, SQL Tuning Advisor to tune SQL statements,etc.


Why is performance tuning a menancing area for DBA’s?
Like many other features of Oracle like exp/imp,backu recovery this field can’t be automated. This is one area that requires a lot of detective work on the part of application programmers and DBA’s to see w some process is running slower than expected, why can’t we scale applications to a larger number of users without problems like performance degradation etc.This is a area where our technical knowledge must be used along with constant experimentation and observation.


What are the approaches towards performance tuning?
We can follow either a systematic approach or a reactive approach for performance tuning.
What is a systematic approach to performance tuning?
It is mandatory to design the database properly at initial stages to avoid potential problems. It is mandatory to know the nature of application that a database is going to support. With a clear idea on the application’s nature database can be optimally created by allocating appropriate resources to avoid problems when the application is moved to production. Most production moves cause problem because of the scalability problems with the applications.So, oracle recommends to tune database at inception stage. this is systematic approach to performance tuning.


What are the Oracle’s suggestions towards systematic tuning?
Oracle suggests a specific design approach with the following steps.This is a top down approach:
1) Design the application correctly
2) Tune the application SQL code
3) Tune memory
4) Tune I/O
5) Tune contention and other issues
What are the effects of poor database design?
A poor database design results in poor application performance. We have to tune the application code and some database resources such as memory,CPU,I/O owing to performance degradation. An applications performs well in development and testing. Will there be any performance problem when it is moved to production?
Production moves may cause problems due to scalability.We can’t simulate the original load in test and development. So problems may crop up at times as the application may be performing poor due to scalability problems.
What is reactive performace tuning?
Performance tuning is an iterative process. We as a DBA may have to tune applications which is designed and implemented in production.The performance tuning at htis stage is referred to as reactive performance tuning.
Which is useful – systematic or reactive tuning?
The performance tuning steps to improve the performance of a database depends on the stage at which we get the input and on the nature of the application. DBA’s can assist the developers to write optimal code that is scalable based on systematic approach. Mostly the real life problems that are encountered after production moves have to be solved by reactive performance tuning.
We have an application whose code can’t be changed.Can we improve its performance?
We can improve the application performance without changing base SQL code by optimizing the SQL performance. Oracle has come up with SQL Advisor tool that helps SQL performance. We can make use of SQL Advisor tools’ SQL Profiles to improve performance,though we can’t touch the underlying SQL.


What is the use of SQL over procedural languages?
SQL isn’t a procedural language in which we have to specify the steps to be followed to achieve the statement goal.We don’t have to specify how to accomplish a task(say data retrival) using SQL,rather we can specify as to what needs to be done.


What is query processing?
When a user starts a data retrieval operation, the user’s SQL statement goes through several sequential steps that together constitute query processing.Query processing is the transformation of the SQL statement into efficient execution plan to return the requested data from the database.

What is query optimization?
Query optimization is the process of choosing the most efficient execution plan.The goal is to achieve the result with least cost in terms of resource usage.Resources include I/O and CPU usage on the server where the dat/abase is running.This is a means to reduce the execution times of the query,which is the sum of the execution times of the all component operations of the query.


What are the techniques used for query optimization?
Cost-based optimization, heuristic strategy are used for query optimization.
What are the phases of a SQL statement processing?
An user’s SQL statement goes through the parsing,optimizing, and execution stages.If the SQL statement is a query(SELECT),data has to be retrived so there’s an additional fetch stage before
the SQL processing is complete.


What is Parsing?
Parsing primarily consists of checking the syntax and semantics of the SQL statements. The end product of the parse stage of query compilation is the creation of a parse tree,which represents the query structure.The parse tree is then sent to the logical query plan generation stage.
Mention the steps in the creation of a parse tree:-
1) The SQL statement is decomposed into relational algebra query that ‘s analyzed to see whether it’s syntactically correct.
2) The query then undergoes semantic checking.
3) The data dictionary is consulted to ensure that the tables and the individual columns that are referenced in the query do exist,as well as all the object privileges.
4) The column types are checked to ensure that the data matches the column definition.
5) The statement is normalized so that it can be processed more efficiently
6) The query is rejected if it is incorrectly formulated
7) Once the parse tree passes all the syntactic and semantic checks,it is considered a valid parse tree,and it’s sent to the logical query plan generation stage.


Where does the parse tree generation take place?
The parse tree generation takes place in the library cahce portion of the SGA(system global Area)./


What is Optimization/what happens during optimization phase?
During the optimization phase,Oracle uses its optimizer(CBO(cost-based optimizer)) to choose the best access method for retriving data for the tables and indexes referred to in the query.


How does a CBO generate an optimal execution plan for the SQL statement?
Using the statistics we provide and the hints specified in the SQL queries, the CBO produces an optimal execution plan for the SQL statement.


What are the parts of an optimizer phase?
An optimizer phase can be divided into two distinct parts: the query rewrite phase and the physical execution plan generation phase.


What is query rewrite phase?
In this phase ,the parse tree is converted into an abstract logical query plan. This is an initial pass at an actual query plan, and it contains only a general algebraic reformulation of the initial query. The various nodes and branches of the parse tree are replaced by operators of relational algebra.


What is execution plan generation phase/physical execution plan execution plan generation phase?
During this phase,Oracle transforms the logical query plan into a physical query plan.
The optimizer may be faced with a choice of several algorithms to solve a query. It needs to choose the most efficient algorithm to answer a query,and it needs to determine the most efficient way to implement the operations.The optimizer determines the order in which it will perform the steps.


What are the factors considered by a physical query/execution plan?
Following factors are considered by a physical query or an execution plan:
1) The various operations(eg:joins) to be performed during the query
2) The order in which the operations are performed
3) The algorithm to be used for performing each operation
4) The best way to retrieve data from disk or memory
5) The best way to pass data from one operation to another during the query


Which generates the query plan/what is generated by optimizer?
The optimizer generates several valid physical query plans.All the physical query plans are potential execution plans.
How does the optimizer choose the query plan/what is cost-based query optimization?/
The optimizer generates several physical query plans that are potential execution plans. The optimizer then chooses among them by estimating the cost of each possible physical plan based on the table and index statistics available to it,and selecting the plan with the lowest estimated cost. This evaluation of the possible physical query plans is called cost-based query optimization.
What are the factors affecting the cost of a execution plan?
The cost of executing a plan is directly proportional to the amount of resources such as I/O,memory and CPU necessary to execute the proposed plan.
What happens after choosing the low-cost physical query plan?
The optimizer passes the low-cost physical query plan to the Oracle’s query execution engine.


What is a heuristic strategy?
The database uses a less systematic query optimiation technique known as the heuristic strategy./
What are unary and binary operations?
A join operation is called a binary operation, an operation like selection is called a unary operation.


What is an optimal operation processing strategy?
In general an optimal strategy is to perform unary operations first so the more complex and time-consuming binary operations use smaller operands. Performing as many of the possible unary operations first reduces the row sources of the join operations.


What are the heuristic-processing strategies?

1) Perform selection operation early so that we can eliminate a majority of the candidate rows early in the operation. If we leave most rows in until the end, we’re going to do needless comparisons with the rows we’re going to get rid of later

2) Perform projection operations early so that we limit the number of columns we have to deal with

3) If we need to perform consecutive join operation,perform the operations that produce the smaller join first

4) Compute common expressions once and save the results
What is query execution?
During the final stage of a query processing, the optimized query(the physical query plan that has been selected) is executed. If it’s a SELECT statement the rows are returned to the user.If it’s an INSERT,UPDATE or DELETE statement ,the rows are modified. The SQL execution engine takes the execution plan provided by the optimization phase and executes it.


What is the crucial step in SQL statement processing?
Of the three steps involved in the SQL statement processing, the optimization process is the crucial one because it determines the all important question of how fast our data will be retrived./


What is the job of an optimizer?

The job of an optimizer is to find the optimal/best plan to execute our DML statements such as SELECT,INSERT,UPDATE and DELETE.Oracle uses CBO to help determine efficient methods to execute queries.
What is an index?
An index is a data structure that takes the value of one or more columns of a table(the key) and returns all rows/requested-columns in a row quickly.
Why is an index efficient?
The efficiency of an index comes from the fact that it lets us find necessary rows without having to scan all the rows of a table.They need a fewer disk I/O’s than if we had to scan the table and hence are efficient.
When do we need to index tables?
We need to index tables only when the queries will be selecting a small portion of the table.If our query is retriving rows that are greater than 10 or 15 percent of the total rows in the table,we may not need an index.
Why does an index traverses a table’s row faster?
Indexes prevent a full table scan,so it is inherently a faster means to traverse a table’s row.

RAC - FLOW

RAC - FLOW 



11g R1 RAC Administration and Maintenance Tasks:

 11g R1 RAC Administration and Maintenance Tasks:
===========================================

·         Checking CRS Status
·         Viewing Name Of the Cluster
·         Viewing Nodes Configuration
·         Checking Votedisk Information
·         Checking OCR Disk information
·         Timeout Settings in Cluster
·         ADD/Remove OCR files
·         ADD/Remove Votedisk
·         Backing Up OCR
·         Backing Up Votedisk
·         Restoring OCR Devices
·         Restoring Voting Disk Devices
·         Changing Public IPs as well as Virtual IPs



The below two commands are generally used to check the status of CRS. The first command lists the status of CRS on the local node where as the other command shows the CRS status across all the nodes in Cluster.

crsctl check crs <<-- for the local node
crsctl check cluster <<-- for remote nodes in the cluster

[root@node1-pub ~]# crsctl check crs
Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
[root@node1-pub ~]#

For the below command to run, CSS needs to be running on the local node. The "ONLINE" status for remote node says that CSS is running on that node. When CSS is down on the remote node, the status of "OFFLINE" is displayed for that node.

[root@node1-pub ~]# crsctl check cluster
node1-pub    ONLINE
node2-pub    ONLINE


I use below command to get the name of Cluster. The similar information can be retrieved from the dump file.

ocrdump -stdout -keyname SYSTEM | grep -A 1 clustername | grep ORATEXT | awk '{print $3}'

OR

ocrconfig -export /tmp/ocr_exp.dat -s online
for i in `strings /tmp/ocr_exp.dat | grep -A 1 clustername` ; do if [ $i != 'SYSTEM.css.clustername' ]; then echo $i; fi; done

OR

Oracle creates a directory with the same name as Cluster under the $ORA_CRS_HOME/cdata.


The below command can be used to find out the number of nodes registered into the cluster. It also displays the node's Public name, Private name and Virtual name along with their numbers.

olsnodes -n -p -i

[root@node1-pub ~]# olsnodes -n -p -i
node1-pub       1       node1-prv       node1-vip
node2-pub       2       node2-prv       node2-vip


The below command is used to view the no. of Voting disks configured in the Cluster.

crsctl query css votedisk


The ocrcheck command displays the no. of OCR files configured in the Cluster. It is primarily used to chck the integrity of the OCR files. It also displays the version of OCR as well as storage space information. You can only have 2 OCR files at max.

[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3848
         Available space (kbytes) :     258272
         ID                       :  744414276
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_0
                                    Device/File integrity check succeeded
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_1
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded


Disktimeout: Disk Latencies in seconds from node-to-Votedisk. Default Value is 200. (Disk IO)
Misscount:     Network Latencies in second from node-to-node (Interconnect). Default Value is 60 Sec (Linux) and 30 Sec in Unix platform. (Network IO) Misscount < Disktimeout

IF
  (Disk IO Time > Disktimeout) OR (Network IO time > Misscount)
THEN
   REBOOT NODE
ELSE
   DO NOT REBOOT
END IF;

crsctl get css disktimeout
crsctl get css misscount
crsctl get css  reboottime

[root@node1-pub ~]# crsctl get css disktimeout
200
[root@node1-pub ~]# crsctl get css misscount
Configuration parameter misscount is not defined.

The above message indicates that the Misscount is not set manually and it is set to its default Value which is 60 seconds on Linux. It can be changed as below.

[root@node1-pub ~]# crsctl set css misscount 100
Configuration parameter misscount is now set to 100.
[root@node1-pub ~]# crsctl get css misscount
100

The below command sets the value of misscount back to its default value.

crsctl unset css misscount
[root@node1-pub ~]# crsctl unset css misscount
[root@node1-pub ~]# crsctl get css  reboottime


Removing OCR File

(1) Get the Existing OCR file information by running ocrcheck utility.

[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3852
         Available space (kbytes) :     258268
         ID                       :  744414276
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_0 <-- OCR
                                    Device/File integrity check succeeded
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_1 <-- OCR Mirror
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

(2) The First command removes the OCR mirror (/u02/ocfs2/ocr/OCRfile_1). If you want to remove the OCR file (/u02/ocfs2/ocr/OCRfile_1) run the next command.

ocrconfig -replace ocrmirror
ocrconfig -replace ocr

[root@node1-pub ~]# ocrconfig -replace ocrmirror
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3852
         Available space (kbytes) :     258268
         ID                       :  744414276
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_0 <<-- OCR File
                                    Device/File integrity check succeeded

                                    Device/File not configured  <-- OCR Mirror not existed any more

         Cluster registry integrity check succeeded

Adding OCR

You need to add OCR or OCR mirror file in a case where you want to move the existing OCR file location to the different devices. The below command add the OCR mirror file if OCR file already exists.

(1) Get the Current status of OCR:

[root@node1-pub ~]# ocrconfig -replace ocrmirror
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3852
         Available space (kbytes) :     258268
         ID                       :  744414276
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_0 <<-- OCR File
                                    Device/File integrity check succeeded

                                    Device/File not configured  <-- OCR Mirror does not exist

         Cluster registry integrity check succeeded

As it can be seen, there is only one OCR file but not the second file (OCR Mirror). Below command adds the second OCR file.

ocrconfig -replace ocrmirror <File name>

[root@node1-pub ~]# ocrconfig -replace ocrmirror /u02/ocfs2/ocr/OCRfile_1
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3852
         Available space (kbytes) :     258268
         ID                       :  744414276
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_0
                                    Device/File integrity check succeeded
         Device/File Name         : /u02/ocfs2/ocr/OCRfile_1
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

You can have at most 2 OCR devices (OCR itself and its single Mirror) in a cluster. Adding extra Mirror gives you below error message

[root@node1-pub ~]# ocrconfig -replace ocrmirror /u02/ocfs2/ocr/OCRfile_2
PROT-21: Invalid parameter
[root@node1-pub ~]#
Add/Remove Votedisk file in Cluster:


Adding Votedisk:

Get the existing Vote Disks associated into the cluster. To be safe, Bring crs cluster stack down on all the nodes but one on which you are going to add votedisk from.

(1)    Stop CRS on all the nodes in cluster but one.

[root@node2-pub ~]# crsctl stop crs

(2)    Get the list of Existing Vote Disks

crsctl query css votedisk

[root@node1-pub ~]# crsctl query css votedisk
 0.     0    /u02/ocfs2/vote/VDFile_0
 1.     0    /u02/ocfs2/vote/VDFile_1
 2.     0    /u02/ocfs2/vote/VDFile_2
Located 3 voting disk(s).


Backup the existing votedisks as below as oracle:

dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0

[root@node1-pub ~]# su - oracle
[oracle@node1-pub ~]$ dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0
41024+0 records in
41024+0 records out
[oracle@node1-pub ~]$

(4)     Add an Extra Votedisk into the Cluster:

  If it is a OCFS, then touch the file as oracle. On raw devices, initialize the raw devices using "dd" command

touch /u02/ocfs2/vote/VDFile_3 <<-- as oracle
crsctl add css votedisk /u02/ocfs2/vote/VDFile_3 <<-- as oracle
crsctl query css votedisks

[root@node1-pub ~]# su - oracle
[oracle@node1-pub ~]$ touch /u02/ocfs2/vote/VDFile_3
[oracle@node1-pub ~]$ crsctl add css votedisk /u02/ocfs2/vote/VDFile_3
Now formatting voting disk: /u02/ocfs2/vote/VDFile_3.
Successful addition of voting disk /u02/ocfs2/vote/VDFile_3.

(5)     Confirm that the file has been added successfully:

[root@node1-pub ~]# ls -l /u02/ocfs2/vote/VDFile_3
-rw-r-----  1 oracle oinstall 21004288 Oct  6 16:31 /u02/ocfs2/vote/VDFile_3
[root@node1-pub ~]# crsctl query css votedisks
Unknown parameter: votedisks
[root@node1-pub ~]# crsctl query css votedisk
 0.     0    /u02/ocfs2/vote/VDFile_0
 1.     0    /u02/ocfs2/vote/VDFile_1
 2.     0    /u02/ocfs2/vote/VDFile_2
 3.     0    /u02/ocfs2/vote/VDFile_3
Located 4 voting disk(s).

Removing Votedisk:

Removing Votedisk from the cluster is very simple. The below command removes the given votedisk from cluster configuration.

crsctl delete css votedisk /u02/ocfs2/vote/VDFile_3

[root@node1-pub ~]# crsctl delete css votedisk /u02/ocfs2/vote/VDFile_3
Successful deletion of voting disk /u02/ocfs2/vote/VDFile_3.
[root@node1-pub ~]#

[root@node1-pub ~]# crsctl query css votedisk
 0.     0    /u02/ocfs2/vote/VDFile_0
 1.     0    /u02/ocfs2/vote/VDFile_1
 2.     0    /u02/ocfs2/vote/VDFile_2
Located 3 voting disk(s).
[root@node1-pub ~]#


Oracle performs physical backup of OCR devices every 4 hours under the default backup directory $ORA_CRS_HOME/cdata/<CLUSTER_NAME>  and then it rolls that forward to Daily, weekly and monthly backup. You can get the backup information by executing below command.

ocrconfig -showbackup

[root@node1-pub ~]# ocrconfig -showbackup
node2-pub     2007/09/03 17:46:47     /u01/app/crs/cdata/test-crs/backup00.ocr
node2-pub     2007/09/03 13:46:45     /u01/app/crs/cdata/test-crs/backup01.ocr
node2-pub     2007/09/03 09:46:44     /u01/app/crs/cdata/test-crs/backup02.ocr
node2-pub     2007/09/03 01:46:39     /u01/app/crs/cdata/test-crs/day.ocr
node2-pub     2007/09/03 01:46:39     /u01/app/crs/cdata/test-crs/week.ocr
[root@node1-pub ~]#

Manually backing up the OCR

ocrconfig -manualbackup <<--Physical Backup of OCR

The above command backs up OCR under the default Backup directory. You can export the contents of the OCR using below command (Logical backup).

ocrconfig -export /tmp/ocr_exp.dat -s online <<-- Logical Backup of OCR


The below command is used to restore the OCR from the physical backup. Shutdown CRS on all nodes.

ocrconfig -restore <file name>

Locate the available Backups

[root@node1-pub ~]# ocrconfig -showbackup
node2-pub     2007/09/03 17:46:47     /u01/app/crs/cdata/test-crs/backup00.ocr
node2-pub     2007/09/03 13:46:45     /u01/app/crs/cdata/test-crs/backup01.ocr
node2-pub     2007/09/03 09:46:44     /u01/app/crs/cdata/test-crs/backup02.ocr
node2-pub     2007/09/03 01:46:39     /u01/app/crs/cdata/test-crs/day.ocr
node2-pub     2007/09/03 01:46:39     /u01/app/crs/cdata/test-crs/week.ocr
node1-pub     2007/10/07 13:50:41     /u01/app/crs/cdata/test-crs/backup_20071007_135041.ocr

Perform Restore from previous Backup

[root@node2-pub ~]# ocrconfig -restore /u01/app/crs/cdata/test-crs/week.ocr

The logical backup of OCR (taken using export option) can be imported using the below command.

ocrconfig -import /tmp/ocr_exp.dat


·         Shutdown CRS on all the nodes in Cluster.
·         Locate the current location of the Votedisks
·         Restore each of the votedisks using "dd" command from the previous good backup of Votedisk taken using the same "dd" command.
·         Start CRS on all the nodes.

crsctl stop crs
crsctl query css votedisk
dd if=<backup of Votedisk> of=<Votedisk file> <<-- do this for all the votedisks
crsctl start crs





Current Config                                               Changed to

Node 1:

Public IP:       216.160.37.154                              192.168.10.11
VIP:             216.160.37.153                              192.168.10.111
subnet:          216.160.37.159                              192.168.10.0
Netmask:         255.255.255.248                             255.255.255.0
Interface used:  eth0                                        eth0
Hostname:        node1-pub.hingu.net                         node1-pub.hingu.net

Node 2:

Public IP:       216.160.37.156                              192.168.10.22
VIP:             216.160.37.157                              192.168.10.222
subnet:          216.160.37.159                              192.168.10.0
Netmask:         255.255.255.248                             255.255.255.0
Interface used:  eth0                                        eth0
Hostname:        node1-pub.hingu.net                         node2-pub.hingu.net


(A)   Take the Services, Database, ASM Instances and nodeapps down on both the Nodes in Cluster. Also disable the nodeapps, asm and database instances to prevent them from restarting in case if this node gets rebooted during this process.

srvctl stop service -d test
srvctl stop database -d test
srvctl stop asm -n node1-pub
srvctl stop asm -n node2-pub
srvctl stop nodeapps -n node1-pub,node1-pub2
srvctl disable instance -d test -i test1,test2
srvctl disable asm -n node1-pub
srvctl disable asm -n node2-pub
srvctl disable nodeapps -n node1-pub
srvctl disable nodeapps -n node2-pub


(B)   Modify the /etc/hosts and/or DNS, ifcfg-eth0 (local node) with the new IP values on All the Nodes

(C)   Restart the specific network interface in order to use the new IP.

ifconfig eth0 down
ifconfig eth0 up

Or, you can restart the network. CAUTION: on NAS, restarting entire network may cause the node to be rebooted.

(D)   Update the OCR with the New Public IP information. 
        In case of public IP, you have to delete the interface first and then add it back with the new IP address. As oracle user, Issue the below command:

oifcfg delif -global eth0
oifcfg setif -global eth0/192.168.10.0:public

(E)    Update the OCR with the New Virtual IP.

        Virtual IP is part of the nodeapps and so you can modify the nodeapps to update the Virtual IP information. As privileged user (root), Issue the below commands:

srvctl modify nodeapps -n node1-pub -A 192.168.10.111/255.255.255.0/eth0 <-- for Node 1
srvctl modify nodeapps -n node1-pub -A 192.168.10.222/255.255.255.0/eth0 <-- for Node 2

(F)    Enable the nodeapps, ASM, database Instances for all the Nodes.

srvctl enable instance -d test -i test1,test2
srvctl enable asm -n node1-pub
srvctl enable asm -n node2-pub
srvctl enable nodeapps -n node1-pub
srvctl enable nodeapps -n node2-pub

(G)  Update the listener.ora file on each nodes with the correct IP addresses in case if it uses the IP address instead of the hostname.

(H)    Restart the Nodeapps, ASM and Database instance

srvctl start nodeapps -n node1-pub
srvctl start nodeapps -n node2-pub
srvctl start asm -n node1-pub
srvctl start asm -n node2-pub

srvctl start database -d test