Thursday, April 15, 2010

Grid Control 11.1- Installation - Weblogic server

Hello

New Grid Control 11g has been released a view days ago (see my previous post with links).I have spend some time downloading it and now is time to share my installing experience.
First of all you have to know that unlike in previous version of Grid Control, new one is shipped without application server and without database.Both of them has to be downloaded and installed separately.
This a list of all necessary Oracle products:
  • Oracle Database - 10.2.0.4, 11.1.0.7, 11.2.0.1 plus required patches - see Grid Control Basic Installation Guide 
  • Weblogic 10.3.2 with patches - I was unable to find required patch but decided to try without it
  • certified operating system - Oracle Enterprise Linux 4, 5.x or RedHat Linux 4, 5.x
I'm wondering what is inside this package Grid Control 10g has about 2.5 GB including database and application server. Grid Control 11g has 4.2 GB without application server (1 GB) and database server (4 GB for Oracle 11gR1).
Let's start with prerequisites.I assume that everybody has database up and running and I will start with Weblogic server. I have some experience with Weblogic version 7 and 8 and I have been very excited to see a new version of it.
  1. Download a Weblogic server - I have used Package installer which has everything inside one package

  2. Login as oracle and start ./wls1032_linux32.bin process

  3. Welcome screen appear - Click Next



  4. Choose Middleware Home and click Next



  5. Confirm that you don't need to configure My Oracle Support



  6. Choose installation type



  7. Confirm Weblogic directory



  8. Installation summary - click Next



  9. Take some - installation in progress



  10. Installation has been completed - We don't need to configure any Weblogic domain now so we can skip Quickstart.



If everything was well you should have all necessary components (database and Weblogic server) to start Grid Control installation. Next post will cover check of database parameters and Grid Control installation. See you soon.


Marcin

    Monday, April 12, 2010

    Grid Control 11.1

    Hi,

    Grid Control 11.1 on Linux platform is available to download from Oracle E-delivery
    Thanks to Marco Gralike and Rob Zoeteweij.

    There are 3 disks - about 4.2 GB in total - so be aware before you download it. You will need a lot of space for test. Grid Control 11.1 is based on Weblogic server and it need 2 GB of RAM.
    According to disk space and memory requirements it is laptop killer.

    regards,
    Marcin

    Friday, April 2, 2010

    Shutdown immediate and background sqlplus process

    Hello,

    I have been playing with Oracle 11g and memory utilization and I finished myself with strange problem. I have started about 60 background sessions using following command:
    $ sqlplus pioro/pioro @a.sql
    
    Script a.sql is a simple one and it is allocating about 8 MB of memory for PL/SQL table but this is story for different post.
    After some tests I was going to restart database. First thought was simple - shutdown immediate and that's it.
    When I come back with next cup of tea database was still open. Hmmm.
    Let's check alter.log

    License high water mark = 59
    Waiting for dispatcher 'D000' to shutdown
    Waiting for shared server 'S000' to die
    All dispatchers and shared servers shutdown
    Tue Mar 30 09:31:00 2010
    SHUTDOWN: Active processes prevent shutdown operation
    Tue Mar 30 09:36:01 2010
    SHUTDOWN: Active processes prevent shutdown operation
    
    and trace file
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    With the Partitioning, Oracle Label Security, OLAP, Data Mining
    and Real Application Testing options
    ORACLE_HOME = /oracle/app/product/11.1.0/db_1
    ...
    *** 2010-03-30 09:25:58.372
    *** SESSION ID:(170.15) 2010-03-30 09:25:58.372
    *** CLIENT ID:() 2010-03-30 09:25:58.372
    *** SERVICE NAME:(SYS$USERS) 2010-03-30 09:25:58.372
    *** MODULE NAME:(sqlplus@piorovm.localdomain (TNS V1-V3)) 2010-03-30 09:25:58.372
    *** ACTION NAME:() 2010-03-30 09:25:58.372
    ...
    ksukia: Starting kill, force = 0
    ksukia: killed 57 out of 57 processes.
    
    *** 2010-03-30 09:26:03.421
    ksukia: Starting kill, force = 0
    ksukia: Attempt 1 to re-kill process OS PID=24040.
    ...
    ksukia: Attempt 1 to re-kill process OS PID=23958.
    ksukia: Attempt 1 to re-kill process OS PID=23954.
    ksukia: Attempt 1 to re-kill process OS PID=23951.
    ksukia: Attempt 1 to re-kill process OS PID=23949.
    ...
    
    Hmm - all this session was idle and there was no transactions at all - so why "shutdown immediate" can't shut down database. Next what has to be done is check of status of processes in Linux
    $ ps -ef 
    ...
    oracle    7426 11402  0 09:34 pts/1    00:00:00 sqlplus             @a.sql
    oracle    7427  7426  0 09:34 ?        00:00:00 [oracle] <defunct>
    ...
    

    I just put two lines as example - as you can see oracle process 7427 becomes zombie.
    So let's kill it and solve problem

    $ kill -9 7427
    $ ps -ef
    ...
    oracle    7426 11402  0 09:34 pts/1    00:00:00 sqlplus             @a.sql
    oracle    7427  7426  0 09:34 ?        00:00:00 [oracle] <defunct>
    ...
    

    Still working. I google a little bit and found answer (http://www.linuxsa.org.au/tips/zombies.html)
    This is true - you can kill dead process. What you have to do is kill his parent process.
    PPID for my process is 7426 and this is a sqlplus process starting my script.

    $ kill -9 7426 
    

    and database is going down. (of course I have to kill all sqlplus processes without that one with shutdown immediate command running)

    Most funny thing is that is sqlplus process is running in foreground or when is started from cron there is no issue with other sessions
    and shutdown immediate is working well.

    Example:

    $ ps -ef
    ...
    oracle    8831 11402  0 09:40 pts/1    00:00:00 sqlplus             @a.sql
    oracle    8832  8831  1 09:40 ?        00:00:00 oraclepioro (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    ...
    

    Shutdown immediate executed on other sqlplus session and following result in observed session

    SQL> select * from dual;
    select * from dual
    *
    ERROR at line 1:
    ORA-03135: connection lost contact
    Process ID: 8832
    Session ID: 153 Serial number: 5
    

    This is expected result of shutdown immediate command.

    Where is a problem ?
    If sqlplus is running as background process and it become idle (no active SQL) will be not finished until it will be killed or taken to foreground using fg.
    Be aware if you want to shutdown database and you have some sqlplus'es in background – especially in this same Linux session.

    regards,
    Marcin

    Saturday, March 27, 2010

    Oracle Application Server issue

    Strange error in Oracle Application Server 10g 10.1.3.3.
    I have tried to start it using opmnctl startall and it finish with following error:
    10/03/25 08:06:44 WARNING: OC4J will not send ONS ProcReadyPort messages to opmn for service: OC4JServiceInfo id: null protocol: jms hostname: nul
    l port: 12602 description: null
    10/03/25 08:06:44 null hostname was null
    10/03/25 08:06:44 Oracle Containers for J2EE 10g (10.1.3.3.0)  initialized
    
    First idea was that something is wrong with /etc/hosts file or IP has been changed but everything was OK. I have found solution on OTN forum and it works. You have to stop all iAS components and delete all files from following directories:
    $ORACLE_HOME/j2ee/home/persistence
    $ORACLE_HOME/j2ee/[other OC4J]/persistence
    
    regards,
    Marcin 

    Saturday, March 13, 2010

    Oracle ACFS on CentOS

    Hi,

    This is short instruction how to install Oracle ACFS on CentOS. CentOS is free version of RedHat and it is binary compatible. It is not officially supported by Oracle but all solutions related for RedHat should work on CentOS too.
    I have found Laurent blog post about it and I used it as a background of my investigation. When I have used Laurent's steps it was fine until I want to register ACFS in Oracle Cluster Registry. I couldn't do it as not all cluster types has been registered during Grid Infrastructure configuration process.
    Here is a simple solution how to fix it for new installations (still working on solution for existing one).
    1. Perform GUI part of Grid Control installation
    2. Before executing root.sh on both nodes edit following file on both nodes : $ORACLE_HOME/lib/osds_acfslib.pm

      line 299:    
      else   {     
         # we don't know what this is     
         $supported = 1;     
         $vers = "EL5";   
      } 
      
    3. Execute a root.sh on both nodes
    Now ACFS will be installed and configured and all necessary tools will be copied.


    Monday, February 1, 2010

    RMAN and SBT_TAPE backup pieces - how to catalog it

    Hi,
    There has been a discussion on oracle-l mailing list about RMAN and backup pieces on tape which are non in recovery catalog anymore. A few people including me response that those backup pieces can be restored using dbms_backup_restore PL/SQL package if we only know a backup piece name.
    Update 01/02/2010: Now is more solutions - I have started my investigation a few days ago.
    I investigated this problem a little deeper and I found another solution. I did it because I was not aware that according to official Oracle documentation CATALOG command is not working with ‘SBT_TAPE’ interface.
    I have tested this solution on:
    • Oracle 11.1.0.7 Linux 32 bit
    • Oracle 10.2.0.1 Windows 32 bit
    • Oracle 10.2.0.4 Linux 32 bit
    I’ve no possibility to check this on other machines now but if you can give me a shout what a results are.

    Let’s story begin.
    Only thing I knew was a backup piece name. This is a prerequisite but it can be found quite easily by Media Manager admin or by you itself if you know your Media Manager software. See example below for Legato Networker:

    [oracle@piorovm usr]$ ./sbin/mminfo -q "client=piorovm" -r "ssid,name,totalsize,savetime,volume"
     ssid      name                                 total  date   volume
    4267926146 RMAN:3bl4n6ru_1_1                  9961944 01/29/2010 piorovm.localdomain.001
    4234372063 RMAN:3dl4n76v_1_1                805331112 01/29/2010 piorovm.localdomain.001
    4217594914 RMAN:3el4n792_1_1               1389143616 01/29/2010 piorovm.localdomain.001
    4200817814 RMAN:3fl4n7cl_1_1                477378960 01/29/2010 piorovm.localdomain.001
    4251148936 RMAN:c-3537902502-20100129-03     10224108 01/29/2010 piorovm.localdomain.001
    4184040645 RMAN:c-3537902502-20100129-04     10224108 01/29/2010 piorovm.localdomain.001
    

    Or another example for Verita Netbackup (by Allen Brandon from Oracle-l list)
     /opt/oracle ->bplist -t 4 -k  -l -s 1/25/2010 -e 1/26/2010 -R /
    -rw------- oracle    oracle       12582912 Jan 25 21:21 /c-18889999-20100125-09
    -rw------- oracle    oracle        2359296 Jan 25 21:18 /xxprd_al_52855_1_709244222
    -rw------- oracle    oracle       3383296K Jan 25 21:15 /xxprd_db_52852_1_709243545
    
    Next thing is to add these names to control file or recovery catalog. First of all I started with very low level solution and dbms_backup_restore package. There is a function called inspectBackupPiece which required only backup piece name. Channel has to be allocated before that command. This gave me a hope that I can do it. I have created a small PL/SQL script and I have executed it.

    DECLARE
    v_dev varchar2(50);             
    v_fullname varchar2(4000);
    recid number;
    stamp number;
    
    BEGIN
    v_dev:=sys.dbms_backup_restore.deviceAllocate(type=>'sbt_tape', ident=>'test');
    sys.dbms_backup_restore.inspectBackupPiece('3fl4n7cl_1_1',v_fullname,recid,stamp);
    sys.dbms_backup_restore.deviceDeallocate;
    END;
    /
    

    And that was it – Backup piece has been added to control file.
    Ok, if there is a possibility to does this using PL/SQL package there should be possibility do this using RMAN command line. I was trying with allocating ‘SBT_TAPE’ channel and catalog command but without success. Because I have very short memory about command syntax and I know that RMAN is helping with that a little bit I gave a try:
    RMAN> catalog  ;
    
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backup, backuppiece, controlfilecopy, clone, datafilecopy, device, db_recovery_file_dest, recovery, start"
    RMAN-01007: at line 2 column 1 file: standard input
    

    As you can see in error message is a short information about what is expected. Hmmm a device I think it is a good direction. Let’s try again
    RMAN> catalog device type;
    
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found ";": expecting one of: "double-quoted-string, disk, equal, identifier, single-quoted-string"
    RMAN-01007: at line 1 column 20 file: standard input
    
    Ok that’s it – RMAN is expecting a disk or any double or single quoted string.
    Final step is to give RMAN a chance:
    RMAN> list backupset;
    
    RMAN>
    

    There is no backup in control file.
    RMAN> catalog device type 'sbt_tape' backuppiece '3dl4n76v_1_1';
    
    released channel: ORA_DISK_1
    released channel: ORA_SBT_TAPE_1
    allocated channel: ORA_SBT_TAPE_1
    channel ORA_SBT_TAPE_1: SID=170 device type=SBT_TAPE
    channel ORA_SBT_TAPE_1: NMO v5.0.0.0
    cataloged backup piece
    backup piece handle=3dl4n76v_1_1 RECID=103 STAMP=709599103 
    and now

    RMAN> list backupset;
    List of Backup Sets
    ===================
    
    
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    ------- ---- -- ---------- ----------- ------------ ---------------
    77      Full    Unknown    SBT_TAPE    00:00:00     29-JAN-10
            BP Key: 103   Status: AVAILABLE  Compressed: NO  Tag: TAG20100129T224031
            Handle: 3dl4n76v_1_1   Media:
      List of Datafiles in backup set 77
      File LV Type Ckp SCN    Ckp Time  Name
      ---- -- ---- ---------- --------- ----
      1       Full 8788185    29-JAN-10 +DATA/pioro/datafile/system.260.695313067 
     
    Yes we have one already added via catalog command.
    After that I have found two notes on MOS where this syntax is mentioned no 727655.1 and not public no550082.1

    This example is very typical for a lot of new solutions – if you are not aware that something is impossible you can try and do that.

    regards,
    Marcin

    Saturday, January 30, 2010

    Oracle RAC One Node – part 3

    At the beginning I have to apologize everyone who was waiting on that post and I will try to keep posting more regular.

    This time before I will present connection test results I need to clarity one thing.
    Instance name in One Node RAC can change on each node. This is related to way how instance is started. In case of Omotion migration there is a situation when both instances are up and running so both instances have to have different name, ex. 
    • testone_1 is running on rac1
    • testone_2 is running on rac2
    What happen if one of servers with crash with running instance (ex. rac1 will crashed).
    ClusterWare status is showing that last running instance was testone_1 and this instance will be migrated to other node in cluster. This mean that testone_1 instance will be started on rac2 server.

    If we fix rac1 server and we want to failback our database using Omotion  instance will be started on rac1 server but according to restriction described in previous point instance name has to be different and in that case instance name will be testone_2. So that mean that now we have instance: 
    • testone_1 running on rac2 
    • testone_2 running on rac1

    Of course after session migration only one instance will be running but still with that same name.
    Where is a problem? You can’t hardcoded instance name and server name in any monitoring tool because instance name can be vary depend on fail over scenario. You should use raconestatus to figure out what is a current status of database.

    Now is a time to make a last tests with Java and Fast Connection Failover client.
    I have used following code based on Oracle Example with FCF functionality.

    After compilation it is high time to start tests:

    Case no 1– both servers are up, instance is running on rac1
    I have started Oracle test program and run Omotion in rac1 forcing instance migration to rac2.
    Below is output from test program:

    Url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    Instance name: testone_1
    FCF Activ(cache): 1
    FCF Avail(cache): 9
    
    Url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    java.sql.SQLException: Closed Connection
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207)
            at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3512)
            at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1244)
            at FCFDemo2.main(FCFDemo2.java:62)
    getErrorCode=17008
    getSQLState=null
    getMessage=Closed Connection
    Url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    
    Instance name: testone_2
    FCF Activ(cache): 1
    FCF Avail(cache): 0
    

    As excepted session has been failover from instance to another without any problems with one raised exception.
    So let’s test it once again

    Url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    Instance name: testone_2
    FCF Activ(cache): 1
    FCF Avail(cache): 9
    
    Url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    java.sql.SQLException: Io exception: Software caused connection abort: recv failed
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
            at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:805)
            at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1030)
            at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:829)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1123)
            at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1263)
            at FCFDemo2.main(FCFDemo2.java:62)
    getErrorCode=17002
    getSQLState=null
    getMessage=Io exception: Software caused connection abort: recv failed
    java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=serviceone)))
    
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:260)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
            at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:413)
            at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:164)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
            at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:296)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:220)
            at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:156)
            at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:93)
            at oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1529)
            at oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:463)
            at oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:332)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:403)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:188)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:164)
            at FCFDemo2.main(FCFDemo2.java:77)
    
    C:\Downloads\fcf_stepbystep>rem Restore old var values
    
    C:\Downloads\fcf_stepbystep>set ORACLE_HOME=C:\oracle\product\10.2.0\db_1
    

    Opps what happen ? We lost a connection and program has been terminated.
    Let’s take a look on raised exceptions – first one is related to session closure on active instance. In code there is catch section which catch exception and try to reopen connection. But in that case a new started instance has not been registered in listener yet and another exception came in. This one was not catch by any section and demo has been terminated.
    This same behaviour appear in SQL*Plus tests – in my opinion information about instance availability is sending before service is registered in listener. Maybe this is only my VM installation issue but if my assumption about order of event is correct it can happen everyware.

    Case no 2 session with transactions


    Base on Oracle example code I have added transactions. Below is my version of code:

    // 
    // last revised 01/06/2006 - Adding connection pool exposure
    //      revised 01/05/2006 - kpm use VIP IP addresses.
    //      revised 12/21/2005 - PC
    // ...........
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.*;
    import java.sql.Statement;
    import java.util.Properties;
    import java.util.*;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.pool.*;
    import oracle.jdbc.*;
    public class FCFDemo2 {
       public static void main(String[] args) throws InterruptedException {
       try {
       OracleDataSource ods = new OracleDataSource();
       OracleConnectionCacheManager occm = null;
       ods.setUser("system");
       ods.setPassword("oracle");
       String cacheName = "cache";
       String dbURL="jdbc:oracle:thin:@"     
                   +"(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)" +
             "(ADDRESS=(PROTOCOL=TCP)" +
             "(HOST=rac1-vip)(PORT=1521))" +
             "(ADDRESS=(PROTOCOL=TCP)" +
             "(HOST=rac2-vip)(PORT=1521)))" +
             "(CONNECT_DATA=(SERVICE_NAME=serviceone)))";
       System.out.println("Url=" + dbURL );
       ods.setURL(dbURL);
       System.out.println("Url=" + dbURL );
       ods.setConnectionCachingEnabled(true);
       Properties prop = new Properties();
       prop.setProperty("MinLimit", "5");
       prop.setProperty("MaxLimit", "40");
       prop.setProperty("InitialLimit", "10");
       prop.put (oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR,"" + (5000)); // 5000ms
       ods.setConnectionCacheProperties(prop);
       ods.setFastConnectionFailoverEnabled(true);
       ods.setONSConfiguration("nodes=rac1-vip:6200,rac2-vip:6200");
       ods.setConnectionCacheName(cacheName);   // moved from above
       occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
       Connection conn = ods.getConnection();
       conn.setAutoCommit(false);
       System.out.println(conn);
       Statement stmt=conn.createStatement();  // fixed
       ResultSet rs = null;
       int stop = 0;
       
       rs =stmt.executeQuery("truncate table marcin");  
       int i = 0;
       int j=0;
       String name = new String();
          while (true){
          try {
                    //System.out.println("Url=" + dbURL );
                    rs =stmt.executeQuery("select instance_name from v$instance");
                    while(rs.next()) {
     name = rs.getString(1);
                       System.out.println("Instance name: " + name);
                       System.out.println("FCF Activ(" + cacheName + "): " +
                       occm.getNumberOfActiveConnections(cacheName));
                       System.out.println("FCF Avail(" + cacheName + "): " +
                       occm.getNumberOfAvailableConnections(cacheName)+"\n");
                       PreparedStatement pstmt = conn.prepareStatement ("insert into marcin  values (?, ?)");
     pstmt.setInt (1, i);               
                       pstmt.setString (2, name);   
    pstmt.execute ();
     System.out.println("inserted " + i +" \n");
     Thread.sleep(1000);
     conn.commit();    
     System.out.println("Commited " + i + " \n");
     i++;
          }
          catch (OracleSQLException sqle) {
         //sqle.printStackTrace();
                  System.out.println("getErrorCode=" + sqle.getErrorCode());
                  System.out.println("getSQLState=" + sqle.getSQLState());
                  System.out.println("getMessage=" + sqle.getMessage());
         //Thread.sleep(1000);
         
         System.out.println("Try number " + j + "\n");
         j++;
         
         try {
         conn =ods.getConnection(); //Re-get the conn
         stmt =conn.createStatement();
         } catch (OracleSQLException sqle1) {
                   System.out.println("getErrorCode - reconnect =" + sqle.getErrorCode());
                   System.out.println("getSQLState - reconnect =" + sqle.getSQLState());
                   System.out.println("getMessage - reconnect=" + sqle.getMessage());
          sqle1.printStackTrace();      
         }
            }
           Thread.sleep(1000);
        System.out.println("New iteration \n");    
           }
       }
       catch(Exception e)
          {
          e.printStackTrace();
          }
       }
    }
    
    

    Start inserting rows.

    Instance name: testone_1
    FCF Activ(cache): 1
    FCF Avail(cache): 9
    
    inserted 185
    Commited 185
    
    Instance name: testone_1
    FCF Activ(cache): 1
    FCF Avail(cache): 9
    
    inserted 186
    Commited 186
    
    java.sql.SQLException: Closed Connection
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207)
            at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3512)
            at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1244)
            at FCFDemo2.main(FCFDemo2.java:70)
    getErrorCode=17008
    getSQLState=null
    getMessage=Closed Connection
    Try number 0
    
    Instance name: testone_2
    FCF Activ(cache): 1
    FCF Avail(cache): 0
    
    inserted 187
    Commited 187
    
    Instance name: testone_2
    FCF Activ(cache): 1
    FCF Avail(cache): 0
    
    inserted 188
    
    Commited 188
    
    Instance name: testone_2
    FCF Activ(cache): 1
    FCF Avail(cache): 0
    

    As you can see transaction got a exception but because there is a loop in the code transaction has been replay and successfully inserted in database.

    SQL> select id,cos from system.marcin where id > 184 order by id;
    
            ID   INSTANCE_NAME
    ---------- ------------------------------
           185 testone_1
           186 testone_1
           187 testone_2
           188 testone_2
    

    Any RAC aware software should work with RAC OneNode without any problem like with typical Oracle RAC installation.

    This is last part about Oracle RAC OneNode and connection details but I’m sure not a last about RAC itself.