ITPub博客

首页 > 数据库 > Oracle > 重建控制文件

重建控制文件

原创 Oracle 作者:身影单行just 时间:2015-04-12 20:53:37 0 删除 编辑
找到最近的trace文件从中获得重建控制文件的脚本
 Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RHEL6" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/rhel6/redo01.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/oradata/rhel6/redo02.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/oradata/rhel6/redo03.log'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE

DATAFILE
  '/u01/app/oracle/oradata/rhel6/system01.dbf',
  '/u01/app/oracle/oradata/rhel6/sysaux01.dbf',
  '/u01/app/oracle/oradata/rhel6/undotbs01.dbf',
  '/u01/app/oracle/oradata/rhel6/users01.dbf'
CHARACTER SET AL32UTF8
;
然后依次执行下面的过程
RECOVER DATABASE USING BACKUP CONTROLFILE                  (1)
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;                           (2)
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/rhel6/temp01.dbf'
     SIZE 62914560  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;                                (3)
-- End of tempfile additions.
在执行(1)的时候如果出现ORA-00289:Specify log: {=suggested | filename | AUTO | CANCEL}
就把日志组一个文件写上去/u01/app/oracle/oradata/rhel6/redo03.log,之后查看select * from v$log;redo3。log为current。此后就可以正常执行(2),(3)了

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30166973/viewspace-1570658/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 手工建库
下一篇: 集合运算符
请登录后发表评论 登录
全部评论

注册时间:2015-03-17

  • 博文量
    14
  • 访问量
    34377