12
返回列表 发新帖
楼主: chj733

关于RMAN备份中控制文件的一个疑惑,大虾帮忙解答下哈!!!

[复制链接]
论坛徽章:
86
ITPUB元老
日期:2005-02-28 12:57:002012新春纪念徽章
日期:2012-01-04 11:49:542012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20咸鸭蛋
日期:2012-05-08 10:27:19版主8段
日期:2012-05-15 15:24:112013年新春福章
日期:2013-02-25 14:51:24
11#
发表于 2005-2-16 15:09 | 只看该作者
最初由 ZALBB 发布
[B]恩,我也注意到,我估计ORACLE也是为了此原因才设置这一项配置的:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'

但若没启动自动备份控制文件选项,则不会备份控制文件,此时将无法得知道BDID。 [/B]


1: dbms_backup_restore 包可以读出所有文件,这是终极(无敌)解决办法

2:如果使用了自动备份并且格式是自己定义的,恢复的时候不知道dbid也成可以指定从某个文件恢复也一样

使用道具 举报

回复
论坛徽章:
27
授权会员
日期:2005-10-30 17:05:33管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36优秀写手
日期:2013-12-18 09:29:13马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14
12#
发表于 2005-2-16 15:41 | 只看该作者
我自己也做了一下,我的版本是817的
确实如biti所说,8i的备份只能用后一次的controlfile才能看到
k380cnracle /backup>export ORACLE_SID=CLNE
k380cnracle /backup>svrmgrl

Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 1997, 1999, Oracle Corporation.  All Rights Reserved.

Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production

SVRMGR> connect internal
Connected.
SVRMGR> startup
ORACLE instance started.
Total System Global Area                         55847400 bytes
Fixed Size                                         104936 bytes
Variable Size                                    24113152 bytes
Database Buffers                                 31457280 bytes
Redo Buffers                                       172032 bytes
Database mounted.
Database opened.
SVRMGR> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/oradata/CLNE/control01.ctl
/oradata/CLNE/control02.ctl
/oradata/CLNE/control03.ctl
3 rows selected.
SVRMGR> exit
Server Manager complete.
k380cnracle /backup>rman target / nocatalog;

Recovery Manager: Release 8.1.7.0.0 - Production

RMAN-06005: connected to target database: CLNE (DBID=2737537682)
RMAN-06009: using target database controlfile instead of recovery catalog

RMAN> report schema;

RMAN-03022: compiling command: report
Report of database schema
File K-bytes    Tablespace           RB segs Name
---- ---------- -------------------- ------- -------------------
1        266240 SYSTEM               ***     /oradata/CLNE/system01.dbf
2          8192 TOOLS                ***     /oradata/CLNE/tools01.dbf
3        528384 RBS                  ***     /oradata/CLNE/rbs01.dbf
4         69632 TEMP                 ***     /oradata/CLNE/temp01.dbf
5        106496 USERS                ***     /oradata/CLNE/users01.dbf
6         55296 INDX                 ***     /oradata/CLNE/indx01.dbf
7         10240 USERS                ***     /oradata/CLNE/users02.dbf
8         20480 PRACTICE             ***     /oradata/CLNE/practice.dbf

第一次备份
RMAN> run{
2> allocate channel ch1 type disk;
3> backup database
4> include current controlfile
5> format '/backup/clne_full_%s_%t.dbf';
6> sql 'alter system archive log current';
7> release channel ch1;
8> }

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch1
RMAN-08500: channel ch1: sid=11 devtype=DISK

RMAN-03022: compiling command: backup
RMAN-03023: executing command: backup
RMAN-08008: channel ch1: starting full datafile backupset
RMAN-08502: set_count=1 set_stamp=550422604 creation_time=2005-02-16 15:10:04
RMAN-08010: channel ch1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00003 name=/oradata/CLNE/rbs01.dbf
RMAN-08522: input datafile fno=00001 name=/oradata/CLNE/system01.dbf
RMAN-08011: including current controlfile in backupset
RMAN-08522: input datafile fno=00005 name=/oradata/CLNE/users01.dbf
RMAN-08522: input datafile fno=00004 name=/oradata/CLNE/temp01.dbf
RMAN-08522: input datafile fno=00006 name=/oradata/CLNE/indx01.dbf
RMAN-08522: input datafile fno=00008 name=/oradata/CLNE/practice.dbf
RMAN-08522: input datafile fno=00007 name=/oradata/CLNE/users02.dbf
RMAN-08522: input datafile fno=00002 name=/oradata/CLNE/tools01.dbf
RMAN-08013: channel ch1: piece 1 created
RMAN-08503: piece handle=/backup/clne_full_1_550422604.dbf comment=NONE
RMAN-08525: backup set complete, elapsed time: 00:02:17

RMAN-03022: compiling command: sql
RMAN-06162: sql statement: alter system archive log current
RMAN-03023: executing command: sql

RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: ch1

第二次备份
RMAN> run{
allocate channel ch1 type disk;
backup database
2> include current controlfile
format '/backup/clne_full_%s_%t.dbf';
sql 'alter system archive log current';
release channel ch1;3>
}4> 5> 6> 7> 8>

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch1
RMAN-08500: channel ch1: sid=11 devtype=DISK

RMAN-03022: compiling command: backup
RMAN-03023: executing command: backup
RMAN-08008: channel ch1: starting full datafile backupset
RMAN-08502: set_count=2 set_stamp=550422826 creation_time=2005-02-16 15:13:46
RMAN-08010: channel ch1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00003 name=/oradata/CLNE/rbs01.dbf
RMAN-08522: input datafile fno=00001 name=/oradata/CLNE/system01.dbf
RMAN-08011: including current controlfile in backupset
RMAN-08522: input datafile fno=00005 name=/oradata/CLNE/users01.dbf
RMAN-08522: input datafile fno=00004 name=/oradata/CLNE/temp01.dbf
RMAN-08522: input datafile fno=00006 name=/oradata/CLNE/indx01.dbf
RMAN-08522: input datafile fno=00008 name=/oradata/CLNE/practice.dbf
RMAN-08522: input datafile fno=00007 name=/oradata/CLNE/users02.dbf
RMAN-08522: input datafile fno=00002 name=/oradata/CLNE/tools01.dbf
RMAN-08013: channel ch1: piece 1 created
RMAN-08503: piece handle=/backup/clne_full_2_550422826.dbf comment=NONE
RMAN-08525: backup set complete, elapsed time: 00:02:16

RMAN-03022: compiling command: sql
RMAN-06162: sql statement: alter system archive log current
RMAN-03023: executing command: sql

RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: ch1

RMAN>

RMAN> list backup;

RMAN-03022: compiling command: list

List of Backup Sets
Key     Recid      Stamp      LV Set Stamp  Set Count  Completion Time
------- ---------- ---------- -- ---------- ---------- ----------------------
1       1          550422732  0  550422604  1          2005-02-16 15:12:12

    List of Backup Pieces
    Key     Pc# Cp# Status      Completion Time        Piece Name
    ------- --- --- ----------- ---------------------- ------------------------
    1       1   1   AVAILABLE   2005-02-16 15:12:12    /backup/clne_full_1_550422604.dbf

    List of Datafiles Included
    File Name                                  LV Type Ckp SCN    Ckp Time
    ---- ------------------------------------- -- ---- ---------- -------------
    1    /oradata/CLNE/system01.dbf            0  Full 62993      2005-02-16 15:10:06
    2    /oradata/CLNE/tools01.dbf             0  Full 62993      2005-02-16 15:10:06
    3    /oradata/CLNE/rbs01.dbf               0  Full 62993      2005-02-16 15:10:06
    4    /oradata/CLNE/temp01.dbf              0  Full 62993      2005-02-16 15:10:06
    5    /oradata/CLNE/users01.dbf             0  Full 62993      2005-02-16 15:10:06
    6    /oradata/CLNE/indx01.dbf              0  Full 62993      2005-02-16 15:10:06
    7    /oradata/CLNE/users02.dbf             0  Full 62993      2005-02-16 15:10:06
    8    /oradata/CLNE/practice.dbf            0  Full 62993      2005-02-16 15:10:06

List of Backup Sets
Key     Recid      Stamp      LV Set Stamp  Set Count  Completion Time
------- ---------- ---------- -- ---------- ---------- ----------------------
2       2          550422954  0  550422826  2          2005-02-16 15:15:54

    List of Backup Pieces
    Key     Pc# Cp# Status      Completion Time        Piece Name
    ------- --- --- ----------- ---------------------- ------------------------
    2       1   1   AVAILABLE   2005-02-16 15:15:54    /backup/clne_full_2_550422826.dbf

    List of Datafiles Included
    File Name                                  LV Type Ckp SCN    Ckp Time
    ---- ------------------------------------- -- ---- ---------- -------------
    1    /oradata/CLNE/system01.dbf            0  Full 62996      2005-02-16 15:13:47
    2    /oradata/CLNE/tools01.dbf             0  Full 62996      2005-02-16 15:13:47
    3    /oradata/CLNE/rbs01.dbf               0  Full 62996      2005-02-16 15:13:47
    4    /oradata/CLNE/temp01.dbf              0  Full 62996      2005-02-16 15:13:47
    5    /oradata/CLNE/users01.dbf             0  Full 62996      2005-02-16 15:13:47
    6    /oradata/CLNE/indx01.dbf              0  Full 62996      2005-02-16 15:13:47
    7    /oradata/CLNE/users02.dbf             0  Full 62996      2005-02-16 15:13:47
    8    /oradata/CLNE/practice.dbf            0  Full 62996      2005-02-16 15:13:47

RMAN> shutdown immediate;

RMAN-06405: database closed
RMAN-06404: database dismounted
RMAN-06402: Oracle instance shut down

RMAN> exit


Recovery Manager complete.
k380cnracle /backup>
k380cnracle /backup>cd /oradata/CLNE
k380cnracle /oradata/CLNE>ls
archive                 create_control.sql      rbs01.dbf               temp01.dbf
backup.ctl              indx01.dbf              redo01.log              tools01.dbf
control01.ctl           lost+found              redo02.log              users01.dbf
control02.ctl           open_backup_output.lst  redo03.log              users02.dbf
control03.ctl           practice.dbf            system01.dbf
k380cnracle /oradata/CLNE>rm control*.ctl
k380cnracle /oradata/CLNE>ls
archive                 lost+found              redo01.log              temp01.dbf
backup.ctl              open_backup_output.lst  redo02.log              tools01.dbf
create_control.sql      practice.dbf            redo03.log              users01.dbf
indx01.dbf              rbs01.dbf               system01.dbf            users02.dbf
k380cnracle /oradata/CLNE>rman target / nocatalog;

Recovery Manager: Release 8.1.7.0.0 - Production

RMAN-06193: connected to target database (not started)

RMAN> startup nomount;

RMAN-06196: Oracle instance started

Total System Global Area      55847400 bytes

Fixed Size                      104936 bytes
Variable Size                 24113152 bytes
Database Buffers              31457280 bytes
Redo Buffers                    172032 bytes

RMAN> run{
2> allocate channel ch1 type disk;
3> replicate controlfile from '/oracle/product/8.1.7/dbs/snapcf_CLNE.f';
4> release channel ch1;
5> }

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch1
RMAN-08500: channel ch1: sid=10 devtype=DISK

RMAN-03022: compiling command: replicate
RMAN-03023: executing command: replicate
RMAN-08058: replicating controlfile
RMAN-08506: input filename=/oracle/product/8.1.7/dbs/snapcf_CLNE.f
RMAN-08505: output filename=/oradata/CLNE/control01.ctl
RMAN-08505: output filename=/oradata/CLNE/control02.ctl
RMAN-08505: output filename=/oradata/CLNE/control03.ctl

RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: ch1


RMAN> alter database mount;

RMAN-03022: compiling command: alter db
RMAN-06199: database mounted

RMAN> list backup;

RMAN-03022: compiling command: list

只有第一次的备份
List of Backup Sets
Key     Recid      Stamp      LV Set Stamp  Set Count  Completion Time
------- ---------- ---------- -- ---------- ---------- ----------------------
1       1          550422732  0  550422604  1          2005-02-16 15:12:12

    List of Backup Pieces
    Key     Pc# Cp# Status      Completion Time        Piece Name
    ------- --- --- ----------- ---------------------- ------------------------
    1       1   1   AVAILABLE   2005-02-16 15:12:12    /backup/clne_full_1_550422604.dbf

    List of Datafiles Included
    File Name                                  LV Type Ckp SCN    Ckp Time
    ---- ------------------------------------- -- ---- ---------- -------------
    1    /oradata/CLNE/system01.dbf            0  Full 62993      2005-02-16 15:10:06
    2    /oradata/CLNE/tools01.dbf             0  Full 62993      2005-02-16 15:10:06
    3    /oradata/CLNE/rbs01.dbf               0  Full 62993      2005-02-16 15:10:06
    4    /oradata/CLNE/temp01.dbf              0  Full 62993      2005-02-16 15:10:06
    5    /oradata/CLNE/users01.dbf             0  Full 62993      2005-02-16 15:10:06
    6    /oradata/CLNE/indx01.dbf              0  Full 62993      2005-02-16 15:10:06
    7    /oradata/CLNE/users02.dbf             0  Full 62993      2005-02-16 15:10:06
    8    /oradata/CLNE/practice.dbf            0  Full 62993      2005-02-16 15:10:06

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
13#
发表于 2005-2-16 15:49 | 只看该作者
1、对,FENNG那个使用dbms_backup_restore 来恢复数据库的帖子堪称经典。
2、尝试过,在不设置DBID的情况下,本机操作(RMAN RELEASE, 目标数据库及
SNAPSHOT都在本机)成功:

备份
RMAN> run
2> {allocate channel d1 type disk;
3>  backup tablespace tools
4>  format 'H:\rmanback\level2\db_%d_%s_%p_%t';
5>  release channel d1;
6> }

allocated channel: d1
channel d1: sid=17 devtype=DISK

Starting backup at 2005-02-16 15:18:51
channel d1: starting full datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00008 name=D:\ORACLE\ORADATA\TELLING\TOOLS01.DBF
channel d1: starting piece 1 at 2005-02-16 15:18:52
channel d1: finished piece 1 at 2005-02-16 15:18:53
piece handle=H:\RMANBACK\LEVEL2\DB_TELLING_5_1_550423131 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
Finished backup at 2005-02-16 15:18:53

Starting Control File and SPFILE Autobackup at 2005-02-16 15:18:53
piece handle=D:\ORACLE\DATABASE\C-925595620-20050216-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2005-02-16 15:18:57

released channel: d1

RMAN> exit


Recovery Manager complete.

D:\ORACLE\BIN>rman nocatalog target /

Recovery Manager: Release 9.2.0.6.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     168894212 bytes

Fixed Size                      454404 bytes
Variable Size                109051904 bytes
Database Buffers              58720256 bytes
Redo Buffers                    667648 bytes
本机操作,知道文件名,不设置DBID[/COLOR]
RMAN> restore controlfile from 'D:\oracle\database\SNCFTELL.ORA';

Starting restore at 2005-02-16 15:27:02

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: copied controlfile copy
replicating controlfile
input filename=D:\ORACLE\ORADATA\TELLING\CONTROL01.CTL
output filename=D:\ORACLE\ORADATA\TELLING\CONTROL02.CTL
output filename=D:\ORACLE\ORADATA\TELLING\CONTROL03.CTL
Finished restore at 2005-02-16 15:27:05
成功MOUNT数据库[/COLOR]
RMAN> alter database mount;

database mounted

RMAN>

使用道具 举报

回复
论坛徽章:
1
会员2006贡献徽章
日期:2006-04-17 13:46:34
14#
发表于 2005-2-16 17:01 | 只看该作者
GZ

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表