TIP 99# : Connection to VMs in Oracle Vistual box

For couple months, I have been involved in setting up a lab and for this, I started using Oracle Vistual box with some pre-build template to speed up the initial process. It was always in back of my mind that when it is built, how other users in different offices gonna connect and use it ? Also what will happen when a lab on my laptop is moved from one network to the other network ?
I was thinking of using WebEx in worse case scenario till I saw an article in Oracle which provided different connection options with which each VM can be setup in Virtual box. They are listed in below and for my case in which users want to login to vms via SSH or SQL*Developer, Bridged Networking is the best.

I put digram from the Oracle article here for my ease of reference. If you are interested in more details, please check the link at the end of this post.


Bridged Networking

Internal networking

Host-Only networking

Reference : https://blogs.oracle.com/fatbloke/entry/networking_in_virtualbox1

TIP 98#: Oracle Restart

I was working on a database maintenance couple days ago and interesting enough, as it is shown in below, I noticed that after killing listener, it is started up somehow...
Environment has 11202 standalone database on Linux 32bit using ASM.

[oracle@localhost bin]$ ps -ef |grep tns
oracle 4365 1 0 15:29 ? 00:00:00 /home/oracle/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
oracle 4370 3513 0 15:29 pts/1 00:00:00 grep tns
[oracle@localhost bin]$ kill 4365
[oracle@localhost bin]$ ps -ef |grep tns
oracle 4373 3513 0 15:29 pts/1 00:00:00 grep tns
[oracle@localhost bin]$ ps -ef |grep tns
oracle 4375 3513 0 15:29 pts/1 00:00:00 grep tns
[oracle@localhost bin]$ ps -ef |grep tns
oracle 4385 1 0 15:30 ? 00:00:00 /home/oracle/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
oracle 4394 3513 0 15:31 pts/1 00:00:00 grep tns

This turned out to be due to Oracle Restart
For those of you who are not familiar, starting 11gR2, ASM as well as Oracle Restart are installed out of Grid Infrastructure home.
Oracle Restart provides managed startup and restart of a single-instance (non-clustered) Oracle Database, Oracle ASM instance, service, listener, and any other
process running on the server.Oracle Restart is used in standalone server (non-clustered) environments only. For RAC, Clusterware provides this functionality.

This explains why listener was started up automatically, So now that we know why, the question is how to stop different components in 11gR2 for single instance DB ?

Oracle recommends to use srvctl to stop/start different components.
However, tools such as sqlplus, lsnrctl, ascmd are integrated with Oracle Restart and in other words, if any component is stopped/started via these tools, Oracle Restart will not try to intervene.
Also if there is a case like maintenance/patch which DBA wants to keep some components down and does not want Oracle Restart to intervene, the best option is to disable Oracle Restart before starting maintenance. To do so, following below steps:

-------- To stop/disable Oracle Restart --------
cd $GI_HOME/bin
./crsctl stop has
./crsctl disable has
-------- To start/enable Oracle Restart --------
cd $GI_HOME/bin
./crsctl enable has
./crsctl start has

For more information about Oracle Restart and how to bounce DB in 11g, please check out : Oracle® Database Administrator's Guide,11g Release 2 (11.2),Part Number E25494-02111