暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

How to Use Oracle10g release 2 ASM

原创 eygle 2005-09-03
381
如何使用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.
复制

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论