Modify the tablespace when standby_file_management is manual in the physical backup mode of mongourad.

Source: Internet
Author: User
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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.