Oracle Data Guard _ Delete tablespace in the master database

Source: Internet
Author: User

8.3.2Dropping Tablespaces and Deleting Datafiles8.3.2 Delete Tablespaces and data files

When you delete one or moredatafiles or drop one or more tablespaces in the primary database, you also need to delete the corresponding datafiles to the standby database. the following sections provide examples of dropping tablespaces and deleting datafiles whenSTANDBY_FILE_MANAGEMENTInitialization parameter is setAUTOOrMANUAL.

When you delete one or more data files in the master database or delete one or more tablespaces, you also need to delete the relevant data files in the slave database. The example provided in the following section is as follows, when the STANDBY_FILE_MANAGEMENT parameter is set to AUTO or MANUAL, you can delete tablespaces and data files.

8.3.2.1When STANDBY_FILE_MANAGEMENT Is Set to AUTO or MANUAL8.3.2.1 when STANDBY_FILE_MANAGEMENT Is Set to AUTO or MANUAL

The following procedure works whetherSTANDBY_FILE_MANAGEMENTInitialization parameter is set to eitherMANUALOrAUTO, As follows:

The following steps can work regardless of whether the STANDBY_FILE_MANAGEMENT parameter is set to MANUAL or AUTO:

 

  1. Drop the tablespace from the primary database:

    1. delete a tablespace from the master database

    SQL> drop tablespace tbs_4; SQL> ALTER SYSTEM SWITCH LOGFILE;
  2. Make sure that Redo Apply is running (so that the change is applied to the standby database). If the following query returns the MRP or MRP0 process, Redo Apply is running.

    Make sure that the redo application is running, so that the slave database will apply these changes. If the MRP or MRP0 process returned by the following query, the redo application is running.

     

    SQL> SELECT PROCESS, STATUS FROM V $ MANAGED_STANDBY;

    To verify that deleted datafiles are no longer part of the database, queryV$DATAFILEView.

    Verify that the deleted data file no longer exists in the Database. You can query the V $ DATAFILE view.

     

  3. Delete the corresponding datafile on the standby system after the archived redo log file was applied to the standby database. For example:

    After the archived redo log is applied to the standby database, delete the corresponding data files in the standby database. For example:

     

    % Rm/disk1/Oracle/oradata/payroll/s2tbs_4.dbf
  4. On the primary database, after ensuring the standby database applied the redo information for the dropped tablespace, you can remove the datafile for the tablespace. For example:

    In the primary database, after the standby database application deletes the tablespace redo information, you can remove data files from the tablespace. For example:

     

    % Rm/disk1/oracle/oradata/payroll/tbs_4.dbf
8.3.2.2Using drop tablespace including contents and DATAFILES8.3.2.2 use DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES

You can issue the SQLDROP TABLESPACE INCLUDING CONTENTS AND DATAFILESStatement on the primary database to delete the datafiles on both the primary and standby databases. To use this statement,STANDBY_FILE_MANAGEMENTInitialization parameter must be setAUTO. For example, to drop the tablespace at the primary site:

You can use drop tablespace including contents and datafiles on the master database to delete the data files of the master AND slave databases, provided that STANDBY_FILE_MANAGEMENT must be set to AUTO. For example, you can delete a TABLESPACE on the master database:

 

SQL> drop tablespace including contents and datafiles tbs_4; SQL> ALTER SYSTEM SWITCH LOGFILE; ######################################## ######################################## ########################## my experiment: the master database uses drop tablespace including contents and datafiles to delete the TABLESPACE. The STANDBY_FILE_MANAGEMENT parameter in the slave database is set to AUTO master database: PROD slave Database: PRODSTD

Related Article

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.