CREATE the ASM for ORACLE on Solaris 10!

本文介绍在SunOS 5.10系统中配置Oracle Automatic Storage Management (ASM) 的过程,包括创建ASM磁盘组、设置参数文件及进行相关权限配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        4.6G   4.3G   265M    95%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   1.1G   928K   1.1G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       4.6G   4.3G   265M    95%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   1.1G   228K   1.1G     1%    /tmp
swap                   1.1G    60K   1.1G     1%    /var/run
/dev/dsk/c0d0s7        3.7G   2.8G   807M    79%    /export/home
/vol/dev/dsk/c1t0d0/vmwaretools
                       1.5M   1.5M     0K   100%    /cdrom/vmwaretools
# format 
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 1171 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1 <VMware V-0000000000000000-0001-4.00GB>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
Specify disk (enter its number): ^C
# zpool create asmdisks c0d1
# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        4.6G   4.3G   265M    95%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   1.1G   928K   1.1G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       4.6G   4.3G   265M    95%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   1.1G   228K   1.1G     1%    /tmp
swap                   1.1G    60K   1.1G     1%    /var/run
/dev/dsk/c0d0s7        3.7G   2.8G   807M    79%    /export/home
/vol/dev/dsk/c1t0d0/vmwaretools
                       1.5M   1.5M     0K   100%    /cdrom/vmwaretools
asmdisks               3.9G     1K   3.9G     1%    /asmdisks
# chown oracle:dba /asmdisks
# su - oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$ dd if=/dev/zero of=/asmdisks/_file_disk1 bs=1k count=500000
500000+0 records in
500000+0 records out
$ dd if=/dev/zero of=/asmdisks/_file_disk2 bs=1k count=500000
500000+0 records in
500000+0 records out
$ dd if=/dev/zero of=/asmdisks/_file_disk3 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
$ dd if=/dev/zero of=/asmdisks/_file_disk4 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
$ exit
# lofiadm -a /asmdisks/_file_disk1
/dev/lofi/1
# lofiadm -a /asmdisks/_file_disk2
/dev/lofi/2
# lofiadm -a /asmdisks/_file_disk3
/dev/lofi/3
# lofiadm -a /asmdisks/_file_disk4
/dev/lofi/4
# ls -lL /dev/lofi/*
brw-------   1 root     sys      144,  1 May 13 14:59 /dev/lofi/1
brw-------   1 root     sys      144,  2 May 13 15:00 /dev/lofi/2
brw-------   1 root     sys      144,  3 May 13 15:00 /dev/lofi/3
brw-------   1 root     sys      144,  4 May 13 15:00 /dev/lofi/4
# mknod /asmdisks/vdisk1 c 144 1
mknod /asmdisks/vdisk2 c 144 2
mknod /asmdisks/vdisk3 c 144 3
mknod /asmdisks/vdisk4 c 144 4# # #
#
# chown oracle:dba /asmdisks/vdisk1
# chown oracle:dba /asmdisks/vdisk2
# chown oracle:dba /asmdisks/vdisk3
# chown oracle:dba /asmdisks/vdisk4#
# chown oracle:dba /asmdisks/vdisk4
# ps -ef|grep ocssd
  oracle  4587  4478   0 14:32:55 ?           0:04 /export/home/oracle/product/10g/bin/ocssd.bin
    root  4752  4649   0 15:04:26 pts/1       0:00 grep ocssd
# su - oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$ mkdir -p $ORACLE_BASE/asm/+ASM/bdump
mkdir -p $ORACLE_BASE/asm/+ASM/cdump
mkdir -p $ORACLE_BASE/asm/+ASM/hdump
$ mkdir -p $ORACLE_BASE/asm/+ASM/pfile
mkdir -p $ORACLE_BASE/asm/+ASM/udump$ $ $
$ more /export/home/oracle/product/10g/dbs/init+ASM.ora
###########################################
# Automatic Storage Management
###########################################
# _asm_allow_only_raw_disks=false
# asm_diskgroups='TESTDB_DATA1'

# Default asm_diskstring values for supported platforms:
#     Solaris (32/64 bit)   /dev/rdsk/*
#     Windows NT/XP         //./orcldisk*
#     Linux (32/64 bit)     /dev/raw/*
#     HPUX                  /dev/rdsk/*
#     HPUX(Tru 64)          /dev/rdisk/*
#     AIX                   /dev/rhdisk/*
# asm_diskstring=''

#asm_diskstrin 用于定义实例启动时搜索可用的ASM磁盘的路径,这个参数很重要。
#还有另外一个参数asm_diskgroups 用于定义ASM实例启动时自动加载的diskgroups,当CREATE #DISKGROUP时会自动在参数文件里写入。

###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=$ORACLE_BASE/asm/+ASM/bdump
core_dump_dest=$ORACLE_BASE/asm/+ASM/cdump
user_dump_dest=$ORACLE_BASE/asm/+ASM/udump

###########################################
# Miscellaneous
###########################################
instance_type=asm
compatible=10.1.0.4.0

###########################################
# Pools
###########################################
large_pool_size=12M

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=exclusive
$ export ORACLE_SID=+ASM
ORACLE_SID=+ASM: is not an identifier
$ ORACLE_SID=+ASM
$ export ORACLE_SID
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Wed May 13 15:09:21 2009

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> startup

ASM instance started

Total System Global Area   83886080 bytes
Fixed Size                  1278640 bytes
Variable Size              57441616 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate
ORA-15100: invalid or missing diskgroup name


ASM instance shutdown
SQL> startup
ASM instance started

Total System Global Area   83886080 bytes
Fixed Size                  1278640 bytes
Variable Size              57441616 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /export/home/oracle/product/10
                                                 g/dbs/spfile+ASM.ora
bash-3.00# chown -h oracle:dba  c0d1
bash-3.00# ls -lrt
total 126
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:b,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:c,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:d,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:e,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s5 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:f,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s6 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:g,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s7 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:h,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s8 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:i,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s9 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:j,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s10 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:k,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s11 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:l,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s12 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:m,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s13 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:n,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s14 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:o,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0s15 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:p,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0p0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:q,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0p1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:r,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0p2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:s,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0p3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:t,raw
lrwxrwxrwx   1 root     root          54 Apr 13 19:34 c0d0p4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:u,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:a,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:b,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:c,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:d,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:e,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s5 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:f,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s6 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:g,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s7 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:h,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s8 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:i,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s9 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:j,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s10 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:k,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s11 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:l,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s12 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:m,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s13 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:n,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s14 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:o,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0s15 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:p,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0p0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:q,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0p1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:r,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0p2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:s,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0p3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:t,raw
lrwxrwxrwx   1 root     root          52 Apr 13 19:34 c1t0d0p4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@1/sd@0,0:u,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:a,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:b,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:c,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:d,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:e,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s5 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:f,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s6 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:g,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s8 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:i,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s9 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:j,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s10 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:k,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s11 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:l,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s12 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:m,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s13 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:n,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s14 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:o,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1s15 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:p,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1p0 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:q,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1p1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:r,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1p2 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:s,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1p3 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:t,raw
lrwxrwxrwx   1 root     root          54 Apr 24 14:41 c0d1p4 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:u,raw
lrwxrwxrwx   1 oracle   dba           55 May  6 13:19 c0d1 -> ../../devices/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0:wd,raw
USE the DBCA to creat the ASM diskgroup!
SQL> startup
ASM instance started

Total System Global Area   83886080 bytes
Fixed Size                  1278640 bytes
Variable Size              57441616 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值