您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

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

2025/8/13 10:19:15发布16次查看
测试使用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.
--
下一篇 从这个备份的文本文件来手工恢复控制文件。

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product