Oracle Data Guard _ add Data files to the master database or create tablespaces

Source: Internet
Author: User

8.3 Managing Primary Database Events That Affect the Standby Database8.3 Managing the master Database can Affect the Events of the slave Database

To prevent possible problems, you must be aware of events on the primary database that affect a standby database and learn how to respond to them. this section describes these events and the recommended responses to these events.

In some cases, the events or changes that occur on a primary database are automatically propagated through redo data to the standby database and thus require no extra action on the standby database. in other cases, you might need to perform maintenance tasks on the standby database.

Table 8-1indicates whether or not a change made on the primary database requires additional intervention by the database administrator (DBA) to be propagated to the standby database. it also briefly describes how to respond to these events. detailed descriptions of the responses are described in the section references provided.

The following events are automatically administered by redo transport services and Redo Apply, and therefore require no intervention by the database administrator:

  • A SQLALTER DATABASEStatement is issued withENABLE THREADOrDISABLE THREADClause.

  • The status of a tablespace changes (changes to read/write or read-only, placed online or taken offline ).

  • A datafile is added or tablespace is created whenSTANDBY_FILE_MANAGEMENTInitialization parameter is setAUTO.

     

Table 8-1 Actions Required on a Standby Database After Changes to a Primary Database

Reference Change Made on Primary Database Action Required on Standby Database

Section 8.3.1

Add a datafile or create a tablespace

Add a file or create a tablespace

If you did not setSTANDBY_FILE_MANAGEMENTInitialization parameterAUTO, You must copy the new datafile to the standby database.

If the STANDBY_FILE_MANAGEMENT initialization parameter is not set to AUTO, you must copy the new data file to the slave database.

Section 8.3.2

Drop or delete a tablespace or datafile

Delete a tablespace or data file

Delete datafiles from primary and standby databases after the archived redo log file containingDROPOrDELETECommand was applied.

DELETE data files from the master database. The backup database will use archive redo logs containing the DROP or DELETE commands to apply them.

Section 8.3.3

Use transportable tablespaces

Use transfer tablespace

Move tablespaces between the primary and standby databases.

Move the tablespace between the master and slave Databases

Section 8.3.4

Rename a datafile

Rename a data file

Rename the datafile on the standby database.

Recommand the data file in the slave Database

Section 8.3.5

Add or drop redo log files

Add or delete redo log files love you

Synchronize changes on the standby database.

Synchronize changes on the slave Database

Section 8.3.6

Perform a DML or DDL operation usingNOLOGGINGOrUNRECOVERABLEClause

UseNOLOGGINGOrUNRECOVERABLEExecute DML or DDL operations,

Send the datafile containing the unlogged changes to the standby database.

Send a file containing no log records to the slave Database

Chapter 13

Change initialization parameters

Change initialization parameters

Dynamically change the standby parameters or shut down the standby database and update the initialization parameter file.

Dynamically change the backup parameters or close the backup database, and then update the initialization parameter file.


8.3.1Adding a Datafile or Creating a Tablespace8.3.1 Add a data file or create a tablespace

The initialization parameter,STANDBY_FILE_MANAGEMENT, Enables you to control whether or not adding a datafile to the primary database is automatically propagated to the standby database, as follows:

STANDBY_FILE_MANAGEMENT initializes the parameter file, which can be used to control whether the data file is automatically transmitted to the slave database when it is added to the master database, as follows:

  • If you setSTANDBY_FILE_MANAGEMENTInitialization parameter in the standby database server parameter file (SPFILE)AUTO, Any new datafiles created on the primary database are automatically created on the standby database as well.

    If the spfile of the STANDBY_FILE_MANAGEMENT initialization parameter file in the slave database is AUTO, any data files created on the master database will be automatically created in the slave database.

  • If you do not specifySTANDBY_FILE_MANAGEMENTInitialization parameter or if you set itMANUAL, Then you must manually copy the new datafile to the standby database when you add a datafile to the primary database.

    If STANDBY_FILE_MANAGEMENT is not set or is set to MANUAL, when you add a data file to the master database, you must manually copy the new data file to the slave database.

Note that if you copy an existing datafile from another database to the primary database, then you must also copy the new datafile to the standby database and re-create the standby control file, regardless of the settingSTANDBY_FILE_MANAGEMENTInitialization parameter.

Note: If you copy an existing data file from another database to the master database, you must also copy it to the inverted database and recreate the backup control file, unless you have setSTANDBY_FILE_MANAGEMENTInitialize parameters.

The following sections provide examples of adding a datafile to the primary and standby databases whenSTANDBY_FILE_MANAGEMENTInitialization parameter is setAUTOAndMANUAL,Respectively.

Add a data file to the master database as follows. STANDBY_FILE_MANAGEMENT of the slave database is set to AUTO and MANUAL respectively.

8.3.1.1When STANDBY_FILE_MANAGEMENT Is Set to AUTO8.3.1.1 when STANDBY_FILE_MANAGEMENT Is Set to AUTO, The following example shows the steps required to add a new datafile to the primary and standby databases when STANDBY_FILE_MANAGEMENTInitialization parameter is set AUTO.

The following example shows how to add a data file to the master database and set STANDBY_FILE_MANAGEMENT to AUTO in the slave database.

  1. Add a new tablespace to the primary database:

    1. Add a new tablespace to the master database:

    SQL> CREATE TABLESPACE new_ts DATAFILE '/disk1/Oracle/oradata/payroll/t_db2.dbf' 2> SIZE 1 m AUTOEXTEND ON MAXSIZE UNLIMITED;
  2. Archive the current online redo log file so the redo data will be transmitted to and applied on the standby database:

    Archive the current redo log. In this way, the redo log will be transmitted to the slave database, and the slave database will apply the transferred logs:

    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
  3. Verify the new datafile was added to the primary database:

    3. Verify that the new data file is added to the master database:

    SQL> SELECT NAME FROM V $ DATAFILE; NAME partition/disk1/oracle/oradata/payroll/t_db1.dbf/disk1/oracle/oradata/payroll/t_db2.dbf
  4. Verify the new datafile was added to the standby database:

    The data file of the verification letter is added to the slave database:

    SQL> SELECT NAME FROM V $ DATAFILE; NAME partition/disk1/oracle/oradata/payroll/s2t_db1.dbf/disk1/oracle/oradata/payroll/s2t_db2.dbf
  • 1
  • 2
  • Next Page

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.