2010-08-26

begin backup - shutdown






What happens when you forget a tablespace in begin backup, before a shutdown immediat

Cannot Open Database With Tablespaces still in Hot Backup Mode [ID 1017140.102]




Problem Description:
====================
 
You are shutting down your database to do a cold backup and the database will
not shut down completely.  You try to open the database and it will only mount
indicating that there are tablespaces that are in hot-backup mode.  When you 
try to take the tablespace out of hot-backup mode, you get the following error:

 svrmgrl> alter tablespace <tsName> end backup;
 ora-1109 database not open

Solution Description:
=====================

Since you cannot take the tablespace out of hot-backup mode, you need to take
the datafiles out of hot-backup mode.

        % svrmgrl
        svrmgrl>  connect internal

to see datafiles in hot backup-mode...

        svrmgrl>  select * from v$backup;

        FILE#     STATUS          CHANGE#      TIME
        -------   --------------  -----------  ---------
              1   NOT ACTIVE                0 
              2   ACTIVE                    1

If the above status indicates 'ACTIVE', this datafile is still in hotbackup
mode.

to determine the datafile names...

        svrmgrl>  select file#, name from v$datafile;

        FILE#     NAME
        --------  ----------------------------------------------------------
               1  /u01/oradata/prod805/datafiles/system01.dbf
               2  /u01/oradata/prod805/datafiles/data01.dbf       

to end the backup of the datafile...

        svrmgrl>  alter database datafile '/u01/oradata/prod805/datafiles/data01.dbf' 
                  end backup;
        statement processed

Then you should be able to open your database.

        svrmgrl>  alter database open;

 
Explanation:
============
 
Even though you are unable to alter a tablespace unless the database is open,
you can still alter a datafile.  By taking the datafiles out of hot-backup mode, 
you essentially take the tablespace out of hot-backup mode.
 
Explanation2: 
===================== 
 
When an 'alter tablespace begin backup' command is issued the datafiles that 
belong to the tablespace are marked as hot-backup-in-progress.  The dirty 
databuffers in the database buffer cache that belong to the database files are 
written out to the files and the datafiles are checkpointed.  The datafile 
headers are updated to the SCN captured when the begin backup is issued.  The 
datafile headers are not updated until the 'alter tablespace end backup' 
command is issued; however, the datablock within the database files can 
continue to be read and updated.  When the datafile is restored from a hot 
backup, the recovery will begin from the SCN captured during the begin backup 
is issued.  All changes applied during the hot backup time period will be 
rolled forward from the redo logs. 

Niciun comentariu:

Trimiteți un comentariu