Sunday, August 17, 2008

Installing Clusterware through OUI fails Cheking OS version in RHL-5

Whenever to install oracle clusterware I run runInstaller on Red hat linux 5 machine it fails with operating system version test. The same problem happens whenever you try to install Oracle Clusterware or oracle database 10g on Oracle Enterprise Linux 5.0 or SUSE Linux Enterprise Server 10 then the current version of Oracle Universal Installer does not recognized these operating systems as supported operating systems and does not perform the installation. It fails like below.

-bash-3.1$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Failed <<<< style="font-weight: bold;">Cause of The Problem
The installer picks up the version of Linux installed from the /etc/redhat-release file. There may be several reasons for which the above messages can be shown.

1. Your OS is not certified with the oracle certification to install clusterware.

2. The /etc/redhat-release become corrupted and installer can't read the file.

3. It cannot identify the version of Linux installed in the machine and reports a failure accordingly.

4. May be bug of the OUI.

Solution of The Problem
Method 1: Change the release value in /etc/redhat-release
Step 1: Ensure that your OS version is certified with clusterware installation or the product you want to install. This can be seen by oracle certification matrix.

Step2: Ensure that /etc/redhat-release is there and not corrupted. You can copy it to somewhere and edit it.

Step 3: I have seen if you want to install oracle clusterware on RHL 5 then then it shows above failure though it is certified and I have intact /etc/redhat-release. In that case to meet clusterware installation edit the /etc/redhat-release file to make it from 5 to 4.

The original value and changed value is listed below.
•On Oracle Enterprise Linux 5.0, original value is "Enterprise Linux Enterprise Linux server release 5". Change it to Enterprise Release Enterprise Linux server release 4.

•On Red Hat Enterprise Linux 5.0, original value is "Red Hat Enterprise Linux server release 5". Change it to Red Hat Enterprise Linux server release 4.

•On SUSE Linux Enterprise Server 10, original value is
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10

Change it to
SUSE Linux Enterprise Server 9 (x86_64)
VERSION = 9


I have done this on my Red Hat system as,

-bash-3.1$ vi /etc/redhat-release
Red Hat Enterprise Linux Server release 4 (Tikanga)

Now again try to run runInstaller and possibly you will not get the error.

Method 2: (recommended) Running as ignoreSysPrereqs flag:
The idea is while running OUI( Oracle Universal Installer) command it to skip operating system test. Start the runIstaller as
./runinstaller -ignoreSysPrereqs
which causes the installer to skip the operating system check and continue with the installation.

Related Documents
Install Oracle Database 10g Software on Red Hat Linux

Some Tips of Mozilla Firefox

1)Zooming: If you get any small font or tiny text in your browser you can enlarge your text by simply pressing
CTRL + plus (+) sign (zoom out) or
CTRL + minus(-) sign (zoom in)

2)Handling Tabs: With firefox you can handle many web page in a single firefox window with the help of tabbed browsing.
CTRL+T will open a new empty tab on an existing firefox window.
CTRL+W will close the current tab.
CTRL+SHIFT+T will will reopen a close tab.
Middle click on a link will open a link in a new tab.

3)Single click bookmarking: While browsing if you find any page useful then you can simply bookmark that page with single click bookmarking so that you can easily find that page from Bookmarking menu. To do single click bookmarking just click star button on the location bar. Your current page will be added to the bookmark.

4)Useful keyboard Shortcut:
CTRL+L will move your cursor to the Address bar so that you can type a new site.
CTRL+K will move your cursor to the search bar so that you can search on net.
CTRL+F will move your cursor to find bar so that you can search text within your current page. This is specially helpful in order to search a word on a larger webpage.
CTRL+N will open a new firfox window.
CTRL+O will open a new file in your firefox browser window.
CTRL+SHIFT+W will close your current window.
CTRL+S will save your current page.
CTRL+P will print your web page.
CTRL+R will reload your current web page.
CTRL+0 will reset your zooming.
F11 will show your browser in full screen.
CTRL+D will bookmark your current page.
CTRL+SHIFT+D will bookmark all current page.
CTRL+SHIFT+B will prompt you to organize bookmarks.
CTRL+J will show you your download window.

5)Assign Tags to bookmarks: If you have many bookmarks entry then you can distinguish them easily by assigning them into tags. In order to do that just double click on the star button in the location bar. There you will see Tags tab. Just simply give a name. In order to give a page multiple tags just separate them by comma. Later to find the page just enter tag name in the location bar. The sites will appear from them you can choose.

6)Add ons: You can do a lots of task you wish to make firefox works. To do it,
go to Tools → Add-ons to open the Add-ons Manager and discover all the ways you can make Firefox your own.

7)Manage Search Engines: Just at the left on the search bar (You can see a big G for google) click on the drop down menu. You will see a list of search engines. Click on the Manage Search Engines and from there you can edit, move up and down and remove a search engine.

8)Clear Private Data: After browsing if you want not to keep track your browsing and downloading history you can clear your private data. To do it go to Tools and select clear private data.

Saturday, August 16, 2008

On RHL5 rawdevices: unrecognized service

On you RHL4 you can use the rawdevices service by enabling via,
# chkconfig --level 345 rawdevices on

But on RHL5 it shows the error message like,
[root@racnode-1 ~]# service rawdevices start
rawdevices: unrecognized service

Check your linux version by,
[root@racnode-1 ~]# uname -a
Linux racnode-1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

This is because that raw device technology had been deprecated in RedHat Linux 5 (RHEL5) and Oracle Enterprise Linux 5 OEL5). / Linux Kernel 2.6

As we see this is linux version EL5 and kernel 2.6, so rawdevices technology had been deprecated.

So you may think can we use rawdevices into RHEL5 or OEL5? In fact rawdevice is enabled on RHL4 by
# chkconfig --level 345 rawdevices on

The answer is yes you can still use the disk partition by means of UDEV technique and Oracle 11g & 10gR2 has options to configure components to access the block devices directly instead of rawdevices.

You might be curious why RHL4 can do and why RHL5 can't. This is beacuse in RHEL5 and OEL5 there is missing,

1. /etc/sysconfig/rawdevices file.
2. /dev/raw file.
3. Service by the name "rawdevices".


So, trying to run the command "service rawdevices restart" will result in "rawdevices: unrecognized service".

In my blog there is shown how to do it if you use RHL4.

To make access of disk block devices in RHL5/OEL5,

Step 1: Make an entry in /etc/udev/rules.d/60-raw.rules or create your own file for example ., /etc/udev/rules.d/-oracle-raw.rules (eg. 63-oracle-raw.rules)

Here I made like this,
#vi /etc/udev/rules.d/63-oracle-raw.rules
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[1-2]*", OWNER="root", GROUP="oinstall", MODE="640"
KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="644"


So our sdb1 will be recognized as /dev/raw/raw1, sdb2 will be as /dev/raw/raw2 and so on.

Step 2: For the mapping to have immediate effect, run below command

#/bin/raw /dev/raw/raw1 /dev/sdb1
/bin/raw /dev/raw/raw2 /dev/sdc1
/bin/raw /dev/raw/raw3 /dev/sdd1
/bin/raw /dev/raw/raw4 /dev/sde1
/bin/raw /dev/raw/raw5 /dev/sdf1


Step3: Adjust the permission settings by,
chown root:oinstall /dev/raw/raw1
chown root:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 640 /dev/raw/raw1
chmod 640 /dev/raw/raw2
chmod 640 /dev/raw/raw3
chmod 640 /dev/raw/raw4
chmod 640 /dev/raw/raw5


Related Documents
Configure Shared Storage in Oracle RAC installation

Friday, August 15, 2008

ORA-12560: TNS:protocol adapter error on windows machine while starting oracle

Error Description
On my windows server machine whenever I try to logon to database as a sysdba user it fails with the message ORA-12560.
C:\Documents and Settings\Oracle>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Aug 16 11:01:58 2008

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

ERROR:
ORA-12560: TNS:protocol adapter error

Cause of The Error
Oracle classify this as a 'generic protocol adapter error'. In my experience while practice the happening of this error oracle indicates that Oracle client does not know what instance to connect to or what TNS alias to use.

Solution of The Problem
1)If you have server running then while connecting to database as a sysdba user ensure that you have set properly your ORACLE_SID variable. Try explicitly set your envionmental variable on windows machine by,
>set ORACLE_SID=db_name

2)Ensure that you have right services running on your database. You can check whether oracle is running or not by right click on taskbar then select task manager and see whether oracle.exe is running or not.

If it is not running then it is likely to get ORA-12560: TNS:protocol adapter error on your windows machine. To avoid this error you have to run the service. You can do it from right click on my computer> select manage> Click on services and Applications> Double click on services> find the service name OracleSERVICE$ORACLE_SID. If your database name is ARJU then find the service name OracleSERVICEARJU and start it.

You can start the service also by command prompt,
C:>sc start OracleSERVICE$ORACLE_SID

Using oradim by,
C:>oradim -startup -sid $ORACLE_SID

After starting try to connect to database as sysdba and likely you will be able to connect to your database.

C:\Documents and Settings\Oracle>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Aug 16 11:03:16 2008

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

3)If you are connecting to a remote database then try easy naming method. Don't try to connect by tnsnames alias. Easy naming method is described in http://arjudba.blogspot.com/2008/06/ora-12514-tnslistener-does-not.html

4)Ensure that you are using correct tnsnames.ora and you have correct settings in your tnsnames alias. Whether you have correct tnsnames entry or not you can check that by >tnsping hostname

On unix machine, if you see tnsnames.ora is most likely accurate then at the Unix prompt, echo the TNS_ADMIN environment variable.

% echo $TNS_ADMIN

•If nothing is returned, try to set the TNS_ADMIN environment variable to explicitly point to the location of the TNSNAMES.ORA file.

In C Shell, the syntax is:
% setenv TNS_ADMIN full_path_of_tnsnames.ora_file

In K Shell or bash, the syntax is:
% export TNS_ADMIN=full_path_of_tnsnames.ora_file

On windows machine try setting the environment variable 'LOCAL' to the required connection alias instead. In windows machine environmental variable is set by set keyword.

Now try to connect to database.

5)If you use DHCP to assign IP of the server then try by putting a static IP to the database server.

Related Documents
http://arjudba.blogspot.com/2008/06/ora-12154-tnscould-not-resolve-connect.html
http://arjudba.blogspot.com/2008/06/ora-12514-tnslistener-does-not.html

How to load data using external table into oracle database

Using SQL*Loader we can load data from flat data file to oracle database which is described in How to load data using sql*loader into oracle database. The external tables feature is a complement to existing SQL*Loader functionality.

In the following section, I will show with an example of how you can load data using external table.

1)Prepare your data file.
This file is where my input data is which will be loaded to database table. Here my datafile data.dat.txt is as follows,
045 Faruk
012 Arju
022 Momin

2)Create the database directory where data file resides.
This data file is not oracle data file rather it is the file where data resides. This oracle database directory is just a operating system path synonym. This directory is the logical path of physical datafile path. As my data file is in the directory c:\oracle\data\ so I create the directory as

SQL> create directory exter_dir as 'E:\oracle\work';

Directory created.

Note that user must have grant create any directory privilege. If other user create the directory then current user must have read access to the directory.
SQL> GRANT READ ON DIRECTORY exter_dir TO Arju;
Here current user is Arju. So execute above statement with a user that have privilege.

3)Prepare the original Table: You should ignore this step if your desired table already exist in your database. If not exist then create a new one. I created as,

SQL> create table std_name (id varchar2(10), name varchar2(20));
Table created.

4)Create the external table: I created the external table as,
SQL> create table external_tab(id char(4),
name char(10))
organization external
(default directory exter_dir
ACCESS parameters
(records delimited by newline
fields (id char(4), name char(10)
)
)
location ('data.dat.txt')
);


Table created.

Here "organizational external" indicates this one is external table.
"default directory" indicates the name of the directory where data file resides.
"location" indicates the name of the data file.

In this phase data from the data file is loaded into the external table. You can check whether it is successfully load or not by issuing,
SQL> select * from external_tab;
ID NAME
---- ----------
045 Faruk
012 Arju
022 Momin

5) Load the data from the external table to database table:
Load data from external_tab into the table std_name by,

SQL> insert into std_name select * from external_tab;
3 rows created.

SQL> commit;
Commit complete
.

6)Test the data.
SQL> select * from std_name;

ID NAME
---------- --------------------
045 Faruk
012 Arju
022 Momin

Thursday, August 14, 2008

Automtic and Manually sized Components of SGA

The parameter SGA_TARGET specifies the total size of all SGA components. If SGA_TARGET is set to a value greater than zero then
DB_CACHE_SIZE,
SHARED_POOL_SIZE,
LARGE_POOL_SIZE and
JAVA_POOL_SIZE are automatically sized.

are automatic sized components.

On the other hand,
LOG_BUFFER,
BUFFER_POOL_KEEP,
BUFFER_POOL_RECYCLE,
DB_nK_CACHE_SIZE other than DB_CACHE_SIZE,
STREAMS_POOL_SIZE ,
Fixed SGA and
other internal components are manually sized components.


However setting the value to manually sized components automatically reduce the value from SGA_TARGET if SGA_TARGET is set to value greater than zero.

When SGA_TARGET>0 then automatic sized components of SGA are automatically allocated and this is called Automatic Shared Memory Management.

Both the automatic and manually sized components of SGA are dynamic components because they dynamically can be changed. You can see them from V$SGA_DYNAMIC_COMPONENTS.

Related Documents

How to determine free memory and used memory in Oracle

Configure Shared Storage in Oracle RAC installation

An Oracle RAC database is logically or physically shared everything database. All
datafiles, control files, PFILEs, and redo log files in Oracle RAC environments must
reside on shared disks. This is so that all of the cluster database instances
can access them.

IN that shared disk you can use the following file storage options for Oracle RAC database.

1)ASM: Which stands for Automatic Storage Management. And oracle recommends ASM.

2)Oracle Cluster File System (OCFS):
OCFS is available for Linux and Windows
platforms, or a third-party cluster file system that is certified for Oracle RAC.

3)A network file system: This is not supported on AIX, POWER, or on IBM zSeries-based Linux.

4)Raw devices

In this post I will show how to configure RAW device to install oracle RAC.

Before discussing it is good to know the difference between single instance database and RAC instance database.

Oracle RAC databases differ architecturally from Oracle RAC single-instance Oracle
databases in that each Oracle RAC database instance also has,
At least one additional thread of redo for each instance
An instance-specific undo tablespace

To configure RAW storage device as a shared storage in RAC database first you have to think about clusterware part. Oracle clusterware has two components OCR and voting disk.

Before you install Oracle Clusterware, you will need to configure 5 raw partitions,
each 256 MB in size, one storing the Oracle Cluster Registry (OCR), another one for duplicate OCR file on a different disk, referred to as the OCR mirror, and three voting disks.

And then If you plan to use raw devices for storing the database files, you will need to create additional raw partitions for each tablespace, online redo log file, control file, SPFILE and password file.

Below is the procedure of how to configure RAW device.

Step 1:
Be sure that you have storage box purchased that is shared on both nodes.
Now to see available shared disk on your system as a root user on racnode-1 use,
# /sbin/fdisk -l
It gave me output like,
.
.
.
Disk /dev/sdb: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 91.2 GB, 91268055040 bytes
255 heads, 63 sectors/track, 11096 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn't contain a valid partition table

Since I have sdb, sdc, sdd, sdf, sde disks on my storage box so all five are shown.

Step 2:
Now as a root user on racnode-1 create two raw partitions 256 MB in size for the OCR and its mirror, and three partitions 256 MB in size for the Oracle Clusterware voting disks. To store first OCR partition I use sdb for this. So, I use
# /sbin/fdisk /dev/sdb
After issuing it,

Use the p command to list the partition table of the device.

Use the n command to create a partition.

After you have created the required partitions on this device, use the w command to write the modified partition table to the device.

Here is the example of creating my first 256 raw partition of sdb disk.
The bolded one is input by me.
[root@racnode-1 ~]# /sbin/fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 19581.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19581, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19581, default 19581): +256M

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@racnode-1 ~]#
Similarly configure other 256MB partition from rest of the disk. I created raw 256MB partition from /dev/sdc for OCR mirror. From the three disks /dev/sdd, /dev/sde and /dev/sdf create each 256MB partition for voting disk.

That is,
#fdisk /dev/sdc

#fdisk /dev/sdd

#fdisk /dev/sde

#fdisk /dev/sdf


After you configure your all 5 disks on your system your fdisk -l output will look like below.
[root@racnode-1 ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 83 Linux
/dev/sda2 1276 3723 19663560 83 Linux
/dev/sda3 3724 6145 19454715 83 Linux
/dev/sda4 6146 9729 28788480 5 Extended
/dev/sda5 6146 8440 18434556 83 Linux
/dev/sda6 8441 9205 6144831 83 Linux
/dev/sda7 9206 9727 4192933+ 82 Linux swap / Solaris

Disk /dev/sdb: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 32 257008+ 83 Linux

Disk /dev/sdc: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 32 257008+ 83 Linux

Disk /dev/sdd: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 32 257008+ 83 Linux

Disk /dev/sde: 161.0 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 32 257008+ 83 Linux

Disk /dev/sdf: 91.2 GB, 91268055040 bytes
255 heads, 63 sectors/track, 11096 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdf1 1 32 257008+ 83 Linux

Step 3:
As the root user on racnode-1, edit the /etc/sysconfig/rawdevices file and add the mappings for the raw devices used by Oracle Clusterware.
[root@racnode-1 ~]# vi /etc/sysconfig/rawdevices
#OCR Devices
/dev/sdb /dev/sdb1
/dev/sdc /dev/sdc1
#Voting Disk Devices
/dev/sdd /dev/sdd1
/dev/sde /dev/sde1
/dev/sdf /dev/sdf1


Step 4: Just ignore this step if you use RHL5. To configure it on RHL5 it is discussed on http://arjudba.blogspot.com/2008/08/on-rhl5-rawdevices-unrecognized-service.html
If you are using RHL4 then as the root user, on the node racnode1, enable the raw devices so that the mappings become effective at the operating system level using,
[root@racnode-1 ~]# service /etc/sysconfig/rawdevices start

If you are using RHL5 then you will get
[root@racnode-1 ~]# service rawdevices start
rawdevices: unrecognized service

To do it in RHL5 it is discussed in http://arjudba.blogspot.com/2008/08/on-rhl5-rawdevices-unrecognized-service.html

Step 5:
In the racnode-2 inform the OS of partition table changes. This is done by partprobe program that informs the operating system kernel of partition table changes, by requesting that the operating system re-read the partition table.

#/sbin/partprobe /dev/sdb
/sbin/partprobe /dev/sdc
/sbin/partprobe /dev/sdd
/sbin/partprobe /dev/sde
/sbin/partprobe /dev/sdf

This forces the operating system on the other node in the cluster to refresh its picture of the shared disk partitions.

Step 6:

On RHL4 for each node make an entry in /etc/sysconfig/rawdevices and use following command,
service rawdevices start
In RHL do as it is in http://arjudba.blogspot.com/2008/08/on-rhl5-rawdevices-unrecognized-service.html

Step 7:
As the root user, on each node in the cluster, enter commands similar to the following to set the owner, group, and permissions on the newly created device files:

chown root:oinstall /dev/raw/raw1
chown root:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 640 /dev/raw/raw1
chmod 640 /dev/raw/raw2
chmod 640 /dev/raw/raw3
chmod 640 /dev/raw/raw4
chmod 640 /dev/raw/raw5