首页 > 数据库 > mysql教程 > Oracle 10g控制文件备份到文件与手工恢复

Oracle 10g控制文件备份到文件与手工恢复

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-06-07 17:35:28
原创
1076 人浏览过

测试使用alter database backup controlfile to trace命令备份oracle10g控制文件以及在丢失控制文件的情况下恢复控制文件之--备份

测试使用alter database backup controlfile to trace命令备份Oracle10g控制文件

以及在丢失控制文件的情况下恢复控制文件之--备份控制文件


查看alter database backup controlfile to trace的默认路径
SQL> show parameter user_dump_dest;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /data/oracle/admin/asp/udump
这是下面的备份控制文件语句默认备份的位置.

部分标记了对应的建立控制文件的语句:

注意这里面记录了两种情况:

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
;
-- 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 '/data/archive/redhat10g_1_562360180_1.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/data/archive/redhat10g_1_817828234_1.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Set Database Guard and/or Supplemental Logging
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- 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 '/data/oracle/oradata/asp/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;

-- 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 "ASP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/data/oracle/oradata/asp/redo01.log' SIZE 50M,
GROUP 2 '/data/oracle/oradata/asp/redo02.log' SIZE 50M,
GROUP 3 '/data/oracle/oradata/asp/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/data/oracle/oradata/asp/system01.dbf',
'/data/oracle/oradata/asp/undotbs01.dbf',
'/data/oracle/oradata/asp/sysaux01.dbf',
'/data/oracle/oradata/asp/users01.dbf',
'/data/oracle/oradata/asp/dgbc01.dbf',
'/data/oracle/oradata/asp/dgbc02.dbf',
'/data/oracle/oradata/asp/dgbc03.dbf',
'/data/oracle/oradata/asp/dgbc04.dbf',
'/data/oracle/oradata/asp/dgbc05.dbf',
'/data/oracle/oradata/asp/dgbc06.dbf'
CHARACTER SET WE8ISO8859P1
;

-- 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 '/data/archive/redhat10g_1_562360180_1.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/data/archive/redhat10g_1_817828234_1.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
-- Set Database Guard and/or Supplemental Logging
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
-- 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 '/data/oracle/oradata/asp/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;

-- End of tempfile additions.
--

下一篇 从这个备份的文本文件来手工恢复控制文件。

linux

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
mongodb热备份和冷备份
来自于 1970-01-01 08:00:00
0
0
0
phpstuy怎么备份.
来自于 1970-01-01 08:00:00
0
0
0
对在线项目的mysql做备份
来自于 1970-01-01 08:00:00
0
0
0
为 MySQL 数据库和服务器创建备份
来自于 1970-01-01 08:00:00
0
0
0
PostgreSQL数据库设计的备份——无数据
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板