Purpose:
========
The purpose of this article is to describe the behavior of the standby database when one or more datafiles on the primary database are resized.
Standby Database Behavior When a Datafile is Resized on the Primary Database:
=============================================================================
On the primary database the initial size of the datafile is 113246208. You decide to resize it by:
SVRMGR> alter database datafile ‘/u01/data/users01.dbf ‘ resize 115M;
The size of the datafile becomes 119537664.
Standby Database:
—————–
SVRMGR> startup nomount pfile=initstd.ora
SVRMGR> alter database mount standby database;
Check the datafile in the dictionary’s views before recovering:
SVRMGR> select file#, status, name, bytes from v$datafile where file#=3;
FILE# NAME
BYTES
———- ——- ————————————
3 /U01/DATA/USERS01.DBF
113246208
1 row selected.
SVRMGR> recover standby database;
…
When you look at the alert.log for any information on the resizing, you only see the following:
ORA-279 signalled during: ALTER DATABASE RECOVER LOGFILE ‘e:archivebase…
Mon Nov 06 13:55:30 2000
ALTER DATABASE RECOVER CANCEL
Mon Nov 06 13:55:30 2000
Media Recovery Cancelled
Completed: ALTER DATABASE RECOVER CANCEL
…
In the directory where the datafile resides, you can see that the size of the datafile has changed.
Check again the datafile in the dictionary’s views:
SVRMGR> select file#, status, name, bytes from v$datafile where file#=3;
FILE# NAME
BYTES
———- ——- ————————————
3 /U01/DATA/USERS01.DBF
119537664
1 row selected.
The size of the datafile on the standby database is now 1199537664 and matches the primary database.
The only thing to do before you apply the logs, is to make sure that there is enough space for enlarging the file. Oracle propagates all during the recovery of the controlfile and the datafile, and resizes the datafile automatically. On the other hand, some views of the dictionary such as v$datafile and v$recover_file can present the file with a status
“RECOVER”. This status does not prevent the correct operation of the database, even in Read Only. Once the database is activated, i.e., opened in Read Write, the datafile does not have the status “RECOVER” anymore.