AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题 / 42643
Accepted
bbigras
bbigras
Asked: 2013-05-21 12:05:48 +0800 CST2013-05-21 12:05:48 +0800 CST 2013-05-21 12:05:48 +0800 CST

是否可以在 NOCATALOG 模式下对 rman 和 Oracle 9i 使用“还原 UNTIL SCN”?

  • 772

我正在尝试使用 rman 进行热备份,我可以将其复制到 USB 驱动器,以便可以在新服务器上恢复它。

备份是两天前完成的,restore database命令在同一天工作,所以我想我需要使用UNTIL SCN最后一个 SCN 但我得到了RMAN-20208: UNTIL CHANGE is before RESETLOGS change

我在互联网上看到我应该使用RESET DATABASE但我得到了RMAN-06002: command not allowed when not connected to a recovery catalog,我认为这个过程可能只适用于 Oracle 10 及更高版本(我使用的是 Oracle 9i)。

有任何想法吗?

rman 备份

CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'c:/brubru/auto/%F';

run
{
CROSSCHECK BACKUP;
CROSSCHECK COPY;
CROSSCHECK BACKUPSET;
CROSSCHECK COPY OF DATABASE;
CROSSCHECK archivelog all;

allocate channel d1 device type disk format 'c:/brubru/%U.bkp';
BACKUP CHECK LOGICAL DATABASE format ‘c:/brubru/data_%d_%s_%T.bak’ PLUS ARCHIVELOG DELETE INPUT;
release channel d1;
}

恢复(在第二台服务器上)

> oradim -new -sid PEM -intpwd sys

> set ORACLE_SID=PEM
> rman target /

Recovery Manager: Release 9.2.0.1.0 - Production

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

connected to target database (not started)

RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:\ORACLE\ORA92\DATABASE\INITPEM.ORA'

trying to start the Oracle instance without parameter files ...
Oracle instance started

Total System Global Area      97589952 bytes

Fixed Size                      453312 bytes
Variable Size                 46137344 bytes
Database Buffers              50331648 bytes
Redo Buffers                    667648 bytes

RMAN> set dbid 2176828955

executing command: SET DBID

RMAN> RUN {
2>     SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\brubru\auto
\%F';
3>     RESTORE SPFILE FROM AUTOBACKUP;
4> }

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
using target database controlfile instead of recovery catalog

Starting restore at 13-05-20

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20130520
channel ORA_DISK_1: looking for autobackup on day: 20130519
channel ORA_DISK_1: looking for autobackup on day: 20130518
channel ORA_DISK_1: autobackup found: C:\brubru\auto\c-2176828955-20130518-00
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 13-05-20

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup nomount

connected to target database (not started)
Oracle instance started

Total System Global Area     135338868 bytes

Fixed Size                      453492 bytes
Variable Size                109051904 bytes
Database Buffers              25165824 bytes
Redo Buffers                    667648 bytes

RMAN> set dbid=2176828955

executing command: SET DBID

RMAN> RUN {
2>     SET CONTROLFILE AUTOBACKUP FORMAT
3>           FOR DEVICE TYPE DISK TO 'C:\brubru\auto\%F';
4>     RESTORE CONTROLFILE FROM AUTOBACKUP;
5> }

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

Starting restore at 13-05-20

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20130520
channel ORA_DISK_1: looking for autobackup on day: 20130519
channel ORA_DISK_1: looking for autobackup on day: 20130518
channel ORA_DISK_1: autobackup found: C:\brubru\auto\c-2176828955-20130518-00
channel ORA_DISK_1: controlfile restore from autobackup complete
replicating controlfile
input filename=C:\BDD_ORACLE\ORADATA\PEM\CONTROL01.CTL
output filename=C:\BDD_ORACLE\ORADATA\PEM\CONTROL02.CTL
output filename=C:\BDD_ORACLE\ORADATA\PEM\CONTROL03.CTL
Finished restore at 13-05-20

RMAN> alter database mount;

database mounted

RMAN> run
2> {
3> allocate channel c1 device type disk format 'c:\brubru\%U.bkp';
4> restore database;
5> release channel c1;
6> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=13 devtype=DISK

Starting restore at 13-05-20

released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/20/2013 15:53:37
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 15 found to restore
RMAN-06023: no backup or copy of datafile 14 found to restore
RMAN-06023: no backup or copy of datafile 13 found to restore
RMAN-06023: no backup or copy of datafile 12 found to restore
RMAN-06023: no backup or copy of datafile 11 found to restore
RMAN-06023: no backup or copy of datafile 10 found to restore
RMAN-06023: no backup or copy of datafile 9 found to restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN> list backup;


List of Backup Sets
===================

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
105     737M       DISK        00:00:39     13-05-18
        BP Key: 105   Status: AVAILABLE   Tag: TAG20130518T124955
        Piece Name: C:\BRUBRU\39O9ULFK_1_1.BKP

  List of Archived Logs in backup set 105
  Thrd Seq     Low SCN    Low Time Next SCN   Next Time
  ---- ------- ---------- -------- ---------- ---------
  1    1156    245177104  13-05-11 245458552  13-05-12
  1    1157    245458552  13-05-12 245647641  13-05-13
  1    1158    245647641  13-05-13 245857439  13-05-14
  1    1159    245857439  13-05-14 246084782  13-05-15
  1    1160    246084782  13-05-15 246304002  13-05-16
  1    1161    246304002  13-05-16 246519120  13-05-17
  1    1162    246519120  13-05-17 246722961  13-05-18
  1    1163    246722961  13-05-18 246779464  13-05-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
106     Full    1G         DISK        00:02:14     13-05-18
        BP Key: 106   Status: AVAILABLE   Tag: TAG20130518T125043
        Piece Name: C:\BRUBRU\DATA_PEM_106_20130518.BAK
  List of Datafiles in backup set 106
  File LV Type Ckp SCN    Ckp Time Name
  ---- -- ---- ---------- -------- ----
  1       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\SYSTEM01.DBF
  2       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\UNDOTBS01.DBF
  3       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\CWMLITE01.DBF
  4       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\DRSYS01.DBF
  5       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\EXAMPLE01.DBF
  6       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\INDX01.DBF
  7       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\ODM01.DBF
  8       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\TOOLS01.DBF
  9       Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\USERS01.DBF
  10      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\XDB01.DBF
  11      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\USER.ORA
  12      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\GDR2.ORA
  13      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\PEM\USR.ORA
  14      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\RMAN\RMAN01.DBF
  15      Full 246779607  13-05-18 C:\BDD_ORACLE\ORADATA\RMAN3\RMAN301.DBF

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
107     163K       DISK        00:00:01     13-05-18
        BP Key: 107   Status: AVAILABLE   Tag: TAG20130518T125258
        Piece Name: C:\BRUBRU\3BO9ULLA_1_1.BKP

  List of Archived Logs in backup set 107
  Thrd Seq     Low SCN    Low Time Next SCN   Next Time
  ---- ------- ---------- -------- ---------- ---------
  1    1164    246779464  13-05-18 246779907  13-05-18

RMAN> run
2> {
3> allocate channel c1 device type disk format 'c:\brubru\%U.bkp';
4> set until SCN 246779907;
5> restore database;
6> release channel c1;
7> }

allocated channel: c1
channel c1: sid=13 devtype=DISK

executing command: SET until clause
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of set command at 05/20/2013 15:59:11
RMAN-20208: UNTIL CHANGE is before RESETLOGS change

RMAN> LIST INCARNATION;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       PEM      2176828955       NO  190578     10-02-10
2       2       PEM      2176828955       YES 246779908  13-05-18

RMAN> RESET DATABASE TO INCARNATION 1;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of reset command at 05/20/2013 15:55:33
RMAN-06002: command not allowed when not connected to a recovery catalog
oracle rman
  • 1 1 个回答
  • 4297 Views

1 个回答

  • Voted
  1. Best Answer
    kubanczyk
    2014-07-16T08:56:38+08:002014-07-16T08:56:38+08:00

    是的,这种情况在 NOCATALOG 模式下是可能的。我上周六 9.2 正是这样做的,所以我可以保证:) 你的尝试几乎成功了。你做错的唯一一件事是你恢复了太新的控制文件,它在上面Reset SCN 246779908。如果您移开C:\brubru\auto\c-2176828955-20130518-00它,它可能会找到一个更旧的控制文件,并且恢复会成功。确保LIST INCARNATIONS根本不显示新的化身 - 控制文件不应该知道它。

    • 1

相关问题

  • Oracle 中的数据库备份 - 导出数据库还是使用其他工具?

  • ORDER BY 使用文本列的自定义优先级

  • 舒服的sqlplus界面?[关闭]

  • 如何在数据库中找到最新的 SQL 语句?

  • 如何使用正则表达式查询名称?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    授予用户对所有表的访问权限

    • 5 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    pedrosanta 使用 psql 列出数据库权限 2011-08-04 11:01:21 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve