Wednesday, May 9, 2018

ASM DISK setup

 [root@rac1 ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb
[root@rac1 ~]# ls -l /dev/sd*          
brw-rw---- 1 root disk 8,  0 May  4 16:40 /dev/sda
brw-rw---- 1 root disk 8,  1 May  4 16:40 /dev/sda1
brw-rw---- 1 root disk 8,  2 May  4 16:40 /dev/sda2
brw-rw---- 1 root disk 8, 16 May  4 16:40 /dev/sdb
[root@rac1 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3ba15934.                    
Changes will remain in memory only, until you decide to write them.              
After that, of course, the previous content won't be recoverable.                

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to 
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-522, default 522):
Using default value 522

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]# ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 May  4 16:40 /dev/sda
brw-rw---- 1 root disk 8,  1 May  4 16:40 /dev/sda1
brw-rw---- 1 root disk 8,  2 May  4 16:40 /dev/sda2
brw-rw---- 1 root disk 8, 16 May  4 16:58 /dev/sdb
brw-rw---- 1 root disk 8, 17 May  4 16:58 /dev/sdb1

oracleasm createdisk DISK1 /dev/sdb1
Writing disk header: done
Instantiating disk: done

[root@rac1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac1 ~]#
 oracleasm listdisks
DISK1
[root@rac1 ~]#vi /etc/scsi_id.config
options=-g

[root@rac1 ~]# /sbin/scsi_id -g -u -d /dev/sdb
1ATA_VBOX_HARDDISK_VB9357ce3b-21d92e85

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB9357ce3b-21d92e85", NAME="asm_disk1", OWNER="oracle", GROUP="dba", MODE="0660"


installation Grid

installation db binary
dbca


. oraenv
ORACLE_SID = [oracle] ? racdb
The Oracle base has been set to /u01/app/oracle
[oracle@rac1 bin]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/RACDB/PARAMETERFILE/spfile.270.975274745
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA
Services:
OSDBA group:
OSOPER group:
Database instance: racdb
[oracle@rac1 bin]$ srvctl status database -d racdb
Database is running.
[oracle@rac1 bin]$
. oraenv
ORACLE_SID = [racdb] ? racdb
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac1 bin]$ srvctl stop database -d racdb

$srvctl stop asm -force




No comments: