eygle.com   eygle.com
eygle.com  
 

« Oracle10gR2:New Features-drop empty datafile | Blog首页 | Using Oracle10g Release 2 KFED tools to view ASM DISK structure »

How to Use Oracle10g release 2 ASM

作者:eygle |【转载时请务必以超链接形式标明文章和作者信息及本声明
链接:
如何使用Oracle10gR2,一点测试:
1.硬盘分区
示例,划分三个硬盘分区:
[root@danaly etc]# fdisk /dev/cciss/c0d0

The number of cylinders for this disk is set to 8854.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/cciss/c0d0: 72.8 GB, 72833679360 bytes
255 heads, 63 sectors/track, 8854 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          33      265041   83  Linux
/dev/cciss/c0d0p2              34         555     4192965   82  Linux swap
/dev/cciss/c0d0p3             556         686     1052257+  83  Linux
/dev/cciss/c0d0p4             687        8854    65609460    5  Extended
/dev/cciss/c0d0p5             687        1730     8385898+  83  Linux
/dev/cciss/c0d0p6            1731        2774     8385898+  83  Linux
/dev/cciss/c0d0p7            2775        3818     8385898+  83  Linux
/dev/cciss/c0d0p8            3819        4601     6289416   83  Linux

Command (m for help): n
First cylinder (4602-8854, default 4602): 
Using default value 4602
Last cylinder or +size or +sizeM or +sizeK (4602-8854, default 8854): +20000M    

Command (m for help): n
First cylinder (7035-8854, default 7035): 
Using default value 7035
Last cylinder or +size or +sizeM or +sizeK (7035-8854, default 8854): +3000M 

Command (m for help): n
First cylinder (7401-8854, default 7401): 
Using default value 7401
Last cylinder or +size or +sizeM or +sizeK (7401-8854, default 8854): +3000M

Command (m for help): p

Disk /dev/cciss/c0d0: 72.8 GB, 72833679360 bytes
255 heads, 63 sectors/track, 8854 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          33      265041   83  Linux
/dev/cciss/c0d0p2              34         555     4192965   82  Linux swap
/dev/cciss/c0d0p3             556         686     1052257+  83  Linux
/dev/cciss/c0d0p4             687        8854    65609460    5  Extended
/dev/cciss/c0d0p5             687        1730     8385898+  83  Linux
/dev/cciss/c0d0p6            1731        2774     8385898+  83  Linux
/dev/cciss/c0d0p7            2775        3818     8385898+  83  Linux
/dev/cciss/c0d0p8            3819        4601     6289416   83  Linux
/dev/cciss/c0d0p9            4602        7034    19543041   83  Linux
/dev/cciss/c0d0p10           7035        7400     2939863+  83  Linux
/dev/cciss/c0d0p11           7401        7766     2939863+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


2.绑定ASM磁盘
[root@danaly data1]# /etc/init.d/oracleasm createdisk VOL5 /dev/cciss/c0d0p10
Marking disk "/dev/cciss/c0d0p10" as an ASM disk: [  OK  ]
[root@danaly data1]# /etc/init.d/oracleasm createdisk VOL6 /dev/cciss/c0d0p11
Marking disk "/dev/cciss/c0d0p11" as an ASM disk: [  OK  ]
[root@danaly data1]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6

3.启动ASM实例,创建磁盘组
[oracle@danaly ~]$ export ORACLE_SID=+ASM
[oracle@danaly ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 3 00:28:09 2006

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

Connected to an idle instance.

SQL> startup
ASM instance started

Total System Global Area   83886080 bytes
Fixed Size                  1217836 bytes
Variable Size              57502420 bytes
ASM Cache                  25165824 bytes
ASM diskgroups mounted

SQL> select group_number,disk_number,mode_status from v$asm_disk;

GROUP_NUMBER DISK_NUMBER MODE_STATUS
------------ ----------- --------------
           0           4 ONLINE
           0           5 ONLINE
           1           0 ONLINE
           1           1 ONLINE
           1           2 ONLINE
           1           3 ONLINE

6 rows selected.


  
SQL> select group_number,disk_number,mode_status,name from v$asm_disk;

GROUP_NUMBER DISK_NUMBER MODE_STATUS    NAME
------------ ----------- -------------- ---------------------------------
           0           4 ONLINE
           0           5 ONLINE
           1           0 ONLINE         VOL1
           1           1 ONLINE         VOL2
           1           2 ONLINE         VOL3
           1           3 ONLINE         VOL4

6 rows selected.

SQL> create diskgroup orag2 external redundancy disk 'ORCL:VOL5';

Diskgroup created.

SQL> select group_number,disk_number,mode_status,name from v$asm_disk;

GROUP_NUMBER DISK_NUMBER MODE_STATUS    NAME
------------ ----------- -------------- -------------------------------------
           0           5 ONLINE
           1           0 ONLINE         VOL1
           1           1 ONLINE         VOL2
           1           2 ONLINE         VOL3
           1           3 ONLINE         VOL4
           2           0 ONLINE         VOL5

6 rows selected.


4.创建表空间
[oracle@danaly ~]$ export ORACLE_SID=danaly
[oracle@danaly ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 3 00:47:04 2006

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  943718400 bytes
Fixed Size                  1222744 bytes
Variable Size             281020328 bytes
Database Buffers          654311424 bytes
Redo Buffers                7163904 bytes
Database mounted.
Database opened.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+ORADG/danaly/datafile/system.264.600016955
+ORADG/danaly/datafile/undotbs1.265.600016969
+ORADG/danaly/datafile/sysaux.266.600016977
+ORADG/danaly/datafile/users.268.600016987

SQL> create tablespace eygle datafile '+ORAG2' ;

Tablespace created.

SQL> select name from v$datafile;

NAME
---------------------------------------------------------------------------------
+ORADG/danaly/datafile/system.264.600016955
+ORADG/danaly/datafile/undotbs1.265.600016969
+ORADG/danaly/datafile/sysaux.266.600016977
+ORADG/danaly/datafile/users.268.600016987
+ORAG2/danaly/datafile/eygle.256.600137647


5.向现有磁盘组增加磁盘
[oracle@danaly log]$ export ORACLE_SID=+ASM
[oracle@danaly log]$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 3 01:36:37 2006

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options

SQL> alter diskgroup orag2 add disk 'ORCL:VOL6';

Diskgroup altered.


一点测试过程的记录,供参考.
-----
这篇 【How to Use Oracle10g release 2 ASM】来自 www.eygle.com | CSDN技术网摘| del.icio.us|365Key

By eygle on 2005-09-03 01:26 | Comments (5) | Posted to Oracle10g/11g | Edit |Pageviews:

相关文章 随机文章
  • Oracle10g OCR及Voting Disk的备份
  • Patchset 10.2.0.4中关于ASM的Buglist
  • DBA警世录:使用ASM应当具备充分认识
  • Oracle10.2.0.3 RAC的VIP及实例依赖关系
  • CRS-0184错误与CRS初始化
  • 2008 中国 - 全国人民都在感受地震
    如何在Oracle中发送Email
    如何在Linux下增加Swap区
    关于shared pool的深入探讨(二)
    streams流复制ORA-01403错误解决一则
    网上相关主题:
    Google

    Listed below are links to weblogs that reference How to Use Oracle10g release 2 ASM:

    » 扩展Oracle10gR2 ASM磁盘空间 from Friends Life and Oracle
    一个Linux AD4上的Oracle10gR2数据库,由于空间不足,扩展了一下硬盘,增加100G做为数据库存储. [Read More]

    Tracked on February 17, 2006 10:51 AM

    » Oracle10g ASM Auto IO Rebalance新特性 from Friends Life and Oracle
    ASM ( Automatic Storage Management ) 的一个重要特性是可以进行在线磁盘重配置及动态均衡。 [Read More]

    Tracked on February 17, 2006 2:53 PM

    留言 (5)

    用10g比用9i好吗?有很多的优点吗?10g有网格,使用它的好处是啥啊?9i不是有RAC吗?10g我还没用过。

    Posted by: John at September 3, 2005 10:04 AM

    用10g比用9i好吗?有很多的优点吗?10g有网格,使用它的好处是啥啊?9i不是有RAC吗?10g我还没用过。

    Posted by: John at September 3, 2005 10:05 AM

    10g是全新的一个产品了,太多的新功能,绝对值得尝试的。

    Posted by: eygle at September 3, 2005 12:04 PM

    我用asm CreateDisk 正常但是 oracleasm restart之后
    用listdisks就看不到ASM磁盘了。。。硬件是HP的磁盘柜,原来是可以的~这次升级重装系统后就不行了。。

    Posted by: zyh at October 9, 2005 12:49 AM

    你用的是什么系统?
    Linux? HP-Unix?

    Posted by: eygle at October 9, 2005 10:57 AM

    发表留言:



    Remember Me?
    (输入验证码后方可评论,谢谢支持)



    CopyRight © 2004 eygle.com, All rights reserved.