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

php中文网
发布: 2016-06-07 17:35:28
原创
1110人浏览过

测试使用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

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号