Cloning Oracle Homes

You are tired of installing and patching Oracle Software over and over again and creating response files for a silent installation is to cumbersome for you? May be Oracle Home cloning is what you are looking for!

Step 1 - Create an tar-file on the source server

[oracle@centos4-ora10g ~]$ cd /opt/oracle/
[oracle@centos4-ora10g oracle]$ tar -cjf ~/ora10gr2.tar.bz2 ora10g
[oracle@centos4-ora10g oracle]$ cd
[oracle@centos4-ora10g ~]$ ls -l
total 583484
-rw-r--r--  1 oracle oinstall 596885752 Jan 23 08:45 ora10gr2.tar.bz2
-rw-r--r--  1 oracle oinstall      1023 Oct 26  2006 oraenv.sh
-rw-r--r--  1 oracle oinstall       804 Jul 14  2007 ora_gc.sh

Step 2 - Copy the tar-file to the target

[oracle@centos4-ora10g ~]$ scp ora10gr2.tar.bz2 oracle@192.168.76.100:/tmp/

Step 3 - Extract the tar-file on the target

-bash-2.05b$ cd /opt/oracle/
-bash-2.05b$ tar -xjf /tmp/ora10gr2.tar.bz2

Step 4 - Start the Cloning process

-bash-2.05b$ /opt/oracle/ora10g/oui/bin/runInstaller \\
-silent \\
-clone ORACLE_HOME="/opt/oracle/ora10g" \\
ORACLE_HOME_NAME="ora10g"

Starting Oracle Universal Installer...

You can find a log of this install session at:
 /opt/oracle/oraInventory/logs/cloneActions2008-02-26_05-42-48AM.log

Installation in progress (Tue Feb 26 05:44:01 CET 2008)
Install successful

Linking in progress (Tue Feb 26 05:44:09 CET 2008)
Link successful

Setup in progress (Tue Feb 26 05:47:50 CET 2008)
Setup successful

End of install phases.(Tue Feb 26 05:48:00 CET 2008)

Step 5 - Run the orainstRoot.sh and root.sh as usual

$ su -
Password: 
[root@centos3-t01 root]# /opt/oracle/oraInventory/orainstRoot.sh
Changing permissions of /opt/oracle/oraInventory to 770.
Changing groupname of /opt/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@centos3-t01 root]# /opt/oracle/ora10g/root.sh

Step 6 - Configuration and Cleanup

The Oracle Home is now ready to use, but before you start with your configuration work,
check and cleanup the following directories:

  • $ORACLE_HOME/dbs
  • $ORACLE_HOME/network/admin

Material für meinen Oracle Grid Control Vortrag

Wie bereits angekündigt, halte ich dieses Jahr einen Vortrag zu Oracle Grid Control auf der 20. Deutsche ORACLE-Anwenderkonferenz in Nürnberg. Meine Präsentation steht ab jetzt unter http://www.fm-berger.de/download/oragc-02.pdf zum Download bereit.

Hier noch einige Links zu diesem Thema:

Access MySQL Databases with Oracle HSODBC

Sometimes you need to access data stored in an different RDBMS like MySQL. Oracle provides an convenient way to access external data-sources via ODBC. To use Oracle HSODBC you can follow my step-by-step notes:

  • Install unixODBC and the MySQL ODBC Driver
    For Fedora Core 6 I installed the following RPMs:

    • unixODBC-2.2.11-7.1
    • mysql-connector-odbc-3.51.12-2.2
  • Configure /etc/odbc.ini
    [ODBC Data Sources]
    TimeSheetTest = MySQL ODBC PHP.TimeSheetTest DSN
    
    [TimeSheetTest]
    Driver       = /usr/lib/libmyodbc3.so
    Description  = MySQL ODBC 3.51 Driver DSN
    SERVER       = localhost
    PORT         = 3306
    USER         = root
    Password     = SECRET
    Database     = timesheet
    OPTION       = 3
    SOCKET       =
    
  • Test the ODBC Connection via isql
    [frank@w0004]$ isql TimeSheetTest
    Connected!
    sql-statement
    help [tablename]
    quit
    SQL> 
    
  • Oracle Configuration
    First ensure that the shell environment used to start the Oracle listener includes the following
    environment variables:

    export ODBCINI=/etc/odbc.ini
    export ODBCSYSINI=/etc
    

    To integrate that ODBC connection into Oracle you have to edit several configuration files:

    $ORACLE_HOME/hs/admin/initTimeSheetTest.ora

    HS_FDS_CONNECT_INFO = TimeSheetTest
    HS_FDS_TRACE_LEVEL = off
    HS_FDS_SHAREABLE_NAME = /usr/lib/libmyodbc3.so
    

    $ORACLE_HOME/network/admin/listener.ora

    ...
    SID_LIST_LISTENER =
    ...
        (SID_DESC =
          (PROGRAM = hsodbc)
          (ORACLE_HOME = /opt/oracle/ora10g)
          (SID_NAME = TimeSheetTest)
          (ENVS=LD_LIBRARY_PATH = /usr/lib:/opt/oracle/ora10g/lib)
        )
      )
    ...
    

    $ORACLE_HOME/network/admin/tnsnames.ora

    ...
    TIMESHEET = (DESCRIPTION = 
        (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))
        (CONNECT_DATA = (SID= TimeSheetTest))(HS=OK)
      )
    ...
    
  • Test the Configuration with tnsping
    $ tnsping timesheet
    
    TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 05-SEP-2007 18:26:16
    
    Copyright (c) 1997, 2005, Oracle.  All rights reserved.
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = localhost)(PORT = 1521))) (CONNECT_DATA = (SID= TimeSheetTest))(HS=OK))
    OK (10 msec)
    
  • Create an Oracle Link in your Oracle Database instance
    SQL> CREATE PUBLIC DATABASE LINK timesheet
      CONNECT TO "root" IDENTIFIED BY "SECRET" USING 'TIMESHEET';
    

Please note that MySQL is case-sensitive on tablenames, so you have to use:

SQL> select * from "timesheet_times"@timesheet;
...

Vortrag - Oracle Grid Control 10g im Praxiseinsatz

Die Deutsche ORACLE-Anwendergruppe (DOAG) veranstaltet in diesem Jahr die 20. Deutsche ORACLE-Anwenderkonferenz in Nürnberg. Das Programm der SIG Database steht dieses Jahr unter dem Motto "Manageability". In diesem Programmbereich halte ich einen Vortrag mit dem Thema "Oracle Grid Control 10g im Praxiseinsatz".

Neben dem üblichen Vortrags-Programm gibt es in diesem Jahr ein Oracle 11g Labor und ein Oracle SOA Camp in denen mit eigenen praktischen Übungen erste Erfahrungen mit den neuen Oracle Technologien gesammelt werden können.

Oracle Database 9iR2 goes and 11gR1 comes

On the 11th of July Oracle launched Version 11 of their RDBMS software. I just received an email from Oracle stating an count-down of 11 until the software will be available for public download. Well 11 could mean 11 hours or 11 days :-)

The release of a new software version is primarily an marketing thing. From an technical point of view it is more interesting to look at version 9iR2 which reached its final phase in the product life cycle. Odd thing, 9iR2 represents still the majority release for production installations. I would guess that around 70 to 80% of the databases of my customers run with 9iR2.

As a software developer I can understand that Oracle keeps the time frame for an product life cycle quite short. The market forces you to make major releases which include some new and cool features. On the other hand they have to support that piece of software on a lot of platforms. For instance 9iR2 was available on OpenVMS or OS/390. If you have to support more than two versions of your software, software testing and support become a real nightmare.

So you still have 9iR2 in production? My advice would be to upgrade to the Terminal Patch Set 9.2.0.8 within the next six month. You should also evaluate the Critical Patch Updates (CPUs) in a timely fashion. Good would be if you could manage to be aware of the problems that are fixed with a CPU in a time frame of 4 weeks after the CPU got released. Depending on how critical the fixed problems are to your environment, you should be able to roll-out the CPUs within 3 months.