Modify the tablespace when standby_file_management is manual in the physical backup mode of mongourad.
Modify the tablespace when standby_file_management is manual in Data Gurad physical backup mode
STANDBY_FILE_MANAGEMENT is set to MANUAL to add and delete tablespaces and data files.
SQL> show parameter standby_file_management
NAME TYPE VALUE
-----------------------------------------------------------------------------
Standby_file_management string AUTO
SQL> alter system set standby_file_management = 'manual' scope = both;
System altered.
SQL> show parameter standby_file_management
NAME TYPE VALUE
-----------------------------------------------------------------------------
Standby_file_management string MANUAL
SQL>
A) Add A new tablespace-primary database operation.
SQL> CREATE TABLESPACE mytest DATAFILE '/u01/app/Oracle/oradata/jytest/mytest01.dbf' size 20 M
SQL> select name from v $ datafile;
NAME
--------------------------------------------------------------------------------
/U01/app/oracle/oradata/jytest/system01.dbf
/U01/app/oracle/oradata/jytest/undotbs01.dbf
/U01/app/oracle/oradata/jytest/sysaux01.dbf
/U01/app/oracle/oradata/jytest/users01.dbf
/U01/app/oracle/oradata/jytest/hygeia01.dbf
/U01/app/oracle/oradata/jytest/mytest01.dbf
6 rows selected
Switch logs
SQL> alter system switch logfile;
System altered
SQL>
B). Verify standby database-standby database operations
SQL> select name from v $ datafile;
NAME
--------------------------------------------------------------------------------
/U01/app/oracle/oradata/jytest/system01.dbf
/U01/app/oracle/oradata/jytest/undotbs01.dbf
/U01/app/oracle/oradata/jytest/sysaux01.dbf
/U01/app/oracle/oradata/jytest/users01.dbf
/U01/app/oracle/oradata/jytest/hygeia01.dbf
/U01/app/oracle/product/10.2.0/db/dbs/UNNAMED00006
6 rows selected.
SQL>
SQL> select name from v $ tablespace;
NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
TEMP
HYGEIA
MYTEST
7 rows selected.
SQL>
As you can see, the tablespace has been automatically created, but the data file has been named with a strange name, and it is manually modified with primary
The database remains consistent.
SQL> alter database create datafile
'/U01/app/oracle/product/10.2.0/db/dbs/UNNAMED00006'
As '/u01/app/oracle/oradata/jytest/mytest01.dbf ';
C). Delete the tablespace-primary database operation
SQL> drop tablespace mytest including contents and datafiles;
Tablespace dropped
SQL> select name from v $ datafile;
NAME
--------------------------------------------------------------------------------
/U01/app/oracle/oradata/jytest/system01.dbf
/U01/app/oracle/oradata/jytest/undotbs01.dbf
/U01/app/oracle/oradata/jytest/sysaux01.dbf
/U01/app/oracle/oradata/jytest/users01.dbf
/U01/app/oracle/oradata/jytest/hygeia01.dbf
SQL> alter system switch logfile;
System altered
SQL>
D). Verify standby database-standby database operations
SQL> select name from v $ datafile;
NAME
--------------------------------------------------------------------------------
/U01/app/oracle/oradata/jytest/system01.dbf
/U01/app/oracle/oradata/jytest/undotbs01.dbf
/U01/app/oracle/oradata/jytest/sysaux01.dbf
/U01/app/oracle/oradata/jytest/users01.dbf
/U01/app/oracle/oradata/jytest/hygeia01.dbf
/U01/app/oracle/oradata/jytest/mytest01.dbf
6 rows selected.
SQL> select name from v $ tablespace;
NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
TEMP
HYGEIA
MYTEST
7 rows selected.
SQL>
The data is still there. View the alertjytest. log File and find the following:
MRP0: Background Media Recovery terminated with error 1274
Mon Dec 3 17:03:34 2012
Restart the redo application and check again:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select name from v $ datafile;
NAME
--------------------------------------------------------------------------------
/U01/app/oracle/oradata/jytest/system01.dbf
/U01/app/oracle/oradata/jytest/undotbs01.dbf
/U01/app/oracle/oradata/jytest/sysaux01.dbf
/U01/app/oracle/oradata/jytest/users01.dbf
/U01/app/oracle/oradata/jytest/hygeia01.dbf
SQL> select name from v $ tablespace;
NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
TEMP
HYGEIA
6 rows selected.
SQL>