Thursday, April 19, 2012

ORA-19573: cannot obtain exclusive enqueue for datafile 10



-bash-3.2$ oerr ora 19573
19573, 00000, "cannot obtain %s enqueue for datafile %s"
// *Cause:  The file access enqueue could not be obtained for a file
//          specified in a backup, copy or restore operation.
//          If the enqueue type shown is 'shared', then the file is the
//          input file for a backup or copy.  If the type is 'exclusive', then
//          the file is the output file for a datafile copy or restore which
//          is attempting to overwrite the currently active version of that
//          file - in this case, the file must be offline or the database must
//          be closed.  If the type is 'read-only', then you are attempting
//          to back up or copy this file while the database is in NOARCHIVELOG
//          mode.
// *Action: Wait until the conflicting operation is complete, then retry
//          the copy or backup.  If the database is in NOARCHIVELOG mode, then
//          all files being backed up must be closed cleanly.
-bash-3.2$



Remove one datafile (just for testing)

-bash-3.2$ ls
idx_big_01.dbf    idx_small_01.dbf  tab_med_01.dbf
idx_med_01.dbf    tab_big_01.dbf    tab_small_01.dbf
-bash-3.2$ rm idx_small_01.dbf
-bash-3.2$ ls
idx_big_01.dbf    tab_big_01.dbf    tab_small_01.dbf
idx_med_01.dbf    tab_med_01.dbf
-bash-3.2$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu Apr 19 11:57:16 2012

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

SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
ORA-01116: error in opening database file 10
ORA-01110: data file 10: '/data/tbs/idx_small_01.dbf'
ORA-27041: unable to open file
Solaris-AMD64 Error: 2: No such file or directory
Additional information: 3
SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
-bash-3.2$
-bash-3.2$


-bash-3.2$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Apr 19 11:57:51 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORATEST (DBID=3309052188)

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name ORATEST

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    730      SYSTEM               ***     +DATA/oratest/datafile/system.256.773672945
2    730      SYSAUX               ***     +DATA/oratest/datafile/sysaux.257.773672955
3    110      UNDOTBS1             ***     +DATA/oratest/datafile/undotbs1.258.773672957
4    18       USERS                ***     +DATA/oratest/datafile/users.259.773672963
5    345      EXAMPLE              ***     +DATA/oratest/datafile/example.265.773673233
6    100      TAB                  ***     +DATA/oratest/datafile/tab.267.774023547
7    64       TAB_SMALL            ***     /data/tbs/tab_small_01.dbf
8    64       TAB_MED              ***     /data/tbs/tab_med_01.dbf
9    256      TAB_BIG              ***     /data/tbs/tab_big_01.dbf
10   0        IDX_SMALL            ***     /data/tbs/idx_small_01.dbf
11   64       IDX_MED              ***     /data/tbs/idx_med_01.dbf
12   256      IDX_BIG              ***     /data/tbs/idx_big_01.dbf
13   100      RC_TBS               ***     +DATA/oratest/datafile/rc_tbs.271.781005987

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    29       TEMP                 32767       +DATA/oratest/tempfile/temp.264.773673181
2    10       TEMP_TEMP            10          +DATA/oratest/tempfile/temp_temp.268.778418247

RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
28         HIGH     OPEN      19-APR-12     One or more non-system datafiles are missing

RMAN> restore datafile 10;

Starting restore at 19-APR-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 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 00010 to /data/tbs/idx_small_01.dbf
channel ORA_DISK_1: reading from backup piece +FRA/oratest/backupset/2012_04_19/nnndf0_tag20120419t102811_0.290.781007293
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/19/2012 11:58:54
ORA-19870: error while restoring backup piece +FRA/oratest/backupset/2012_04_19/nnndf0_tag20120419t102811_0.290.781007293
ORA-19573: cannot obtain exclusive enqueue for datafile 10

RMAN> sql 'alter tablespace IDX_SMALL offline';

sql statement: alter tablespace IDX_SMALL offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 04/19/2012 12:01:56
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace IDX_SMALL offline
ORA-01116: error in opening database file 10
ORA-01110: data file 10: '/data/tbs/idx_small_01.dbf'
ORA-27041: unable to open file
Solaris-AMD64 Error: 2: No such file or directory
Additional information: 3

RMAN> sql 'alter tablespace IDX_SMALL offline immediate';

sql statement: alter tablespace IDX_SMALL offline immediate

RMAN> restore tablespace IDX_SMALL;

Starting restore at 19-APR-12
using channel ORA_DISK_1

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 00010 to /data/tbs/idx_small_01.dbf
channel ORA_DISK_1: reading from backup piece +FRA/oratest/backupset/2012_04_19/nnndf0_tag20120419t102811_0.290.781007293
channel ORA_DISK_1: piece handle=+FRA/oratest/backupset/2012_04_19/nnndf0_tag20120419t102811_0.290.781007293 tag=TAG20120419T102811
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 19-APR-12

RMAN> recover tablespace IDX_SMALL;

Starting recover at 19-APR-12
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:07

Finished recover at 19-APR-12

RMAN> sql 'alter tablespace IDX_SMALL online';

sql statement: alter tablespace IDX_SMALL online

RMAN>  report schema;

Report of database schema for database with db_unique_name ORATEST

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    730      SYSTEM               ***     +DATA/oratest/datafile/system.256.773672945
2    730      SYSAUX               ***     +DATA/oratest/datafile/sysaux.257.773672955
3    110      UNDOTBS1             ***     +DATA/oratest/datafile/undotbs1.258.773672957
4    18       USERS                ***     +DATA/oratest/datafile/users.259.773672963
5    345      EXAMPLE              ***     +DATA/oratest/datafile/example.265.773673233
6    100      TAB                  ***     +DATA/oratest/datafile/tab.267.774023547
7    64       TAB_SMALL            ***     /data/tbs/tab_small_01.dbf
8    64       TAB_MED              ***     /data/tbs/tab_med_01.dbf
9    256      TAB_BIG              ***     /data/tbs/tab_big_01.dbf
10   64       IDX_SMALL            ***     /data/tbs/idx_small_01.dbf
11   64       IDX_MED              ***     /data/tbs/idx_med_01.dbf
12   256      IDX_BIG              ***     /data/tbs/idx_big_01.dbf
13   100      RC_TBS               ***     +DATA/oratest/datafile/rc_tbs.271.781005987

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    29       TEMP                 32767       +DATA/oratest/tempfile/temp.264.773673181
2    10       TEMP_TEMP            10          +DATA/oratest/tempfile/temp_temp.268.778418247

RMAN>






No comments:

Post a Comment