Showing posts with label Installation. Show all posts
Showing posts with label Installation. Show all posts

Friday, February 6, 2015

Minimize database downtime when moving an Oracle DB to a new server

Minimize database downtime when moving an Oracle DB to a new server

My Oracle 10gR2 database is currently on a Windows 2003 32-bit server.  I am planning to migrate to Oracle10g R2 on another Windows 2008 64-bit server for better performance.   What is the best method to do so? My main concern is database downtime.  The total database size is around 200GB.

The first thing to do is to install Oracle 10gR2 64-bit on your new server. Then use the Database Configuration Assistant (DBCA) to precreate a new database on that server. If you want this to go the fastest way possible, use the same exact directory structure for your database files on your new Win 2008 server as you are using on your Win 2003 server. Also, make sure the new database name is the same name as the old database. To minimize downtime, the fastest way is to copy the database datafiles from the old server to the new server. You can use this method because your original platform is Windows and your new platform is Windows. Follow these steps after you have precreated the database on the new server.

1. SHUTDOWN IMMEDIATE the database on the Win 2003 server.
2. SHUTDOWN IMMEDIATE the database on the Win 2008 server.
3. On the Win 2008 server, delete the database datafiles, online redo log files, and the control files.
4. Map a drive from the Win 2008 server to the Win 2003 server.
5. Copy the datafiles, online redo logs, and control files from the Win 2003 server to the Win 2008 server, keeping the file directory placement the same.
6. STARTUP your database on the Win 2008 server.

The step that will take the longest is step 5. But doing a file copy is much faster than other methods.

This procedure works because you are not changing platforms. From Oracle's file's perspective, 32-bit Win 2003 is the same platform as 64-bit Win 2008. We first create a dummy db on the Win 2008 server to get the server set up and configured for the database. We then copy the files over to the new server and since the directory structure and database name are the same, it just starts right up!

Tuesday, May 21, 2013

Oracle Home Silent Installation/Deinstallation and Clone with Patching in Solaris

Oracle Home Silent Installation/Deinstallation and Clone with  Patching in Solaris

Oracle Home silent installation is fast as compared to GUI mode which uses minimal resources.This is much faster than GUI mode.

Following steps provide the installation/deinstallation silently and alos clone of Oracle Home, which can be done across multiple servers without installing and applying the patches for similar Oracle Home.

For fresh installation (Both Oracle Home and Patchset update):

1. To install Oracle 10g/11g with the response file (edit the response file template available in response
    folder after unzipping the downloaded Oracle installation .zip files.
2. Create a directory where the new Oralce Binaries to be installed.
     mkdir -p /u01/app/oracle/product/10205
    Prior to 11g, for any patchset release, we need to install first the base release and then install patchset.
    Eg: To install 10.2.0.2/10.2.0.3/10.2.0.4/10.2.0.5/ first we need to install 10.2.0.1.
           From 11g onwards each patchset upgrade is a new installation and doesn't require base release.
3. Edit the response file and provide the values for
            ORACLE_HOME= <complete path of folder created in Step 2>
            ORACLE_HOME_NAME="<Unique Home Identifier that reflects in Central Inventory>".
      Before proceeding with installation make sure that make/ar/ld/nm are accessible from PATH variable.
4. Invoke runinstaller from install folder of unzipped Oracle Home.
    ./runInstaller -silent -responseFile <complete path of responsefile>
5. If oraInst.loc resides in different location, use -invPtrLoc to point to exact location of oraInst.loc file.
    ./runInstaller -silent -invPtrLoc <location of oraInst.loc file> -responseFile <complete path of 
     responsefile>

Review the log file generated for any errors during installation and fix them before going for another install.

Silent Patchset installation(10.2.0.5):

Once we have Oracle installed, unzip the patchset, update the response file with "DECLINE_SECURITY_UPDATES=TRUE" to avoid error during installation regarding mail notifications.

EXPORT ORACLE_HOME=<existing ORACLE HOME which need to be patched>
./runInstaller -silent -responseFile <Patchset responsefile>

CLONE OF ORACLE HOME

Cloning of ORACLE HOME is useful when we need to install and apply patcset updated on numerous servers. Following are the theoretical steps involved while cloning Oracle Home.

1.Since ORACLE HOME is being cloned, underlying OS version,Hardware all should be similar.
2. Brig down all the services running from this home (Database/listener)
3. cd /u01/app/oracle/product
    tar -cvf 10205.tar ./10.2.0.5   (or)
    mkdir -p /backups/10205_bkp
    cd /u01/app/oracle/product/10.2.0.5
    find . -print |cpio -pdmv /backups/10205_bkp/.
    tar -cvf /backups/10205_bkp.tar /backups/10205_bkp/.
4. This tar file contains ORACLE HOME of 10.2.0.1 applied with patchset of 10.2.0.5
5. scp/ftp this tar file to server
6. untar the file in the location where we want to install ORACLE HOME
7. Attach the newly extracted ORACLE HOME to the existing inventory.
8. Before attaching the new home, take a backup of existing ORACLE Inventory.
    tar -xvf 10205_bkp.tar
9. Invoke runinstaller available from extracted new OracleHome/oui/bin
   ./runInstaller -silent -clone ORACLE_HOME= "<path to new Oracle home>" ORACLE_HOME_NAME="<Name for Oracle Home>"

    ORACLE HOME De-installation:

To deinstall Oracle Home Silently, invoke runInstaller from any uncompressed Oracle Home
Before running Remove_Homes:
/u01/app/oracle/product/10.2.0/clone/config[PLMTEST]$cat /u01/app/oracle/oraInventory/ContentsXML/inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 2005 Oracle Corporation. All rights Reserved -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>10.2.0.2.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="ORACLE_HOME1" LOC="/u01/app/oracle/8.1.7" TYPE="O" IDX="1"/>
<HOME NAME="ORACLE_HOME92" LOC="/u01/app/oracle/9.2.0" TYPE="O" IDX="2"/>
<HOME NAME="ora1020" LOC="/u01/app/oracle/product/10.2.0" TYPE="O" IDX="3"/>
</HOME_LIST>
</INVENTORY>
After running Remove_Homes
./runInstaller -deinstall -silent REMOVE_HOMES={"/u01/app/oracle/8.1.7"}

After everything goes successfully, the invetory.xml file reads like
/u01/app/oracle/oraInventory/ContentsXML[PLMTEST]$cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2010, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>10.2.0.5.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="ORACLE_HOME92" LOC="/u01/app/oracle/9.2.0" TYPE="O" IDX="2"/>
<HOME NAME="ora1020" LOC="/u01/app/oracle/product/10.2.0" TYPE="O" IDX="3"/>
<HOME NAME="ORACLE_HOME1" LOC="/u01/app/oracle/8.1.7" TYPE="O" IDX="1" REMOVED="T"/>
</HOME_LIST>
</INVENTORY>