ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ASM学习-2使用文件系统

ASM学习-2使用文件系统

原创 Linux操作系统 作者:lsq_008 时间:2011-01-19 16:22:46 0 删除 编辑

1.用dd命令创建磁盘文件

[ora10g@single ~]$ dd if=/dev/zero f=/home/db/oracle/oradata/+ASM/fs/filesystem_dsk1 bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 0.930547 seconds, 144 MB/s
[ora10g@single ~]$ dd if=/dev/zero f=/home/db/oracle/oradata/+ASM/fs/filesystem_dsk2 bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 2.2698 seconds, 59.1 MB/s
[ora10g@single ~]$ dd if=/dev/zero f=/home/db/oracle/oradata/+ASM/fs/filesystem_dsk3 bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 2.85864 seconds, 47.0 MB/s
[ora10g@single ~]$ dd if=/dev/zero f=/home/db/oracle/oradata/+ASM/fs/filesystem_dsk4 bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 0.913548 seconds, 147 MB/s

2.修改权限

[ora10g@single ~]$ cd /home/db/oracle/oradata/+ASM/fs
[ora10g@single fs]$ ll
total 524816
-rw-r--r-- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk1
-rw-r--r-- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk2
-rw-r--r-- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk3
-rw-r--r-- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk4

[ora10g@single fs]$ chmod 660 *
[ora10g@single fs]$ ll
total 524816
-rw-rw---- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk1
-rw-rw---- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk2
-rw-rw---- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk3
-rw-rw---- 1 ora10g dba 134217728 Dec 11 23:04 filesystem_dsk4

3.配置asm_diskstring

idle>Alter system set asm_diskstring='/dev/raw/raw*','/home/db/oracle/oradata/+ASM/fs/*' scope=both;

System altered.

idle>show parameter asm_disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      TEST_ASM_DG
asm_diskstring                       string      /dev/raw/raw*, /home/db/oracle
                                                 /oradata/+ASM/fs/*

4.修改_asm_allow_only_raw_disks参数,以识别文件系统

idle>alter system set "_asm_allow_only_raw_disks"= FALSE scope=spfile;

System altered.

idle>shutdown     
ASM diskgroups dismounted
ASM instance shutdown
idle>startup
ASM instance started

Total System Global Area   79691776 bytes
Fixed Size                  1217812 bytes
Variable Size              53308140 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

idle>show parameters _asm_allow_only_raw_disks

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_asm_allow_only_raw_disks            boolean     FALSE

5.查看disk并创建磁盘组

idle>SELECT path, header_status, library, total_mb, free_mb FROM v$asm_disk;

PATH                                               HEADER_STATU LIBRARY                TOTAL_MB    FREE_MB
-------------------------------------------------- ------------ -------------------- ---------- ----------
/home/db/oracle/oradata/+ASM/fs/filesystem_dsk4    CANDIDATE    System                      128          0
/home/db/oracle/oradata/+ASM/fs/filesystem_dsk2    CANDIDATE    System                      128          0
/home/db/oracle/oradata/+ASM/fs/filesystem_dsk1    CANDIDATE    System                      128          0
/home/db/oracle/oradata/+ASM/fs/filesystem_dsk3    CANDIDATE    System                      128          0
/dev/raw/raw4                                      MEMBER       System                      256        231
/dev/raw/raw3                                      MEMBER       System                      256        228
/dev/raw/raw2                                      MEMBER       System                      256        233
/dev/raw/raw1                                      MEMBER       System                      256        226

idle>CREATE DISKGROUP FS_DISK_GROUP NORMAL REDUNDANCY
  2  FAILGROUP array1
  3  DISK
  4  '/home/db/oracle/oradata/+ASM/fs/filesystem_dsk1' NAME fs_array1_disk1,
  5  '/home/db/oracle/oradata/+ASM/fs/filesystem_dsk2' NAME fs_array1_disk2
  6  FAILGROUP array2
  7  DISK
  8  '/home/db/oracle/oradata/+ASM/fs/filesystem_dsk3' NAME fs_array2_disk1,
  9  '/home/db/oracle/oradata/+ASM/fs/filesystem_dsk4' NAME fs_array2_disk2;

Diskgroup created.

idle>SELECT name, block_size, allocation_unit_size, state,
  2    type, total_mb, usable_file_mb
  3    FROM v$asm_diskgroup;

NAME                           BLOCK_SIZE ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB USABLE_FILE_MB
------------------------------ ---------- -------------------- ----------- ------ ---------- --------------
TEST_ASM_DG                          4096              1048576 MOUNTED     NORMAL       1024            331
FS_DISK_GROUP                        4096              1048576 MOUNTED     NORMAL        512            139

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

上一篇: ASM学习-1使用raw
下一篇: ASM学习-3使用LUN
请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    325
  • 访问量
    1258702