Tuesday, April 21, 2009

Oracle Installation fails with OUI-10133: Invalid staging area

Problem Description
While installing oracle on my windows machine it fails with the message,
OUI-10133: Invalid staging area. There are no top level components for Windows NT, Windows 2000 available for installation in this staging area.

On linux system this message is like,
OUI-10133: Invalid staging area. There are no top level components for Linux available for installation in this staging area.

Cause of the problem
There are many causes by which this problem can happen.

1)The product.xml directory is not found and hence the problem occurs. In the oraparam.ini the source location is specified to product.xml but no product.xml exist in the stage directory.

2)Someone has deleted the products.xml file from its location and installer could not find it.

3)You have downloaded oracle from e-delivery.oracle.com which contains three zip files and you extracted three zip files into different locations.

4)The staging area i.e stage folder is corrupted.

5)The media is corrupted.

Solution of the Problem
1)Open oraparam.ini configuration file which resides in the install directory both in windows and linux.

2)Within the file you will see there is SOURCE parameter and within it the location of products.xml is specified.

3)Go to that location and be sure that products.xml exist. There might be several reasons that installer could not find any. Suppose you copied oracle software from network and it is not fully copied. Someone deleted file from stage directory.

4)If you download zipped file of oracle software from e-delivery.oracle.com for 11g, then there will be three zip file. Unzip those three files into the same directory and then start installing the software.

5)After downloading software do cksum on source and verify with cksum in the OTN.

6)Get a fresh copy of oracle software and install.

RMAN-06429: TARGET database is not compatible with this version of RMAN

Whenever you connect to a database (rman version if different from source database version in fact rman version is higher than the source database) through RMAN using/without recovery catalog it fails with RMAN-06429: TARGET database is not compatible with this version of RMAN as below.

C:\>rman target rman/rman@local2 catalog rman/rman@testdb

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 24 05:07:14 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Recovery Manager incompatible with TARGET database: RMAN 8.0.4.0 to 10.1.0.0 req
uired
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06429: TARGET database is not compatible with this version of RMAN

Cause of the Problem
You have higher RMAN version than the target database (to which you are connecting). In order to successfully connect to database by rman the rman version must be less or equal to the target database version.

Solution of the Problem
There is a rule of thumb in this connecting issue and it is best practice to use 'rule of thumb'. That is "always use the target database RMAN executable and the latest release of Oracle for your recovery catalog."

However, if you are going to use a lower version RMAN executable to backup higher
version databases then remember you are restricted to only the features available
in the database your using. But the executable you are using must be able to
handle the feature or configuration you are using.

In the above example a 10.2.0.1 rman executable tried to connect to database version 10.1.0.2 which is not supported. If we follow rule of thumb then also use 10.1.0.2 rman executable to connect to database 10.1.0.2 in order to best use of all the available features. However we can connect to 10.1.0.2 database with lower version of rman executable but that is not recommended as in that case we might be restricted to use less features.

One more thing is clear from the error message is,
"Recovery Manager incompatible with TARGET database: RMAN 8.0.4.0 to 10.1.0.0
required". So you can use any rman executable to connect to target database (which- the target database in fact 10.1g) but current RMAN executable is shown as 10.2.0.1.

What is kernel, shell, shell script

Kernel
The linux kernel is the most important part or in order word called the heart of the linux operating system. It is the piece of code that manages both hardware and software components and communicates between them. It manages memory, processors, I/O devices with any applications and decides which applications will use hardware resources.

Shell
On your windows machine you have seen command prompt (command.com or cmd.exe) where you type command like ping, ipconfig etc. Similarly, on linux there is such prompt where you can type command and that prompt is called shell. In order to define shell we can say shell is an interpreter that interprets commands as typed from a keyboard or from a text script.

The shell is provided in order to interact with the computer systems. Shell itself is not part of the kernel, but it uses kernel to executes commands.

There are various types of shell and can be broadly defined into four categories.

1)Bourne like shell(sh): Almquist shell (ash), Bourne-Again shell (bash), Debian Almquist shell (dash), Korn shell (ksh), Z shell (zsh) falls into bourne like shell category.

2)C shell like (csh): TENEX C shell (tcsh) falls within this category.

3)Non traditional shell: es shell (es), scheme Shell (scsh) falls within this category.

4)Historical shell: Thompson shell (sh), PWB shell or Mashey shell (sh) falls within this category.

In order to know all available shells in your system issue, cat /etc/shells
On my system,
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh

To find out current shell you are using issue, echo $SHELL or ps $$
On my system,

# ps $$
PID TTY STAT TIME COMMAND
4593 pts/0 Ss 0:00 -bash
# echo $SHELL
/bin/bash

Shell Script
Shell script is a plain text file which contains a series of commands. In this case instead of running command one by one we can store all commands in a script and we execute the script. It is similar to a batch file in MS-DOS.

A simple shell script to check whether user is root

In many case inside your shell script you need to check whether the user who runs the script is root or not because based on the user you might need to take necessary action inside your shell script.

Following shell script might help you in this case.

Way 01: With system variable $LOGNAME
As echo $LOGNAME show the currently logged in user show we can use this variable to determine whether it is root user.
1)create script
# vi test_root.sh
if [[ $LOGNAME = "root" ]]
then
echo "You are root user"
else
echo "You are $LOGNAME user"
fi

2)Grant execute permission.
# chmod +x test_root.sh

3)Test it by running as root.
# whoami
root

# ./test_root.sh
You are root user

4)Test it by running as oracle user.
# su - oracle

$ whoami
oracle

$ ./test_root.sh
You are oracle user

Way 02: As system variable $UID:
As system variable $UID for root user is zero so we can use that in order to determine whether user is root.
1)create script
# vi test_root2.sh
if [[ $UID = "0" ]]
then
echo "You are root user"
else
echo "You are not root user"
fi

2)Give execute permission.
# chmod +x test_root2.sh

3)Test it by running as root user.
# ./test_root2.sh
You are root user

Way 03: With the command whoami
With the command whoami you can check the user who is logged in. So you can use that in your script.
1)Create script
# vi test_root3.sh
if [ `whoami` = "root" ]
then
echo "You have logged on as root"
else
echo "You are not root user"
fi

2)Grant execute permission.
# chmod +x test_root3.sh

3)Test the script by running it.
# ./test_root3.sh
You have logged on as root

Different types of standby database in oracle data guard

In oracle data guard configuration, you need to setup one or more additional databases beside the primary database. These additional databases are called standby database. Up to nice standby database can be created for one primary database.

Using a backup of primary database you can set up standby database and then you can made standby database as part of data guard configuration. Once you configured standby database, data guard automatically maintains standby database by transmitting redo log from the primary database and then applying redo to the standby database.

A standby database can be of three types.

1)Physical Standby Database: A physical standby database is an identical copy of the primary database. The disk structures are also identical with primary database. It is kept synchronized with the primary database by Redo Apply- which means the redo data is received from the primary database and then redo is applied to the physical standby database.

Note that as of Oracle Database 11g release 1 (11.1), a physical standby database can receive and apply redo while it is open for read-only access. You can use physical standby database for query and reporting purpose along with data protection.

2)Logical Standby Database: A logical standby database is the same logical information of the primary database. The physical data structure need not to be same on the standby database. It is kept synchronized with the primary database by SQL Apply- which means the redo data is received from the primary database, transforms redo data into SQL statements and at last executes the SQL statements on the standby database.

You can use logical standby database for query and reporting purpose along with data protection. Also you have to facility to upgrade oracle database software and patch sets along with data protection with help of logical standby database.

3)Snapshot Standby Database: A snapshot standby database is a convertible copy of the physical standby database but the difference from the physical or logical standby database is, the redo data that it received does not apply into it. The redo is applied whenever it is converted back to the physical standby database. You can play with the snapshot standby database and while converting to physical standby database from snapshot standby database these local updates are discarded.

Note that in case of snapshot standby database, the time needed to perform a role transition is directly proportional to the amount of redo data that needs to be applied.

What is oracle data guard

Oracle data guard is the term(you can call it a feature too) used by oracle and this feature is integrated with oracle RDBMS. Data guard create, maintain, manage and monitor one/more extra databases -called standby database, beside production database. The goal is to survive production databases from any disasters, failure or data corruptions.

At first, an exact replica of production database is created, which referred to as standby database later. Data guard then maintains and keep up to date of these standby databases with of production database. If production database becomes unavailable then data guard can switch standby database to production role and thus minimize the downtime without any data loss.

In addition to availability of production database data guard gives other advantages. Like we can do real time query in standby database, do backup operation in it and thus minimize the load of production database.

There is no restriction about the location of the stand by databases. They can be located thousands miles away from the production database or can be within same room, provided they can communicate each-other.

The more features, configurations, advantage about oracle data guard will be discussed gradually.