恢复oracle控制文件

恢复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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值