Bo's Oracle Station

查看: 1306|回复: 0

课程第13/14次

[复制链接]

75

主题

115

帖子

2732

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2732
发表于 2019-6-5 21:30:26 | 显示全部楼层 |阅读模式
Notice: This blog is written by Bo Tang.

2019-06-10

  1. create tablespace rcat datafile '/u01/app/oracle/oradata/rcat/rcat.dbf' size 100M autoextend on ;

  2. create user u80 identified by oracle_4U default tablespace rcat quota unlimited on rcat;

  3. grant recovery_catalog_owner to u90;
复制代码
  1. . oraenv
  2. orcl
  3. ......
  4. rman target / catalog u80/oracle_4U@rcat
  5. rman>  create catalog;
  6. rman> register database;
复制代码


QQ图片20190605222725.png


  1. select  * from v$asm_template where group_number=1;

  2. select  * from v$asm_file
  3. where group_number=1 and  file_number=268;

  4. select  * from v$asm_alias
  5.   where group_number=1 and file_number=268;
  6.   where lower(name) ='tbs2.dbf';

  7. --SYSTEM.256.1008007421


  8. alter diskgroup data add template template1 attribute (unprotected fine);
  9. -------------------------------------
复制代码
  1. select  * from v$logfile;

  2. select  * from v$datafile;

  3. create tablespace tbs1 datafile '+data(template1)' size 10M ;

  4. create tablespace tbs2 datafile '+data(template1)/orcl/datafile/tbs2.dbf' size 10M ;
复制代码

--------------------------------------------------
关于
  1. [oracle@station80 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 10 20:22:08 2019

  3. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  4. SQL> conn / as sysasm
  5. Connected.
  6. SQL> ALTER DISKGROUP HIGHDATA ADD TEMPLATE TEMPLATE1 ATTRIBUTES (mirror FINE);

  7. Diskgroup altered.

  8. SQL>  ALTER DISKGROUP HIGHDATA ADD TEMPLATE TEMPLATE2 ATTRIBUTES ( unprotected  fine ) ;
  9. ALTER DISKGROUP HIGHDATA ADD TEMPLATE TEMPLATE2 ATTRIBUTES ( unprotected  fine )
  10. *
  11. ERROR at line 1:
  12. ORA-15067: command or option incompatible with diskgroup redundancy


  13. SQL>  ALTER DISKGROUP fra ADD TEMPLATE TEMPLATE1  ATTRIBUTES ( unprotected  fine ) ;

  14. Diskgroup altered.

  15. SQL>  ALTER DISKGROUP fra ADD TEMPLATE TEMPLATE2  ATTRIBUTES (  mirror  fine ) ;
  16. ALTER DISKGROUP fra ADD TEMPLATE TEMPLATE2  ATTRIBUTES (  mirror  fine )
  17. *
  18. ERROR at line 1:
  19. ORA-15067: command or option incompatible with diskgroup redundancy


  20. SQL>   ALTER DISKGROUP fra ADD TEMPLATE TEMPLATE2  ATTRIBUTES (  high fine ) ;
  21.   ALTER DISKGROUP fra ADD TEMPLATE TEMPLATE2  ATTRIBUTES (  high fine )
  22. *
  23. ERROR at line 1:
  24. ORA-15067: command or option incompatible with diskgroup redundancy


  25. SQL>
复制代码
删除磁盘组,有client时候是删除不掉的:
  1. SQL> drop diskgroup highdata including contents;
  2. drop diskgroup highdata including contents
  3. *
  4. ERROR at line 1:
  5. ORA-15039: diskgroup not dropped
  6. ORA-15027: active use of diskgroup "HIGHDATA" precludes its dismount
复制代码

---------------------
非下线,非只读,alter database open时要检查:
  1. ORACLE_SID = [orcl] ? +ASM
  2. The Oracle base remains unchanged with value /u01/app/oracle
  3. [oracle@station80 ~]$ sqlplus /nolog

  4. SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 10 20:54:42 2019

  5. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  6. SQL> conn / as sysasm
  7. Connected.
  8. SQL> drop diskgroup highdata  ;
  9. drop diskgroup highdata
  10. *
  11. ERROR at line 1:
  12. ORA-15039: diskgroup not dropped
  13. ORA-15053: diskgroup "HIGHDATA" contains existing files


  14. SQL> drop diskgroup highdata including contents;

  15. Diskgroup dropped.

  16. SQL> exit
  17. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  18. With the Automatic Storage Management option
  19. [oracle@station80 ~]$ . oraenv
  20. ORACLE_SID = [+ASM] ? orcl
  21. The Oracle base remains unchanged with value /u01/app/oracle
  22. [oracle@station80 ~]$ sqlplus /nolog

  23. SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 10 20:55:23 2019

  24. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  25. SQL> conn / as sysdba
  26. Connected.
  27. SQL> alter database open ;
  28. alter database open
  29. *
  30. ERROR at line 1:
  31. ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
  32. ORA-01110: data file 8: '+HIGHDATA/orcl/datafile/tbs3.dbf'


  33. SQL> alter database datafile 8 offline ;

  34. Database altered.

  35. SQL> alter database open ;

  36. Database altered.

  37. SQL> archive log list
  38. Database log mode              Archive Mode
  39. Automatic archival             Enabled
  40. Archive destination            USE_DB_RECOVERY_FILE_DEST
  41. Oldest online log sequence     8
  42. Next log sequence to archive   10
  43. Current log sequence           10
  44. SQL> alter database create datafile 8 as '+data';

  45. Database altered.

  46. SQL> alter database datafile 8 online ;
  47. alter database datafile 8 online
  48. *
  49. ERROR at line 1:
  50. ORA-01113: file 8 needs media recovery
  51. ORA-01110: data file 8: '+DATA/orcl/datafile/tbs3.269.1010610067'


  52. SQL> recover datafile 8 ;
  53. ORA-00279: change 1770013 generated at 06/10/2019 20:32:16 needed for thread 1
  54. ORA-00289: suggestion :
  55. +FRA/orcl/archivelog/2019_06_10/thread_1_seq_3.269.1010609115
  56. ORA-00280: change 1770013 for thread 1 is in sequence #3


  57. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  58. ORA-00279: change 1771435 generated at 06/10/2019 20:45:14 needed for thread 1
  59. ORA-00289: suggestion :
  60. +FRA/orcl/archivelog/2019_06_10/thread_1_seq_4.270.1010609117
  61. ORA-00280: change 1771435 for thread 1 is in sequence #4


  62. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  63. ORA-00279: change 1771445 generated at 06/10/2019 20:45:14 needed for thread 1
  64. ORA-00289: suggestion :
  65. +FRA/orcl/archivelog/2019_06_10/thread_1_seq_5.271.1010609117
  66. ORA-00280: change 1771445 for thread 1 is in sequence #5


  67. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
  68. auto
  69. ORA-00279: change 1771459 generated at 06/10/2019 20:45:17 needed for thread 1
  70. ORA-00289: suggestion :
  71. +FRA/orcl/archivelog/2019_06_10/thread_1_seq_6.272.1010609119
  72. ORA-00280: change 1771459 for thread 1 is in sequence #6


  73. ORA-00279: change 1771462 generated at 06/10/2019 20:45:17 needed for thread 1
  74. ORA-00289: suggestion :
  75. +FRA/orcl/archivelog/2019_06_10/thread_1_seq_7.273.1010609121
  76. ORA-00280: change 1771462 for thread 1 is in sequence #7


  77. Log applied.
  78. Media recovery complete.
  79. SQL> alter database datafile 8 online;

  80. Database altered.

  81. SQL> alter tablespace tbs3 online;

  82. Tablespace altered.

  83. SQL>
复制代码
添加磁盘到磁盘组:
  1. ALTER DISKGROUP DATA ADD FAILGROUP FG2 DISK 'ORCL:ASMLOOP2' SIZE 7000 M FAILGROUP FG1 DISK 'ORCL:ASMLOOP1' SIZE 7000 M REBALANCE POWER 11
复制代码








回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-20 18:20 , Processed in 0.160762 second(s), 27 queries .

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