Bo's Oracle Station

查看: 1782|回复: 0

课程第17/18次(2016-12-04星期日上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-12-4 23:57:36 | 显示全部楼层 |阅读模式
上完1Z0-052第5章(ASM实例管理)
(052共19章,053共21章,063多租户共9章,49-12)
high磁盘组:
  1. create diskgroup diskgroup3  high redundancy
  2.        failgroup fgroup1 disk 'ORCL:ASMDISK1'  
  3.        failgroup fgroup2 disk 'ORCL:ASMDISK2'
  4.        failgroup fgroup3 disk 'ORCL:ASMDISK3'
  5.        attribute 'au_size'='4M';
复制代码
+ASM里的命令:
  1. select  * from v$asm_template;

  2. select  * from v$asm_alias;

  3. select  * from v$asm_file;

  4. select  path,name,failgroup  from v$asm_disk;

  5. select  * from v$asm_operation;

  6. select  * from v$asm_attribute;


复制代码
  1. /dev/sda14          15249       15375     1013760   83  Linux
  2. /dev/sda15          15375       15501     1013760   83  Linux

  3. Disk /dev/mapper/vol0-botanglinux: 94.3 GB, 94296342528 bytes
  4. 255 heads, 63 sectors/track, 11464 cylinders
  5. Units = cylinders of 16065 * 512 = 8225280 bytes
  6. Sector size (logical/physical): 512 bytes / 512 bytes
  7. I/O size (minimum/optimal): 512 bytes / 512 bytes
  8. Disk identifier: 0x00000000

  9. Disk /dev/mapper/vol0-botanglinux doesn't contain a valid partition table

  10. Disk /dev/mapper/loop0: 10.6 GB, 10569117696 bytes
  11. 255 heads, 63 sectors/track, 1284 cylinders
  12. Units = cylinders of 16065 * 512 = 8225280 bytes
  13. Sector size (logical/physical): 512 bytes / 512 bytes
  14. I/O size (minimum/optimal): 512 bytes / 512 bytes
  15. Disk identifier: 0x00000000

  16. Disk /dev/mapper/loop0 doesn't contain a valid partition table
  17. [root@station90 3]# vim /etc/sysconfig/rawdevices
  18. [root@station90 3]# vim /etc/rc.d/init.d/rawdevices
  19. [root@station90 3]# rpm -qa | grep kmod
  20. libmikmod-3.2.0-9.beta2.fc12.x86_64
  21. kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64
  22. [root@station90 3]# rpm -qa | grep oracle
  23. oracle-instantclient11.2-basic-11.2.0.2.0-1.x86_64
  24. oracleasmlib-2.0.4-1.el6.x86_64
  25. oracleasm-support-2.1.8-1.el6.x86_64
  26. kmod-oracleasm-2.0.6.rh1-3.el6_5.x86_64
  27. [root@station90 3]# oracleasm configure -i
  28. Configuring the Oracle ASM library driver.

  29. This will configure the on-boot properties of the Oracle ASM library
  30. driver.  The following questions will determine whether the driver is
  31. loaded on boot and what permissions it will have.  The current values
  32. will be shown in brackets ('[]').  Hitting <ENTER> without typing an
  33. answer will keep that current value.  Ctrl-C will abort.

  34. Default user to own the driver interface []: oracle
  35. Default group to own the driver interface []: asmadmin
  36. Start Oracle ASM library driver on boot (y/n) [n]: y
  37. Scan for Oracle ASM disks on boot (y/n) [y]: y
  38. Writing Oracle ASM library driver configuration: done
  39. [root@station90 3]# service oracleasm start
  40. Initializing the Oracle ASMLib driver:                     [  OK  ]
  41. Scanning the system for Oracle ASMLib disks:               [  OK  ]
  42. [root@station90 3]# oracleasm listdisks
  43. [root@station90 3]# oracleasm-discover
  44. Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
  45. [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
  46. [root@station90 3]# cd /4
  47. [root@station90 4]# ls
  48. 17_Windows7_KVM  linux2.doc  RH135-RHEL6-en-2-20110131-slides.pdf  RH.pdf  评估
  49. [root@station90 4]# dd if=/dev/zero of=loop0.img bs=964M count=1
  50. 记录了1+0 的读入
  51. 记录了1+0 的写出
  52. 1010827264字节(1.0 GB)已复制,0.833313 秒,1.2 GB/秒
  53. [root@station90 4]# dd if=/dev/zero of=loop1.img bs=964M count=1
  54. 记录了1+0 的读入
  55. 记录了1+0 的写出
  56. 1010827264字节(1.0 GB)已复制,0.910872 秒,1.1 GB/秒
  57. [root@station90 4]# dd if=/dev/zero of=loop2.img bs=512M count=1
  58. 记录了1+0 的读入
  59. 记录了1+0 的写出
  60. 536870912字节(537 MB)已复制,0.442148 秒,1.2 GB/秒
  61. [root@station90 4]# dd if=/dev/zero of=loop3.img bs=512M count=1
  62. 记录了1+0 的读入
  63. 记录了1+0 的写出
  64. 536870912字节(537 MB)已复制,0.452707 秒,1.2 GB/秒
  65. [root@station90 4]# dd if=/dev/zero of=loop4.img bs=512M count=1
  66. 记录了1+0 的读入
  67. 记录了1+0 的写出
  68. 536870912字节(537 MB)已复制,0.448147 秒,1.2 GB/秒
  69. [root@station90 4]# ls
  70. 17_Windows7_KVM  loop0.img  loop2.img  loop4.img                             RH.pdf
  71. linux2.doc       loop1.img  loop3.img  RH135-RHEL6-en-2-20110131-slides.pdf  评估
  72. [root@station90 4]# du -sh *.img
  73. 965M        loop0.img
  74. 965M        loop1.img
  75. 513M        loop2.img
  76. 513M        loop3.img
  77. 513M        loop4.img
  78. [root@station90 4]# losetup /dev/loop0  loop0.img
  79. losetup: /dev/loop0: device is busy
  80. [root@station90 4]# df -h
  81. 文件系统              容量  已用  可用 已用%% 挂载点
  82. /dev/mapper/vol0-botanglinux
  83.                        87G   80G  2.2G  98% /
  84. tmpfs                 7.8G  4.3G  3.5G  56% /dev/shm
  85. /dev/sda3             194M  112M   73M  61% /boot
  86. /dev/sda1              21G   20G  1.2G  95% /3
  87. /dev/mapper/loop0     9.7G  9.1G  152M  99% /file/loop0
  88. [root@station90 4]# ls
  89. 17_Windows7_KVM  loop0.img  loop2.img  loop4.img                             RH.pdf
  90. linux2.doc       loop1.img  loop3.img  RH135-RHEL6-en-2-20110131-slides.pdf  评估
  91. [root@station90 4]# mv loop0.img loop5.img
  92. [root@station90 4]# losetup /dev/loop5  loop5.img
  93. [root@station90 4]# losetup /dev/loop1  loop1.img
  94. [root@station90 4]# losetup /dev/loop2  loop2.img
  95. [root@station90 4]# losetup /dev/loop3  loop2.img
  96. [root@station90 4]# losetup -d /dev/loop3
  97. [root@station90 4]# losetup /dev/loop3  loop3.img
  98. [root@station90 4]# losetup /dev/loop4  loop4.img
  99. [root@station90 4]# losetup /dev/loop5
  100. /dev/loop5: [fd00]:408565 (/4/loop5.img)
  101. [root@station90 4]# losetup /dev/loop1
  102. /dev/loop1: [fd00]:408566 (/4/loop1.img)
  103. [root@station90 4]# losetup /dev/loop2
  104. /dev/loop2: [fd00]:408567 (/4/loop2.img)
  105. [root@station90 4]# losetup /dev/loop3
  106. /dev/loop3: [fd00]:408568 (/4/loop3.img)
  107. [root@station90 4]# losetup /dev/loop4
  108. /dev/loop4: [fd00]:408569 (/4/loop4.img)
  109. [root@station90 4]# vim /etc/sysconfig/rawdevices
  110. [root@station90 4]# raw -qa
  111. /dev/raw/raw7:        bound to major 8, minor 7
  112. /dev/raw/raw8:        bound to major 8, minor 8
  113. /dev/raw/raw9:        bound to major 8, minor 9
  114. /dev/raw/raw10:        bound to major 8, minor 10
  115. /dev/raw/raw11:        bound to major 8, minor 11
  116. /dev/raw/raw12:        bound to major 8, minor 12
  117. /dev/raw/raw13:        bound to major 8, minor 13
  118. /dev/raw/raw14:        bound to major 8, minor 14
  119. /dev/raw/raw15:        bound to major 8, minor 15
  120. [root@station90 4]# service rawdevices restart
  121. Assigning devices:
  122.            /dev/raw/raw7  -->   /dev/sda7
  123. Error setting raw device (??????)
  124.            /dev/raw/raw8  -->   /dev/sda8
  125. Error setting raw device (??????)
  126.            /dev/raw/raw9  -->   /dev/sda9
  127. Error setting raw device (??????)
  128.            /dev/raw/raw10  -->   /dev/sda10
  129. Error setting raw device (??????)
  130.            /dev/raw/raw11  -->   /dev/sda11
  131. Error setting raw device (??????)
  132.            /dev/raw/raw12  -->   /dev/sda12
  133. Error setting raw device (??????)
  134.            /dev/raw/raw13  -->   /dev/sda13
  135. Error setting raw device (??????)
  136.            /dev/raw/raw14  -->   /dev/sda14
  137. Error setting raw device (??????)
  138.            /dev/raw/raw15  -->   /dev/sda15
  139. Error setting raw device (??????)
  140.            /dev/raw/raw16  -->   /dev/loop5
  141. /dev/raw/raw16:        bound to major 7, minor 5
  142.            /dev/raw/raw17  -->   /dev/loop1
  143. /dev/raw/raw17:        bound to major 7, minor 1
  144. done
  145. [root@station90 4]# raw -qa
  146. /dev/raw/raw7:        bound to major 8, minor 7
  147. /dev/raw/raw8:        bound to major 8, minor 8
  148. /dev/raw/raw9:        bound to major 8, minor 9
  149. /dev/raw/raw10:        bound to major 8, minor 10
  150. /dev/raw/raw11:        bound to major 8, minor 11
  151. /dev/raw/raw12:        bound to major 8, minor 12
  152. /dev/raw/raw13:        bound to major 8, minor 13
  153. /dev/raw/raw14:        bound to major 8, minor 14
  154. /dev/raw/raw15:        bound to major 8, minor 15
  155. /dev/raw/raw16:        bound to major 7, minor 5
  156. /dev/raw/raw17:        bound to major 7, minor 1
  157. [root@station90 4]# oracleasm createdisk ASMDISK1  /dev/loop2
  158. Writing disk header: done
  159. Instantiating disk: done
  160. [root@station90 4]# oracleasm createdisk ASMDISK2  /dev/loop3
  161. Writing disk header: done
  162. Instantiating disk: done
  163. [root@station90 4]# oracleasm createdisk ASMDISK3  /dev/loop4
  164. Writing disk header: done
  165. Instantiating disk: done
  166. [root@station90 4]# oracleasm-discover
  167. Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
  168. [ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
  169. Discovered disk: ORCL:ASMDISK1 [1048576 blocks (536870912 bytes), maxio 128]
  170. Discovered disk: ORCL:ASMDISK2 [1048576 blocks (536870912 bytes), maxio 128]
  171. Discovered disk: ORCL:ASMDISK3 [1048576 blocks (536870912 bytes), maxio 128]
  172. [root@station90 4]# oracleasm listdisks
  173. ASMDISK1
  174. ASMDISK2
  175. ASMDISK3
  176. [root@station90 4]# oracleasm scandisks
  177. Reloading disk partitions: done
  178. Cleaning any stale ASM disks...
  179. Scanning system for ASM disks...
  180. [root@station90 4]# su - oracle
  181. [oracle@station90 ~]$ . oraenv
  182. ORACLE_SID = [orcl] ? +ASM
  183. The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
  184. [oracle@station90 ~]$ sqlplus /nolog

  185. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 11:39:59 2016

  186. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  187. SQL> conn / as sysdba
  188. Connected.
  189. SQL> show parameter instance_type

  190. NAME                                     TYPE
  191. ------------------------------------ ---------------------------------
  192. VALUE
  193. ------------------------------
  194. instance_type                             string
  195. asm
  196. SQL> show parameter rebalance
  197. SQL> show parameter  asm

  198. NAME                                     TYPE
  199. ------------------------------------ ---------------------------------
  200. VALUE
  201. ------------------------------
  202. asm_diskgroups                             string
  203. FRA
  204. asm_diskstring                             string

  205. asm_power_limit                      integer
  206. 1
  207. asm_preferred_read_failure_groups    string

  208. SQL> exit
  209. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  210. With the Automatic Storage Management option
  211. [oracle@station90 ~]$ ps aux | grep arb
  212. oracle   13278  0.0  0.0 103244   876 pts/2    S+   11:52   0:00 grep arb
  213. [oracle@station90 ~]$ sqlplus /nolog

  214. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 11:55:29 2016

  215. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  216. SQL> conn / as sysdba
  217. Connected.
  218. SQL> show parameter asm

  219. NAME                                     TYPE
  220. ------------------------------------ ---------------------------------
  221. VALUE
  222. ------------------------------
  223. asm_diskgroups                             string
  224. FRA
  225. asm_diskstring                             string

  226. asm_power_limit                      integer
  227. 1
  228. asm_preferred_read_failure_groups    string

  229. SQL> exit
  230. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  231. With the Automatic Storage Management option
  232. [oracle@station90 ~]$ asmcmd
  233. ASMCMD> ls
  234. DATA/
  235. FRA/
  236. ASMCMD> help
  237.         asmcmd [-vV] [-a <sysasm|sysdba>] [-p] [command]

  238.         The environment variables ORACLE_HOME and ORACLE_SID determine the
  239.         instance to which the program connects, and ASMCMD establishes a
  240.         bequeath connection to it, in the same manner as a SQLPLUS / AS
  241.         SYSASM.  The user must be a member of the OSASM group.

  242.         Specifying the -V option prints the asmcmd version number and
  243.         exits immediately.

  244.         Specifying the -v option prints extra information that can help
  245.         advanced users diagnose problems.

  246.         Specify the -a option to choose the type of connection. There are
  247.         only two possibilities: connecting as SYSASM or as SYSDBA.
  248.         The default value if this option is unspecified is SYSASM.

  249.         Specifying the -p option allows the current directory to be displayed
  250.         in the command prompt, like so:

  251.         ASMCMD [+DATA/ORCL/CONTROLFILE] >

  252.         [command] specifies one of the following commands, along with its
  253.         parameters.

  254.         Type "help [command]" to get help on a specific ASMCMD command.

  255.         commands:
  256.         --------

  257.         md_backup, md_restore

  258.         lsattr, setattr

  259.         cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
  260.         mkdir, pwd, rm, rmalias

  261.         chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
  262.         offline, online, rebal, remap, umount

  263.         dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
  264.         spmove, spset, startup

  265.         chtmpl, lstmpl, mktmpl, rmtmpl

  266.         chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
  267.         mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr

  268.         volcreate, voldelete, voldisable, volenable, volinfo
  269.         volresize, volset, volstat

  270. ASMCMD> ls
  271. DATA/
  272. FRA/
  273. ASMCMD> cd data
  274. ASMCMD> ls
  275. ASM/
  276. ORCL/
  277. ASMCMD> cd ORCL/
  278. ASMCMD> ls
  279. CONTROLFILE/
  280. DATAFILE/
  281. ONLINELOG/
  282. PARAMETERFILE/
  283. TEMPFILE/
  284. spfileorcl.ora
  285. ASMCMD> cd DATAFILE/
  286. ASMCMD> ls
  287. EXAMPLE.265.816169651
  288. SYSAUX.257.816169553
  289. SYSTEM.256.816169553
  290. UNDOTBS1.258.816169553
  291. USERS.259.816169553
  292. ASMCMD> exit
  293. [oracle@station90 ~]$ ls
  294. apex                     orcl.txt              reset_sqldev                                 update_t04209_uname.sql
  295. app                      ords                  reset_xmldb                                  公共的
  296. copytape-root.sh         ords.sh               restclient-ui-3.1-jar-with-dependencies.jar  模板
  297. create_t04209_uname.sql  osb.txt               revertape-root.sh                            视频
  298. derby.log                pdb_open_says_me.sql  select_t04209_uname.sql                      图片
  299. mail                     p.sql                 shrink.sh                                    文档
  300. one_time_setup.sql       rac_tns               shrink_undo.sql                              下载
  301. oracle                   reset_apex            sqldeveloper                                 音乐
  302. oradiag_oracle           reset_JSON            s_rest.zip                                   桌面
  303. oraInventory             reset_rest            tnsnames.ora
  304. orcl.link                reset_soup            ttio.rcv
  305. orcl.ora                 reset_soup_apex_only  update2_t04209_uname.sql
  306. [oracle@station90 ~]$ vim diskgroup3.sql
  307. [oracle@station90 ~]$ sqlplus /nolog

  308. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 12:30:35 2016

  309. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  310. SQL> conn / as sysasm
  311. Connected.
  312. SQL> @diskgroup3.sql
  313. create diskgroup diskgroup3  high redundancy
  314. *
  315. ERROR at line 1:
  316. ORA-15018: diskgroup cannot be created
  317. ORA-15031: disk specification 'ORCL:ASMDISK3' matches no disks
  318. ORA-15031: disk specification 'ORCL:ASMDISK2' matches no disks
  319. ORA-15031: disk specification 'ORCL:ASMDISK1' matches no disks


  320. SQL> select  name from v$asm_disk;

  321. NAME
  322. --------------------------------------------------------------------------------


  323. FRA_0002
  324. FRA_0001
  325. FRA_0000
  326. DATA_0005
  327. DATA_0004
  328. DATA_0003
  329. DATA_0002
  330. DATA_0001
  331. DATA_0000

  332. 11 rows selected.

  333. SQL> exit
  334. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  335. With the Automatic Storage Management option
  336. [oracle@station90 ~]$ sqlplus /nolog

  337. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 12:32:24 2016

  338. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  339. SQL> conn / as sysasm
  340. Connected to an idle instance.
  341. SQL> startup
  342. ORA-01078: failure in processing system parameters
  343. ORA-29701: unable to connect to Cluster Synchronization Service
  344. SQL> conn / as sysasm
  345. Connected to an idle instance.
  346. SQL> conn / as sysasm
  347. Connected to an idle instance.
  348. SQL> conn / as sysasm
  349. Connected to an idle instance.
  350. SQL> conn / as sysasm
  351. Connected to an idle instance.
  352. SQL> conn / as sysasm
  353. Connected to an idle instance.
  354. SQL> conn / as sysasm
  355. Connected to an idle instance.
  356. SQL> conn / as sysasm
  357. Connected to an idle instance.
  358. SQL> conn / as sysasm
  359. Connected to an idle instance.
  360. SQL> conn / as sysasm
  361. Connected to an idle instance.
  362. SQL> conn / as sysasm
  363. Connected to an idle instance.
  364. SQL> conn / as sysasm
  365. Connected to an idle instance.
  366. SQL> conn / as sysasm
  367. Connected to an idle instance.
  368. SQL> conn / as sysasm
  369. Connected to an idle instance.
  370. SQL> startup
  371. ORA-01078: failure in processing system parameters
  372. ORA-29701: unable to connect to Cluster Synchronization Service
  373. SQL> conn / as sysasm
  374. Connected to an idle instance.
  375. SQL> startup
  376. ASM instance started

  377. Total System Global Area  283930624 bytes
  378. Fixed Size                    2212656 bytes
  379. Variable Size                  256552144 bytes
  380. ASM Cache                   25165824 bytes
  381. ASM diskgroups mounted
  382. SQL> select  name from v$asm_disk;

  383. NAME
  384. --------------------------------------------------------------------------------








  385. DATA_0005
  386. DATA_0004
  387. DATA_0003

  388. NAME
  389. --------------------------------------------------------------------------------
  390. DATA_0002
  391. DATA_0001
  392. DATA_0000

  393. 14 rows selected.

  394. SQL> @diskgroup3.sql

  395. Diskgroup created.

  396. SQL> exit
  397. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  398. With the Automatic Storage Management option
  399. [oracle@station90 ~]$ crs_stat -t
  400. Name           Type           Target    State     Host        
  401. ------------------------------------------------------------
  402. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  403. ora....OUP3.dg ora....up.type ONLINE    ONLINE    station90   
  404. ora.FRA.dg     ora....up.type ONLINE    OFFLINE               
  405. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  406. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  407. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  408. ora.diskmon    ora....on.type ONLINE    ONLINE    station90   
  409. ora.orcl.db    ora....se.type ONLINE    OFFLINE               
  410. [oracle@station90 ~]$ sqlplus /nolog

  411. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 15:33:29 2016

  412. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  413. SQL> conn / as sysasm
  414. Connected.
  415. SQL> alter diskgroup fra mount ;

  416. Diskgroup altered.

  417. SQL> alter diskgroup  diskgroup3 set attribute 'compatible.asm'='11.2.0';

  418. Diskgroup altered.

  419. SQL> alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.2.0';
  420. alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.2.0'
  421. *
  422. ERROR at line 1:
  423. ORA-15032: not all alterations performed
  424. ORA-15242: could not set attribute compatible.asm
  425. ORA-15238: 10.2.0 is not a valid value for attribute compatible.asm
  426. ORA-15243: 10.2.0.0.0 is not a valid version number


  427. SQL> alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.2.0.1';
  428. alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.2.0.1'
  429. *
  430. ERROR at line 1:
  431. ORA-15032: not all alterations performed
  432. ORA-15242: could not set attribute compatible.asm
  433. ORA-15238: 10.2.0.1 is not a valid value for attribute compatible.asm
  434. ORA-15243: 10.2.0.1.0 is not a valid version number


  435. SQL> alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.1.0';
  436. alter diskgroup  diskgroup3 set attribute 'compatible.asm'='10.1.0'
  437. *
  438. ERROR at line 1:
  439. ORA-15032: not all alterations performed
  440. ORA-15242: could not set attribute compatible.asm
  441. ORA-15244: new compatibility setting less than current [11.2.0.0.0]


  442. SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP1" ATTRIBUTES (HIGH FINE);

  443. Diskgroup altered.

  444. SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprot FINE);
  445. ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprot FINE)
  446.                                                       *
  447. ERROR at line 1:
  448. ORA-00905: missing keyword


  449. SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotect FINE);
  450. ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotect FINE)
  451.                                                       *
  452. ERROR at line 1:
  453. ORA-00905: missing keyword


  454. SQL> ALTER DISKGROUP DATA ADD TEMPLATE "TEMP2" ATTRIBUTES (unprotected FINE);

  455. Diskgroup altered.

  456. SQL> ALTER DISKGROUP disgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE);
  457. ALTER DISKGROUP disgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE)
  458. *
  459. ERROR at line 1:
  460. ORA-15032: not all alterations performed
  461. ORA-15001: diskgroup "DISGROUP3" does not exist or is not mounted


  462. SQL> ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE);
  463. ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (unprotected FINE)
  464. *
  465. ERROR at line 1:
  466. ORA-15067: command or option incompatible with diskgroup redundancy


  467. SQL> ALTER DISKGROUP diskgroup3 ADD TEMPLATE "TEMP3" ATTRIBUTES (mirror FINE);

  468. Diskgroup altered.

  469. SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (mirror FINE);
  470. ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (mirror FINE)
  471. *
  472. ERROR at line 1:
  473. ORA-15067: command or option incompatible with diskgroup redundancy


  474. SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (high FINE);
  475. ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (high FINE)
  476. *
  477. ERROR at line 1:
  478. ORA-15067: command or option incompatible with diskgroup redundancy


  479. SQL> ALTER DISKGROUP fra ADD TEMPLATE "TEMP4" ATTRIBUTES (unprotected FINE);

  480. Diskgroup altered.

  481. SQL> drop diskgroup diskgroup3;
  482. drop diskgroup diskgroup3
  483. *
  484. ERROR at line 1:
  485. ORA-15039: diskgroup not dropped
  486. ORA-15053: diskgroup "DISKGROUP3" contains existing files


  487. SQL> drop diskgroup diskgroup3;

  488. Diskgroup dropped.

  489. SQL> exit
  490. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  491. With the Automatic Storage Management option
  492. [oracle@station90 ~]$ ls
  493. apex                     oraInventory          reset_apex                                   shrink.sh                 视频
  494. app                      orcl.link             reset_JSON                                   shrink_undo.sql           图片
  495. copytape-root.sh         orcl.ora              reset_rest                                   sqldeveloper              文档
  496. create_t04209_uname.sql  orcl.txt              reset_soup                                   s_rest.zip                下载
  497. derby.log                ords                  reset_soup_apex_only                         tnsnames.ora              音乐
  498. diskgroup3.sql           ords.sh               reset_sqldev                                 ttio.rcv                  桌面
  499. mail                     osb.txt               reset_xmldb                                  update2_t04209_uname.sql
  500. one_time_setup.sql       pdb_open_says_me.sql  restclient-ui-3.1-jar-with-dependencies.jar  update_t04209_uname.sql
  501. oracle                   p.sql                 revertape-root.sh                            公共的
  502. oradiag_oracle           rac_tns               select_t04209_uname.sql                      模板
  503. [oracle@station90 ~]$ vim diskgroup3.sql
  504. [oracle@station90 ~]$ sqlplus /nolog

  505. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 17:15:29 2016

  506. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  507. SQL> conn / as sysasm
  508. Connected.
  509. SQL> @diskgroup3.sql

  510. Diskgroup created.

  511. SQL> drop diskgroup diskgroup3;

  512. Diskgroup dropped.

  513. SQL> exit
  514. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  515. With the Automatic Storage Management option
  516. [oracle@station90 ~]$ ls
  517. apex                     oraInventory          reset_apex                                   shrink.sh                 视频
  518. app                      orcl.link             reset_JSON                                   shrink_undo.sql           图片
  519. copytape-root.sh         orcl.ora              reset_rest                                   sqldeveloper              文档
  520. create_t04209_uname.sql  orcl.txt              reset_soup                                   s_rest.zip                下载
  521. derby.log                ords                  reset_soup_apex_only                         tnsnames.ora              音乐
  522. diskgroup3.sql           ords.sh               reset_sqldev                                 ttio.rcv                  桌面
  523. mail                     osb.txt               reset_xmldb                                  update2_t04209_uname.sql
  524. one_time_setup.sql       pdb_open_says_me.sql  restclient-ui-3.1-jar-with-dependencies.jar  update_t04209_uname.sql
  525. oracle                   p.sql                 revertape-root.sh                            公共的
  526. oradiag_oracle           rac_tns               select_t04209_uname.sql                      模板
  527. [oracle@station90 ~]$ vim diskgroup3.sql
  528. [oracle@station90 ~]$ sqlplus /nolog

  529. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 17:16:53 2016

  530. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  531. SQL> conn / as sysasm
  532. Connected.
  533. SQL> @diskgroup3.sql

  534. Diskgroup created.

  535. SQL> show parameter asm

  536. NAME                                     TYPE
  537. ------------------------------------ ---------------------------------
  538. VALUE
  539. ------------------------------
  540. asm_diskgroups                             string
  541. FRA, DISKGROUP3
  542. asm_diskstring                             string

  543. asm_power_limit                      integer
  544. 1
  545. asm_preferred_read_failure_groups    string

  546. SQL> alter diskgroup data add failgroup DATA_0000  
  547.   2     add disk '/dev/raw/raw16' name DATA_0006
  548.   3   failgroup DATA_0001
  549.   4    add disk '/dev/raw/raw17' name DATA_0007
  550.   5  rebalance power 11 ;
  551.    add disk '/dev/raw/raw16' name DATA_0006
  552.    *
  553. ERROR at line 2:
  554. ORA-00905: missing keyword


  555. SQL> alter diskgroup data add failgroup DATA_0000
  556.   2    disk '/dev/raw/raw16' name DATA_0006
  557.   3   failgroup DATA_0001
  558.   4    disk '/dev/raw/raw17' name DATA_0007
  559.   5   rebalance power 11 ;

  560. Diskgroup altered.

  561. SQL> alter diskgroup data  drop disk  DATA_0006
  562.   2                              disk DATA_0007
  563.   3   rebalance power 11 ;

  564. Diskgroup altered.

  565. SQL> alter diskgroup data  drop disk  DATA_0001
  566.   2                  add  failgroup DATA_0000 disk '/dev/raw/raw8' name DATA_0001;
  567. alter diskgroup data  drop disk  DATA_0001
  568. *
  569. ERROR at line 1:
  570. ORA-15032: not all alterations performed
  571. ORA-15029: disk '/dev/raw/raw8' is already mounted by this instance


  572. SQL> alter diskgroup data  drop disk  DATA_0001
  573.   2                  add  failgroup DATA_0000 disk '/dev/raw/raw16' name DATA_0001;
  574. alter diskgroup data  drop disk  DATA_0001
  575. *
  576. ERROR at line 1:
  577. ORA-15032: not all alterations performed
  578. ORA-15020: discovered duplicate ASM disk "DATA_0001"


  579. SQL> alter diskgroup data  drop disk  DATA_0001
  580.   2                  add  failgroup DATA_0000 disk '/dev/raw/raw16' name DATA_0008;

  581. Diskgroup altered.

  582. SQL> alter diskgroup data  drop disk  DATA_0003;

  583. Diskgroup altered.

  584. SQL> alter diskgroup data  add  failgroup  DATA_0002  disk '/dev/raw/raw10'   name DATA_0003;

  585. Diskgroup altered.

  586. SQL> alter diskgroup data  drop disk  DATA_0008;

  587. Diskgroup altered.

  588. SQL> alter diskgroup data  add  failgroup  DATA_0000  disk '/dev/raw/raw8'   name DATA_0001;

  589. Diskgroup altered.

  590. SQL> alter diskgroup data  drop disk  DATA_0005;

  591. Diskgroup altered.

  592. SQL> alter diskgroup data  add  failgroup  DATA_0004  disk '/dev/raw/raw12'   name DATA_0005;
  593. alter diskgroup data  add  failgroup  DATA_0004  disk '/dev/raw/raw12'         name DATA_0005
  594. *
  595. ERROR at line 1:
  596. ORA-15032: not all alterations performed
  597. ORA-15029: disk '/dev/raw/raw12' is already mounted by this instance


  598. SQL> alter diskgroup data  add  failgroup  DATA_0004  disk '/dev/raw/raw12'   name DATA_0005;

  599. Diskgroup altered.

  600. SQL> alter diskgroup data undrop disks;

  601. Diskgroup altered.

  602. SQL> exit
  603. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  604. With the Automatic Storage Management option
  605. [oracle@station90 ~]$ asmca
  606. No protocol specified
  607. [oracle@station90 ~]$ . oraenv
  608. ORACLE_SID = [+ASM] ?
  609. The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
  610. [oracle@station90 ~]$ asmcmd
  611. ASMCMD> ls
  612. DATA/
  613. DISKGROUP3/
  614. FRA/
  615. ASMCMD> cd DATA/
  616. ASMCMD> ls
  617. ASM/
  618. ORCL/
  619. RCAT/
  620. ASMCMD> cd ORCL/
  621. ASMCMD> ls
  622. CONTROLFILE/
  623. DATAFILE/
  624. ONLINELOG/
  625. PARAMETERFILE/
  626. TEMPFILE/
  627. spfileorcl.ora
  628. ASMCMD> cd PARAMETERFILE/
  629. ASMCMD> ls
  630. spfile.266.929563525
  631. ASMCMD> ls
  632. spfile.266.929563525
  633. ASMCMD> cd ..
  634. ASMCMD> ls
  635. CONTROLFILE/
  636. DATAFILE/
  637. ONLINELOG/
  638. PARAMETERFILE/
  639. TEMPFILE/
  640. spfileorcl.ora
  641. ASMCMD> mkdir YOURNAME
  642. ASMCMD> ls
  643. CONTROLFILE/
  644. DATAFILE/
  645. ONLINELOG/
  646. PARAMETERFILE/
  647. TEMPFILE/
  648. YOURNAME/
  649. spfileorcl.ora
  650. ASMCMD> cd YOURNAME/
  651. ASMCMD> sl
  652.         commands:
  653.         --------

  654.         md_backup, md_restore

  655.         lsattr, setattr

  656.         cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
  657.         mkdir, pwd, rm, rmalias

  658.         chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
  659.         offline, online, rebal, remap, umount

  660.         dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
  661.         spmove, spset, startup

  662.         chtmpl, lstmpl, mktmpl, rmtmpl

  663.         chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
  664.         mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr

  665.         volcreate, voldelete, voldisable, volenable, volinfo
  666.         volresize, volset, volstat

  667. ASMCMD> ls
  668. ASMCMD> pwd
  669. +DATA/ORCL/YOURNAME
  670. ASMCMD> ls
  671. tbs4.dbf
  672. ASMCMD> ls -l
  673. Type      Redund  Striped  Time             Sys  Name
  674.                                             N    tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
  675. ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS4.269.929728719
  676. Type      Redund  Striped  Time             Sys  Name
  677. DATAFILE  MIRROR  COARSE   DEC 04 17:00:00  Y    TBS4.269.929728719
  678. ASMCMD> ls
  679. tbs4.dbf
  680. ASMCMD> ls
  681. tbs4.dbf
  682. ASMCMD> cd ..
  683. ASMCMD> ls
  684. CONTROLFILE/
  685. DATAFILE/
  686. ONLINELOG/
  687. PARAMETERFILE/
  688. TEMPFILE/
  689. YOURNAME/
  690. spfileorcl.ora
  691. ASMCMD> cd DATAFILE/
  692. ASMCMD> ls
  693. EXAMPLE.265.816169651
  694. SYSAUX.257.816169553
  695. SYSTEM.256.816169553
  696. UNDOTBS1.258.816169553
  697. USERS.259.816169553
  698. ASMCMD> cd ..
  699. ASMCMD> ls
  700. CONTROLFILE/
  701. DATAFILE/
  702. ONLINELOG/
  703. PARAMETERFILE/
  704. TEMPFILE/
  705. YOURNAME/
  706. spfileorcl.ora
  707. ASMCMD> cd YOURNAME/
  708. ASMCMD> ls
  709. tbs4.dbf
  710. ASMCMD> ls -l
  711. Type      Redund  Striped  Time             Sys  Name
  712.                                             N    tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
  713. ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS4.269.929728719
  714. Type      Redund  Striped  Time             Sys  Name
  715. DATAFILE  MIRROR  COARSE   DEC 04 18:00:00  Y    TBS4.269.929728719
  716. ASMCMD> ls
  717. tbs4.dbf
  718. tbs5.dbf
  719. ASMCMD> ls
  720. tbs4.dbf
  721. ASMCMD> ls -l
  722. Type      Redund  Striped  Time             Sys  Name
  723.                                             N    tbs4.dbf => +DATA/RCAT/DATAFILE/TBS4.269.929728719
  724. ASMCMD> cd ..
  725. ASMCMD> ls
  726. CONTROLFILE/
  727. DATAFILE/
  728. ONLINELOG/
  729. PARAMETERFILE/
  730. TEMPFILE/
  731. YOURNAME/
  732. spfileorcl.ora
  733. ASMCMD> cls   
  734.         commands:
  735.         --------

  736.         md_backup, md_restore

  737.         lsattr, setattr

  738.         cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
  739.         mkdir, pwd, rm, rmalias

  740.         chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
  741.         offline, online, rebal, remap, umount

  742.         dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
  743.         spmove, spset, startup

  744.         chtmpl, lstmpl, mktmpl, rmtmpl

  745.         chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
  746.         mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr

  747.         volcreate, voldelete, voldisable, volenable, volinfo
  748.         volresize, volset, volstat

  749. ASMCMD> ls
  750. CONTROLFILE/
  751. DATAFILE/
  752. ONLINELOG/
  753. PARAMETERFILE/
  754. TEMPFILE/
  755. YOURNAME/
  756. spfileorcl.ora
  757. ASMCMD> cd ..
  758. ASMCMD> ls
  759. ASM/
  760. ORCL/
  761. RCAT/
  762. ASMCMD> cd RCAT/
  763. ASMCMD> ls
  764. DATAFILE/
  765. ASMCMD> cd DATAFILE/
  766. ASMCMD> ls
  767. TBS2.267.929724085
  768. TBS3.268.929724423
  769. TBS4.269.929728719
  770. ASMCMD> rm  TBS4.269.929728719
  771. ASMCMD> ls
  772. TBS2.267.929724085
  773. TBS3.268.929724423
  774. ASMCMD> cd ..
  775. ASMCMD> ls
  776. DATAFILE/
  777. ASMCMD> cd ..
  778. ASMCMD> ls
  779. ASM/
  780. ORCL/
  781. RCAT/
  782. ASMCMD> cd ..
  783. ASMCMD> ls
  784. DATA/
  785. DISKGROUP3/
  786. FRA/
  787. ASMCMD> cd DATA/
  788. ASMCMD> ls
  789. ASM/
  790. ORCL/
  791. RCAT/
  792. ASMCMD> cd ORCL/
  793. ASMCMD> ls
  794. CONTROLFILE/
  795. DATAFILE/
  796. ONLINELOG/
  797. PARAMETERFILE/
  798. TEMPFILE/
  799. YOURNAME/
  800. spfileorcl.ora
  801. ASMCMD> cd YOURNAME/
  802. ASMCMD> ls
  803. ASMCMD> ls
  804. tbs6.dbf
  805. ASMCMD> ls -l tbs6.dbf
  806. Type      Redund  Striped  Time             Sys  Name
  807.                                             N    tbs6.dbf => +DATA/RCAT/DATAFILE/TBS6.269.929729013
  808. ASMCMD> ls -l +DATA/RCAT/DATAFILE/TBS6.269.929729013
  809. Type      Redund  Striped  Time             Sys  Name
  810. DATAFILE  HIGH    FINE     DEC 04 18:00:00  Y    TBS6.269.929729013
  811. ASMCMD> exit
  812. [oracle@station90 ~]$ sqlplus /nolog

  813. SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 4 18:11:32 2016

  814. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  815. SQL> conn  / as sysasm
  816. Connected.
  817. SQL> alter diskgroup data drop disk data_0000  force ;

  818. Diskgroup altered.

  819. SQL> alter diskgroup data add   failgroup  data_0000   disk '/dev/raw/raw7' name data_0000   ;
  820. alter diskgroup data add   failgroup  data_0000   disk '/dev/raw/raw7' name data_0000
  821. *
  822. ERROR at line 1:
  823. ORA-15032: not all alterations performed
  824. ORA-15033: disk '/dev/raw/raw7' belongs to diskgroup "DATA"


  825. SQL> alter diskgroup data add   failgroup  data_0000   disk '/dev/raw/raw7' name data_0000   ;

  826. Diskgroup altered.

  827. SQL> show parameter compat
  828. SQL> alter diskgroup data set attribute 'compatible.rdbms'='11.2.0';

  829. SQL> alter diskgroup data set attribute 'compatible.rdbms'='11.2.0';

  830. Diskgroup altered.

  831. SQL> alter diskgroup data drop disk data_0000  ;

  832. Diskgroup altered.

  833. SQL> alter diskgroup data  add failgroup data_0000 disk '/dev/raw/raw7' name data_0000;

  834. Diskgroup altered.

  835. SQL> alter diskgroup data offline disk data_0000;

  836. Diskgroup altered.

  837. SQL> alter diskgroup data online disk data_0000;

  838. Diskgroup altered.

  839. SQL>

复制代码


rcat里的命令:
  1. select   name  from v$datafile;

  2. create tablespace tbs2 datafile '+data' size 10M;

  3. create tablespace tbs3 datafile '+data(temp1)' size 10M ;

  4. drop tablespace tbs1 ;

  5. create tablespace tbs5 datafile '+data/orcl/yourname/tbs5.dbf' size 10M;

  6. select  name from v$datafile;

  7. drop tablespace tbs4;

  8. drop tablespace tbs5  including contents and datafiles;

  9. create tablespace tbs6 datafile '+data(temp1)/orcl/yourname/tbs6.dbf' size 10M;
复制代码




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-19 04:49 , Processed in 0.042541 second(s), 24 queries .

快速回复 返回顶部 返回列表