ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Manually Creating an ASM Instance

Manually Creating an ASM Instance

原创 Linux操作系统 作者:hjianping 时间:2011-05-05 22:52:07 0 删除 编辑

1、Create Admin Directories

$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump
$ mkdir -p $ORACLE_BASE/admin/+ASM/hdump
$ mkdir -p $ORACLE_BASE/admin/+ASM/pfile
$ mkdir -p $ORACLE_BASE/admin/+ASM/udump


2、Create Instance Parameter File

$ vi $ORACLE_BASE/admin/+ASM/pfile/init.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=''

###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=/export/home/u01/admin/+ASM/bdump
core_dump_dest=/export/home/u01/admin/+ASM/cdump
user_dump_dest=/export/home/u01/admin/+ASM/udump

###########################################
# Miscellaneous
###########################################
instance_type=asm
compatible=10.2.0.2.0

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

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=exclusive
============================================================

3、Create symbolic link
$ ln -s $ORACLE_BASE/admin/+ASM/pfile/init.ora $ORACLE_HOME/dbs/init+ASM.ora


4、Identify Devices(Install Oracle base on ASM on Solaris)

# ls -lL /dev/rdsk
crw-r-----   1 oracle   dba       32, 198 Sep 17 22:44 c2t0d0s6
crw-r-----   1 oracle   dba       32, 262 Sep 17 22:44 c2t1d0s6
crw-r-----   1 oracle   dba       32, 326 Sep 17 21:52 c2t2d0s6
crw-r-----   1 oracle   dba       32, 390 Sep 17 21:52 c2t3d0s6
crw-r-----   1 oracle   dba       32, 454 Sep 17 22:44 c2t4d0s6
crw-r-----   1 oracle   dba       32, 518 Sep 17 22:44 c2t5d0s6


5、Install ocssd(root)

# cd /export/home/u01/oracle/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

Adding to inittab
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.
CSS is active on these nodes.
        huang
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)


6、Starting the ASM Instance(oracle)

$ ORACLE_SID=+ASM; export ORACLE_SID
$ sqlplus "/ as sysdba"

SQL> startup
ASM instance started

Total System Global Area   75497472 bytes
Fixed Size                   777852 bytes
Variable Size              74719620 bytes
Database Buffers                  0 bytes
Redo Buffers                      0 bytes
ORA-15110: no diskgroups mounted

SQL> create spfile from pfile='/export/home/u01/admin/+ASM/pfile/init.ora';

SQL> shutdown
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


7、Verify RAW Disk Are Discovered

$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba

SQL> select group_number,disk_number,mount_status,header_status,state,path from v$asm_disk;

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE    PATH
------------ ----------- ------- ------------ -------- ------------------------------
           0           0 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t0d0s6
           0           1 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t1d0s6
           0           5 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t5d0s6
           0           3 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t3d0s6
           0           4 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t4d0s6
           0           2 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t2d0s6


8、Creating Disk Groups

SQL> create diskgroup file_data normal redundancy
failgroup d1 disk '/dev/rdsk/c2t0d0s6', '/dev/rdsk/c2t2d0s6'
failgroup d2 disk '/dev/rdsk/c2t1d0s6', '/dev/rdsk/c2t3d0s6';

SQL> create diskgroup flash_data normal redundancy
failgroup f1 disk '/dev/rdsk/c2t4d0s6'
failgroup f2 disk '/dev/rdsk/c2t5d0s6';

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

GROUP_NUMBER NAME                             TOTAL_MB    FREE_MB STATE       TYPE
------------ ------------------------------ ---------- ---------- ----------- ------
           1 FILE_DATA                            6124       6022 MOUNTED     NORMAL
           2 FLASH_DATA                           6124       6022 MOUNTED     NORMAL

SQL> select group_number,disk_number,mount_status,header_status,state,path,failgroup from v$asm_disk;

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE    PATH                           FAILGROUP
------------ ----------- ------- ------------ -------- ----------------------        ----------
           0           2 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t2d0s6
           0           3 CLOSED  CANDIDATE    NORMAL   /dev/rdsk/c2t3d0s6
           1           0 CACHED  MEMBER       NORMAL   /dev/rdsk/c2t0d0s6             D1
           1           1 CACHED  MEMBER       NORMAL   /dev/rdsk/c2t1d0s6             D2
           2           0 CACHED  MEMBER       NORMAL   /dev/rdsk/c2t4d0s6             F1
           2           1 CACHED  MEMBER       NORMAL   /dev/rdsk/c2t5d0s6             F2

 


备注:
==================================================================
+ASM.asm_diskgroups='DATA1','FLASH_DATA','FILE_DATA'#Manual Mount
*.asm_diskstring='/dev/rdsk/*'
*.background_dump_dest='/export/home/u01/admin/+ASM/bdump'
*.core_dump_dest='/export/home/u01/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/export/home/u01/admin/+ASM/udump'
==================================================================

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17012874/viewspace-694562/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-04-24

  • 博文量
    80
  • 访问量
    75427