ASM
ASM
Views: 1. desc v$asm_diskgroup 2. desc v$asm_disk 3. desc v$asm_client 4. desc v$asm_disk_stat Automatic Storage Management (ASM) is a feature in Oracle Database 10g/11g that provides the database administrator with a simple storage management interface that is consistent across all server and storage platforms. The ASM functionality is controlled by an ASM instance. This is not a full database instance, just the memory structures and as such is very small and lightweight. The main components of ASM are disk groups, each of which comprise of several physical disks that are controlled as a single unit. The physical disks are known as ASM disks, while the files that reside on the disks are known as ASM files. The locations and names for the files are controlled by ASM. To create a database that uses storage managed by Automatic Storage Management, we must first start the ASM instance. However, an ASM instance does not require that a database instance is running. We can achieve RAID implementation at Oracle level with the help of ASM (from Oracle 10G), with ASM we can avoid such expenses since ASM is free with Oracle 10g software. RAID: redundant array of inexpensive drive the implementation of RAID will be possible at 3 levels. 1, Hardware level 2, Operating system level 3, Oracle level It will be more expensive implementation of RAID at hardware level and it needs more knowledge of system administration for operating system level RAID implementation. There is no cost for implementation of RAID at Oracle level, and is preferable for database administrators to implement RAID at Oracle level.
If one disk crashes then the show doesnt stop. ASM is only an instance with background processes and SGA only. And ASM supports not only regular database but also RAC(real application cluster) database. ASM included[takes care of] all files C/R/D, archives, rman backups, flashback log files, temp files, sp file . ASM Availability: Redundancy External Normal High No of failover groups 1 2 3
1.create four manual partitions. To create manual partitions: We need to login as root to make the manual partitions. 1. fdisk l #to see existing partitions. 2. fdisk /dev/sda 3. type m and enter to see the options. 4.type n to create new partition. 5. type enter once and specify the size +1000M and enter 6.repeat the 5th step three times to create four partitions. 7.type w and enter to save it. 8. partprobe #to take effect of partitions immediately. 9.fdisk l #to see the existing partitions.
10.chown R oracle:oinstall /dev/sda6 /dev/sda7 /dev/sda8 /dev/sda9 Prepare the directory structure: #su - oracle $cd $mkdir asm $cd asm $mkdir udump cdump bdump Go to default location of parameter files. Prepare the asm parameter. $cd $ORACLE_HOME/dbs $vi init+ASM.ora instance_type=asm instance_name=+ASM asm_diskstring='/dev/sda6','/dev/sda7','/dev/sda8','/dev/sda9' shared_pool_size=100M
background_dump_dest='/home/oracle/asm/bdump' user_dump_dest='/home/oracle/asm/udump' core_dump_dest='/home/oracle/asm/cdump' :wq $cd Enter into root account: $su root #cd /home/oracle/oracle/product/10.2.0/db_1/bin #sh localconfig add #cluster synchronization service. #ps ef |grep css Login into as oracle. #su - oracle $crsctl check css # to check the status. Export the ASM instance: $export ORACLE_SID=+ASM $sqlplus / as sysdba >startup nomunt; # it will read the parameter file. >create diskgroup dgrp1 normal redundancy failgroup f1 disk '/dev/sda6','/dev/sda7' failgroup f2 disk '/dev/sda8','/dev/sda9'; >select GROUP_NUMBER,NAME from v$asm_diskgroup; >shutdown immediate; >startup nomount; >alter diskgroup dgrp1 mount; >alter diskgroup dgrp1 add directory '+dgrp1/prod1'; >alter diskgroup dgrp1 add directory '+dgrp1/prod1/control'; >alter diskgroup dgrp1 add directory '+dgrp1/prod1/data';
>alter diskgroup dgrp1 add directory '+dgrp1/prod1/log'; >exit $asmcmd # to login into the asm diskgroup. ASMCMD>ls ASMCMD>cd dgrp1 ASMCMD>cd prod1/data ASMCMD>exit Prepare the parameter file to create the database. $cd $ORACLE_HOME/dbs $vi initprod1.ora control_files='+dgrp1/prod1/control/control.ctl','+dgrp1/prod1/control/control1.ctl' db_name=prod1 instance_name=prod1 background_dump_dest='/home/oracle/prod1/bdump' core_dump_dest='/home/oracle/prod1/cdump' user_dump_dest='/home/oracle/prod1/udump' sga_max_size=600M sga_target=512M compatible=10.2.0 undo_management=Auto undo_tablespace=undotbs :wq $cd Create directory structure: $mkdir prod1 $cd prod1
$mkdir udump cdump bdump arch $vi dbcreation.sql create database prod1 datafile '+dgrp1/prod1/data/system.dbf' size 200M autoextend on sysaux datafile '+dgrp1/prod1/data/sysaux.dbf' size 20M autoextend on default tablespace users datafile '+dgrp1/prod1/data/userdata.dbf' size 10M autoextend on undo tablespace undotbs datafile '+dgrp1/prod1/data/undotbs.dbf' size 10M autoextend on default temporary tablespace temp tempfile '+dgrp1/prod1/data/temp.dbf' size 10M autoextend on logfile group 1('+dgrp1/prod1/log/redolog01.log','+dgrp1/prod1/log/redolog02.log') size 10M, group 2('+dgrp1/prod1/log/redologa1.log','+dgrp1/prod1/log/redologa2.log') size 10M reuse; :wq $export ORACLE_SID=prod1 $sqlplus / as sysdba >startup nomount; >@dbcreation.sql #here we should see a statement of database created >@?/rdbms/admin/catalog.sql >@?/rdbms/admin/catproc.sql >conn system/manager >@?/sqlplus/admin/pupbld.sql >exit $cd $ORACLE_HOME/dbs $vi init+ASM.ora
Asm_diskgroups=dgrp1 :wq $export ORACLE_SID=prod1 $sqlplus / as sysdba >shutdown immediate >startup; $export ORACLE_SID=+ASM $asmcmd # to login into the asm diskgroup. ASMCMD>ls ASMCMD>cd dgrp1 ASMCMD>cd prod1/data ASMCMD>ls Before shutting down the ASM instance we must first shutdown the rdbms instance(prod1)
Trouble shooting: ORA-15032: not all alterations performed ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DGRP1" Here we need to give permission to raw devices. Ex: chown -R oracle:oinstall /dev/sda6 /dev/sda7 /dev/sda8 /dev/sda9
Dropping database along with disk groups: On rdbms instance: > startup mount restrict; >drop database;