关闭

利用隐藏参数_asm_allow_only_raw_disks创建ASM环境

380人阅读 评论(0) 收藏 举报

[root@Oracle ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *         132        1044     7333672+  83  Linux
/dev/sda2               1         131     1052226   82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          56      449788+  83  Linux
/dev/sdb2              57        2489    19543072+  83  Linux

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         130     1044193+  83  Linux

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         130     1044193+  83  Linux

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         130     1044193+  83  Linux

Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         130     1044193+  83  Linux
[root@Oracle ~]#

[root@Oracle ~]# /u01/app/oracle/product/10.2.0/db_1/bin/localconfig add
/etc/oracle does not exist. Creating it now.
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 90 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.
        oracle
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

[root@Oracle ~]$cd /dev
[root@Oracle ~]$chown oracle.oinstall sdc1
[root@Oracle ~]$chown oracle.oinstall sdd1
[root@Oracle ~]$chown oracle.oinstall sde1
[root@Oracle ~]$chown oracle.oinstall sdf1

[oracle@Oracle ~]$ vim /u01/app/oracle/product/10.2.0/db_1/dbs/init+ASM.ora

instance_type=asm
asm_diskstring='/dev/sd*'


~
~
<oracle/product/10.2.0/db_1/dbs/init+ASM.ora" 2L, 44C written
[oracle@Oracle dev]$ export ORACLE_SID=+ASM
[oracle@Oracle dev]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 30 12:56:40 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


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

SQL>

SQL> create spfile from pfile;

File created.
SQL> select path,header_status from v$asm_disk;

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


ASM instance shutdown
SQL> startup nomount
ASM instance started

Total System Global Area  125829120 bytes
Fixed Size                  2019000 bytes
Variable Size              98644296 bytes
ASM Cache                  25165824 bytes
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/10.2.0
                                                 /db_1/dbs/spfile+ASM.ora
SQL>
SQL> alter system set "_asm_allow_only_raw_disks"=false scope=spfile sid='*';

System altered.

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


ASM instance shutdown
SQL> startup nomount
ASM instance started

Total System Global Area  125829120 bytes
Fixed Size                  2019000 bytes
Variable Size              98644296 bytes
ASM Cache                  25165824 bytes
SQL>
SQL> select path,header_status,library,total_mb,free_mb from v$asm_disk;

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------
/dev/sdf1
MEMBER       System
      1019          0

/dev/sdc1
CANDIDATE    System
      1019          0

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------

/dev/sdd1
MEMBER       System
      1019          0

/dev/sde1
MEMBER       System

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------
      1019          0


SQL>

SQL> create diskgroup raw_dg normal redundancy failgroup
raw1 disk
'/dev/sdf1' name raw1_disk1,
'/dev/sdc1' name raw1_disk2
failgroup
raw2 disk
'/dev/sdd1' name raw_2disk1,
'/dev/sde1' name raw2_disk2;

Diskgroup created.

SQL>
SQL> select path,header_status,library,total_mb,free_mb from v$asm_disk;

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------
/dev/sdf1
MEMBER       System
      1019        989

/dev/sde1
MEMBER       System
      1019        994

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------

/dev/sdd1
MEMBER       System
      1019        991

/dev/sdc1
MEMBER       System

PATH
--------------------------------------------------------------------------------
HEADER_STATU LIBRARY
------------ ----------------------------------------------------------------
  TOTAL_MB    FREE_MB
---------- ----------
      1019        996


SQL>
SQL> select name,block_size,allocation_unit_size,state,type,total_mb,free_mb,usable_file_mb from v$asm_diskgroup
  2  /

NAME                           BLOCK_SIZE ALLOCATION_UNIT_SIZE STATE
------------------------------ ---------- -------------------- -----------
TYPE     TOTAL_MB    FREE_MB USABLE_FILE_MB
------ ---------- ---------- --------------
RAW_DG                               4096              1048576 MOUNTED
NORMAL       4076       3970           1475


SQL>

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:18074次
    • 积分:290
    • 等级:
    • 排名:千里之外
    • 原创:12篇
    • 转载:1篇
    • 译文:0篇
    • 评论:3条
    文章分类
    文章存档
    最新评论