lesson 6:
1 丢失临时文件:
自动 tempfile 恢复--11g 新特性
1)删除临时表空间数据文件
SQL>SELECT file_name FROM dba_temp_files;
2)创建张大表,并对大表进行排序
SQL>create table bigtab as select * from dba_objects;
insert into bigtab select * from bigtab;
/
/
commit;
select * from bigtab order by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;
3)重启数据库,数据库会自动重建临时数据文件,可以查看 alert 日志看相关信
息
shutdown immediate;
startup
如数据库不能重起:
创建新的临时表空间:
create temporary tablespace tempa tempfile
'/u01/app/oracle/oradata/orcl/tempa01.dbf' size 10m reuse autoextend on
maxsize 200m;
SQL>alter database default temporary tablespace tempa;
SQL>drop tablespace temp;
给临时表空间添加文件:
ALTER TABLESPACE temp ADD TEMPFILE '/u01/app/oracle/oradata/orcl/temp02.dbf'
SIZE 20M;
2 丢失redo
select a.group#, a.status, a.archived,b.member
from v$log a,v$logfile b
where a.group#=b.group#;
$rm /u01/app/oracle/oradata/ENMOEDU/redo01.log
Sql> shutdown immediate
Sql> startup –出错
Sql> startup mount
Sql> alter database clear logfile group 1;
Sql> alter database open;
Alert日志:
Errors in file