oracle 只读方式打开文件,DBPITR后到底能不能以只读方式打开数据库?

rushlight 发表于 2011-12-12 14:42 thread-1538108-1-1.html

再执行recover database 那就是complete recovery了,alert database open read only肯定行,直接读写打开 ...

rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Dec 12 14:59:54 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area    1610612736 bytes

Fixed Size                     2073088 bytes

Variable Size                369102336 bytes

Database Buffers            1224736768 bytes

Redo Buffers                  14700544 bytes

RMAN> restore controlfile from '/u01/app/oracle/*****_1_1';

Starting restore at 12-DEC-11

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:02

output filename=/u01/app/oracle/oradata//control01.ctl

output filename=/u01/app/oracle/oradata//control02.ctl

output filename=/u01/app/oracle/oradata//control03.ctl

Finished restore at 12-DEC-11

RMAN> alter database mount;

database mounted

released channel: ORA_DISK_1

RMAN> run {

2>     set until scn 6801190;

3>     restore database;

4>     recover database;

5> }

executing command: SET until clause

Starting restore at 12-DEC-11

Starting implicit crosscheck backup at 12-DEC-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

Crosschecked 1 objects

Finished implicit crosscheck backup at 12-DEC-11

Starting implicit crosscheck copy at 12-DEC-11

using channel ORA_DISK_1

Finished implicit crosscheck copy at 12-DEC-11

searching for all files in the recovery area

cataloging files...

no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /u01/app/oracle/orada.dbf

restoring datafile 00003 to /u01/app/oracle/oradat.dbf

restoring datafile 00004 to /u01/app/oracle/oradata/backup/users01.dbf

restoring datafile 00006 to /u01/app/oracle/oradata/backup/undotbs02.dbf

restoring datafile 00007 to /u01/app/oracle/orada.dbf

restoring datafile 00011 to /u01/app/oracle/or.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/app/oracle/backup/full07mu1fqq_1_1 tag=TAG20111212T143609

channel ORA_DISK_1: restore complete, elapsed time: 00:00:46

Finished restore at 12-DEC-11

Starting recover at 12-DEC-11

using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 1 is already on disk as file /u01/app/oracle/oradata/backup/redo05.log

archive log filename=/u01/app/oracle/oradata/backup/redo05.log thread=1 sequence=1

media recovery complete, elapsed time: 00:00:01

Finished recover at 12-DEC-11

RMAN> sql 'alter  database open read only';

sql statement: alter  database open read only

RMAN> exit

Recovery Manager complete.

[oracle@db_backup backup]$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Dec 12 15:02:21 2011

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> select open_mode from v$database;

OPEN_MODE

------------------------------

READ ONLY

SQL> select checkpoint_change# from v$datafile;

CHECKPOINT_CHANGE#

------------------

6801190

6801190

6801190

6801190

6801190

6801190

6 rows selected.

SQL> select checkpoint_change# from v$datafile_header;

CHECKPOINT_CHANGE#

------------------

6801190

6801190

6801190

6801190

6801190

6801190

6 rows selected.

你的操作有些问题~就是你controlfile不是从备份恢复过来的吧?如果是心的controlfile是不行的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值