ASM Installation steps





Automatic Storage Management

storage collection  of  physical  diskgroups  and diskgroup is collection   of disks
To prepare  of  this  asm disk group required asm library software  in Redhat linux  .

Asm  is  software to manage this  disk groups

Files  are stored with  respective  disk group

+DATA /Datafile/db1.dbf
+ARCHIVE/Archive/db.arc   

Striping :whever  a file  created or stored in asm diskgroup these files spread across disks in disgroup this is called and  this is called  I/O Load  balancing  and at  any time we can  add  disk  and  remove the disk from diskgroup  with out down time .


Asm  also  support   fault tolerance even some disks  diamaged   database   should able  to  

These  redundancy  are  3types

External
Normal
HIgh

After  12.1x will  have  
Flex redundancy



To create the partition
# Fdisk –l
# Fdisk  /dev/sdb

Changing  the owner ship of the partition
# Chown –R oracle:dba /dev/sdb*
# Chmod -R 775 /dev/sdb* 


Install Grid infrastructure s/w (GRID ASM)

Starting the instance and creating the diskgroup
   $export ORACLE_SID=+ASM
    $sqlplus / as sysasm

Sql> startup nomount
Sql> select name,path from v$asm_disk;

Creating of the diskgroup
Sql> create diskgroup dg1 external redundancy disk ‘/dev/sdb1’,’/dev/sdb2’;
Sql> create diskgroup dg1 disk ‘/dev/sdb1’,’/dev/sdb2’;
Sql> create diskgroup dg1 high redundancy disk ‘/dev/sdb1’, ’/dev/sdb2’, ’/dev/sdb3’;
Sql> select name,state from v$asm_diskgroup;
Sql> create diskgroup dg1 normal redundancy 
failgroup fg1 disk ‘/dev/sdb1’,’/dev/sdb2’ 
failgroup fg2 disk ‘/dev/sdb3’,’/dev/sdb4’;

Altering the diskgroup
sql> alter diskgroup dg1 mount;
sql>alter diskgroup dg1 dismount;
Sql> alter diskgroup dg1 add disk ‘/dev/sdb3’;
Sql> select name,path from v$asm_disk;
Sql> alter diskgroup dg1 drop disk DG1_0003;

Creating the tablespace with diskgroup
Sql> create tablespace hz datafile ‘+dg1/demo/datafile/hz01.dbf’ size 1g;


Utility to manage the diskgroup
$asmcmd 
$asmca

views
v$asm_diskgroup
v$asm_volume
v$asm_client
v$asm_disk
v$asm_file



DATABASE MIGRATION FROM NON-ASM TO ASM


First we have to take the backup
Export ORACLE_SID=demo
$Rman target / nocatalog
Rman> backup as copy database format ‘+dg1’;
Rman> run
{
  Shutdown immediate;
  Startup mount;
}
Switch the database to backup 
Rman> switch database to copy;
Rman> recover database;
Rman> sql ‘alter database open’;
Rman> backup as copy current controlfile format ‘+dg1’;
Sql> alter system set control files=’+dg1/demo/control file/backup.267.3455’ scope=spfile;
Sql> shut immediate;
Sql> startup mount;
Sql>recover database  using backup controlfile until cancel;
Sql> alter database open resetlogs;
Sql> alter database add logfile group 3(‘+dg1/demo/log/redo04.log’) size 50m;
Sql> alter database add logfile group 4(‘+dg1/demo/log/redo04.log’) size 50m;
Sql>alter database drop logfile group 1;
Sql> alter database drop logfile group 2;
Sql> create spfile=’+dg1/demo/spfiledemo.ora’ from pfile;
Sql> shut immediate;
$cd $ORACLE_HOME/dbs
$vi initdemo.ora
Spfile=’+dg1/demo/spfiledemo.ora’
Sql> startup 


Comments

Popular posts from this blog

How to check OS inventory