恢复oracle控制文件
在这里要注意几个地方:
数据块block与预期的header大小的比对,可用块×每个块的大小来计算
加入预期块数为102400,那么,我们就该给出每个redo空间的大小为:50m(假设每个块大小为512)--50*1024*2
[oracle@localhost MDT]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 2 06:47:26 2003
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "orcl" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 50
3 MAXLOGMEMBERS 5
4 MAXDATAFILES 100
5 MAXINSTANCES 1
6 MAXLOGHISTORY 226
7 LOGFILE
8 GROUP 1 '/oradata/orcl/redo01.log' SIZE 50M,
9 GROUP 2 '/oradata/orcl/redo02.log' SIZE 50M,
10 GROUP 3 '/oradata/orcl/redo03.log' SIZE 50M
11 DATAFILE
12 '/oradata/orcl/system01.dbf',
13 '/oradata/orcl/sysaux01.dbf',
14 '/oradata/orcl/users01.dbf',
15 '/oradata/orcl/undotbs01.dbf'
16 CHARACTER SET ZHS16GBK;
Control file created.
SQL> ALTER SYSTEM ARCHIVE LOG ALL;
System altered.
(中间有可能还需要这样一步:recover database;)
SQL> ALTER DATABASE OPEN;
Database altered.
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/orcl/temp01.dbf'
2 SIZE 20971520 REUSE AUTOEXTEND OFF;
Tablespace altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 100663296 bytes
Fixed Size 1217908 bytes
Variable Size 92277388 bytes
Database Buffers 4194304 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> conn scott/tiger
Connected.
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>