With each new release of Oracle it becomes more evident that it’s a product that can operate independently, the Automatic Storage Management feature is an example of this.
Using Oracle’s ASM feature makes it possible to manage a disk regardless of its file system (such as FAT32, NTFS, EXT2, EXT3, etc).
Excluding intermediary file system results in better performance of block level read/write operations and load balancing.
There are 3 fault tolerance options available to DBAs:
1. External: Duties of fault tolerance are left to the DBA, in effect telling the DBMS that there is a Fault Tolerant RAID architecture in place and that the DBMS should use the disks for performance (RAID 0 striped).
2. Normal: There is a storage structure similar to RAID 1 (mirror) in use, however only the extents are copied, instead of creating a copy of the entire disk.
3. High: The same data is mirrored (not a RAID mirror) on 3 separate disks. This, of course, requires 3 separate disks. There won’t be a loss of data even if there is a failure on 2 disks. In this situation, it is highly recommended that the faulty disks are changed as soon as possible.
A partition is created and mounted directly on to Oracle, datafies are written directly on to this partition followed by the datafile no longer having a name.
Differences between the ASM and file system are explained more clearly below:
Server using the file system
1 2 3 4 5 |
select file_name from dba_data_files; FILE_NAME ---------------------------------------------- /u01/app/oracle/oradata/smp/users01.dbf /u01/app/oracle/oradata/smp/sysaux01.dbf |
Server using ASM
1 2 3 4 5 |
select file_name from dba_data_files; FILE_NAME --------------------------------------- +DATA/orcl/datafile/users.259.729863957 +DATA/orcl/datafile/sysaux.257.729863955 |
Setup
The system is prepared for setting up Oracle (please refer to the Oracle 10g setup (RHEL) article)
Use fdisk to make the partitions on the disk, they should be formatted before being mounted (please refer to the Oracle 10g setup (RHEL) article)
Install the ASM packages (rpm)
1 2 |
rpm -Uvh oracleasm-support-2.0.0-1.i386.rpm oracleasmlib-2.0.0-1.i386.rpm oracleasm-2.4.9-e.27enterprise-1.0.4-1.i686.rpm http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html |
Add the following lines to /etc/rc.local
1 2 3 4 5 |
chown oracle:oinstall /dev/sdx1chown oracle:oinstall /dev/sdy1 chown oracle:oinstall /dev/sdz1 chmod 600 /dev/sdx1 chmod 600 /dev/sdy1 chmod 600 /dev/sdz1 |
Configure oracleasm
1 |
service oracleasm configure |
(as the root)the prompted questions should be answered in the following sequence:
1 2 3 |
oracle oinstall y |
Naming the disk groups
1 2 3 4 5 6 |
# service oracleasm createdisk D1 /dev/sdb1 service oracleasm createdisk D1 /dev/sdc1 service oracleasm createdisk FRA /dev/sdd1 service oracleasm scandisks service oracleasm listdisks service oracleasm querydisk /dev/sdx |
To delete
1 |
service oracleasm deletedisk d1 |
At this point Oracle Setup begins and the disks can be viewed using the <em>config asm</em> command.
To add a disk after creating a database or a database instance
1. Physically install the disk on to the hardware, mount and create partitions using fdisk.
2. Add the following lines to the /etc/rc.local file
1 2 |
chown oracle:oinstall /dev/sdx1 chmod 600 /dev/sdx1 |
3.
The following command, as a root user, mounts the disk to the ASM
1 |
# service oracleasm createdisk d3 /dev/sdx1 |
4.
1 |
ALTER DISKGROUP DATA ADD FAILGROUP D3 DISK 'ORCL:D3' NAME D3 SIZE 3067 M |
or
1 |
ALTER DISKGROUP DATA ADD FAILGROUP D3 DISK 'ORCL:D3' NAME D3 |
or
1 |
ALTER DISKGROUP recovery ADD FAILGROUP FRA2 DISK 'ORCL:FRA2' NAME FRA2; |
or
1 |
ALTER DISKGROUP RECOVERY ADD DISK 'ORCL:FRA2' SIZE 3067 M |
In our example scenario there were 2 groups, 1. Data and 2. Recovery. The name of the Oracle instance is orcl.
A 3Gb disk was added and included in the data group using the above syntax (4).
Note: ALTER DISKGROUP DATA DROP DISK D3 will remove or drop the disk.
Setting disks, located on separate SCSI controllers, as each others failgroups prevents problems that can arise due to controller failure.
1 2 3 4 |
DisksA1 /dev/sdf1 CONTROLLER1 A2 /dev/sdg1 CONTROLLER1 B1 /dev/sdh1 CONTROLLER2 B2 /dev/sdi1 CONTROLLER2 |
Commands to be entered as the root user
1 2 3 4 |
service oracleasm createdisk A1 /dev/sdf1 service oracleasm createdisk A2 /dev/sdg1 service oracleasm createdisk B1 /dev/sdh1 service oracleasm createdisk B2 /dev/sdi1 |
sentences to be added to rc.local
1 2 3 4 |
chown oracle:oinstall /dev/sdf1 chown oracle:oinstall /dev/sdg1 chown oracle:oinstall /dev/sdh1 chown oracle:oinstall /dev/sdi1 |
1 2 3 4 |
chmod 600 /dev/sdf1 chmod 600 /dev/sdg1 chmod 600 /dev/sdh1 chmod 600 /dev/sdi1 |
create diskgroup Disk_Group_A normal redundancy
1 2 3 4 5 6 7 |
failgroup controller1 DISK 'ORCL:A1', 'ORCL:A2' FAILGROUP controller2 DISK 'ORCL:B1', 'ORCL:B2'; ALTER DISKGROUP DGROUPA DROP DISK A1 |
Creating an ASM user for an ASM instance makes administration easier
As a root user
Create an asm user by adding a user to the oinstall, dba and asmadmin groups.
1 |
useradd -g oinstall -G dba, oper, asmadmin asm |
Assigning a password to an asm user.
1 |
passwd asm |
Add the following lines to the /home/asm/.bash_profile file
1 2 3 4 5 6 7 8 9 |
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME ORACLE_SID=+ASM; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib/oracle/10.2.0.4/client/lib/; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:/opt/SDK1/jdk/; export CLASSPA JAVA_HOME=/opt/SDK1/jdk/; export JAVA_HOME PATH=$PATH:/opt/SDK1/jdk/bin;export PATH |
Connecting to an ASM instance and starting up
1 2 3 |
export ORACLE_SID='+ASM'sqlplus /nolog conn as sysdba startup; |
Controlling the CSSD status
1 |
crsctl check cssd |
Disk group information
1 2 3 4 5 6 7 8 9 10 |
set lines 100col name format a10 col path format a30 select name , group_number , disk_number , mount_status , state , path from v$asm_disk order by group_number |
Disk usage
1 2 3 4 5 6 7 |
select name , group_number , disk_number , total_mb , free_mb from v$asm_disk order by group_number |
Creating disk groups
1 2 3 |
create diskgroup data1 external redundancy disk '/dev/raw/raw1' |
1 2 3 4 |
create diskgroup data2 external redundancy disk '/dev/raw/raw2' , '/dev/raw/raw3' |
1 2 3 4 |
create diskgroup data3 normal redundancy failgroup controller1 disk '/dev/raw/raw4' failgroup controller2 disk '/dev/raw/raw6' |
Adding a disk to a group
1 2 |
alter diskgroup data1 add disk '/dev/raw/raw4' |
Dropping (deleting) a diskgroup
1 |
drop diskgroup '' |
Checking the situation of the balance operation
1 |
select * from v$asm_operation |
Mounting/Dismounting disk groups
1 2 3 4 |
alter diskgroup all mount alter diskgroup data1 mount alter diskgroup all dismount alter diskgroup data1 dismount |
Checking the consistency of the disk groups
1 |
alter diskgroup data1 check all |
Running tests (on databases that aren’t in archive mode)
The examples here show some of ASM’s capabilities:
3 disks: D1 (5Gb capacity), D2 (5Gb) and D3 (2Gb) are about to be included in the DATA disk group.
The type of disk group is set to normal (redundancy), i.e. the same data is written on to 2 separate disks.
Disk D3 (with a 2Gb capacity) gets deleted (physically removed from the server), the db continues to be operational.
The resulting messages that appear on +ASM’s alertlog:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
status:2 WARNING: IO Failed. au:0 diskname:ORCL:D3 rq:0xb7f562a8 buffer:0xb7eeca00 au_offset(bytes):0 iosz:4096 operation:0 status:2 WARNING: IO Failed. au:0 diskname:ORCL:D3 rq:0xb7f562a8 buffer:0xb7eeca00 au_offset(bytes):0 iosz:4096 operation:0 status:2 WARNING: IO Failed. au:0 diskname:ORCL:D3 rq:0xb7f562a8 buffer:0xb7eeca00 au_offset(bytes):0 iosz:4096 operation:0 status:2 Messages output on the database instance's alertlog: WARNING: failed to write mirror side 0 of virtual extent 0 of file 260 in group 1 WARNING: process 9020 initiating offline of disk 2.3916004244 (D3) with mask 0x3 in group 1 Tue Sep 21 10:19:30 EEST 2010 SUCCESS: disk D3 (2.3916004244) dropped from diskgroup DATA The database continues running issues, however disk D3 is no longer visible within the group. Shutdown and restart the database to test it. Shutdown: First, shutdown the instance of database instance (orcl). No issues. Followed by shutting down the +ASM instance. No issues. Restart: Starting the +ASM instance. No issues. Start the database instance. No issues. There are now 2 x 5Gb disks remaining on the DATA disk group. One of these disks get dropped. The db continues to function as normal. Messages on the +ASM alertlog: NOTE: recovering COD for group 1/0xea3dce80 (DATA) SUCCESS: completed COD recovery for group 1/0xea3dce80 (DATA) NOTE: recovering COD for group 2/0xea5dce81 (RECOVERY) SUCCESS: completed COD recovery for group 2/0xea5dce81 (RECOVERY) Tue Sep 21 10:49:02 EEST 2010 Starting background process ASMB ASMB started with pid=13, OS id=14456 Tue Sep 21 10:49:18 EEST 2010 NOTE: ASMB process exiting due to lack of ASM file activity for 10 seconds Tue Sep 21 10:54:58 EEST 2010 WARNING: process 14850 initiating offline of disk 1.3916250737 (D2) with mask 0x3 in group 1 WARNING: Disk 1 in group 1 in mode: 0x7,state: 0x2 will be taken offline NOTE: PST update: grp = 1, dsk = 1, mode = 0x6 Tue Sep 21 10:54:58 EEST 2010 NOTE: group DATA: relocated PST to: disk 0000 (PST copy 0) Tue Sep 21 10:54:58 EEST 2010 NOTE: PST update: grp = 1, dsk = 1, mode = 0x4 Tue Sep 21 10:54:58 EEST 2010 NOTE: group DATA: relocated PST to: disk 0000 (PST copy 0) NOTE: cache closing disk 1 of grp 1: D2 Tue Sep 21 10:55:59 EEST 2010 WARNING: PST-initiated drop disk 1(3929919104).1(3916250737) (D2) NOTE: PST update: grp = 1 Tue Sep 21 10:55:59 EEST 2010 NOTE: group DATA: relocated PST to: disk 0000 (PST copy 0) Tue Sep 21 10:55:59 EEST 2010 NOTE: requesting all-instance membership refresh for group=1 Tue Sep 21 10:55:59 EEST 2010 NOTE: membership refresh pending for group 1/0xea3dce80 (DATA) SUCCESS: refreshed membership for 1/0xea3dce80 (DATA) Tue Sep 21 10:56:04 EEST 2010 SUCCESS: PST-initiated disk drop completed SUCCESS: PST-initiated disk drop completed Tue Sep 21 10:56:09 EEST 2010 NOTE: starting rebalance of group 1/0xea3dce80 (DATA) at power 1 Starting background process ARB0 ARB0 started with pid=18, OS id=14934 Tue Sep 21 10:56:09 EEST 2010 NOTE: assigning ARB0 to group 1/0xea3dce80 (DATA) NOTE: stopping process ARB0 Tue Sep 21 10:56:13 EEST 2010 SUCCESS: rebalance completed for group 1/0xea3dce80 (DATA) Tue Sep 21 10:56:13 EEST 2010 SUCCESS: rebalance completed for group 1/0xea3dce80 (DATA) NOTE: PST update: grp = 1 Tue Sep 21 10:56:13 EEST 2010 NOTE: group DATA: relocated PST to: disk 0000 (PST copy 0) Tue Sep 21 10:56:13 EEST 2010 WARNING: offline disk number 1 has references (1046 AUs) NOTE: PST update: grp = 1 Tue Sep 21 10:56:13 EEST 2010 NOTE: group DATA: relocated PST to: disk 0000 (PST copy 0) Tue Sep 21 11:57:36 EEST 2010 WARNING: IO Failed. au:0 diskname:ORCL:D3 rq:0xb7f76494 buffer:0xb7ef2c00 au_offset(bytes):0 iosz:4096 operation:0 status:2 WARNING: IO Failed. au:0 diskname:ORCL:D3 rq:0xb7f76494 buffer:0xb7ef2c00 au_offset(bytes):0 iosz:4096 operation:0 status:2 WARNING: IO Failed. au:0 diskname:ORCL:D2 rq:0xb7f760bc buffer:0xb7f03c00 au_offset(bytes):0 iosz:4096 operation:0 status:2 WARNING: IO Failed. au:0 diskname:ORCL:D2 rq:0xb7f760bc buffer:0xb7f03c00 au_offset(bytes):0 iosz:4096 operation:0 status:2 Error messages that appear on the database (orcl) alertlog: replication_dependency_tracking turned off (no async multimaster replication found) Starting background process QMNC QMNC started with pid=20, OS id=14512 Tue Sep 21 10:49:26 EEST 2010 db_recovery_file_dest_size of 2048 MB is 7.86% used. This is a user-specified limit on the amount of space that will be used by this database for recovery-related files, and does not reflect the amount of space available in the underlying filesystem or ASM diskgroup. Tue Sep 21 10:49:27 EEST 2010 Completed: ALTER DATABASE OPEN Tue Sep 21 10:54:58 EEST 2010 WARNING: failed to write mirror side 0 of virtual extent 0 of file 260 in group 1 WARNING: process 14476 initiating offline of disk 1.3916250737 (D2) with mask 0x3 in group 1 Both the ASM and database instance have been shutdown and restarted without problems, even with a single disk remaining the database continues running as normal. |
Errors such as those in the following lines are due to the ASM instance not starting
1 2 3 4 5 |
startup ORA-01078: failure in processing system parameters ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora' ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora ORA-15077: could not locate ASM instance serving a required diskgroup |
Create the TableSpace for the Datafiles within the ASM
1 2 3 4 5 6 7 8 9 |
CREATE TABLESPACE "EXAMPLE" DATAFILE '+DATA/orcl/datafile/example' SIZE 1048576 K REUSE AUTOEXTEND OFF LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE; The Pfile's path /u01/app/oracle/admin/orcl/pfile/ startup pfile=/u01/app/oracle/admin/orcl/pfile/init.ora.816201012134 |
To create the spfile:
1 |
create spfile='+data/orcl/spfileorcl.ora' from pfile='/u01/app/oracle/admin/orcl/pfile/init.ora.816201012134' ; |
1 |
create pfile='/u01/app/oracle/admin/orcl/pfile/init.ora.816201012134' from spfile='+data/orcl/spfileorcl.ora' |
The ASM connection
1 2 3 4 5 6 7 8 |
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOMEORACLE_SID=+ASM1; export ORACLE_SID $sqlplus / as sysasm $asmcmd Add RAC-NODE-01 to .bash_profile ORACLE_BASE=/u01; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/asm; export ORACLE_HOME ORACLE_SID=+ASM1; export ORACLE_SID PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH |
NODE-02
1 2 3 4 5 6 7 |
ORACLE_BASE=/u01; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/asm; export ORACLE_HOME ORACLE_SID=+ASM2; export ORACLE_SID PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH unset ORACLE_HOME unset ORACLE_SID unset ORACLE_BASE |
Retrieving information
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
select INSTANCE_NAME from GV$ASM_CLIENT;select * from V$ASM_DISKGROUP; col inst format 9col path format a36 col diskgroup format a8 col diskname format a10 col failgroup format a10 col PR format a2 SELECT inst_id inst, path, g.name diskgroup,d.name diskname, failgroup, preferred_read PR FROM v$asm_disk d JOIN gv$asm_diskgroup g ON(d.group_number=g.group_number) WHERE mount_status='CACHED' ORDER BY 1; --------------------------------------- INST PATH DISKGROU DISKNAME FAILGROUP PR ------ -------- ---------- ---------- -- 1 /dev/oracle/ASMDISK02 DATA DATA_0000 DATA_0000 1 /dev/oracle/ASMDISK04 DATA DATA_0002 DATA_0002 1 /dev/oracle/ASMDISK01 FRA FRA_0000 FRA_0000 1 /dev/oracle/ASMDISK03 DATA DATA_0001 DATA_0001 2 /dev/oracle/ASMDISK01 FRA FRA_0000 FRA_0000 2 /dev/oracle/ASMDISK02 DATA DATA_0000 DATA_0000 2 /dev/oracle/ASMDISK03 DATA DATA_0001 DATA_0001 2 /dev/oracle/ASMDISK04 DATA DATA_0002 DATA_0002 |
1 2 3 4 5 |
col path format a36col diskgroup format a10 col failgroup format a10 SELECT path, dg.name diskgroup, failgroup, mount_status, mode_status FROM v$asm_disk d JOINv$asm_diskgroup dg ON (d.group_number=dg.group_number) ORDER BY 1; SELECT path, g.name diskgroup, d.name diskname, failgroup, mode_statusFROM v$asm_disk d JOIN v$asm_diskgroup g ON(d.group_number=g.group_number) WHERE mount_status='CACHED'; |
The remaining space on the ASM
1 2 3 4 5 6 7 8 |
column inst_id format 9999999 heading "Instance ID" justify leftcolumn name format a15 heading "Disk Group" justify left column total_mb format 999,999,999 heading "Total (MB)" justify right column free_mb format 999,999,999 heading "Free (MB)" justify right column pct_free format 999.99 heading "% Free" justify right select inst_id, name, total_mb, free_mb, round((free_mb/total_mb)*100,2) pct_free from gv$asm_diskgroup] where total_mb != 0 order by inst_id, name; |
The percentage and file count
1 |
select * from v$flash_recovery_area_usage; |
1 |
SELECT compatibility, database_compatibilityFROM v$asm_diskgroup ; |
Mount disk groups
1 2 3 |
ALTER DISKGROUP ALL DISMOUNT;ALTER DISKGROUP ALL MOUNT; ALTER DISKGROUP disk_group_1 DISMOUNT; ALTER DISKGROUP data MOUNT; |
Note: It may be necessary to mount all diskgroups individually in all of the nodes.
***** The resources and ASM may not be visible in the first node or those started later.
/u01/11.2.0/grid/bin/crsctl start cluster -allwhen triggered using the above command
As a grid user:
1 |
crsctl status resource -w "TYPE co 'ora'" -t |
All nodes are visible.
Shutting down the RAC
All commands should be run as an Oracle user.
Database stop
1 |
srvctl stop database -d databaseadı |
ASM stop
1 |
srvctl stop asm -n node1srvctl stop asm -n node2 |
All application stop
1 2 |
srvctl stop nodeapps -n node1 srvctl stop nodeapps -n node2 |
CRS STOP
on all nodes as the root user
1 |
/etc/init.d/init.crs stop |
Verify voting disks configuration
1 2 |
./crsctl query css votedisk./crsctl check crs ./ocrcheck |
Testing Failover Capabilities
1 2 3 4 5 6 7 8 9 10 11 12 |
./orajdbcstat.sh -d ERAC -i RAC1 -i RAC2 1 root@rac1 bin]# ./ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 327188 Used space (kbytes) : 3848 Available space (kbytes) : 323340 ID : 2120916034 Device/File Name : /dev/iscsi/racdata1.ocr/lun0/part1 Device/File integrity check succeeded Device/File Name : /dev/iscsi/racdata2.ocr/lun0/part1 Device/File needs to be synchronized with the other device |
Cluster registry integrity check succeeded
8. In order to fix this you just run ocrconfig, then you can check /u01/app/crs/log/rac1/crsd/crsd.log for information about the new OCR mirror (actions taken during replacement).
1 |
[root@rac1 bin]# ./ocrconfig -replace ocrmirror /dev/iscsi/racdata2.ocr/lun0/part1 |
Adding a Group/Disk ID 361468.1
script hugepages_settings.sh in Document 401749.1
The parameters will be set by default on:
Oracle Linux with oracle-validated package (See Document 437743.1) installed.
Oracle Exadata DB compute nodes
1 2 |
/usr/sbin/oracleasm createdisk OCR_VOTE02 /dev/sdc1 ALTER DISKGROUP DATA ADD DISK '/dev/ASM/ASMDATA06'; |
1 2 3 4 |
ALTER DISKGROUP DATA ADD FAILGROUP D3 DISK 'ORCL:D3' NAME D3 ALTER DISKGROUP DATA ADD FAILGROUP DATA_0003 DISK '/dev/ASM/ASMDATA06' NAME DATA_0003; ALTER DISKGROUP DATA ADD DISK 'ASM/ASMDATA06' SIZE 1024M; ALTER DISKGROUP VOTE SET ATTRIBUTE 'compatible.asm' = '11.2'; |
Adding a shared disk
Accessing the ESX server through SSH (secure shell)
1 2 3 |
mkdir /vmfs/volumes/$storage_name/folder_name cd /vmfs/volumes/$storage_name/folder_name vmkfstools -c 10G -d eagerzeroedthick ASM09.vmdk -a lsilogic |
1 2 |
SELECT name, value FROM V$ASM_ATTRIBUTE WHERE name = 'sector_size' AND group_number = 1; |
1 2 3 4 5 |
CREATE DISKGROUP OCR_VOT NORMAL REDUNDANCY DISK '/dev/ASM/OCR_VOTE04', '/dev/ASM/OCR_VOTE05', '/dev/ASM/OCR_VOTE06'; |
Mounting a Solaris ASM disk
1-
1 2 3 4 5 |
format fdisk-- Y 0 . partition --16. starting from this sector label-- Y volname ---DATA0xx etc. |
2-
1 2 3 4 5 6 |
5. c1t50002AC182C72171d0 &lt;DEFAULT cyl 6524 alt 2 hd 255 sec 63&gt; DATA04 /scsi_vhci/disk@g50002ac182c72171&gt; c1t50002AC182C72171d0 ------ Added to s0 Finding a disk [crayon-67c972e6cd4a5419069098]ls -l /dev/rdsk |grep c1t50002AC182C72171d0s0 |
3-
1 |
chown grid:asmadmin /dev/rdsk/c1t50002AC182C72171d0s0chmod 660 /dev/rdsk/c1t50002AC182C72171d0s0 |
Defining a link as a grid user.
1 |
ln -s ../../devices/scsi_vhci/disk@g50002ac182c72171:a"&gt;../../devices/scsi_vhci/disk@g50002ac182c72171:a,raw /dev/oracle/ASMDISK05 |
To change the group owner.
1 |
chgrp -h asmadmin ASMDISK05 |
1 2 3 4 5 6 7 |
ls -lL /dev/rdsk/ chown grid:asmadmin /dev/rdsk/c2t0d0s0 chown grid:asmadmin /dev/rdsk/c2t1d0s0 chown grid:asmadmin /dev/rdsk/c2t2d0s0 chown grid:asmadmin /dev/rdsk/c2t3d0s0 chown grid:asmadmin /dev/rdsk/c2t4d0s0 chown grid:asmadmin /dev/rdsk/c2t5d0s0 |
1 2 3 4 5 6 |
chmod 660 /dev/rdsk/c2t0d0s0 chmod 660 /dev/rdsk/c2t1d0s2 chmod 660 /dev/rdsk/c2t2d0s0 chmod 660 /dev/rdsk/c2t3d0s0 chmod 660 /dev/rdsk/c2t4d0s0 chmod 660 /dev/rdsk/c2t5d0s0 |
1 2 3 4 5 6 |
dd if=/dev/zero of=/dev/rdsk/c2t0d0s0 bs=1024 count=100 dd if=/dev/zero of=/dev/rdsk/c2t1d0s0 bs=1024 count=100 dd if=/dev/zero of=/dev/rdsk/c2t2d0s0 bs=1024 count=100 dd if=/dev/zero of=/dev/rdsk/c2t3d0s0 bs=1024 count=100 dd if=/dev/zero of=/dev/rdsk/c2t4d0s0 bs=1024 count=100 dd if=/dev/zero of=/dev/rdsk/c2t5d0s0 bs=1024 count=100 |
1 |
alter diskgroup data dismount force; |
1 |
drop diskgroup data force including contents; |
1 2 |
CREATE DISKGROUP DATA external REDUNDANCY '/dev/rdsk/c1t2d0s0' NAME diska2 ; |
1 2 3 |
CREATE DISKGROUP DATA EXTERNAL REDUNDANCY FAILGROUP DATA_0000 DISK '/dev/rdsk/c1t2d0s0' NAME DATA_0000 ; |
The SPFILE within the ASM
1 2 3 |
spmove /u01/11.2.0/grid/dbs/registry.253.822241075 +data/asm/asmparameterfile/spfileASM.ora spmove /u01/oracle/dbs/spfile+ASM.ora /u01/oracle/dbs/testspfileASM.ora spmove /u01/oracle/dbs/spfile+ASM.ora +DATA/testspfileASM.ora |
RHEL 5
1 2 3 4 5 6 7 |
# /bin/cat /etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29258c2157b5b0d94d51d1cd18c", NAME="DATA001", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29b4a4ef15255948b6302185920", NAME="DATA002", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29471e463f0754f988df645aa19", NAME="DATA003", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29564b69e6a5290ce0363b33e26", NAME="DATA004", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29dea29b91c8e26578e89da5f69", NAME="FRA001", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29bbe458e2feca640cc14890ded", NAME="FRA002", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c2921ea5d12586649ca8a3237510", NAME="OCR_VOTE01", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660"12 KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c29536230a9c103ef6be2c700586", NAME="OCR_VOTE02", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="36000c290591254d7b08020bee785681f", NAME="OCR_VOTE03", ACTION=="add|change", OWNER="grid",GROUP="asmadmin", MODE="0660" |
1 2 3 4 5 6 7 8 9 |
/sbin/scsi_id -g -u -s /block/sdb/sbin/scsi_id -g -u -s /block/sdc /sbin/scsi_id -g -u -s /block/sdd /sbin/scsi_id -g -u -s /block/sde /sbin/scsi_id -g -u -s /block/sdf /sbin/scsi_id -g -u -s /block/sdg /sbin/scsi_id -g -u -s /block/sdh /sbin/scsi_id -g -u -s /block/sdi /sbin/scsi_id -g -u -s /block/sdj /sbin/scsi_id -g -u -s /block/sdk |
RHEL 6
1 2 3 4 5 6 |
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29a76827320ca1899dd213424be", NAME="ASM/OCR_VOTE01", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29e1ff37893f44e9f84fae98988", NAME="ASM/OCR_VOTE02", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c297aa54f4220fc6bb3662525407", NAME="ASM/OCR_VOTE03", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c2910bb61e6745286c409b9b1cef", NAME="ASM/ASMDATA01", OWNER="grid", GROUP="asmadmin", MODE="0660"KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c2953c641c79f640182684a996e3", NAME="ASM/ASMDATA02", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c294ceec960c8a1307e928ad726f", NAME="ASM/ASMDATA03", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c290d51248f321a8f6ed1e592deb", NAME="ASM/ASMDATA04", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29fde26f24785e7d4c90603637c", NAME="ASM/ASMDATA05", OWNER="grid", GROUP="asmadmin", MODE="0660" |
Create it in /dev/ASM/*
1 2 3 4 |
/sbin/udevcontrol reload_rulessbin/start_udev udevadm test /block/sdb udevadm control --reload-rules start_udev |
1 2 3 4 5 6 |
show parameter asm NAME TYPE VALUE ------------------------------ asm_diskgroups stringasm_diskstring string /dev/ASM/* asm_power_limit integer 1 asm_preferred_read_failure_groups string |
To completely remove a currently active setup
1 2 3 4 5 6 |
rm -rf /etc/oraclerm -rf /etc/oratab rm -rf /etc/oraInst.loc rm -rf /u01/ rm -rf /opt/oracle rm -rf /tmp/* rm -rf /etc/init.d/ohasd |
The solution to: the exclusive mode cluster start failed perl -I rootcrs.pl execution failed 11.2.0.3</em>
can be found in ID 1050908.1
Delete
1 2 3 4 5 6 7 8 |
oracleasm deletedisk DATA001oracleasm deletedisk DATA002 oracleasm deletedisk DATA003 oracleasm deletedisk DATA004 oracleasm deletedisk FRA001 oracleasm deletedisk FRA002 oracleasm deletedisk OCR_VOTE01 oracleasm deletedisk OCR_VOTE02 oracleasm deletedisk OCR_VOTE03 |
1 2 3 |
/sbin/service oracleasm restarttail -f /var/log/oracleasm oracleasm scandisksoracleasm listdisks oracleasm querydisk DATA001 |
1 2 3 4 5 6 7 8 |
oracleasm createdisk DATA001 /dev/sdb1oracleasm createdisk DATA002 /dev/sdc1 oracleasm createdisk DATA003 /dev/sdd1 oracleasm createdisk DATA004 /dev/sde1 oracleasm createdisk FRA001 /dev/sdf1 oracleasm createdisk FRA002 /dev/sdg1 oracleasm createdisk OCR_VOTE01 /dev/sdh1 oracleasm createdisk OCR_VOTE02 /dev/sdi1 oracleasm createdisk OCR_VOTE03 /dev/sdj1 |
Notes: Create the files and folders
1. Create OS groups using the command below. Enter these commands as the ‘root’ user:
1 2 3 4 |
/usr/sbin/groupadd -g 601 oinstall/usr/sbin/groupadd -g 602 dba /usr/sbin/groupadd -g 604 asmadmin /usr/sbin/groupadd -g 606 asmdba /usr/sbin/groupadd -g 607 asmoper |
2. Create the users that will own the Oracle software using the commands:
1 |
/usr/sbin/useradd -u 601 -g oinstall -G asmadmin,asmdba,asmoper grid/usr/sbin/useradd -u 602 -g oinstall -G dba,asmdba oracle |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
mkdir -p /u01/app/oraInventorychown -R grid:oinstall /u01/app/oraInventory chmod -R 775 /u01/app/oraInventory mkdir -p /u01/11.2.0/grid chown -R grid:oinstall /u01/11.2.0/grid chmod -R 775 /u01/11.2.0/grid mkdir -p /u01/app/oracle mkdir /u01/app/oracle/cfgtoollogs chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle mkdir -p /u01/app/oracle/product/11.2.0/db_1 chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1 chmod -R 775 /u01/app/oracle/product/11.2.0/db_1 /usr/sbin/groupadd -g 501 oinstall/usr/sbin/groupadd -g 502 dba /usr/sbin/groupadd -g 504 asmadmin /usr/sbin/groupadd -g 506 asmdba /usr/sbin/groupadd -g 507 asmoper /usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid /usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
mkdir -p /u01/app/oraInventory chown -R grid:oinstall /u01/app/oraInventory chmod -R 775 /u01/app/oraInventory mkdir -p /u01/11.2.0/grid chown -R grid:oinstall /u01/11.2.0/grid chmod -R 775 /u01/11.2.0/grid mkdir -p /u01/app/oracle mkdir /u01/app/oracle/cfgtoollogs chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle mkdir -p /u01/app/oracle/product/11.2.0/db_1 chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1 chmod -R 775 /u01/app/oracle/product/11.2.0/db_1 /usr/sbin/oracleasm createdisk OCR_VOTE01 /dev/sdb1/usr/sbin/oracleasm createdisk OCR_VOTE02 /dev/sdc1 /usr/sbin/oracleasm createdisk OCR_VOTE03 /dev/sdd1 /usr/sbin/oracleasm createdisk ASMDATA01 /dev/sde1 /usr/sbin/oracleasm createdisk ASMDATA02 /dev/sdf1 /usr/sbin/oracleasm createdisk ASMDATA03 /dev/sdg1 /usr/sbin/oracleasm createdisk ASMDATA04 /dev/sdh1 /usr/sbin/oracleasm createdisk ASMDATA05 /dev/sdi1 |
1 2 |
COL % FORMAT 99 SELECT name, free_mb, total_mb, free_mb/total_mb*100 "%" FROM v$asm_diskgroup; |
Tips on Installing and Using ASMLib on Linux [ID 394953.1]
Locked Objects
12 March 2019