【备份恢复】所有控制文件丢失后 利用trace中的控制文件备份执行恢复

丢失了所有控制文件副本后进行恢复

注:在利用trace备份恢复控制文件的时候,有一下两个点要特别注意:
    - 只读表空间
    - 临时表空间

1.准备只读表空间环境
SYS@ORA11GR2>create tablespace ts datafile
  2  '/u01/app/oracle/oradata/ORA11GR2/ts01.dbf' size
  3  5m,'/u01/app/oracle/oradata/ORA11GR2/ts02.dbf' size 5m;

Tablespace created.

SYS@ORA11GR2>select tablespace_name,status from dba_tablespaces where tablespace_name='TS';

TABLESPACE_NAME STATUS
--------------- ---------
TS              ONLINE
SYS@ORA11GR2>select file_id,file_name,status,online_status from dba_data_files where tablespace_name='TS';

   FILE_ID FILE_NAME                                     STATUS    ONLINE_
---------- --------------------------------------------- --------- -------
        12 /u01/app/oracle/oradata/ORA11GR2/ts01.dbf     AVAILABLE ONLINE
        13 /u01/app/oracle/oradata/ORA11GR2/ts02.dbf     AVAILABLE ONLINE

——将表空间ts该为read only:
SYS@ORA11GR2>alter tablespace ts read only;

Tablespace altered.

SYS@ORA11GR2>select tablespace_name,status from dba_tablespaces where tablespace_name='TS';

TABLESPACE_NAME STATUS
--------------- ---------
TS              READ ONLY

SYS@ORA11GR2>select file_id,file_name,status,online_status from dba_data_files where tablespace_name='TS';

   FILE_ID FILE_NAME                                     STATUS    ONLINE_
---------- --------------------------------------------- --------- -------
        12 /u01/app/oracle/oradata/ORA11GR2/ts01.dbf     AVAILABLE ONLINE
        13 /u01/app/oracle/oradata/ORA11GR2/ts02.dbf     AVAILABLE ONLINE

2.查看控制文件位置
SYS@ORA11GR2>select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORA11GR2/control01.ctl
/u01/app/oracle/oradata/ORA11GR2/control02.ctl

3.转储控制文件到trace文件中
SYS@ORA11GR2>oradebug setmypid(设定追踪)
Statement processed.

SYS@ORA11GR2>alter database backup controlfile to trace;

Database altered.

SYS@ORA11GR2>oradebug tracefile_name(显示产生的追踪文件名称)
/u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_ora_23019.trc
SYS@ORA11GR2>

4.打开转储后文件,以下为部分内容
SYS@ORA11GR2>!cat /u01/app/oracle/diag/rdbms/ora11gr2/ORA11GR2/trace/ORA11GR2_ora_23019.trc
———————————————————————————————————————
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORA11GR2" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/ORA11GR2/redo01.log',
    '/u01/app/oracle/oradata/ORA11GR2/redo01_a.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/ORA11GR2/redo02.log',
    '/u01/app/oracle/oradata/ORA11GR2/redo02_a.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/ORA11GR2/redo03.log',
    '/u01/app/oracle/oradata/ORA11GR2/redo03_a.log'
  ) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/ORA11GR2/system01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/ts_lob01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/users01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/example01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/ts_idx01.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/ts_catalog.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/ts_users.dbf',
  '/u01/app/oracle/oradata/ORA11GR2/undo1.dbf'
CHARACTER SET AL32UTF8
;
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEFAULT DEVICE TYPE TO','DISK');
-- Configure RMAN configuration record 2
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK BACKUP TYPE TO COPY PARALLELISM 1');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/FRA/ORA11GR2/archivelog/2016_10_01/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Set Database Guard and/or Supplemental Logging
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Files in read-only tablespaces are now named.
ALTER DATABASE RENAME FILE 'MISSING00011'
  TO '/u01/app/oracle/oradata/ORA11GR2/ts1.dbf';
ALTER DATABASE RENAME FILE 'MISSING00012'
  TO '/u01/app/oracle/oradata/ORA11GR2/ts01.dbf';
ALTER DATABASE RENAME FILE 'MISSING00013'
  TO '/u01/app/oracle/oradata/ORA11GR2/ts02.dbf';
-- Online the files in read-only tablespaces.
ALTER TABLESPACE "TS1" ONLINE;
ALTER TABLESPACE "TS" ONLINE;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/ORA11GR2/temp01.dbf'
     SIZE 87031808  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
——————————————————————————————————————
注:在转储的控制文件中,没有只读表空间的内容,本测试是先生成转储文件,再恢复的,往往在控制文件丢失之前很少会有人转储控制文件的(当然了,一般情况都会备份控制文件的),如果没有转储控制文件的话,我们也可以在其他数据库中转储控制文件,按照目标库的情况进行调整,然后再创建
———————————————————————————————————————

5.手工删除控制文件
SYS@ORA11GR2>!ls /u01/app/oracle/oradata/ORA11GR2/*.ctl
/u01/app/oracle/oradata/ORA11GR2/control01.ctl
/u01/app/oracle/oradata/ORA11GR2/control02.ctl

SYS@ORA11GR2>!rm /u01/app/oracle/oradata/ORA11GR2/*.ctl

SYS@ORA11GR2>!ls /u01/app/oracle/oradata/ORA11GR2/*.ctl
ls: /u01/app/oracle/oradata/ORA11GR2/*.ctl: No such file or directory

6.切换日志,强制归档出错(因为归档触发ckpt写到控制文件信息,但此时已经没有了对应的物理控制文件了)
SYS@ORA11GR2>alter system archive log current;
alter system archive log current
*
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ORA11GR2/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
(((控制文件删除以后,数据库是正常运行的;不过当修改结构信息时,会写控制文件,会立即报错!!!!!!!)))

7.一致性关闭数据库已经不可能了(控制文件丢失,无法同步SCN),采取强制手段
SYS@ORA11GR2>shutdown immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ORA11GR2/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SYS@ORA11GR2>
SYS@ORA11GR2>shutdown abort;
ORACLE instance shut down.

8.按照转储文件中的步骤恢复控制文件,nomount启动数据库
SYS@ORA11GR2>startup nomount;(仅仅打开实例)
ORACLE instance started.

Total System Global Area  730714112 bytes
Fixed Size                  2256832 bytes
Variable Size             452984896 bytes
Database Buffers          272629760 bytes
Redo Buffers                2842624 bytes

9.采用NORESETLOGS方式创建控制文件
SYS@ORA11GR2>create controlfile reuse database "ORA11GR2" noresetlogs  archivelog
  2      maxlogfiles 16
  3      maxlogmembers 3
  4      maxdatafiles 100
  5      maxinstances 8
  6      maxloghistory 292
  7  logfile
  8    group 1 (
  9      '/u01/app/oracle/oradata/ORA11GR2/redo01.log',
 10      '/u01/app/oracle/oradata/ORA11GR2/redo01_a.log'
 11    ) size 50m blocksize 512,
 12    group 2 (
 13      '/u01/app/oracle/oradata/ORA11GR2/redo02.log',
 14      '/u01/app/oracle/oradata/ORA11GR2/redo02_a.log'
 15    ) size 50m blocksize 512,
 16    group 3 (
 17      '/u01/app/oracle/oradata/ORA11GR2/redo03.log',
 18      '/u01/app/oracle/oradata/ORA11GR2/redo03_a.log'
 19    ) size 50m blocksize 512
 20  -- standby logfile
 21  datafile
 22    '/u01/app/oracle/oradata/ORA11GR2/system01.dbf',
 23    '/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf',
 24    '/u01/app/oracle/oradata/ORA11GR2/ts_lob01.dbf',
 25    '/u01/app/oracle/oradata/ORA11GR2/users01.dbf',
 26    '/u01/app/oracle/oradata/ORA11GR2/example01.dbf',
 27    '/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf',
 28    '/u01/app/oracle/oradata/ORA11GR2/ts_idx01.dbf',
 29    '/u01/app/oracle/oradata/ORA11GR2/ts_catalog.dbf',
 30    '/u01/app/oracle/oradata/ORA11GR2/ts_users.dbf',
 31    '/u01/app/oracle/oradata/ORA11GR2/undo1.dbf'
 32  character set al32utf8
 33  ;

Control file created.

10.因为之前shutdown没有采取一致性关闭,所以,需要recover database,recover后,可正常open数据库
SYS@ORA11GR2>select status from v$instance;

STATUS
------------
MOUNTED(控制文件创建成功之后自动处于mount状态)

SYS@ORA11GR2>alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/ORA11GR2/system01.dbf'


SYS@ORA11GR2>recover database;
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 13: '/u01/app/oracle/oradata/ORA11GR2/ts02.dbf'
ORA-01110: data file 12: '/u01/app/oracle/oradata/ORA11GR2/ts01.dbf'

SYS@ORA11GR2>recover database;
ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 12 is unknown - rename to correct file
ORA-01110: data file 12:
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00012'
ORA-01157: cannot identify/lock data file 12 - see DBWR trace file
ORA-01111: name for data file 12 is unknown - rename to correct file
ORA-01110: data file 12:
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00012'

——解决:
SYS@ORA11GR2>alter database datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00012' offline;
Database altered.

SYS@ORA11GR2>recover database;
ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 13 is unknown - rename to correct file
ORA-01110: data file 13:
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00013'
ORA-01157: cannot identify/lock data file 13 - see DBWR trace file
ORA-01111: name for data file 13 is unknown - rename to correct file
ORA-01110: data file 13:
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00013'

SYS@ORA11GR2>alter database datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00013' offline;

Database altered.

SYS@ORA11GR2>recover database;
Media recovery complete.

——启库:
SYS@ORA11GR2>alter database open;

Database altered.

SYS@ORA11GR2>!ls /u01/app/oracle/oradata/ORA11GR2/*.ctl
/u01/app/oracle/oradata/ORA11GR2/control01.ctl
/u01/app/oracle/oradata/ORA11GR2/control02.ctl
(控制文件恢复回来了)!!!!!!!!!
注:看视恢复完成,不过可以很清晰的看到转储的控制文件中,还有几步没有完成,进行;

11.再次查看表空间和数据文件状态:
注:我们可以看到,只读表空间的状态依然是read only,不过数据文件的路径、名字及状态都有所变化
SYS@ORA11GR2>select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
TEMP                           ONLINE
USERS                          ONLINE
EXAMPLE                        ONLINE
TS_ORA11GR2                    ONLINE
TS_CATALOG                     ONLINE
TS_USERS                       ONLINE
UNDO1                          ONLINE
TS_IDX_1                       ONLINE
TS_LOB                         ONLINE

TABLESPACE_NAME                STATUS
------------------------------ ---------
TS1                            READ ONLY
TS                             READ ONLY

13 rows selected.

SYS@ORA11GR2>col file_name for a52
SYS@ORA11GR2>select file_name,status,online_status from dba_data_files;

FILE_NAME                                            STATUS    ONLINE_
---------------------------------------------------- --------- -------
/u01/app/oracle/oradata/ORA11GR2/undo1.dbf           AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_users.dbf        AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_catalog.dbf      AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_idx01.dbf        AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf  AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/example01.dbf       AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/users01.dbf         AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_lob01.dbf        AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf        AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/system01.dbf        AVAILABLE SYSTEM
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED0 AVAILABLE RECOVER

FILE_NAME                                            STATUS    ONLINE_
---------------------------------------------------- --------- -------
0012

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED0 AVAILABLE RECOVER
0013

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/MISSING0 AVAILABLE OFFLINE
0011


13    ows selected.

12.按照转储的步骤继续rename数据文件(按照转储文件内的内容修改)
注:如果不rename数据文件的话,数据文件是没法ONLINE的
SYS@ORA11GR2>alter database rename file'UNNAMED00012' to '/u01/app/oracle/oradata/ORA11GR2/ts01.dbf';

Database altered.

SYS@ORA11GR2>alter database rename file'UNNAMED00013' to '/u01/app/oracle/oradata/ORA11GR2/ts02.dbf';

Database altered.

13.按照转储步骤,修改表空间online
SYS@ORA11GR2>alter tablespace ts online;

Tablespace altered.

14.再次查看表空间、数据文件的状态,已经恢复原貌
SYS@ORA11GR2>select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
TEMP                           ONLINE
USERS                          ONLINE
EXAMPLE                        ONLINE
TS_ORA11GR2                    ONLINE
TS_CATALOG                     ONLINE
TS_USERS                       ONLINE
UNDO1                          ONLINE
TS_IDX_1                       ONLINE
TS_LOB                         ONLINE

TABLESPACE_NAME                STATUS
------------------------------ ---------
TS1                            READ ONLY
TS                             READ ONLY

13 rows selected.

SYS@ORA11GR2>select file_name,status,online_status from dba_data_files;

FILE_NAME                                                    STATUS    ONLINE_
------------------------------------------------------------ --------- -------
/u01/app/oracle/oradata/ORA11GR2/undo1.dbf                   AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_users.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_catalog.dbf              AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_idx01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf          AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/example01.dbf               AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/users01.dbf                 AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_lob01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/system01.dbf                AVAILABLE SYSTEM
/u01/app/oracle/oradata/ORA11GR2/ts01.dbf                    AVAILABLE ONLINE

FILE_NAME                                                    STATUS    ONLINE_
------------------------------------------------------------ --------- -------
/u01/app/oracle/oradata/ORA11GR2/ts02.dbf                    AVAILABLE ONLINE
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/MISSING00011     AVAILABLE OFFLINE

13 rows selected.

——也可以按照转储文件将ts1表空间rename,不过对于不需要的可以直接drop:
SYS@ORA11GR2>drop tablespace ts1 including contents and datafiles;

Tablespace dropped.
——验证:
SYS@ORA11GR2>select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
TEMP                           ONLINE
USERS                          ONLINE
EXAMPLE                        ONLINE
TS_ORA11GR2                    ONLINE
TS_CATALOG                     ONLINE
TS_USERS                       ONLINE
UNDO1                          ONLINE
TS_IDX_1                       ONLINE
TS_LOB                         ONLINE

TABLESPACE_NAME                STATUS
------------------------------ ---------
TS                             READ ONLY

12 rows selected.

SYS@ORA11GR2>select file_name,status,online_status from dba_data_files;

FILE_NAME                                                    STATUS    ONLINE_
------------------------------------------------------------ --------- -------
/u01/app/oracle/oradata/ORA11GR2/undo1.dbf                   AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_users.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_catalog.dbf              AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_idx01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf          AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/example01.dbf               AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/users01.dbf                 AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/ts_lob01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf                AVAILABLE ONLINE
/u01/app/oracle/oradata/ORA11GR2/system01.dbf                AVAILABLE SYSTEM
/u01/app/oracle/oradata/ORA11GR2/ts01.dbf                    AVAILABLE ONLINE

FILE_NAME                                                    STATUS    ONLINE_
------------------------------------------------------------ --------- -------
/u01/app/oracle/oradata/ORA11GR2/ts02.dbf                    AVAILABLE ONLINE

12 rows selected.

15.转储步骤中还涉及到了临时表空间,我们验证一下,重建控制文件后,临时表空间的情况,没有任何数据文件
SYS@ORA11GR2>select file_name,tablespace_name from dba_temp_files;

no rows selected
(临时表空间对应的物理文件及其路径,都没有)

16.按照转储中的语句给临时表空间增加数据文件
SYS@ORA11GR2>select * from database_properties where property_name like '%TEMP%';

PROPERTY_NAME             PROPERTY_VALUE  DESCRIPTION
------------------------- --------------- ----------------------------------------
DEFAULT_TEMP_TABLESPACE   TEMP            Name of default temporary tablespace

SYS@ORA11GR2>ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/ORA11GR2/temp01.dbf' SIZE 87031808  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

Tablespace altered.

17.临时文件已添加成功(临时表空间对应的物理文件及其路径)
SYS@ORA11GR2>select tablespace_name,file_name from dba_temp_files;

TABLESPACE FILE_NAME
---------- ---------------------------------------------
TEMP       /u01/app/oracle/oradata/ORA11GR2/temp01.dbf

至此,控制文件恢复完毕!!!!!!!!!!!!!!!!!!!!!!!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31397003/viewspace-2126522/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31397003/viewspace-2126522/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值