rac把数据文件创建在不共享的地方(五)
91004 25-APR-13 /tmp/rman.dbf
[oracle@rac1 tmp]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 25 17:11:39 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter database open;
Database altered.
SQL> !mv /tmp/rman.dbf /tmp/rman.dbf.bak
SQL>
SQL> select * from rman;
ID NAME
---------- ----------
1 cc
SQL> alter system flush buffer_cache;
System altered.
SQL> select * from rman;
select * from rman
*
ERROR at line 1:
ORA-01116: error in opening database file 7
ORA-01110: data file 7: '/tmp/rman.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
[oracle@rac1 tmp]$ rman target /
RMAN> run{
2> set newname for datafile '/tmp/rman.dbf' to '+DATA/racdb/datafile/rman.dbf';
3> restore datafile 7;
4> switch datafile 7;
5> recover datafile 7;
6> }
executing command: SET NEWNAME
Starting restore at 25-APR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 instance=racdb1 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to +DATA/racdb/datafile/rman.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/dbs/05o7vrob_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/dbs/05o7vrob_1_1 tag=TAG20130425T171035
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 25-APR-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of switch command on default channel at 04/25/2013 17:19:13
ORA-19623: file 7 is open
此时,我用sqlplus:
SQL> alter database datafile '/tmp/rman.dbf' offline drop;
然后再次:
RMAN> run{
2> set newname for datafile '/tmp/rman.dbf' to '+DATA/racdb/datafile/rman.dbf';
3> restore datafile 7;
4> switch datafile 7;
5> recover datafile 7;
6> }
executing command: SET NEWNAME
Starting restore at 25-APR-13
using channel ORA_DISK_1
datafile 7 is already restored to file +DATA/racdb/datafile/rman.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 25-APR-13
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=813691325 file name=+DATA/racdb/datafile/rman.dbf
Starting recover at 25-APR-13
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:02
Finished recover at 25-APR-13
节点1:
SQL> select * from rman;
ID NAME
---------- ----------
1 cc
节点2:
SQL> se