Oracle控制文件丢失恢复归档模式

目录
  • 一、查看控制文件路径和内容
  • 二、模拟控制文件丢失情况:
    • 1、未丢失全部控制文件
    • 2、全部丢失,控制文件存在备份
      • 通过备份文件重建控制文件
      • 通过rman恢复控制文件
    • 3、全部丢失,没有备份
  • 三、建议

一、查看控制文件路径和内容

SQL> show parameter control_files
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /oradata/orcl/control01.ctl, /
                                                 u01/app/oracle/fast_recovery_a
                                                 rea/orcl/control02.ctl
[oracle@orcl:/oradata/orcl]$ ll /oradata/orcl/control01.ctl
-rw-r----- 1 oracle oinstall 9748480 Apr 15 10:01 /oradata/orcl/control01.ctl
[oracle@orcl:/oradata/orcl]$ ll /u01/app/oracle/fast_recovery_area/orcl/control02.ctl
-rw-r----- 1 oracle oinstall 9748480 Apr 15 10:03 /u01/app/oracle/fast_recovery_area/orcl/control02.ctl
--确保开启归档
SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /archivelog
Oldest online log sequence     10
Current log sequence           12
SQL> select distinct dbms_rowid.rowid_block_number(rowid) from props$;
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------------------------
                                 801
--控制文件内容
--生成控制文件
SQL> alter database backup controlfile to trace as '/home/oracle/ctlbak.ctl';
Database altered.
--查看trace内容
[oracle@orcl:/home/oracle]$ cat ctlbak.ctl
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="orcl"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=/archivelog'
-- LOG_ARCHIVE_DEST_1='OPTIONAL REOPEN=300 NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='REGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS 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.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- 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 "ORCL" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/oradata/orcl/system01.dbf',
  '/oradata/orcl/sysaux01.dbf',
  '/oradata/orcl/undotbs01.dbf',
  '/oradata/orcl/users01.dbf',
  '/oradata/orcl/example01.dbf'
CHARACTER SET AL32UTF8
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/archivelog/1_1_1069941729.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/orcl/temp01.dbf'
     SIZE 30408704  REUSE AUTOEXTEND OFF;
-- End of tempfile additions.
--
--     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 "ORCL" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/oradata/orcl/system01.dbf',
  '/oradata/orcl/sysaux01.dbf',
  '/oradata/orcl/undotbs01.dbf',
  '/oradata/orcl/users01.dbf',
  '/oradata/orcl/example01.dbf'
CHARACTER SET AL32UTF8
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/archivelog/1_1_1069941729.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/orcl/temp01.dbf'
     SIZE 30408704  REUSE AUTOEXTEND OFF;
-- End of tempfile additions.
--

当前数据库存在两份控制文件,分别位于数据文件路径和快速闪回区路径。

二、模拟控制文件丢失情况:

1、未丢失全部控制文件

删除快闪区中的控制文件,强制关闭数据库。

[oracle@orcl:/oradata/orcl]$ rm -rf /u01/app/oracle/fast_recovery_area/orcl/control02.ctl
[oracle@orcl:/oradata/orcl]$ ll /u01/app/oracle/fast_recovery_area/orcl/control02.ctl
ls: cannot access /u01/app/oracle/fast_recovery_area/orcl/control02.ctl: No such file or directory
--开一个新的session,此时数据库已经处于报错状态,无论什么操作都会报错,此时强制关闭数据库
SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file:
'/u01/app/oracle/fast_recovery_area/orcl/control02.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort
ORACLE instance shut down.
SQL>

从数据文件路径复制一份控制文件到快闪区中,尝试再次关闭是否报错。

--复制控制文件
[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ cp /oradata/orcl/control01.ctl control02.ctl
[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ ls
control02.ctl
--开启数据库
SQL> startup
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size                  2253664 bytes
Variable Size             452988064 bytes
Database Buffers         1140850688 bytes
Redo Buffers                7319552 bytes
Database mounted.
Database opened.

2、全部丢失,控制文件存在备份

有两种方式:

1、通过备份的文件进行重建控制文件

2、通过rman恢复控制文件,需要通过resetlogs方式打开数据库

通过备份文件重建控制文件

--通过备份控制文件获取创建控制文件脚本
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/oradata/orcl/system01.dbf',
  '/oradata/orcl/sysaux01.dbf',
  '/oradata/orcl/undotbs01.dbf',
  '/oradata/orcl/users01.dbf',
  '/oradata/orcl/example01.dbf'
CHARACTER SET AL32UTF8;
--开始恢复
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size                  2253664 bytes
Variable Size             452988064 bytes
Database Buffers         1140850688 bytes
Redo Buffers                7319552 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  NOARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  9    GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
 10    GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
 11  -- STANDBY LOGFILE
 12  DATAFILE
 13    '/oradata/orcl/system01.dbf',
 14    '/oradata/orcl/sysaux01.dbf',
 15    '/oradata/orcl/undotbs01.dbf',
 16    '/oradata/orcl/users01.dbf',
 17    '/oradata/orcl/example01.dbf'
 18  CHARACTER SET AL32UTF8;
Control file created.
SQL> recover database;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/orcl/temp01.dbf';
Tablespace altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE

成功恢复控制文件。

通过rman恢复控制文件

rman备份控制文件

RMAN> backup current controlfile format '/home/oracle/ctrl.ora';
Starting backup at 15-APR-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 15-APR-21
channel ORA_DISK_1: finished piece 1 at 15-APR-21
piece handle=/home/oracle/ctrl.ora tag=TAG20210415T104457 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 15-APR-21
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    9.64M      DISK        00:00:01     15-APR-21
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20210415T104457
        Piece Name: /home/oracle/ctrl.ora
  Control File Included: Ckp SCN: 1219869      Ckp time: 15-APR-21

rm删除所有控制文件,尝试添加数据文件,强制关闭数据库,尝试开启到mount状态。

[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ rm control02.ctl
[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ rm /oradata/orcl/control01.ctl
[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ ll
total 0
[oracle@orcl:/u01/app/oracle/fast_recovery_area/orcl]$ ll /oradata/orcl/control01.ctl
ls: cannot access /oradata/orcl/control01.ctl: No such file or directory
SQL> alter tablespace USERS add datafile;
alter tablespace USERS add datafile
*
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Process ID: 2333
Session ID: 1 Serial number: 9
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size                  2253664 bytes
Variable Size             452988064 bytes
Database Buffers         1140850688 bytes
Redo Buffers                7319552 bytes
ORA-00205: error in identifying control file, check alert log for more info

开启数据库到nomount状态,rman恢复控制文件,恢复数据库

--开启到nomount状态
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size                  2253664 bytes
Variable Size             452988064 bytes
Database Buffers         1140850688 bytes
Redo Buffers                7319552 bytes
--rman恢复控制文件
RMAN> restore controlfile from '/home/oracle/ctrl.ora';
Starting restore at 15-APR-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/orcl/control02.ctl
Finished restore at 15-APR-21
--开启数据库到mount状态
SQL> alter database mount;
Database altered.
--恢复数据库
RMAN> recover database;
Starting recover at 15-APR-21
released channel: ORA_DISK_1
Starting implicit crosscheck backup at 15-APR-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Finished implicit crosscheck backup at 15-APR-21
Starting implicit crosscheck copy at 15-APR-21
using channel ORA_DISK_1
Finished implicit crosscheck copy at 15-APR-21
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database:
ORA-19922: there is no parent row with id 0 and level 1
starting media recovery
archived log for thread 1 with sequence 12 is already on disk as file /oradata/orcl/redo03.log
archived log file name=/oradata/orcl/redo03.log thread=1 sequence=12
media recovery complete, elapsed time: 00:00:00
Finished recover at 15-APR-21

通过resetlogs方式打开数据库

SQL> alter database open resetlogs;
Database altered.

3、全部丢失,没有备份

删除全部控制文件,并且没有备份控制文件

SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oradata/orcl/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort
ORACLE instance shut down.

手动创建控制文件

--通过spfile或者pfile文件获取信息
--1.db_name
[oracle@orcl:/home/oracle]$ grep "db_name" pfile.ora
*.db_name='orcl'
--2.字符集(通过dd if查看system01数据文件)
dd if=system01.dbf of=lucifer bs=8192 skip=801
--3.获取数据文件和日志文件名称
[oracle@orcl:/oradata/orcl]$ ll
total 2083264
-rw-r-----. 1 oracle oinstall 328343552 Apr 15 15:14 example01.dbf
-rw-r-----. 1 oracle oinstall 125829632 Apr 15 15:14 redo01.log
-rw-r-----. 1 oracle oinstall 125829632 Apr 15 15:14 redo02.log
-rw-r-----. 1 oracle oinstall 125829632 Apr 15 15:17 redo03.log
-rw-r-----. 1 oracle oinstall 545267712 Apr 15 15:14 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 786440192 Apr 15 15:14 system01.dbf
-rw-r-----. 1 oracle oinstall  30416896 Apr 15 15:14 temp01.dbf
-rw-r-----. 1 oracle oinstall  89137152 Apr 15 15:14 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072 Apr 15 15:14 users01.dbf
--重建控制文件(这里不需要加临时文件,开启数据库之后需要reuse)
--开启数据库到nomount
STARTUP NOMOUNT;
--创建控制文件
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
  GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/oradata/orcl/system01.dbf',
  '/oradata/orcl/sysaux01.dbf',
  '/oradata/orcl/undotbs01.dbf',
  '/oradata/orcl/users01.dbf',
  '/oradata/orcl/example01.dbf'
CHARACTER SET AL32UTF8
;
--恢复数据库
RECOVER DATABASE;
--执行过程
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  NOARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 '/oradata/orcl/redo01.log'  SIZE 120M BLOCKSIZE 512,
  9    GROUP 2 '/oradata/orcl/redo02.log'  SIZE 120M BLOCKSIZE 512,
 10    GROUP 3 '/oradata/orcl/redo03.log'  SIZE 120M BLOCKSIZE 512
 11  -- STANDBY LOGFILE
 12  DATAFILE
 13    '/oradata/orcl/system01.dbf',
 14    '/oradata/orcl/sysaux01.dbf',
 15    '/oradata/orcl/undotbs01.dbf',
 16    '/oradata/orcl/users01.dbf',
 17    '/oradata/orcl/example01.dbf'
 18  CHARACTER SET AL32UTF8
 19  ;
Control file created.
SQL> RECOVER DATABASE;
Media recovery complete.

打开数据库,成功恢复控制文件

SQL> ALTER DATABASE OPEN;
Database altered.
--这里需要将临时文件重用
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/orcl/temp01.dbf' REUSE;
Tablespace altered.

三、建议

1、创建多份控制文件,建议分别存放在多个存储的多个文件夹上,防止文件被误删或者存储损坏。

2、打开归档模式。

3、保存当前库的控制文件生成脚本(包括重要信息:dbname,字符集,文件路径)。

4、定期备份数据库文件,防止丢失,建议将备份放置到源端进行保存。

以上就是Oracle控制文件丢失恢复归档模式的详细内容,更多关于Oracle控制文件恢复归档模式的资料请关注我们其它相关文章!

(0)

相关推荐

  • Oracle数据库中的控制文件管理以及常用参数设置

    一.控制文件 作用: 二进制文件 记录了数据库当前实例的结构和行为,数据文件日志文件的信息,维护数据库一致性 参数文件中定义了控制文件的位置和大小 很小的二进制文件,一般不超过100m mount阶段open以后,一直在用 一套控制文件只能连接一个database 分散放置,至少一份,至多八份 相关视图: v$controlfile ---- 列出实例的所有控制文件的名字和状态 v$parameter ---- 列出所有参数的位置和状态(where name='control_files') v

  • 详解Oracle控制文件及日志文件的管理问题

    目录 一.控制文件的管理 1.控制文件的概述 2.控制文件的创建 1.控制文件的重新建立 3.控制文件的备份 1.将控制文件备份为二进制文件 2.将控制文件备份为文本文件 4.控制文件的恢复 5.添加多路复用的控制文件 二.重做日志文件的管理 1.重做日志文件概述 2.查询重做日志文件信息 3.重做日志文件组及成员的创建 4.重做日志文件组及成员的删除 5.修改重做日志文件的名称或位置 三.归档日志文件的管理 1.归档日志文件概述 2.归档日志信息的查询 3.归档模式的设置 四.总结 一.控制文

  • Oracle 11g控制文件全部丢失从零开始重建控制文件

    介绍 控制文件(control file)是一个相当小的文件(最多能增长到64M左右),其中包含Oracle需要的其他文件的一个目录.参数文件告知实例控制文件的位置,控制文件则告知示例数据库和在线重做日志文件的位置.控制文件还告知了Oracle其他一些事情,如已发生检查点的有关信息.数据库名(必须和db_name参数匹配).创建数据库的时间戳.归档重做日志的历史(有时这会让控制文件变大).RMAN信息等. 控制文件应该通过硬件(RAID)多路保存,如果不支持镜像,则要通过Oracle多路保存.应

  • Oracle RMAN自动备份控制文件方法介绍

    RMAN(Recovery Manager)是一种用于备份(backup).还原(restore)和恢复(recover) 数据库的 Oracle 工具.RMAN只能用于ORACLE8或更高的版本中.它能够备份整个数据库或数据库部件,如表空间.数据文件.控制文件.归档文件以及Spfile参数文件.RMAN也允许您进行增量数据块级别的备份,增量RMAN备份是时间和空间有效的,因为他们只备份自上次备份以来有变化的那些数据块.而且,通过RMAN提供的接口,第三方的备份与恢复软件如veritas将提供更

  • Oracle重建控制文件的实例教程

    前言 控制文件(control file)是一个相当小的文件(最多能增长到64M左右),其中包含Oracle需要的其他文件的一个目录.参数文件告知实例控制文件的位置,控制文件则告知示例数据库和在线重做日志文件的位置.控制文件还告知了Oracle其他一些事情,如已发生检查点的有关信息.数据库名(必须和db_name参数匹配).创建数据库的时间戳.归档重做日志的历史(有时这会让控制文件变大).RMAN信息等. 环境:OEL 5.7 + Oracle 10.2.0.5 背景:在Oracle的运维过程中

  • Oracle控制文件丢失恢复归档模式

    目录 一.查看控制文件路径和内容 二.模拟控制文件丢失情况: 1.未丢失全部控制文件 2.全部丢失,控制文件存在备份 通过备份文件重建控制文件 通过rman恢复控制文件 3.全部丢失,没有备份 三.建议 一.查看控制文件路径和内容 SQL> show parameter control_files NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ cont

  • oracle的归档模式 ORACLE数据库归档日志常用命令

    --连接恢复管理器 C:\Documents and Settings\mengzhaoliang>rman target/ --归档日志列表 RMAN> list archivelog all; --删除物理文件不存在的归档日志 RMAN> delete expired archivelog all; --删除7天前的归档日志 RMAN> DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7'; oracle的归档模式 一.查看ora

  • 优化Oracle停机时间及数据库恢复

    正在看的ORACLE教程是:优化Oracle停机时间及数据库恢复. 这里会讨论令Oracle停机时间最小化的步骤.各种形式的停机--计划的或者是非计划的--总是不断地发生,一个DBA应该有正确的备份策略,这样在数据库出现问题时就可以更快地恢复. 以下是假定的备份策略和数据库的运作条件 控制文件是镜像的 数据库运行在archivelog模式 每个星期都进行冷备份 每日都进行热备份 每日都进行一次全数据库导出 事件1:完整的数据库重构 在这种情形下,你可以使用全数据库导出或者冷热备份结合的方式来重构

  • oracle日志操作模式(归档模式和非归档模式的利与弊)

    笔者今天就谈谈自己对这两种操作模式的理解,并且给出一些可行的建议,跟大家一起来提高Oracle数据库的安全性. 一.非归档模式的利与弊. 非归档模式是指不保留重做历史的日志操作模式,只能够用于保护例程失败,而不能够保护介质损坏.如果数据库采用的是日志操作模式的话,则进行日志切换时,新的日志会直接覆盖原有日志文件的内容,不会保留原有日志文件中的数据. 这么说听起来可能比较难理解.笔者举一个简单的例子,就会清楚许多.如现在Oracle数据库中有四个日志组,日志序列号分别为11. 12.13.14.当

  • 数据库ORA-01196故障-归档日志丢失恢复详解

    问题: 由于机房停电,其中一DG备库无法open,启动时报错 启动数据库时报下面的错误 SQL> alter database open; alter database open * 第 1 行出现错误: ORA-10458: standby database requiresrecovery ORA-01196: 文件 1 由于介质恢复会话失败而不一致 ORA-01110: 数据文件 1:'+DATA/htdb7/datafile/system.313.884996245' 查看归档日志应用情

  • ORACLE 数据库RMAN备份恢复

    机器A: select instance_name from v$instance; select name from v$database; select name from v$datafile; 查询日志模式: archive log list; shutdown immediate; startup mount; 把日志改为归档模式: alter database archivelog; alter database open; alter system archive log curr

随机推荐