Database Reference
In-Depth Information
the given data file is in hot backup mode. Here is an example of such a query where our
USERS
tablespace is in hot backup mode, as indicated by the
ACTIVE
status:
SQL> select a.tablespace_name, b.status
2 from dba_data_files a, v$backup b
3 where a.file_id=b.file#
4 order by tablespace_name;
TABLESPACE_NAME STATUS
------------------------------ -----------
REVEAL_DATA NOT ACTIVE
REVEAL_INDEX NOT ACTIVE
SYSAUX NOT ACTIVE
SYSTEM NOT ACTIVE
UNDOTBS1 NOT ACTIVE
USERS ACTIVE
USERS ACTIVE
Another thing to be aware of is what happens if the database is shut down while data
files are in hot backup mode. First, Oracle will not allow you to shut down a database with
most shutdown commands (
SHUTDOWN
,
SHUTDOWN IMMEDIATE
, or
SHUTDOWN TRANSACTIONAL
)
while a tablespace is in hot backup mode. Instead it will generate an error, as shown here:
ORA-01149: cannot shutdown - file 4 has online backup set
ORA-01110: data file 4: 'C:\ORACLE\ORADATA\ORCL\USERS01.DBF'
This error identifies the data file that is in hot backup mode. You would need to deter-
mine which tablespace the data file is assigned to by looking at the
DBA_DATA_FILES
view.
You would then issue the
ALTER TABLESPACE END BACKUP
command to take it out of hot
backup mode.
If you issue a
SHUTDOWN ABORT, STARTUP FORCE
, or if the database crashes for some
reason or the server shuts down without shutting down the database in a natural fashion,
Oracle will not restart with a data file in hot backup mode. You will see the following
error when you try to restart the database:
ORA-10873: file 4 needs end backup before opening a database
ORA-01110: data file 4: 'C:\ORACLE\ORADATA\ORCL\USERS01.DBF'
You simply issue the command
ALTER DATABASE END BACKUP
to take the data files out of
hot backup mode and then
ALTER DATABASE OPEN
to open the database.
You can take the tablespaces out of hot backup mode with the
ALTER DATABASE END
BACKUP
command, or you can individually take each tablespace out of hot backup mode by
issuing the
ALTER TABLESPACE END BACKUP
command.
Search WWH ::
Custom Search