这篇文章将为大家详细讲解有关怎么进行oracle控制文件的恢复,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。1重建控制文件SYS@hyyk>
alter database backup controlfile to ‘/home/oracle/controlfile01.ctl’;2.删除当前使用的控制文件SYS@hyyk>
ho rm -rf /u01/app/oracle/oradata/hyyk/control01.ctl3.从启数据库SYS@hyyk>
startup forceORACLE instance started.Total System Global Area 776646656 bytesFixed Size 2217384 bytesVariable Size 578816600 bytesDatabase Buffers 188743680 bytesRedo Buffers 6868992 bytesORA-00205: error in identifying control file,
check alert log for more info4.拷贝备份的控住文件SYS@hyyk>ho
cp /home/oracle/controlfile01.ctl /u01/app/oracle/oradata/hyyk/control01.ctlSYS@hyyk>
alter database mount;Database altered.SYS@hyyk>
alter database open;alter database open*ERROR at line 1:ORA-01589: must use RESETLOGS or
NORESETLOGS option for database openSYS@hyyk>
alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01194: file 1 needs more recovery to be
consistentORA-01110: data file 1: ‘/u01/app/oracle/oradata/hyyk/system01.dbf’SYS@hyyk>
recover database using backup controlfile;ORA-00279: change 1324612 generated at
11/03/2017 11:03:43 needed for thread 1ORA-00289: suggestion : /u01/app/oracle/archive/arch_1_943793507_23.logORA-00280: change 1324612 for thread 1 is
in sequence #23
这里查看/u01/app/oracle/archive/arch_1_943793507_23.log是否存在
如果不存在说明没有归档,Specify log: {
filename | AUTO | CANCEL}
alter database open resetlogs;Database altered.//及时进行全库备份实验2 修改数据库结构后丢所有的控制文件实验思路:1.备份当前的控制文件2.建立一个表空间和表
3.删除当前的控制文件 4.从启数据库 5.发现控制文件和数据文件不一致备份控制文件SYS@hyyk>
alter database backup controlfile to ‘/home/oracle/control01.ctl’;创建表空间和表SYS@hyyk>
create tablespace t2 datafile ‘/u01/app/oracle/oradata/hyyk/t2.dbf’ size 10m;SYS@hyyk>
create table b(id number) tablespace t2;SYS@hyyk>
insert into b values(2);SYS@hyyk>
commit;删除当前的控制文件SYS@hyyk>
ho cp /home/oracle/control01.ctl /u01/app/oracle/oradata/hyyk/control01.ctlSYS@hyyk>
h免费主机域名o cp /home/oracle/control01.ctl /u01/app/oracle/oradata/hyyk/control02.ctl将数据库mount阶段SYS@hyyk>
alter database mount;将数据库打开SYS@hyyk>
alter database open;alter database open*ERROR at line 1:ORA-01589: must use RESETLOGS or NORESETLOGS option for
database openSYS@hyyk>
alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01194: file 1 needs more recovery to be consistentORA-01110: data file 1:
‘/u01/app/oracle/oradata/hyyk/system01.dbf’查看当前正在使用的日志SYS@hyyk> select * from v$log;
GROUP# THREAD# SEQUENCE#
BYTES BLOCKSIZE MEMBERS ARC———- ———- ———- ———-
———- ———- —STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE#
NEXT_TIME—————- ————- ———
———— ———
1 1 1
52428800 512 1 YESINACTIVE 1347611 05-NOV-17 1354710 05-NOV-17 3 1 3
52428800 512 1 NOCURRENT
1358125 05-NOV-17 2.8147E+14
2 1 2
52428800 512 1 YESINACTIVE 1354710 05-NOV-17 1358125 05-NOV-17恢复当前的数据库SYS@hyyk>
recover database using backup controlfile;ORA-00279: change 1358125 generated at 11/05/2017 12:37:33
needed for thread 1ORA-00289: suggestion :
/u01/app/oracle/archive/arch_1_959256089_3.logORA-00280: change 1358125 for thread 1 is in sequence #3
//这里查看是否存在归档日志,如果存在下面选择auto,如果不存在就输入当前的rodo logSpecify log: {
filename | AUTO | CANCEL}
recoveryORA-01110: data file 7: ‘/u01/app/oracle/oradata/hyyk/t2.dbf’ORA-01112: media recovery not startedSYS@hyyk>
select name from v$datafile;NAME——————————————————————————–/u01/app/oracle/oradata/hyyk/system01.dbf/u01/app/oracle/oradata/hyyk/sysaux01.dbf/u01/app/oracle/oradata/hyyk/undotbs01.dbf/u01/app/oracle/oradata/hyyk/users01.dbf/u01/app/oracle/oradata/hyyk/example01.dbf/u01/app/oracle/oradata/hyyk/t1.dbf/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007数据文件改名SYS@hyyk>
alter database create datafile‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007’
as
2
‘/u01/app/oracle/oradata/hyyk/t2.dbf’;9.恢复数据库SYS@hyyk>
recover database using backup controlfile;ORA-00279: change 1364363 generated at
11/05/2017 13:51:22 needed for thread 1ORA-00289: suggestion :
/u01/app/oracle/archive/arch_1_959256089_3.logORA-00280: chang免费主机域名e 1364363 for thread 1 is
in sequence #3Specify log: {
filename | AUTO | CANCEL}
alter database open resetlogs;Database altered.查看数据文件SYS@hyyk>
select name from v$datafile;NAME——————————————————————————–/u01/app/oracle/oradata/hyyk/system01.dbf/u01/app/oracle/oradata/hyyk/sysaux01.dbf/u01/app/oracle/oradata/hyyk/undotbs01.dbf/u01/app/oracle/oradata/hyyk/users01.dbf/u01/app/oracle/oradata/hyyk/example01.dbf/u01/app/oracle/oradata/hyyk/t1.dbf/u01/app/oracle/oradata/hyyk/t2.dbf7 rows selected.SYS@hyyk> select * from b; ID———-关于怎么进行oracle控制文件的恢复就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
本篇文章给大家分享的是有关如何理解oracle索引组织表,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。 今天学习下oracle中索引组织表,通过这篇文章,你可了解到,什么是索引组织表?什么情况下可…