Simulating ASM with 10g Database by faking the hardware

Simulating Asm by faking hardware

1. Faking Hardware

2. Instaling ASM Lib

3. Configuring the disks

4. Install DB & ASM instance

Faking Hardware:

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

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

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

Now we need to configure entries to the file “/etc/rc.local” so that these divices are

reinitialised on reboot also.

Add the following entries to the file “/etc/rc.local”

/sbin/losetup /dev/loop1 /asmdisk/disk1

/sbin/losetup /dev/loop2 /asmdisk/disk2

/sbin/losetup /dev/loop3 /asmdisk/disk3

/sbin/losetup /dev/loop4 /asmdisk/disk4

/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

Instaling ASM Lib

ASMLib is a support library for the Automatic Storage Management feature of Oracle

Database 10

g. 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

Pls download the Lib files accoring 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 <ENTER> 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 Instance

ASM 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

o Select Advanced Installation

o Click on Next

2. Specify Inventory Directory and Credentials

o Inventory Directory: /u01/app/oracle/oraInventory

o Operating System group name: oinstall

o Click on Next

3. Select Installation Type

o Select Enterprise Edition

o Click on Next

4. Specify Home Details

o Name: Ora10gAsm

o 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.

o Click on Next

5. Product-specific Prerequisite Checks

o 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.

o Click on Next

6. Select Configuration Option

o Select Configure Automatic Storage Management (ASM)

o Enter the ASM SYS password and confirm

o Click on Next

7. Configure Automatic Storage Management

o Disk Group Name: DATA

o 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.

o Add Disks

The disks you configured for use with ASMLib are listed as Candidate

Disks. Select each disk you wish to include in the disk group.

o Click on Next

8. Summary

o A summary of the products being installed is presented.

o Click on Install.

9. Execute Configuration Scripts

o 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.

o Click on OK when finished.

10. Configuration Assistants

o The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants

will run automatically

11. End of Installation

o 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

o Select Advanced Installation

o Click on Next

2. Select Installation Type

o Select Enterprise Edition

o Click on Next

3. Specify Home Details

o Name: OraDb10g

o Path: /u01/app/oracle/product/10.2.0/db

Note:Oracle recommends using a different ORACLE_HOME for the

database than the ORACLE_HOME used for ASM.

o Click on Next

4. Product-specific Prerequisite Checks

o 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.

o Click on Next

5. Select Configuration Option

o Select Create a Database

o Click on Next

6. Select Database Configuration

o Select General Purpose

o Click on Next

7. Specify Database Configuration Options

o Database Naming: Enter the Global Database Name and SID

o Database Character Set: Accept the default

o Database Examples: Select Create database with sample schemas

o Click on Next

8. Select Database Management Option

o Select Use Database Control for Database Management

o Click on Next

9. Specify Database Storage Option

o Select Automatic Storage Management (ASM)

o Click on Next

10. Specify Backup and Recovery Options

o Select Do not enable Automated backups

o Click on Next

11. Select ASM Disk Group

o Select the DATA disk group created in the previous section

o Click on Next

12. Specify Database Schema Passwords

o Select Use the same password for all the accounts

o Enter the password and confirm

o Click on Next

13. Summary

o A summary of the products being installed is presented.

o Click on Install.

14. Configuration Assistants

o The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants

will run automatically

15. Execute Configuration Scripts

o 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.

o Click on OK when finished.

16. End of Installation

o Make note of the URLs presented in the summary, and click on Exit when

ready.

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

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *