分类: Oracle
2009-05-14 17:37:43
dd if=/dev/zero of=/tmp/max/u1 bc=1024k count=1000 dd if=/dev/zero of=/tmp/max/u2 bc=1024k count=1000 dd if=/dev/zero of=/tmp/max/u3 bc=1024k count=1000 losetup /dev/loop1 /tmp/max/u1 losetup /dev/loop2 /tmp/max/u2 losetup /dev/loop3 /tmp/max/u3 模拟几个设备 [root@max ~]# losetup -a /dev/loop1: [0302]:522567 (/tmp/max/u1) /dev/loop2: [0302]:522569 (/tmp/max/u2) /dev/loop3: [0302]:522580 (/tmp/max/u3) [root@max ~]# |
/etc/init.d/oracleasm createdisk max1 /dev/loop1 /etc/init.d/oracleasm createdisk max2 /dev/loop2 /etc/init.d/oracleasm createdisk max3 /dev/loop3 |
[root@max ~]# oracleasm listdisks MAX1 MAX2 MAX3 [root@max ~]# |
[oracle@max ~]$ cat $ORACLE_HOME/dbs/init+ASM.ora *.asm_diskstring='ORCL:*' *.background_dump_dest='/opt/oracle/admin/+ASM/bdump/' *.core_dump_dest='/opt/oracle/admin/+ASM/cdump' *.instance_type='asm' *.large_pool_size=12M *.remote_login_passwordfile='SHARED' *.user_dump_dest='/opt/oracle/admin/+ASM/udump' [oracle@max ~]$ |
orapwd file=/opt/oracle/product/10.2.0/db_1/dbs/orapw+ASM password=max |
SQL> select group_number,redundancy,total_mb,free_mb,name,path from v$asm_disk; GROUP_NUMBER REDUNDANCY TOTAL_MB FREE_MB NAME ------------ -------------- ---------- ---------- ------------------------------------------------------------ PATH ------------------------------------------------------------------------------------------------------------------------------------ 0 UNKNOWN 1000 0 ORCL:MAX3 1 UNKNOWN 1000 949 MAX1 ORCL:MAX1 1 UNKNOWN 1000 949 MAX2 ORCL:MAX2 SQL> select name from V$asm_diskgroup; NAME ------------------------------------------------------------ CAN SQL> |
alter system set db_create_file_dest='+CAN'; |
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- /opt/oracle/oradata/orcl/system01.dbf /opt/oracle/oradata/orcl/undotbs01.dbf /opt/oracle/oradata/orcl/sysaux01.dbf /opt/oracle/oradata/orcl/users01.dbf /opt/oracle/oradata/orcl/max.dbf /opt/oracle/oradata/orcl/mmm.dbf 6 rows selected. SQL> create tablespace can datafile size 30m; Tablespace created. SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- /opt/oracle/oradata/orcl/system01.dbf /opt/oracle/oradata/orcl/undotbs01.dbf /opt/oracle/oradata/orcl/sysaux01.dbf /opt/oracle/oradata/orcl/users01.dbf /opt/oracle/oradata/orcl/max.dbf /opt/oracle/oradata/orcl/mmm.dbf +CAN/orcl/datafile/can.256.686860717 7 rows selected. SQL> |
SQL> alter diskgroup can add disk 'ORCL:MAX3'; Diskgroup altered. SQL> select group_number,redundancy,total_mb,free_mb,name,path from v$asm_disk; GROUP_NUMBER REDUNDANCY TOTAL_MB FREE_MB NAME ------------ -------------- ---------- ---------- ------------------------------------------------------------ PATH ------------------------------------------------------------------------------------------------------------------------------------ 1 UNKNOWN 1000 916 MAX1 ORCL:MAX1 1 UNKNOWN 1000 916 MAX2 ORCL:MAX2 1 UNKNOWN 1000 995 MAX3 ORCL:MAX3 SQL> |
alter diskgroup can add directory '+CAN/max'; [oracle@max ~]$ asmcmd ASMCMD> ls CAN/ ASMCMD> ls CAN ORCL/ max/ ASMCMD> ls CAN/max/ ASMCMD> lsct DB_Name Status Software_Version Compatible_version Instance_Name orcl CONNECTED 10.2.0.1.0 10.2.0.1.0 orcl ASMCMD> lsdg State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name MOUNTED NORMAL N N 512 4096 1048576 3000 2779 1000 889 0 CAN/ ASMCMD> |
SQL> select name,type from v$fixed_table where name like '%ASM%'; NAME TYPE ------------------------------------------------------------ ---------- GV$ASM_TEMPLATE VIEW V$ASM_TEMPLATE VIEW GV$ASM_ALIAS VIEW V$ASM_ALIAS VIEW GV$ASM_FILE VIEW V$ASM_FILE VIEW GV$ASM_CLIENT VIEW V$ASM_CLIENT VIEW GV$ASM_DISKGROUP VIEW V$ASM_DISKGROUP VIEW GV$ASM_DISKGROUP_STAT VIEW NAME TYPE ------------------------------------------------------------ ---------- V$ASM_DISKGROUP_STAT VIEW GV$ASM_DISK VIEW V$ASM_DISK VIEW GV$ASM_DISK_STAT VIEW V$ASM_DISK_STAT VIEW GV$ASM_OPERATION VIEW V$ASM_OPERATION VIEW 18 rows selected. SQL> |