Saturday, 9 April 2016

Creating ASM Instance and diskgroups manually without DBCA

create the password file :
[oracle@oracleasm1 dbs]$ orapwd file=orapw+ASM1 password=oracle entries=5

create required directories :
[oracle@oracleasm1 dbs]$ cd $ORACLE_BASE
[oracle@oracleasm1 oracle]$ cd admin/
[oracle@oracleasm1 admin]$ mkdir +ASM1

[oracle@oracleasm1 admin]$ cd +ASM1/
[oracle@oracleasm1 +ASM1]$ mkdir bdump
[oracle@oracleasm1 +ASM1]$ mkdir udump
[oracle@oracleasm1 +ASM1]$ mkdir dump
[oracle@oracleasm1 +ASM1]$ mkdir cdump
[oracle@oracleasm1 +ASM1]$ mkdir pfile


Create the init+ASM1.ora file:


Using vi editor or any other editor you like, create the init+ASM1.ora file under the $ORACLE_HOME/dbs directory and add the below lines into this file.

[oracle@oracleasm1 dbs]$ vi init+ASM1.ora

#background_dump_dest='/u01/app/oracle/admin/+ASM1/bdump'  //commented
core_dump_dest='/u01/app/oracle/admin/+ASM1/cdump'
instance_type='asm'
large_pool_size=12M
remote_login_passwordfile='SHARED'
#user_dump_dest='/u01/app/oracle/admin/+ASM1/udump'                  //commented

start the instance using that file :

[oracle@oracleasm1 dbs]$ . oraenv
ORACLE_SID = [orcl] ? +ASM1
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/grid
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
[oracle@oracleasm1 dbs]$ rlwrap sqlplus / as sysasm

SQL> startup pfile='/u01/app/oracle/product/11.2.0/grid/dbs/init+ASM1.ora' ;
ASM instance started

Total System Global Area  284565504 bytes
Fixed Size                    1336036 bytes
Variable Size                        258063644 bytes
ASM Cache                 25165824 bytes
ORA-15110: no diskgroups mounted


SQL> alter system set asm_diskstring='/dev/oracleasm/disks';

System altered.

SQL> select name,path,state,mount_status,header_status,group_number from v$asm_disk;
SQL> alter system set asm_diskgroups='NEWDATA','DATA';

System altered.

SQL> create diskgroup data_disk_grp
  2  disk '/dev/oracleasm/disks/NEWDATA' , '/dev/oracleasm/disks/DATAVOL1' ;
create diskgroup data_disk_grp
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15033: disk '/dev/oracleasm/disks/DATAVOL1' belongs to diskgroup "DATA"

SQL> create diskgroup data_disk_grp
  2  disk '/dev/oracleasm/disks/NEWDATA' , '/dev/oracleasm/disks/DATAVOL1'  force;
Diskgroup created.

SQL> set linesize 100
SQL> col path format a30
SQL> select name, path from v$asm_disk where name is not null;

NAME                                          PATH
------------------------------      --------------------------------------------
DATA_DISK_GRP_0000        /dev/oracleasm/disks/NEWDATA
DATA_DISK_GRP_0001        /dev/oracleasm/disks/DATAVOL1

SQL>


SQL> select name, type, total_mb, free_mb from v$asm_diskgroup;

NAME                                          TYPE      TOTAL_MB    FREE_MB
------------------------------ ------ ---------- ----------
DATA                                                                   0    0
DATA_DISK_GRP                     NORMAL             12283      12181


Open the /etc/oratab file and add the following line at the end:

[oracle@oracleasm1 ~]$ vi /etc/oratab

+ASM1:/u01/app/oracle/product/11.2.0/grid:N


1 comment:

  1. Great post, did you mean [oracle@oracleasm1 +ASM1]$ mkdir adump instead of [oracle@oracleasm1 +ASM1]$ mkdir dump?

    ReplyDelete