|
上完1Z0-052第5章(ASM实例管理)
(052共19章,053共21章,063多租户共9章,49-12)
high磁盘组:
- create diskgroup diskgroup3 high redundancy
- failgroup fgroup1 disk 'ORCL:ASMDISK1'
- failgroup fgroup2 disk 'ORCL:ASMDISK2'
- failgroup fgroup3 disk 'ORCL:ASMDISK3'
- attribute 'au_size'='4M';
复制代码 +ASM里的命令:
- select * from v$asm_template;
- select * from v$asm_alias;
- select * from v$asm_file;
- select path,name,failgroup from v$asm_disk;
- select * from v$asm_operation;
- select * from v$asm_attribute;
复制代码- /dev/sda14 15249 15375 1013760 83 Linux
- /dev/sda15 15375 15501 1013760 83 Linux
- Disk /dev/mapper/vol0-botanglinux: 94.3 GB, 94296342528 bytes
- 255 heads, 63 sectors/track, 11464 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0x00000000
- Disk /dev/mapper/vol0-botanglinux doesn't contain a valid partition table
- Disk /dev/mapper/loop0: 10.6 GB, 10569117696 bytes
- 255 heads, 63 sectors/track, 1284 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0x00000000
- Disk /dev/mapper/loop0 doesn't contain a valid partition table
- [root@station90 3]# vim /etc/sysconfig/rawdevices
- [root@station90 3]# vim /etc/rc.d/init.d/rawdevices
- [root@station90 3]# rpm -qa | grep kmod
- libmikmod-3.2.0-9.beta2.fc12.x86_64
- kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64
- [root@station90 3]# rpm -qa | grep oracle
- oracle-instantclient11.2-basic-11.2.0.2.0-1.x86_64
- oracleasmlib-2.0.4-1.el6.x86_64
- oracleasm-support-2.1.8-1.el6.x86_64
- kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64
- [root@station90 3]# oracleasm configure -i
- Configuring the Oracle ASM library driver.
- This will configure the on-boot properties of the Oracle ASM library
- driver. The following questions will determine whether the driver is
- loaded on boot and what permissions it will have. The current values
- will be shown in brackets ('[]'). Hitting <ENTER> without typing an
- answer will keep that current value. Ctrl-C will abort.
- Default user to own the driver interface []: oracle
- Default group to own the driver interface []: asmadmin
- Start Oracle ASM library driver on boot (y/n) [n]: y
- Scan for Oracle ASM disks on boot (y/n) [y]: y
- Writing Oracle ASM library driver configuration: done
- [root@station90 3]# service oracleasm start
- Initializing the Oracle ASMLib driver: [ OK ]
- Scanning the system for Oracle ASMLib disks: [ OK ]
- [root@station90 3]# oracleasm listdisks
- [root@station90 3]# oracleasm-discover
- Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
- [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
- [root@station90 3]# cd /4
- [root@station90 4]# ls
- 17_Windows7_KVM linux2.doc RH135-RHEL6-en-2-20110131-slides.pdf RH.pdf 评估
- [root@station90 4]# dd if=/dev/zero of=loop0.img bs=964M count=1
- 记录了1+0 的读入
- 记录了1+0 的写出
- 1010827264字节(1.0 GB)已复制,0.833313 秒,1.2 GB/秒
- [root@station90 4]# dd if=/dev/zero of=loop1.img bs=964M count=1
- 记录了1+0 的读入
- 记录了1+0 的写出
- 1010827264字节(1.0 GB)已复制,0.910872 秒,1.1 GB/秒
- [root@station90 4]# dd if=/dev/zero of=loop2.img bs=512M count=1
- 记录了1+0 的读入
- 记录了1+0 的写出
- 536870912字节(537 MB)已复制,0.442148 秒,1.2 GB/秒
- [root@station90 4]# dd if=/dev/zero of=loop3.img bs=512M count=1
- 记录了1+0 的读入
- 记录了1+0 的写出
- 536870912字节(537 MB)已复制,0.452707 秒,1.2 GB/秒
- [root@station90 4]# dd if=/dev/zero of=loop4.img bs=512M count=1
- 记录了1+0 的读入
- 记录了1+0 的写出
- 536870912字节(537 MB)已复制,0.448147 秒,1.2 GB/秒
- [root@station90 4]# ls
- 17_Windows7_KVM loop0.img loop2.img loop4.img RH.pdf
- linux2.doc loop1.img loop3.img RH135-RHEL6-en-2-20110131-slides.pdf 评估
- [root@station90 4]# du -sh *.img
- 965M loop0.img
- 965M loop1.img
- 513M loop2.img
- 513M loop3.img
- 513M loop4.img
- [root@station90 4]# losetup /dev/loop0 loop0.img
- losetup: /dev/loop0: device is busy
- [root@station90 4]# df -h
- 文件系统 容量 已用 可用 已用%% 挂载点
- /dev/mapper/vol0-botanglinux
- 87G 80G 2.2G 98% /
- tmpfs 7.8G 4.3G 3.5G 56% /dev/shm
- /dev/sda3 194M 112M 73M 61% /boot
- /dev/sda1 21G 20G 1.2G 95% /3
- /dev/mapper/loop0 9.7G 9.1G 152M 99% /file/loop0
- [root@station90 4]# ls
- 17_Windows7_KVM loop0.img loop2.img loop4.img RH.pdf
- linux2.doc loop1.img loop3.img RH135-RHEL6-en-2-20110131-slides.pdf 评估
- [root@station90 4]# mv loop0.img loop5.img
- [root@station90 4]# losetup /dev/loop5 loop5.img
- [root@station90 4]# losetup /dev/loop1 loop1.img
- [root@station90 4]# losetup /dev/loop2 loop2.img
- [root@station90 4]# losetup /dev/loop3 loop2.img
- [root@station90 4]# losetup -d /dev/loop3
- [root@station90 4]# losetup /dev/loop3 loop3.img
- [root@station90 4]# losetup /dev/loop4 loop4.img
- [root@station90 4]# losetup /dev/loop5
- /dev/loop5: [fd00]:408565 (/4/loop5.img)
- [root@station90 4]# losetup /dev/loop1
- /dev/loop1: [fd00]:408566 (/4/loop1.img)
- [root@station90 4]# losetup /dev/loop2
- /dev/loop2: [fd00]:408567 (/4/loop2.img)
- [root@station90 4]# losetup /dev/loop3
- /dev/loop3: [fd00]:408568 (/4/loop3.img)
- [root@station90 4]# losetup /dev/loop4
- /dev/loop4: [fd00]:408569 (/4/loop4.img)
- [root@station90 4]# vim /etc/sysconfig/rawdevices
- [root@station90 4]# raw -qa
- /dev/raw/raw7: bound to major 8, minor 7
- /dev/raw/raw8: bound to major 8, minor 8
- /dev/raw/raw9: bound to major 8, minor 9
- /dev/raw/raw10: bound to major 8, minor 10
- /dev/raw/raw11: bound to major 8, minor 11
- /dev/raw/raw12: bound to major 8, minor 12
- /dev/raw/raw13: bound to major 8, minor 13
- /dev/raw/raw14: bound to major 8, minor 14
- /dev/raw/raw15: bound to major 8, minor 15
- [root@station90 4]# service rawdevices restart
- Assigning devices:
- /dev/raw/raw7 --> /dev/sda7
- Error setting raw device (??????)
- /dev/raw/raw8 --> /dev/sda8
- Error setting raw device (??????)
- /dev/raw/raw9 --> /dev/sda9
- Error setting raw device (??????)
- /dev/raw/raw10 --> /dev/sda10
- Error setting raw device (??????)
- /dev/raw/raw11 --> /dev/sda11
- Error setting raw device (??????)
- /dev/raw/raw12 --> /dev/sda12
- Error setting raw device (??????)
- /dev/raw/raw13 --> /dev/sda13
- Error setting raw device (??????)
- /dev/raw/raw14 --> /dev/sda14
- Error setting raw device (??????)
- /dev/raw/raw15 --> /dev/sda15
- Error setting raw device (??????)
- /dev/raw/raw16 --> /dev/loop5
- /dev/raw/raw16: bound to major 7, minor 5
- /dev/raw/raw17 --> /dev/loop1
- /dev/raw/raw17: bound to major 7, minor 1
- done
- [root@station90 4]# raw -qa
- /dev/raw/raw7: bound to major 8, minor 7
- /dev/raw/raw8: bound to major 8, minor 8
- /dev/raw/raw9: bound to major 8, minor 9
- /dev/raw/raw10: bound to major 8, minor 10
- /dev/raw/raw11: bound to major 8, minor 11
- /dev/raw/raw12: bound to major 8, minor 12
- /dev/raw/raw13: bound to major 8, minor 13
- /dev/raw/raw14: bound to major 8, minor 14
- /dev/raw/raw15: bound to major 8, minor 15
- /dev/raw/raw16: bound to major 7, minor 5
- /dev/raw/raw17: bound to major 7, minor 1
- [root@station90 4]# oracleasm createdisk ASMDISK1 /dev/loop2
- Writing disk header: done
- Instantiating disk: done
- [root@station90 4]# oracleasm createdisk ASMDISK2 /dev/loop3
- Writing disk header: done
- Instantiating disk: done
- [root@station90 4]# oracleasm createdisk ASMDISK3 /dev/loop4
- Writing disk header: done
- Instantiating disk: done
- [root@station90 4]# oracleasm-discover
- Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
- [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
- Discovered disk: ORCL:ASMDISK1 [1048576 blocks (536870912 bytes), maxio 128]
- Discovered disk: ORCL:ASMDISK2 [1048576 blocks (536870912 bytes), maxio 128]
- Discovered disk: ORCL:ASMDISK3 [1048576 blocks (536870912 bytes), maxio 128]
- [root@station90 4]# oracleasm listdisks
- ASMDISK1
- ASMDISK2
- ASMDISK3
- [root@station90 4]# oracleasm scandisks
- Reloading disk partitions: done
- Cleaning any stale ASM disks...
- Scanning system for ASM disks...
- [root@station90 4]# su - oracle
- [oracle@station90 ~]$ . oraenv
- ORACLE_SID = [orcl] ? +ASM
- The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 11:39:59 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> show parameter instance_type
- NAME TYPE
- ------------------------------------ ---------------------------------
- VALUE
- ------------------------------
- instance_type string
- asm
- SQL> show parameter rebalance
- SQL> show parameter asm
- NAME TYPE
- ------------------------------------ ---------------------------------
- VALUE
- ------------------------------
- asm_diskgroups string
- FRA
- asm_diskstring string
- asm_power_limit integer
- 1
- asm_preferred_read_failure_groups string
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ ps aux | grep arb
- oracle 13278 0.0 0.0 103244 876 pts/2 S+ 11:52 0:00 grep arb
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 11:55:29 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> show parameter asm
- NAME TYPE
- ------------------------------------ ---------------------------------
- VALUE
- ------------------------------
- asm_diskgroups string
- FRA
- asm_diskstring string
- asm_power_limit integer
- 1
- asm_preferred_read_failure_groups string
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ asmcmd
- ASMCMD> ls
- DATA/
- FRA/
- ASMCMD> help
- asmcmd [-vV] [-a <sysasm|sysdba>] [-p] [command]
- The environment variables ORACLE_HOME and ORACLE_SID determine the
- instance to which the program connects, and ASMCMD establishes a
- bequeath connection to it, in the same manner as a SQLPLUS / AS
- SYSASM. The user must be a member of the OSASM group.
- Specifying the -V option prints the asmcmd version number and
- exits immediately.
- Specifying the -v option prints extra information that can help
- advanced users diagnose problems.
- Specify the -a option to choose the type of connection. There are
- only two possibilities: connecting as SYSASM or as SYSDBA.
- The default value if this option is unspecified is SYSASM.
- Specifying the -p option allows the current directory to be displayed
- in the command prompt, like so:
- ASMCMD [+DATA/ORCL/CONTROLFILE] >
- [command] specifies one of the following commands, along with its
- parameters.
- Type "help [command]" to get help on a specific ASMCMD command.
- commands:
- --------
- md_backup, md_restore
- lsattr, setattr
- cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
- mkdir, pwd, rm, rmalias
- chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
- offline, online, rebal, remap, umount
- dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
- spmove, spset, startup
- chtmpl, lstmpl, mktmpl, rmtmpl
- chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
- mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr
- volcreate, voldelete, voldisable, volenable, volinfo
- volresize, volset, volstat
- ASMCMD> ls
- DATA/
- FRA/
- ASMCMD> cd data
- ASMCMD> ls
- ASM/
- ORCL/
- ASMCMD> cd ORCL/
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- spfileorcl.ora
- ASMCMD> cd DATAFILE/
- ASMCMD> ls
- EXAMPLE.265.816169651
- SYSAUX.257.816169553
- SYSTEM.256.816169553
- UNDOTBS1.258.816169553
- USERS.259.816169553
- ASMCMD> exit
- [oracle@station90 ~]$ ls
- apex orcl.txt reset_sqldev update_t04209_uname.sql
- app ords reset_xmldb 公共的
- copytape-root.sh ords.sh restclient-ui-3.1-jar-with-dependencies.jar 模板
- create_t04209_uname.sql osb.txt revertape-root.sh 视频
- derby.log pdb_open_says_me.sql select_t04209_uname.sql 图片
- mail p.sql shrink.sh 文档
- one_time_setup.sql rac_tns shrink_undo.sql 下载
- oracle reset_apex sqldeveloper 音乐
- oradiag_oracle reset_JSON s_rest.zip 桌面
- oraInventory reset_rest tnsnames.ora
- orcl.link reset_soup ttio.rcv
- orcl.ora reset_soup_apex_only update2_t04209_uname.sql
- [oracle@station90 ~]$ vim diskgroup3.sql
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 12:30:35 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> @diskgroup3.sql
- create diskgroup diskgroup3 high redundancy
- *
- ERROR at line 1:
- ORA-15018: diskgroup cannot be created
- ORA-15031: disk specification 'ORCL:ASMDISK3' matches no disks
- ORA-15031: disk specification 'ORCL:ASMDISK2' matches no disks
- ORA-15031: disk specification 'ORCL:ASMDISK1' matches no disks
- SQL> select name from v$asm_disk;
- NAME
- --------------------------------------------------------------------------------
- FRA_0002
- FRA_0001
- FRA_0000
- DATA_0005
- DATA_0004
- DATA_0003
- DATA_0002
- DATA_0001
- DATA_0000
- 11 rows selected.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 12:32:24 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> startup
- ORA-01078: failure in processing system parameters
- ORA-29701: unable to connect to Cluster Synchronization Service
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> startup
- ORA-01078: failure in processing system parameters
- ORA-29701: unable to connect to Cluster Synchronization Service
- SQL> conn / as sysasm
- Connected to an idle instance.
- SQL> startup
- ASM instance started
- Total System Global Area 283930624 bytes
- Fixed Size 2212656 bytes
- Variable Size 256552144 bytes
- ASM Cache 25165824 bytes
- ASM diskgroups mounted
- SQL> select name from v$asm_disk;
- NAME
- --------------------------------------------------------------------------------
- DATA_0005
- DATA_0004
- DATA_0003
- NAME
- --------------------------------------------------------------------------------
- DATA_0002
- DATA_0001
- DATA_0000
- 14 rows selected.
- SQL> @diskgroup3.sql
- Diskgroup created.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ crs_stat -t
- Name Type Target State Host
- ------------------------------------------------------------
- ora.DATA.dg ora....up.type ONLINE ONLINE station90
- ora....OUP3.dg ora....up.type ONLINE ONLINE station90
- ora.FRA.dg ora....up.type ONLINE OFFLINE
- ora....ER.lsnr ora....er.type ONLINE ONLINE station90
- ora.asm ora.asm.type ONLINE ONLINE station90
- ora.cssd ora.cssd.type ONLINE ONLINE station90
- ora.diskmon ora....on.type ONLINE ONLINE station90
- ora.orcl.db ora....se.type ONLINE OFFLINE
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 15:33:29 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> alter diskgroup fra mount ;
- Diskgroup altered.
- SQL> alter diskgroup diskgroup3 set attribute 'compatible.asm'='11.2.0';
- Diskgroup altered.
- SQL> alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.2.0';
- alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.2.0'
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15242: could not set attribute compatible.asm
- ORA-15238: 10.2.0 is not a valid value for attribute compatible.asm
- ORA-15243: 10.2.0.0.0 is not a valid version number
- SQL> alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.2.0.1';
- alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.2.0.1'
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15242: could not set attribute compatible.asm
- ORA-15238: 10.2.0.1 is not a valid value for attribute compatible.asm
- ORA-15243: 10.2.0.1.0 is not a valid version number
- SQL> alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.1.0';
- alter diskgroup diskgroup3 set attribute 'compatible.asm'='10.1.0'
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15242: could not set attribute compatible.asm
- ORA-15244: new compatibility setting less than current [11.2.0.0.0]
- SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP1" ATTRIBUTES (HIGH FINE);
- Diskgroup altered.
- SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprot FINE);
- ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprot FINE)
- *
- ERROR at line 1:
- ORA-00905: missing keyword
- SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotect FINE);
- ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotect FINE)
- *
- ERROR at line 1:
- ORA-00905: missing keyword
- SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotected FINE);
- Diskgroup altered.
- SQL> ALTER DISKGROUP disgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE);
- ALTER DISKGROUP disgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE)
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15001: diskgroup "DISGROUP3" does not exist or is not mounted
- SQL> ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE);
- ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE)
- *
- ERROR at line 1:
- ORA-15067: command or option incompatible with diskgroup redundancy
- SQL> ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (mirror FINE);
- Diskgroup altered.
- SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (mirror FINE);
- ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (mirror FINE)
- *
- ERROR at line 1:
- ORA-15067: command or option incompatible with diskgroup redundancy
- SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (high FINE);
- ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (high FINE)
- *
- ERROR at line 1:
- ORA-15067: command or option incompatible with diskgroup redundancy
- SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (unprotected FINE);
- Diskgroup altered.
- SQL> drop diskgroup diskgroup3;
- drop diskgroup diskgroup3
- *
- ERROR at line 1:
- ORA-15039: diskgroup not dropped
- ORA-15053: diskgroup "DISKGROUP3" contains existing files
- SQL> drop diskgroup diskgroup3;
- Diskgroup dropped.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ ls
- apex oraInventory reset_apex shrink.sh 视频
- app orcl.link reset_JSON shrink_undo.sql 图片
- copytape-root.sh orcl.ora reset_rest sqldeveloper 文档
- create_t04209_uname.sql orcl.txt reset_soup s_rest.zip 下载
- derby.log ords reset_soup_apex_only tnsnames.ora 音乐
- diskgroup3.sql ords.sh reset_sqldev ttio.rcv 桌面
- mail osb.txt reset_xmldb update2_t04209_uname.sql
- one_time_setup.sql pdb_open_says_me.sql restclient-ui-3.1-jar-with-dependencies.jar update_t04209_uname.sql
- oracle p.sql revertape-root.sh 公共的
- oradiag_oracle rac_tns select_t04209_uname.sql 模板
- [oracle@station90 ~]$ vim diskgroup3.sql
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 17:15:29 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> @diskgroup3.sql
- Diskgroup created.
- SQL> drop diskgroup diskgroup3;
- Diskgroup dropped.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ ls
- apex oraInventory reset_apex shrink.sh 视频
- app orcl.link reset_JSON shrink_undo.sql 图片
- copytape-root.sh orcl.ora reset_rest sqldeveloper 文档
- create_t04209_uname.sql orcl.txt reset_soup s_rest.zip 下载
- derby.log ords reset_soup_apex_only tnsnames.ora 音乐
- diskgroup3.sql ords.sh reset_sqldev ttio.rcv 桌面
- mail osb.txt reset_xmldb update2_t04209_uname.sql
- one_time_setup.sql pdb_open_says_me.sql restclient-ui-3.1-jar-with-dependencies.jar update_t04209_uname.sql
- oracle p.sql revertape-root.sh 公共的
- oradiag_oracle rac_tns select_t04209_uname.sql 模板
- [oracle@station90 ~]$ vim diskgroup3.sql
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 17:16:53 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> @diskgroup3.sql
- Diskgroup created.
- SQL> show parameter asm
- NAME TYPE
- ------------------------------------ ---------------------------------
- VALUE
- ------------------------------
- asm_diskgroups string
- FRA, DISKGROUP3
- asm_diskstring string
- asm_power_limit integer
- 1
- asm_preferred_read_failure_groups string
- SQL> alter diskgroup data add failgroup DATA_0000
- 2 add disk '/dev/raw/raw16' name DATA_0006
- 3 failgroup DATA_0001
- 4 add disk '/dev/raw/raw17' name DATA_0007
- 5 rebalance power 11 ;
- add disk '/dev/raw/raw16' name DATA_0006
- *
- ERROR at line 2:
- ORA-00905: missing keyword
- SQL> alter diskgroup data add failgroup DATA_0000
- 2 disk '/dev/raw/raw16' name DATA_0006
- 3 failgroup DATA_0001
- 4 disk '/dev/raw/raw17' name DATA_0007
- 5 rebalance power 11 ;
- Diskgroup altered.
- SQL> alter diskgroup data drop disk DATA_0006
- 2 disk DATA_0007
- 3 rebalance power 11 ;
- Diskgroup altered.
- SQL> alter diskgroup data drop disk DATA_0001
- 2 add failgroup DATA_0000 disk '/dev/raw/raw8' name DATA_0001;
- alter diskgroup data drop disk DATA_0001
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15029: disk '/dev/raw/raw8' is already mounted by this instance
- SQL> alter diskgroup data drop disk DATA_0001
- 2 add failgroup DATA_0000 disk '/dev/raw/raw16' name DATA_0001;
- alter diskgroup data drop disk DATA_0001
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15020: discovered duplicate ASM disk "DATA_0001"
- SQL> alter diskgroup data drop disk DATA_0001
- 2 add failgroup DATA_0000 disk '/dev/raw/raw16' name DATA_0008;
- Diskgroup altered.
- SQL> alter diskgroup data drop disk DATA_0003;
- Diskgroup altered.
- SQL> alter diskgroup data add failgroup DATA_0002 disk '/dev/raw/raw10' name DATA_0003;
- Diskgroup altered.
- SQL> alter diskgroup data drop disk DATA_0008;
- Diskgroup altered.
- SQL> alter diskgroup data add failgroup DATA_0000 disk '/dev/raw/raw8' name DATA_0001;
- Diskgroup altered.
- SQL> alter diskgroup data drop disk DATA_0005;
- Diskgroup altered.
- SQL> alter diskgroup data add failgroup DATA_0004 disk '/dev/raw/raw12' name DATA_0005;
- alter diskgroup data add failgroup DATA_0004 disk '/dev/raw/raw12' name DATA_0005
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15029: disk '/dev/raw/raw12' is already mounted by this instance
- SQL> alter diskgroup data add failgroup DATA_0004 disk '/dev/raw/raw12' name DATA_0005;
- Diskgroup altered.
- SQL> alter diskgroup data undrop disks;
- Diskgroup altered.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Automatic Storage Management option
- [oracle@station90 ~]$ asmca
- No protocol specified
- [oracle@station90 ~]$ . oraenv
- ORACLE_SID = [+ASM] ?
- The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
- [oracle@station90 ~]$ asmcmd
- ASMCMD> ls
- DATA/
- DISKGROUP3/
- FRA/
- ASMCMD> cd DATA/
- ASMCMD> ls
- ASM/
- ORCL/
- RCAT/
- ASMCMD> cd ORCL/
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- spfileorcl.ora
- ASMCMD> cd PARAMETERFILE/
- ASMCMD> ls
- spfile.266.929563525
- ASMCMD> ls
- spfile.266.929563525
- ASMCMD> cd ..
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- spfileorcl.ora
- ASMCMD> mkdir YOURNAME
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cd YOURNAME/
- ASMCMD> sl
- commands:
- --------
- md_backup, md_restore
- lsattr, setattr
- cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
- mkdir, pwd, rm, rmalias
- chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
- offline, online, rebal, remap, umount
- dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
- spmove, spset, startup
- chtmpl, lstmpl, mktmpl, rmtmpl
- chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
- mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr
- volcreate, voldelete, voldisable, volenable, volinfo
- volresize, volset, volstat
- ASMCMD> ls
- ASMCMD> pwd
- +DATA/ORCL/YOURNAME
- ASMCMD> ls
- tbs4.dbf
- ASMCMD> ls -l
- Type Redund Striped Time Sys Name
- N tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
- ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS4.269.929728719
- Type Redund Striped Time Sys Name
- DATAFILE MIRROR COARSE DEC 04 17:00:00 Y TBS4.269.929728719
- ASMCMD> ls
- tbs4.dbf
- ASMCMD> ls
- tbs4.dbf
- ASMCMD> cd ..
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cd DATAFILE/
- ASMCMD> ls
- EXAMPLE.265.816169651
- SYSAUX.257.816169553
- SYSTEM.256.816169553
- UNDOTBS1.258.816169553
- USERS.259.816169553
- ASMCMD> cd ..
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cd YOURNAME/
- ASMCMD> ls
- tbs4.dbf
- ASMCMD> ls -l
- Type Redund Striped Time Sys Name
- N tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
- ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS4.269.929728719
- Type Redund Striped Time Sys Name
- DATAFILE MIRROR COARSE DEC 04 18:00:00 Y TBS4.269.929728719
- ASMCMD> ls
- tbs4.dbf
- tbs5.dbf
- ASMCMD> ls
- tbs4.dbf
- ASMCMD> ls -l
- Type Redund Striped Time Sys Name
- N tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
- ASMCMD> cd ..
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cls
- commands:
- --------
- md_backup, md_restore
- lsattr, setattr
- cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
- mkdir, pwd, rm, rmalias
- chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
- offline, online, rebal, remap, umount
- dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
- spmove, spset, startup
- chtmpl, lstmpl, mktmpl, rmtmpl
- chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
- mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr
- volcreate, voldelete, voldisable, volenable, volinfo
- volresize, volset, volstat
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cd ..
- ASMCMD> ls
- ASM/
- ORCL/
- RCAT/
- ASMCMD> cd RCAT/
- ASMCMD> ls
- DATAFILE/
- ASMCMD> cd DATAFILE/
- ASMCMD> ls
- TBS2.267.929724085
- TBS3.268.929724423
- TBS4.269.929728719
- ASMCMD> rm TBS4.269.929728719
- ASMCMD> ls
- TBS2.267.929724085
- TBS3.268.929724423
- ASMCMD> cd ..
- ASMCMD> ls
- DATAFILE/
- ASMCMD> cd ..
- ASMCMD> ls
- ASM/
- ORCL/
- RCAT/
- ASMCMD> cd ..
- ASMCMD> ls
- DATA/
- DISKGROUP3/
- FRA/
- ASMCMD> cd DATA/
- ASMCMD> ls
- ASM/
- ORCL/
- RCAT/
- ASMCMD> cd ORCL/
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- YOURNAME/
- spfileorcl.ora
- ASMCMD> cd YOURNAME/
- ASMCMD> ls
- ASMCMD> ls
- tbs6.dbf
- ASMCMD> ls -l tbs6.dbf
- Type Redund Striped Time Sys Name
- N tbs6.dbf => +DATA/RCAT/DATAFILE/TBS6.269.929729013
- ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS6.269.929729013
- Type Redund Striped Time Sys Name
- DATAFILE HIGH FINE DEC 04 18:00:00 Y TBS6.269.929729013
- ASMCMD> exit
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 18:11:32 2016
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysasm
- Connected.
- SQL> alter diskgroup data drop disk data_0000 force ;
- Diskgroup altered.
- SQL> alter diskgroup data add failgroup data_0000 disk '/dev/raw/raw7' name data_0000 ;
- alter diskgroup data add failgroup data_0000 disk '/dev/raw/raw7' name data_0000
- *
- ERROR at line 1:
- ORA-15032: not all alterations performed
- ORA-15033: disk '/dev/raw/raw7' belongs to diskgroup "DATA"
- SQL> alter diskgroup data add failgroup data_0000 disk '/dev/raw/raw7' name data_0000 ;
- Diskgroup altered.
- SQL> show parameter compat
- SQL> alter diskgroup data set attribute 'compatible.rdbms'='11.2.0';
- SQL> alter diskgroup data set attribute 'compatible.rdbms'='11.2.0';
- Diskgroup altered.
- SQL> alter diskgroup data drop disk data_0000 ;
- Diskgroup altered.
- SQL> alter diskgroup data add failgroup data_0000 disk '/dev/raw/raw7' name data_0000;
- Diskgroup altered.
- SQL> alter diskgroup data offline disk data_0000;
- Diskgroup altered.
- SQL> alter diskgroup data online disk data_0000;
- Diskgroup altered.
- SQL>
复制代码
rcat里的命令:
- select name from v$datafile;
- create tablespace tbs2 datafile '+data' size 10M;
- create tablespace tbs3 datafile '+data(temp1)' size 10M ;
- drop tablespace tbs1 ;
- create tablespace tbs5 datafile '+data/orcl/yourname/tbs5.dbf' size 10M;
- select name from v$datafile;
- drop tablespace tbs4;
- drop tablespace tbs5 including contents and datafiles;
- create tablespace tbs6 datafile '+data(temp1)/orcl/yourname/tbs6.dbf' size 10M;
复制代码
|
|