码迷,mamicode.com
首页 > 数据库 > 详细

Oracle Database 控制文件管理

时间:2018-06-25 12:55:01      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:more   Fix   UI   mount   移动   control   ash   des   val   

移动控制文件

[oracle@db01 ~]$ sqlplus / as sysdba
SQL> set line 200
SQL> col name for a60
SQL> select status,name from v$controlfile;
STATUS                NAME
--------------------- ------------------------------------------------------------
                      /u01/app/oracle/oradata/king/control01.ctl
                      /u01/app/oracle/flash_recovery_area/king/control02.ctl


SQL> alter system set control_files=
'/u01/app/oracle/oradata/king/control01.ctl',
'/u02/app/oracle/oradata/king/control02.ctl' scope=spfile;


SQL> shutdown immediate                                
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit


[oracle@db01 ~]$ cp /u01/app/oracle/oradata/king/control01.ctl /u02/app/oracle/oradata/king/control02.ctl


[oracle@db01 ~]$ sqlplus / as sysdba
SQL> startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             289410904 bytes
Database Buffers          771751936 bytes
Redo Buffers                5554176 bytes
Database mounted.
Database opened.


SQL> set line 200
SQL> col name for a60
SQL> select status,name from v$controlfile;
STATUS                NAME
--------------------- ------------------------------------------------------------
                      /u01/app/oracle/oradata/king/control01.ctl
                      /u02/app/oracle/oradata/king/control02.ctl


SQL> host rm -rf /u01/app/oracle/flash_recovery_area/king/control02.ctl


重建控制文件

SQL> show parameter user_dump_dest
NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
user_dump_dest                       string                            /u01/app/oracle/diag/rdbms/kin
                                                                       g/king/trace
                                                                       
SQL> alter session set tracefile_identifier='trace_control';

SQL> alter database backup controlfile to trace;

[oracle@db01 ~]$ cd /u01/app/oracle/diag/rdbms/king/king/trace

[oracle@db01 trace]$ more king_ora_20316_trace_control.trc


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> host rm -rf /u01/app/oracle/oradata/king/control01.ctl

SQL> host rm -rf /u01/app/oracle/oradata/king/control02.ctl


SQL> startup nomount
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             289410904 bytes
Database Buffers          771751936 bytes
Redo Buffers                5554176 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "KING" NORESETLOGS  ARCHIVELOG
        MAXLOGFILES 16
        MAXLOGMEMBERS 3
        MAXDATAFILES 100
        MAXINSTANCES 8
        MAXLOGHISTORY 292
    LOGFILE
      GROUP 1 '/u01/app/oracle/oradata/king/redo01.log'  SIZE 50M BLOCKSIZE 512,
      GROUP 2 '/u01/app/oracle/oradata/king/redo02.log'  SIZE 50M BLOCKSIZE 512,
      GROUP 3 '/u01/app/oracle/oradata/king/redo03.log'  SIZE 50M BLOCKSIZE 512
    -- STANDBY LOGFILE
    DATAFILE
       '/u01/app/oracle/oradata/king/system01.dbf',
       '/u01/app/oracle/oradata/king/sysaux01.dbf',
       '/u01/app/oracle/oradata/king/users01.dbf',
       '/u01/app/oracle/oradata/king/tpcc01.dbf',
       '/u01/app/oracle/oradata/king/tpcc02.dbf',
       '/u01/app/oracle/oradata/king/undotbs02.dbf'
     CHARACTER SET AL32UTF8;
     
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             289410904 bytes
Database Buffers          771751936 bytes
Redo Buffers                5554176 bytes
Database mounted.
Database opened.


Oracle Database 控制文件管理

标签:more   Fix   UI   mount   移动   control   ash   des   val   

原文地址:http://blog.51cto.com/13598811/2132354

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!