RMAN 备份恢复 删除表空间后控制文件丢失

先备份一个控制文件

RMAN> backup current controlfile tag=‘bak_ctlfile‘ format=‘/home/oracle/backup/bak_ctl_%U_%T‘;

drop一个表空间

SQL> drop tablespace xds including contents and datafiles;

Tablespace dropped.

删除控制文件

rm /u01/app/oracle/oradata/orcl/control01.ctl

rm /u01/app/oracle/flash_recovery_area/orcl/control02.ctl

shutdown abort

采用rman恢复时报错

MAN> startup nomount;

Oracle instance started

Total System Global Area 835104768 bytes

Fixed Size 2217952 bytes
Variable Size 520095776 bytes
Database Buffers 310378496 bytes
Redo Buffers 2412544 bytes

RMAN> restore controlfile from ‘/home/oracle/backup/bak_ctl_0qr8l6u3_1_1_20160620‘;

Starting restore at 20-JUN-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 20-JUN-16

RMAN> mount database;

database mounted
released channel: ORA_DISK_1

RMAN> recover database;

Starting recover at 20-JUN-16
Starting implicit crosscheck backup at 20-JUN-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 13 objects
Finished implicit crosscheck backup at 20-JUN-16

Starting implicit crosscheck copy at 20-JUN-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 20-JUN-16

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/20/2016 21:53:14
RMAN-06094: datafile 7 must be restored

SQL> alter database datafile 7 offline;

Database altered.

SQL> recover database using backup controlfile;
ORA-00279: change 1106750 generated at 06/20/2016 21:31:26 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_06_20/o1_mf_1_3_%u_.arc
ORA-00280: change 1106750 for thread 1 is in sequence #3

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: cannot open archived log
‘/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_06_20/o1_mf_1_3_%u_.arc‘
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory

Additional information: 3

因为还没有生成archivelog,所以找不到
手工一个个指定redolog文件,直到恢复

SQL> recover database using backup controlfile;
ORA-00279: change 1106750 generated at 06/20/2016 21:31:26 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_06_20/o1_mf_1_3_%u_.arc
ORA-00280: change 1106750 for thread 1 is in sequence #3

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/orcl/redo03.log
Log applied.
Media recovery complete.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/example01.dbf
/u01/app/oracle/oradata/orcl/test01.dbf

6 rows selected.

SQL> alter database open resetlogs;

Database altered.

时间: 2024-12-27 22:41:10

RMAN 备份恢复 删除表空间后控制文件丢失的相关文章

备份恢复-----system表空间损坏

无法进行关库,报错如下 SQL> shutdown immediate ORA-01122: database file 1 failed verification checkORA-01110: data file 1: '/u01/app/oracle/oradata/cuug/system01.dbf'ORA-01210: data file header is media corruptSQL> 只能启动到mount状态 SQL> startup ORACLE instance

oracle学习 六 删除表空间,数据文件的语句以及导入导出dmp文件的方法(持续更新中)

要想删除表空间就要先删除数据文件 例如这个例子 CREATE TABLESPACE STHSGIMGDB_SPACE11 DATAFILE 'D:\ORACLEDATABASE\JinHuaDataBase\STHSGIMGDB_SPACE11_01' SIZE 1M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED, 'D:\ORACLEDATABASE\JinHuaDataBase\STHSGIMGDB_SPACE11_02' SIZE 1M AUTOEXTE

oracle 删除表空间及数据文件方法

drop tablespace tablespace_name;--删除非空表空间,但是不包含物理文件drop tablespace tablespace_name including contents;--删除空表空间,包含物理文件drop tablespace tablespace_name including datafiles;--删除非空表空间,包含物理文件drop tablespace tablespace_name including contents and datafiles;

RMAN备份数据库与表空间

脚本: 数据库备份: backup database format='/u01/app/oracle/oradata/Backup/oradb_%d_%s.bak'; 表空间备份:backup tablespace EXAMPLE format='/u01/app/oracle/oradata/Backup/%d_%p_%t_%c.dbf';        或者 RMAN> run{ 2> allocate channel ch_1 type disk; 3> backup tables

删除表空间及数据文件

--删除空的表空间,但是不包含物理文件drop tablespace tablespace_name;--删除非空表空间,但是不包含物理文件drop tablespace tablespace_name including contents;--删除空表空间,包含物理文件drop tablespace tablespace_name including datafiles;--删除非空表空间,包含物理文件drop tablespace tablespace_name including cont

Oracle非关键文件恢复,日志成员、临时文件、索引表空间、口令文件(密码文件)

关键性与非关键性 非关键性文件是指数据库和大多数应用程序没有它也能继续运行的文件.例如,如果数据库丢失了一个多路复用重做日志文件,仍可使用其它重做日志文件副本来保持数据库持续运行. 虽然丢失非关键性文件不会导致数据库崩溃,但它会削弱数据库的功能.例如: 丢失索引表空间会导致应用程序和查询的运行速度大幅减慢,或者,如果这些索引用于强制实施约束,则丢失后甚至会导致应用程序无法使用. 丢失联机重做日志组(只要不是当前联机日志组)会导致在 LGWR 下一次尝试写入组时数据库操作被挂起,直到生成新的日志文

oracle下正确删除表空间的方法

Oracle因为本身的多重验证机制所有在删除表空间时不像MySQL中删除database一样,可以通过外部的删除直接删除掉database文件夹就可以删除掉database,当然这两者是2种不同的东西,在此仅用于举例说明.在Oracle中表空间相当于系统中的硬盘,Oracle可以通过修改配置表空间来对Oracle下的数据进行存储,所以在Oracle下表空间是非常重要的,尤其是在表空间文件处理不当都会造成Oracle的不稳定,在此就说一说如何正确的删除Oracle的表空间. 删除表空间时,需要确定

Oracle菜鸟之怎样创建和删除表空间

1.创建暂时表空间 创建表空间时,dbf文件一般存放在datafile文件的存放文件夹下(通常是在实例名命名的文件夹以下) 能够通过 select * from v$datafile;查看全部数据文件的存放位置 create temporary tablespace 表空间名 tempfile '/data/oradata/CHUANSHU/datafile/tmp_文件名称.dbf' size 50M autoextend on next 1M maxsize 1024M extent man

Oracle菜鸟之如何创建和删除表空间

1.创建临时表空间 创建表空间时,dbf文件一般存放在datafile文件的存放目录下(一般是在实例名命名的文件夹下面) 可以通过 select * from v$datafile;查看所有数据文件的存放位置 create temporary tablespace 表空间名 tempfile '/data/oradata/CHUANSHU/datafile/tmp_文件名.dbf' size 50M autoextend on next 1M maxsize 1024M extent manag