1)vm–>setting–>hard disk–>add–>create virual disk–>click independent–>5gb–>finish
2) add more disk and restart server
#init 6
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
3)#n–>p–>1–>w
4)#fdisk -l
5)mkdir raw
vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
/dev/raw/raw4 /dev/sde1
6)#service rawdevices restart
chown oracle:oinstall /dev/raw/raw*
chmod 755 /dev/raw/raw*
7)
vi /etc/rc.local
chown oracle:oinstall /dev/raw/raw*
chmod 755 /dev/raw/raw*
8)check raw devices
[root@teng raw]# ls -lrt /dev/raw
total 0
crwxr-xr-x 1 oracle oinstall 162, 1 May 15 07:18 raw1
crwxr-xr-x 1 oracle oinstall 162, 2 May 15 07:18 raw2
crwxr-xr-x 1 oracle oinstall 162, 3 May 15 07:18 raw3
crwxr-xr-x 1 oracle oinstall 162, 3 May 15 07:18 raw4
9) just download and run below rpm for asm disk creation befor that u need to check ur
vm->setting->option->shared_folder ->ok
#cp -r /mnt/hgfs/ASMLib/ /home/oracle/
#cd /home/oracle/ASMLib/
#cd /media/Enterprise\ Linux\ dvd\ 20100405/Server/
rpm -Uvh oracleasm-support-2.1.3-1.el5.i386.rpm
rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm
10)/etc/init.d/oracleasm configure
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]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks: [ OK ]
Shutting down the Oracle ASMLib driver: [ OK ]
[root@teng raw]# ps -ef|grep oracleasm
root 27230 4673 0 12:58 pts/1 00:00:00 grep oracleasm
[root@teng raw]# /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]: oracle
Default group to own the driver interface [oinstall]:
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks:
[ OK ]
#init 6
11)#
/etc/init.d/oracleasm createdisk disk1 /dev/sdb1
/etc/init.d/oracleasm createdisk disk2 /dev/sdc1
/etc/init.d/oracleasm createdisk disk3 /dev/sdd1
/etc/init.d/oracleasm createdisk disk4 /dev/sde1
Marking disk “disk1” as an ASM disk: [ OK ]
[root@teng raw]# /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
12) for css initialize
[root@teng ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin
[root@teng bin]# ./localconfig add
13)check status of css
[root@teng bin]# ps -ef |grep css
14) #init 6
15)10g asm initialization file creation
cd $ORACLE_HOME/dbs
vi init+ASM.ora
instance_name=+ASM
instance_type=asm
asm_diskgroups=’DG1′
16) startup 10g asm instance
export ORACLE_SID=+ASM
sqlplus / as sysdba
startup
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup “DG1”
solution:-
SQL> create diskgroup DG1 external redundancy disk ‘/dev/raw/raw1’ size 5114m;
Diskgroup created.
SQL>FOR NORMAL
create diskgroup DG1 normal redundancy
failgroup FG1 disk ‘/dev/raw/raw1′,’/dev/raw/raw2’ size 5114m
failgroup FG2 disk ‘/dev/raw/raw3′,’/dev/raw/raw4’ size 5114m;
Diskgroup created.
17)SQL> shut immediate;
ASM diskgroups dismounted
ASM instance shutdown
18)SQL> startup;
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
19)FOR NORMAL
SQL> select name, state, type, total_mb, free_mb from v$asm_diskgroup;
NAME STATE TYPE TOTAL_MB FREE_MB
—————————— ———– —— ———- ———-
DG1 MOUNTED NORMAL 20456 20350
SQL> create tablespace tbs datafile ‘+dg1’ size 10m;
Tablespace created.
20)Listing client databases
The following command shows all the database instances connected to the ASM instance.
SQL> select INSTANCE_NAME,STATUS,SOFTWARE_VERSION,COMPATIBLE_VERSION from v$asm_client;
INSTANCE_NAME STATUS SOFTWARE_VERSION COMPATIBLE_VERSION
——————– ———— ——————– ——————–
kfc CONNECTED 10.2.0.1.0 10.2.0.0.0
SQL> select name, path, mode_status, state, disk_number from v$asm_disk;
NAME PATH MODE_ST STATE DISK_NUMBER
——————– —————————— ——- ——– ———–
ORCL:DISK1 ONLINE NORMAL 4
ORCL:DISK2 ONLINE NORMAL 5
ORCL:DISK3 ONLINE NORMAL 6
ORCL:DISK4 ONLINE NORMAL 7
DG1_0000 /dev/raw/raw1 ONLINE NORMAL 0
DG1_0001 /dev/raw/raw2 ONLINE NORMAL 1
FG12_0001 /dev/raw/raw4 ONLINE NORMAL 1
FG12_0000 /dev/raw/raw3 ONLINE NORMAL 0
8 rows selected.
…………………………………………………………………………………….
IF U DON’T WANT TO OCCUR THIS BELOW ERROR IN 15’TH STEP
U NEED USE THIS BELOW SCRIPT INSTEAD OF 15’TH STEP
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup “DG1”
15’TH SCRIPT STEP
export ORACLE_SID=+ASM
sqlplus / as sysdba
startup nomount;
create diskgroup DG1 external redundancy disk ‘/dev/raw/raw1’ size 5114m;
shut immediate;
startup;
………………………………………………………………………………………
21) SCRIPT MODE 10G ASM MANUAL DB CREATTION
vi db.sh
mkdir kfc
cd kfc
mkdir admin oradata
cd admin
mkdir pfile adump bdump cdump udump
cd ..
cd oradata
mkdir control log archive data
cd
cp /home/oracle/pf /home/oracle/kfc/admin/pfile/initkfc.ora
cd
export ORACLE_SID=kfc
sqlplus / as sysdba <<eof
startup pfile=’/home/oracle/kfc/admin/pfile/initkfc.ora’ nomount;
create database kfc
datafile ‘+DG1’ size 400m
sysaux datafile ‘+DG1’ size 300m
logfile group 1 ‘+DG1’ size 10m,
group 2 ‘+DG1’ size 10m;
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
create spfile from pfile=’/home/oracle/kfc/admin/pfile/initkfc.ora’;
vi pf
db_name=kfc
sga_target=600m
compatible=10.2.0
control_files=’+DG1′
audit_file_dest=’/home/oracle/kfc/admin/adump’
core_dump_dest=’/home/oracle/kfc/admin/cdump’
background_dump_dest=’/home/oracle/kfc/admin/bdump’
user_dump_dest=’/home/oracle/kfc/admin/udump’
22)run the db creation script this will create db.
sh db.sh
23)
note:-
SQL> show parameter control_file
NAME TYPE VALUE
———————————— ———– ——————————
control_file_record_keep_time integer 7
control_files string +DG1/kfc1/controlfile/current.
271.913266591, +DG1/kfc1/contr
olfile/current.270.913266593
SQL> create spfile from pfile=’/home/oracle/kfc/admin/pfile/initkfc.ora’;
File created.
SQL> create pfile from spfile;
File created.
24) restart the db will get the below error
SQL> startup force;
ORACLE instance started.
Total System Global Area 629145600 bytes
Fixed Size 1220964 bytes
Variable Size 171970204 bytes
Database Buffers 452984832 bytes
Redo Buffers 2969600 bytes
ORA-00205: error in identifying control file, check alert log for more info
solution:-
SQL> alter system set control_files=’+DG1/kfc/controlfile/current.257.913439613′ scope
2
SQL> alter system set control_files=’+DG1/kfc/controlfile/current.257.913439613′ scope=spfile;
System altered.
SQL>
SQL> startup force;
ORACLE instance started.
Total System Global Area 629145600 bytes
Fixed Size 1220964 bytes
Variable Size 171970204 bytes
Database Buffers 452984832 bytes
Redo Buffers 2969600 bytes
Database mounted.
Database opened.
25)if ur server is shut down when restart u need to run below
[root@teng ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/
[root@teng bin]# ./localconfig add
——>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>—————->>>>>>>>>>>>>>>>>>>>>>>>—————–
[oracle@teng ~]$ . .bash_profile
[oracle@teng ~]$ export ORACLE_SID=+ASM
[oracle@teng ~]$ asmcmd
ASMCMD> ls
DG1/
ASMCMD> DG1
commands:
——–
cd
du
find
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
ASMCMD> cd DG1
ASMCMD> ls
KFC/
ASMCMD> cd kfc
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
ASMCMD> cd controlfile
ASMCMD> ls
Current.256.917583353
Current.262.918355715
Current.267.918358463
Current.272.918365263
Current.276.918365369
ASMCMD>