gigadevice代理:Configuration example of Oracle ASM on Solari
Configuration example of Oracle ASM on Solaris.
By Roman Ivanov on Feb 16, 2009
Update: Instructions in this post are not valid for Oracle 11gR2. In 11gR2 ASM is not a part of database as it moved into Grid.
In this example you will see how to configure Oracle ASM on Solaris.
The following system will be used in this example: Sun T5220 with attached 6140 array, Solaris 10 (10/08) and Oracle 11.
Briefly, Oracle Database installation steps can be performed as five separate steps:
Install Oracle binaries only
Install Oracle patchset
Configuring ASM
Configuring Listener
Database Creation
In this post I will show you the steps necessary to create ASM (step 3). Each step is accomplished with it's screenshot.
Start dbca and choose “Configure Automatic Storage Management”
$ dbca
Before using ASM you will be asked to configure Oracle Cluster Synchronization Service (CSS).
Login as root at execute required script:
bash-3.00# /oracle/database/product/10.2.0/bin/localconfig add Successfully accumulated necessary OCR keys. Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Configuration for local CSS has been initialized Cleaning up Network socket directories Setting up Network socket directories Adding to inittab Feb 16 02:04:24 rac10 root: Oracle Cluster Synchronization Service starting by user request. Startup will be queued to init within 30 seconds. Checking the status of new Oracle init process... Expecting the CRS daemons to be up within 600 seconds. Feb 16 02:04:24 rac10 root: Cluster Ready Services completed waiting on dependencies. Cluster Synchronization Services is active on these nodes. rac10 Cluster Synchronization Services is active on all the nodes. Oracle CSS service is installed and running under init(1M)
After the script will complete continue to next step and enter desired password for ASM instance. I choose 'oracle'.
Proceed with ASM instance creation.
Now we can check that ASM instance is running:
bash-3.00# ps -ef|grep ASM oracle 8438 1 0 02:10:09 ? 0:00 asm_vktm_+ASM oracle 8719 8378 0 02:12:08 ? 0:00 oracle+ASM (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 8435 1 0 02:10:09 ? 0:00 asm_pmon_+ASM oracle 8446 1 0 02:10:09 ? 0:00 asm_dia0_+ASM oracle 8442 1 0 02:10:09 ? 0:00 asm_diag_+ASM oracle 8444 1 0 02:10:09 ? 0:00 asm_psp0_+ASM oracle 8448 1 0 02:10:09 ? 0:00 asm_mman_+ASM oracle 8450 1 0 02:10:09 ? 0:00 asm_dbw0_+ASM oracle 8452 1 0 02:10:09 ? 0:00 asm_lgwr_+ASM oracle 8454 1 0 02:10:09 ? 0:00 asm_ckpt_+ASM oracle 8456 1 0 02:10:09 ? 0:00 asm_smon_+ASM oracle 8458 1 0 02:10:09 ? 0:00 asm_rbal_+ASM oracle 8460 1 0 02:10:09 ? 0:00 asm_gmon_+ASM root 8833 734 0 02:13:03 console 0:00 grep ASM
When instance is up we need to create disk group(s).
If you will choose “Create New” then you may see that there are no candidate disks for new disk group.
We need to set oracle:dba ownership of the candidate disk. As root we will take partition s0 of disk c4t600A0B8000562790000005D04998C446d0.
bash-3.00# format Searching for disks...done c4t600A0B8000562790000005D04998C446d0: configured with capacity of 1024.00GB AVAILABLE DISK SELECTIONS: 0. c1t0d0/pci@0/pci@0/pci@2/scsi@0/sd@0,0 1. c1t1d0 /pci@0/pci@0/pci@2/scsi@0/sd@1,0 2. c4t600A0B80003391700000060A49963C06d0 /scsi_vhci/ssd@g600a0b80003391700000060a49963c06 3. c4t600A0B8000562790000005D04998C446d0 /scsi_vhci/ssd@g600a0b8000562790000005d04998c446 Specify disk (enter its number): 3 selecting c4t600A0B8000562790000005D04998C446d0 [disk formatted] Disk not labeled. Label it now? y FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels inquiry - show vendor, product and revision volname - set 8-character volume name ! - execute , then return quit format> p PARTITION MENU: 0 - change `0' partition 1 - change `1' partition 2 - change `2' partition 3 - change `3' partition 4 - change `4' partition 5 - change `5' partition 6 - change `6' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk ! - execute , then return quit partition> p Current partition table (original): Total disk sectors available: 2147467230 + 16384 (reserved sectors) Part Tag Flag First Sector Size Last Sector 0 usr wm 34 1023.99GB 2147467230 1 unassigned wm 0 0 0 2 unassigned wm 0 0 0 3 unassigned wm 0 0 0 4 unassigned wm 0 0 0 5 unassigned wm 0 0 0 6 unassigned wm 0 0 0 8 reserved wm 2147467231 8.00MB 2147483614 partition> Ctrl-D
Default owner is root:sys needs to be changed to oracle:dba
bash-3.00# ls -lhL /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0crw-r----- 1 root sys 118, 64 Feb 16 02:10 /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0 bash-3.00# chown oracle:dba /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0 bash-3.00# ls -lhL /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0crw-r----- 1 oracle dba 118, 64 Feb 16 03:00 /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0
Going back to candidate disks and now we have our disk in the list.
Enter desired name for disk group and mark candidate disk. I will use External redundancy since I have external array.
Continue and finish ASM creation.
To check disk group status and size quickly use the following asm.sql query:
-bash-3.00$ cat asm.sql set linesize 132;
column path format a58;
column name format a10;
column G# format 99;
column D# format 99;
select group_number G#, disk_number D#, state, redundancy, name, path, total_mb, free_mb, (total_mb - free_mb) used_mb from v$asm_disk;
select name, total_mb, free_MB from v$asm_diskgroup;
exit -bash-3.00$ ORACLE_SID=+ASM sqlplus / as sysdba @asm SQL\*Plus: Release 11.1.0.7.0 - Production on Mon Feb 16 03:11:21 2009 Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options G# D# STATE REDUNDA NAME PATH TOTAL_MB FREE_MB USED_MB --- --- -------- ------- ---------- ---------------------------------------------------------- ---------- ---------- ---------- 1 0 NORMAL UNKNOWN DG1_0000 /dev/rdsk/c4t600A0B8000562790000005D04998C446d0s0 1048567 1048508 59 NAME TOTAL_MB FREE_MB ---------- ---------- ---------- DG1 1048567 1048508 Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
Now you can move to database creation and using ASM storage.
Setup listerner by running
$ netca
Create database by running
$ dbca