Link back: This guide is a part of the Virtual Oracle RAC project, the index to the whole project is here.
We could do a few more things to make the good work perfect, for instance we can enable archive log mode in our RAC and set up backup with RMAN but this is already outside of the scope of this little (I am kidding, it feels quite big to me) project.
What I really want to do now is to connect to the RAC database, run a long query and then kill one of the nodes. Wondering if RAC will stand to its reputation.
Configure client side TNS (tnsnames.ora)
Add following lines:
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.2.200)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.2.201)(PORT = 1521))
(LOAD_BALANCE = yes)
(SERVER = DEDICATED)
(SERVICE_NAME = racdb_taf.harzion.org)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
In some cases you will need to add a following line to sqlnet.ora (to overcome possible ORA-12170 error):
sqlnet.inbound_connect_timeout = 30
Connecting with sqlplus
Bring up a sqlplus in your host PC and connect to the cluster:
SQL> connect system/password@RACDB_TAF
Run this "long" query that will keep the RAC occupied for a while:
SQL:> select * from help t1, help t2;
While the query’s output is running (it may run like this for hours), we will reboot odbn1 node (I did the "shutdown" but you can do "reboot"):
Next picture shows that OCFS was stopped properly:
The other node is running happily if quite busy all the meanwhile:
And the sqlplus is still producing the output…
The odbn1 node is coming back, OCFS loaded, then ASM follows
If you log in to the console and run the "top" command filtering user "oracle" (press "u" to specify user), you will notice that for a minute or two there will be no processes for "oracle", then they will start appearing.
and finally you will have plenty of them, just as on the other node:
If noting happens within 5 minutes though, then most probably you have skipped the step where we edited "svrctl" script. Go back, edit and reboot again.
Now, just for fun, I will reboot the second node, odbn2. I do not have much hope that my query will survive this too. It would be too good.
Sure enough, just as OCFS is going down, the query dies as well, although the first node is running again:
Well, I consider this project concluded, thanks for your patience and comments.