Monday, May 5, 2008

Installation of Oracle 10g ASM FULL DOC on Linux RHEL – 4

cd /lib
rpm -Uvh oracleasm-support-2.0.3-1.i386.rpm \
> oracleasmlib-2.0.2-1.i386.rpm \ oracleasm-2.6.9-42.ELsmp-2.0.3-1.i6


usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle
[root@cdr-master_test lib]# id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)


vi /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax =536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144






vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

vi /etc/profile

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi


mkdir -p /u01/oracle
chown -R oracle:oinstall /u01/oracle
chmod -R 775 /u01/oracle

mkdir -p /u02/oracle
chown -R oracle:oinstall /u02/oracle
chmod -R 775 /u02/oracle

# export DISPLAY=10.13.3.102:0.0

vi .bash_profile -----add
umask 022



parted /dev/cciss/c0d2 ----LINUX
print ---PARTED
mkpart primary ext3 1 10240 ----PARTED
cat /proc/partitions ---LINUX
/sbin/mkfs -t ext3 /dev/cciss/c0d2p1 ---LINUX



parted /dev/cciss/c0d2 ----LINUX
print ---PARTED
mkpart primary ext3 10241 20481 ---PARTED
cat /proc/partitions ---LINUX
/sbin/mkfs -t ext3 /dev/cciss/c0d2p2 ---LINUX



Step 1) Here we create 4 zero-filed files using the DD comand
As "root" run the following commands, this will create 4 files of 2Gb each.
cat /proc/partitions
mkdir /asmdisk
dd if=/dev/zero of=/asmdisk/disk1 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk2 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk3 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk4 bs=1024k count=2000
dd if=/dev/zero of=/asmdisk/disk5 bs=1024k count=500

Step 2) Use the loopback device to assign these disks.
/sbin/losetup /dev/loop1 /asmdisk/disk1
/sbin/losetup /dev/loop2 /asmdisk/disk2
/sbin/losetup /dev/loop3 /asmdisk/disk3
/sbin/losetup /dev/loop4 /asmdisk/disk4
/sbin/losetup /dev/loop5 /asmdisk/disk5

Now we need to configure entries to the file "/etc/rc.local" so that these divices are re-initialised on reboot also.
Add the following entries to the file "/etc/rc.local"
/etc/init.d/oracleasm createdisk ASM1 /dev/loop1/etc/init.d/oracleasm createdisk ASM2 /dev/loop2/etc/init.d/oracleasm createdisk ASM3 /dev/loop3/etc/init.d/oracleasm createdisk ASM4 /dev/loop4


###### To delete /sbin/losetup -d /DEV/loop1


Instaling ASM Lib
ASMLib is a support library for the Automatic Storage Management feature of Oracle Database 10g. ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. ASMlib are provided by Oracle from below link : http://www.oracle.com/technology/tech/linux/asmlib/index.html
Please download the Lib files according to your OS & kernel version.
[root@csstage root]# uname -r
2.4.21-27.EL
It gives 3 rpms for download as per the version , pls install then using below command
[root@csstage asm]# rpm –ivh *.rpm
After this completes we go to next step of configuring the disks.
Configuring the ASM Lib & disks
Now we need to use the ASM Lib, configure it & configure the disks accordingly.
[root@csstage root]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver:
This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). Hitting without typing an answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
Now as the ASM Lib are configured, we will configure the disks:
[root@csstage root]# /etc/init.d/oracleasm createdisk ASM1 /dev/loop1
Marking disk "/dev/loop1" as an ASM disk: [ OK ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM2 /dev/loop2
Marking disk "/dev/loop2" as an ASM disk: [ OK ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM3 /dev/loop3
Marking disk "/dev/loop3" as an ASM disk: [ OK ]

[root@csstage root]# /etc/init.d/oracleasm createdisk ASM4 /dev/loop4
Marking disk "/dev/loop4" as an ASM disk: [ OK ]
So, now our hardware is all set to go & we need to install 10g database on the server using the above disks.
Install DB & ASM instance
Now we install the Database with ASM option
Create the ASM InstanceASM runs as a separate Oracle instance, which can be created and configured using OUI. Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance. Log in as oracle and start runInstaller:
$ ./runInstaller
1. Select Installation Method- Select Advanced Installation- Click on Next

2. Specify Inventory Directory and Credentials - Inventory Directory: /u01/app/oracle/oraInventory- Operating System group name: oinstall- Click on Next


3. Select Installation Type- Select Enterprise Edition- Click on Next

4. Specify Home Details- Name: Ora10gAsm- Path: /u01/app/oracle/product/10.2.0/asm


Note:Oracle recommends using a different ORACLE_HOME for ASM than the ORACLE_HOME used for the database for ease of administration.
- Click on Next


5. Product-specific Prerequisite Checks - If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. - Click on Next


6. Select Configuration Option- Select Configure Automatic Storage Management (ASM)- Enter the ASM SYS password and confirm- Click on Next


7. Configure Automatic Storage ManagementDisk Group Name: DATA- Redundancy-- High mirrors data twice.-- Normal mirrors data once. This is the default.-- External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy.- Add DisksThe disks you configured for use with ASMLib are listed as Candidate Disks. Select each disk you wish to include in the disk group.- Click on Next


8. Summary - A summary of the products being installed is presented.- Click on Install.


9. Execute Configuration Scripts- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.- Click on OK when finished.


10. Configuration Assistants- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically


11. End of Installation - Make note of the URLs presented in the summary, and click on Exit when ready.


12. Congratulations! Your new Oracle ASM Instance is up and ready for use.



Create the Database:
Once the ASM instance has been created, create a database that uses ASM for storage:
Log in as oracle and start runInstaller: $ ./runInstaller
1. Select Installation Method- Select Advanced Installation- Click on Next
2. Select Installation Type- Select Enterprise Edition- Click on Next
3. Specify Home Details- Name: OraDb10g- Path: /u01/app/oracle/product/10.2.0/dbNote:Oracle recommends using a different ORACLE_HOME for the database than the ORACLE_HOME used for ASM.- Click on Next
4. Product-specific Prerequisite Checks - If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. - Click on Next
5. Select Configuration Option- Select Create a Database- Click on Next
6. Select Database Configuration- Select General Purpose- Click on Next
7. Specify Database Configuration Options- Database Naming: Enter the Global Database Name and SID- Database Character Set: Accept the default- Database Examples: Select Create database with sample schemas- Click on Next
8. Select Database Management Option- Select Use Database Control for Database Management- Click on Next
9. Specify Database Storage Option- Select Automatic Storage Management (ASM)- Click on Next
10. Specify Backup and Recovery Options- Select Do not enable Automated backups- Click on Next
11. Select ASM Disk Group- Select the DATA disk group created in the previous section- Click on Next
12. Specify Database Schema Passwords- Select Use the same password for all the accounts- Enter the password and confirm- Click on Next
13. Summary - A summary of the products being installed is presented.- Click on Install.


14. Configuration Assistants- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
15. Execute Configuration Scripts- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.- Click on OK when finished.

16. End of Installation - Make note of the URLs presented in the summary, and click on Exit when ready.
The following J2EE Applications have been deployed and are accessible at the URLs listed below.
iSQL*Plus URL:
http://cdr-master_test:5562/isqlplus

iSQL*Plus DBA URL:
http://cdr-master_test:5562/isqlplus/dba

Enterprise Manager 10g Database Control URL:
http://cdr-master_test:1158/em

17. Congratulations! Your new Oracle Database is up and ready for use.






Note: In between the installation , You might be asked to start CSS Deamon , if you havent already done.To start the CSS daemon and configure the host to always start the daemon upon reboot, do the following:
1. Log in to the host as root.
2. Ensure that $ORACLE_HOME/bin is in your PATH environment variable.
3. Enter the following command: localconfig add


Start the ASM instance:
$ export ORACLE_SID=+ASM
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 3 00:28:09 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> select group_number,disk_number,name,state,mode_status,mount_status,total_mb from v$asm_disk;

G# D# NAME STATE MODE_ST MOUNT_S TOTAL_MB
---- ---------- ----------
1 0 ASM1 NORMAL ONLINE CACHED 2000
1 1 ASM2 NORMAL ONLINE CACHED 2000
1 2 ASM3 NORMAL ONLINE CACHED 2000
1 3 ASM4 NORMAL ONLINE CACHED 2000
1 4 ASM5 NORMAL ONLINE CACHED 2000
2 0 ASM6 NORMAL ONLINE CACHED 2000
2 1 ASM7 NORMAL ONLINE CACHED 1000

1 comment:

Anonymous said...

This is very good article. step by step so that all can be benefited by this document. Thanks to Hakky for this awesome writing.

Monzur
Bangladesh