eygle.com   eygle.com
eygle.com eygle
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
modb.pro

如何使用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.


一点测试过程的记录,供参考.

历史上的今天...
    >> 2012-09-03文章:
    >> 2010-09-03文章:
    >> 2009-09-03文章:
    >> 2008-09-03文章:
    >> 2007-09-03文章:

By eygle on 2005-09-03 01:26 | Comments (5) | Oracle12c/11g | 416 |

5 Comments

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

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

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

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

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


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com