控制文件實驗

 

  1. SQL> conn / as sysdba 
  2. Connected. 
  3. SQL> show parameter control_file  
  4.  
  5. NAME                                 TYPE        VALUE 
  6. ------------------------------------ ----------- ------------------------------ 
  7. control_file_record_keep_time        integer     7 
  8. control_files                        string      /u01/app/oracle/oradata/orcl/c 
  9.                                                  ontrol01.ctl, /u01/app/oracle/ 
  10.                                                  oradata/orcl/control02.ctl, /u 
  11.                                                  01/app/oracle/oradata/orcl/con 
  12.                                                  trol03.ctl 
  13.  
  14.  
  15.  
  16.  
  17. [root@station4 ~]# ls -l /u01/app/oracle/oradata/orcl/control01.ctl 
  18. -rw-r----- 1 oracle oinstall 7159808 Mar  9 14:08 /u01/app/oracle/oradata/orcl/control01.ctl 
  19. [root@station4 ~]# rm -i /u01/app/oracle/oradata/orcl/control01.ctl 
  20. rm: remove regular file `/u01/app/oracle/oradata/orcl/control01.ctl'? y 
  21.  
  22.  
  23. SQL> shutdown immediate; 
  24. ORA-00210: cannot open the specified control file 
  25. ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl' 
  26. ORA-27041: unable to open file 
  27. Linux Error: 2: No such file or directory 
  28. Additional information: 3 
  29. SQL> shutdown abort  
  30. ORACLE instance shut down. 
  31. @@@if you want to open the database will occur errors 
  32. SQL> startup 
  33. ORACLE instance started. 
  34.  
  35. Total System Global Area  276824064 bytes 
  36. Fixed Size                  1218944 bytes 
  37. Variable Size              92276352 bytes 
  38. Database Buffers          180355072 bytes 
  39. Redo Buffers                2973696 bytes 
  40. ORA-00205: error in identifying control file, check alert log for more info 
  41.  
  42. @@@use  oracle identify to copy the image copy from other contolfiles 
  43. [oracle@station4 ~]$ cp /u01/app/oracle/oradata/orcl/control02.ctl /u01/app/oracle/oradata/orcl/control01.ctl 
  44. @@@@alter database status 
  45. SQL> alter database mount; 
  46.  
  47. Database altered. 
  48.  
  49. SQL> alter database open
  50.  
  51. Database altered. 
  52.  
  53.  
  54.  
  55.  
  56. @@@@lab 2 add new control file 
  57.  
  58. SQL> shutdown immediate 
  59. Database closed. 
  60. Database dismounted./u01/app/oracle/oradata/orcl/control01.ctl 
  61. ORACLE instance shut down. 
  62.  
  63.  
  64.  
  65. @@@@open database to nomount 
  66. @@@@add new control file 
  67. SQL> startup nomount; 
  68. ORACLE instance started. 
  69.  
  70. Total System Global Area  276824064 bytes 
  71. Fixed Size                  1218944 bytes 
  72. Variable Size              96470656 bytes 
  73. Database Buffers          176160768 bytes 
  74. Redo Buffers                2973696 bytes 
  75.  
  76.  
  77. [oracle@station4 controlfile]$ cp /u01/app/oracle/oradata/ORCL/controlfile/control04.ctl /u01/app/oracle/oradata/orcl/control04.ctl 
  78.  
  79. SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl','/u01/app/oracle/oradata/orcl/control04.ctl'  scope=spfile; 
  80.  
  81. System altered. 
  82.  
  83. @@@shutdown database then open it 
  84. SQL> shutdown immediate 
  85. ORA-01507: database not mounted 
  86. ORACLE instance shut down. 
  87. SQL> startup            
  88. ORACLE instance started. 
  89.  
  90. Total System Global Area  276824064 bytes 
  91. Fixed Size                  1218944 bytes 
  92. Variable Size              96470656 bytes 
  93. Database Buffers          176160768 bytes 
  94. Redo Buffers                2973696 bytes 
  95. Database mounted. 
  96. Database opened. 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章