Skip Headers

Oracle9i Data Guard Broker
Release 2 (9.2)

Part Number A96629-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

7
Data Guard Command-Line Interface Reference

The Data Guard command-line interface allows you to manage a Data Guard configuration and its site and database resource objects directly from the command line, or from batch programs or scripts. You can use the Data Guard command-line interface as an alternative to the Oracle9i Data Guard Manager graphical user interface for managing a Data Guard configuration.

This chapter provides reference information for the Data Guard command-line interface.

7.1 Starting the Data Guard Command-Line Interface

To run the Data Guard command-line interface, you must have SYSDBA privileges.

Start the command-line interface by entering DGMGRL at the command line prompt on a system where Oracle9i Data Guard is installed:

% DGMGRL [options]
DGMGRL for Solaris:  Version 9.2.0.0.0 - Production.
(c) Copyright 2002 Oracle Corporation. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL>

7.1.1 DGMGRL Optional Parameters

You can supply optional parameters on the command line to indicate how you want the Data Guard command-line interface to display output such as command prompts, banners, and messages.

Specify none, one, or all of the following keywords when you invoke the DGMGRL command-line interface:

The following subsections specify the command format that you enter at the DGMGRL> command prompt.

7.1.2 DGMGRL Command Format and Parameters

The DGMGRL commands allow you to create and maintain one broker configuration at a time. A broker configuration can consist of a primary site and from 1 to 9 standby sites.

After you invoke the command-line interface, you can enter any of the DGMGRL commands listed in Table 7-1. Each command and its associated parameters are described in detail in later sections of this chapter.

Table 7-1  Summary of DGMGRL Commands
Command Effect

ALTER CONFIGURATION (protection mode)

Alters the protection mode of the overall Data Guard configuration.

ALTER CONFIGURATION (state)

Alters a broker configuration state from online to offline, or from offline to online.

ALTER RESOURCE (property)

Allows you to change the value of a property for the specified database resource object.

ALTER RESOURCE (state)

Allows you to change the state of the specified database resource object.

ALTER SITE (state)

Allows you to change the state of a site object from online to offline, or from offline to online.

ALTER SITE (AUTO PFILE)

Allows you to specify the initialization parameter file used to automatically restart the database of the site as needed by the client. The information you specify with this command is session specific; that is, it resets to the default initialization parameter file when you connect to a database using the CONNECT command.

CONNECT

Connects a given username to the specified database.

CREATE CONFIGURATION

Creates a broker configuration, a primary site object, and a database resource object on the primary site.

CREATE SITE

Creates a new standby site object and a database resource object, and adds them to the broker configuration.

DISABLE CONFIGURATION

Disables broker management of a configuration so that the configuration and all of its site objects and database resource objects are no longer managed by the broker.

DISABLE RESOURCE

Disables broker management of a database resource object in the broker configuration.

DISABLE SITE

Disables broker management of the specified standby site object in the broker configuration so that the standby site object and the database resource objects on the standby site are no longer managed by the broker.

ENABLE CONFIGURATION

Enables broker management of the broker configuration.

ENABLE RESOURCE

Enables broker management of a database resource object in the broker configuration.

ENABLE SITE

Enables broker management of a standby site object in the broker configuration.

EXIT

Exits the Data Guard command-line interface.

FAILOVER

Performs a database failover operation in which the standby site to which the CLI is currently connected fails over into the role of primary database. You issue the FAILOVER command as a result of an unplanned transition.

HELP

Displays online help for the Data Guard command-line interface.

QUIT

Quits the Data Guard command-line interface.

REMOVE CONFIGURATION

Removes the broker configuration including all of its site objects and database resource objects.

REMOVE SITE

Removes a standby site object from the broker configuration including the database resource object running on the standby site.

SHOW CONFIGURATION

Displays a information about the broker configuration.

SHOW DEPENDENCY TREE

Displays the dependency tree and default online states for the broker configuration.

SHOW LOG

Shows the Data Guard configuration log or the Oracle database alert log.

SHOW RESOURCE

Displays information about the named database resource object and its status.

SHOW SITE

Displays information about the site object in the broker configuration.

SHUTDOWN

Shuts down a currently running Oracle database instance.

STARTUP

Starts an Oracle instance with several options, including mounting and opening a database.

SWITCHOVER

Performs a switchover operation in which the current primary site becomes a standby site, and the standby site becomes the primary site.

7.1.3 DGMGRL Command Usage Notes

To use the Data Guard command-line interface, the following must be true:

Command Examples

Example 1

This example demonstrates how to connect to the DGMGRL command-line interface on a local system.

% DGMGRL

Welcome to DGMGRL, type "help" for information.

DGMGRL> CONNECT sys/change_on_install;
Connected.
Example 2

This example demonstrates how to connect to the DGMGRL command-line interface on a remote system.

DGMGRL> CONNECT sys/change_on_install@remote-stby;
Connected.

7.2 Stopping the Data Guard Command-Line Interface

When you are done working with the command-line interface and want to return to the operating system, enter the EXIT or QUIT command at the DGMGRL command prompt. For example:

DGMGRL> EXIT;

You can use either the EXIT or the QUIT command to leave the DGMGRL command-line interface.


ALTER CONFIGURATION (protection mode)

Alters the current protection mode setting for broker configuration.

Format

ALTER CONFIGURATION SET PROTECTION MODE AS protection-mode;

Command Parameters

protection mode

The data protection mode in which you want the configuration to run when the configuration is enabled. The possible protection modes are:

MAXPROTECTION
MAXAVAILABILITY
MAXPERFORMANCE

Usage Notes

Perform the following steps before you use the ALTER CONFIGURATION command to set the protection mode:

If broker management of the configuration is disabled when you enter the ALTER CONFIGURATION command, the protection mode of the configuration does not take effect until the next time you enable the configuration with the ENABLE CONFIGURATION command.

Command Examples

Example 1

The following example shows how to upgrade the broker configuration to the MAXPROTECTION protection mode. The broker configuration will have the maximum amount of data protection after these commands complete.

After verifying that standby redo logs are configured on the standby site and that the LogXptMode is set properly to support the protection mode, enter the following commands:

DGMGRL> ALTER RESOURCE 'Sales_db' SET PROPERTY LogXptMode=SYNC;
Property "logxptmode" updated.

DGMGRL> ALTER CONFIGURATION SET PROTECTION MODE AS MAXPROTECTION;
Operation requires restart of site "Primary";
Shutting down site Primary...
Database closed.
Database dismounted.
ORACLE instance shut down.
Restarting site Primary...
Started "Primary" as new primary

The broker automatically stops and restarts the primary site and database.


ALTER CONFIGURATION (state)

Alters the intended (runtime) state of the broker configuration.

Format

ALTER CONFIGURATION SET STATE = state;

Command Parameters

state

The state in which you want the configuration to be running when management of the configuration is enabled. The possible states are:

OFFLINE
ONLINE

Usage Notes

Command Examples

Example 1

In the following example, the broker configuration will be in the online state the next time you enable the configuration.

DGMGRL> ALTER CONFIGURATION SET STATE = ONLINE;
Succeeded.

ALTER RESOURCE (property)

Allows you to change the value of a property for the specified database resource object.

Format

ALTER RESOURCE resource-name [ON SITE site-name]

SET PROPERTY property-name = value;

Command Parameters

resource-name

The name of the database resource object for which you want to set a property value.


site-name

The name of the site object where the database resource object is located.

property-name

The name of the property for which you want to set a new value. Section 2.8 describes the database resource properties in detail.

value

The new value for the property. Section 2.8 describes the values for each property.

Usage Notes

Command Examples

Example 1

The ALTER RESOURCE command in the following example changes the value of the LogArchiveTrace property to be 127 for the database resource object named Sales_db.

DGMGRL> ALTER RESOURCE 'Sales_db' ON SITE 'Boston' SET PROPERTY 'LogArchiveTrace'='127';
Property "LogArchiveTrace" updated.

The command-line interface returns the following message to indicate that the LogArchiveTrace property was updated successfully in the Data Guard configuration file:

Property "LogArchiveTrace" updated 

If broker management of the configuration is currently disabled, the property does not affect the actual database, until the next time you enable the broker configuration with the ENABLE CONFIGURATION command.


ALTER RESOURCE (state)

Allows you to change the state of the specified database resource object.

Format

ALTER RESOURCE resource-name [ON SITE site-name]

SET STATE = state;

Command Parameters

resource-name

The name of the database resource object for which you want to change the state.


site-name

The name of the site object that contains the database resource object that you want to alter.

state

The state to which the database resource will transition when it is enabled.

Usage Notes

Command Examples

Example 1

The ALTER RESOURCE command in the following example changes the state of the Sales_db database resource to read/write.

DGMGRL> ALTER RESOURCE 'Sales_db' ON SITE 'Boston' SET STATE='read-write';
Succeeded.


ALTER SITE (state)

Allows you to change the state of a site object.

Format

ALTER SITE site-name

SET STATE = state;

Command Parameters

site-name

The name of the site object for which you want to change state.

state

The state to which the site will transition when management of the site is enabled. The possible states are:

OFFLINE
ONLINE

Usage Notes

Command Examples

Example 1
DGMGRL> ALTER SITE 'Boston' SET STATE='online';
Succeeded.

ALTER SITE (AUTO PFILE)

Allows you to specify an initialization parameter file that will be used to automatically restart the database of the site.

Format

ALTER SITE site-name

SET AUTO PFILE= initialization-file | OFF ;

Command Parameters

site-name

The name of the site object for which you want to specify the automatic restart initialization parameter file.

initialization-file

The name of the PFILE initialization parameter file that will be used to automatically restart the database of the site.

Usage Notes

Command Examples

Example 1
DGMGRL> ALTER SITE 'Boston' SET AUTO PFILE='/oracle/dbs/initbs.ora';
Succeeded.
Example 2
DGMGRL> ALTER SITE 'Boston' SET AUTO PFILE=OFF;
Succeeded.

CONNECT

Connects a given username to the specified database.

Format

CONNECT username/password[@net-service-name];

Command Parameters

username/password

Represents the username and password with which you want to connect to the database.

net-service-name

Consists of the Oracle Net service name of the site to which you want to connect. The exact syntax depends upon the Oracle Net communications protocol your Oracle installation uses.

Usage Notes

Command Examples

Example 1

This example connects to the default database on the local system.

DGMGRL> CONNECT sys/change_on_install;
Connected.
Example 2

This example connects to a remote database whose service name is prmy.

DGMGRL> CONNECT sys/change_on_install@prmy;
Connected.

CREATE CONFIGURATION

Creates a new broker configuration, and creates and adds a primary site object and a database resource object to the configuration.

Format

CREATE CONFIGURATION configuration-name AS

PRIMARY SITE IS site-name

RESOURCE IS resource-name

HOSTNAME IS host-name

INSTANCE NAME IS instance-name

SERVICE NAME IS net-service-name

SITE IS MAINTAINED AS standby-type;

Command Parameters

configuration-name

A user-friendly name for the configuration you are creating. Valid names contain any alphanumeric characters. If spaces are included in the name, the name must be enclosed in double or single quotation marks. The name must consist of 30 or fewer bytes.

site-name

A user-friendly name for the primary site object.

resource-name

A user-friendly name for the database resource object to be created for the primary site.

host-name

The host name of the primary site, as shown in the V$INSTANCE view.

instance-name

The instance name of the primary database, as shown in the V$INSTANCE view.

net-service-name

Consists of the Oracle Net service name for the primary site. The exact syntax depends upon the Oracle Net communications protocol your Oracle installation uses. For more information, refer to the Oracle Net documentation.

standby-type

Specify PHYSICAL or LOGICAL for this parameter to indicate the type of standby database that this site will contain as a result of a switchover operation.

Usage Notes

Command Examples

Example 1

The following example creates a new broker configuration named Sales with a database that will have the physical standby characteristics if the primary database transitions to the standby role in a future switchover operation.

DGMGRL> CREATE CONFIGURATION 'Sales' AS
  PRIMARY SITE IS 'Boston'
  RESOURCE IS 'Sales_db'
  HOSTNAME IS 'boston'
  INSTANCE NAME IS 'bstn'
  SERVICE NAME IS 'bstn'
    SITE IS MAINTAINED AS PHYSICAL;

Configuration "Sales" added with primary site "Boston"
Database resource "Sales_db" added.

CREATE SITE

Creates a new standby site object and database resource object and adds it to an existing broker configuration.

Format

CREATE SITE site-name

RESOURCE IS resource-name

HOSTNAME IS host-name

INSTANCE NAME IS instance-name

SERVICE NAME IS net-service-name

SITE IS MAINTAINED AS standby-type;

Command Parameters

site-name

A user-friendly name for the site object you are creating. Valid names contain any alphanumeric characters. If spaces are included in the name, the name must be enclosed in double or single quotation marks. The name must consist of 30 or fewer bytes.

resource-name

A user-friendly name for the database resource object to be created for the standby site.

host-name

The host name of the standby site.

instance-name

The instance name of the primary database.

net-service-name

Consists of the Oracle Net service name of the standby site that you want to add. The exact syntax depends upon the Oracle Net communications protocol your Oracle installation uses. For more information, see the Oracle Net documentation.

standby-type

Specify PHYSICAL or LOGICAL for this parameter to indicate the type of standby database that this site will contain.

Usage Notes

Command Examples

Example 1

The following example demonstrates how to add a standby site called San Francisco to the broker configuration.

DGMGRL> CREATE SITE 'San Francisco'
  RESOURCE IS 'reportingdb'
  HOSTNAME IS 'sf'
  INSTANCE NAME IS 'sfdb'
  SERVICE NAME IS 'dest2'
    SITE IS MAINTAINED AS PHYSICAL;

Site "San Francisco" added to configuration.
Database resource "reportingdb" added.

DISABLE CONFIGURATION

Disables broker management of a broker configuration and all of its site objects and database resource objects.

Format

DISABLE CONFIGURATION;

Command Parameters

None.

Usage Notes

Command Examples

Example 1

The following example disables management of the broker configuration and all of its sites and database resources.

DGMGRL> DISABLE CONFIGURATION;
Disabled.

DISABLE RESOURCE

Disables broker management of a database resource object.

Format

DISABLE RESOURCE resource-name [ON SITE site-name];

Command Parameters

resource-name

The name of the database resource object that you want to disable.

site-name

The name of the site containing the database resource that you want to disable.

Usage Notes

Command Examples

Example 1

The following example demonstrates how to disable management of the database resource reportingdb from the San Francisco site.

DGMGRL> DISABLE RESOURCE 'reportingdb' ON SITE 'San Francisco';
Disabled.

DISABLE SITE

Disables broker management of the specified standby site object in the broker configuration and any database resource objects on the site.

Format

DISABLE SITE site-name;

Command Parameters

site-name

The name of the standby site that you want to disable.

Usage Notes

Command Examples

Example 1

The following example demonstrates how to disable broker management of the San Francisco standby site.

DGMGRL> DISABLE SITE 'San Francisco';
Disabled.




ENABLE CONFIGURATION

Enables the broker to actively manage the broker configuration including all of its site objects and database resource objects.

Format

ENABLE CONFIGURATION;

Command Parameters

None.

Usage Notes

Command Examples

Example 1

The following example enables management of a broker configuration.

DGMGRL> ENABLE CONFIGURATION;
Enabled.

ENABLE RESOURCE

Enables the broker to actively manage the specified database resource object.

Format

ENABLE RESOURCE resource-name [ON SITE site-name];

Command Parameters

resource-name

The name of the database resource object you want to manage with the broker.

site-name

The name of the site object containing the database resource object that you want to enable.

Usage Notes

Command Examples

Example 1

The following example enables broker management of the database resource object named Sales_db.

DGMGRL> ENABLE RESOURCE 'Sales_db';
Enabled.

ENABLE SITE

Enables the broker to actively manage the specified standby site object, including its database resource object.

Format

ENABLE SITE site-name;

Command Parameters

site-name

The name of the standby site object you want to manage with the broker.

Usage Notes

Command Examples

Example 1

The following example enables management of the standby site named San Francisco.

DGMGRL> ENABLE SITE 'San Francisco';
Enabled.

EXIT

Exits the command-line interface.

Format

EXIT;

Usage Notes

Command Examples

Example 1

The following example demonstrates how to exit (quit) the command-line interface.

DGMGRL> EXIT;

FAILOVER

A failover operation changes one of the standby sites and its database into the role of a primary site and database.


Note:

Because a failover operation results in a role transition that may result in the loss of application data, you should perform a failover operation only if the primary database has failed. If you want the current primary database and a standby database to switch roles, then use the SWITCHOVER command.


Format

FAILOVER TO site-name {GRACEFUL | FORCED};

Command Parameters

site-name

The name of the standby site object you want to fail over to the primary site role.

Usage Notes

Command Examples

Example 1

The following example performs a graceful failover in which the standby site, Standby2, transitions to the primary role:

DGMGRL> FAILOVER TO 'Standby2' GRACEFUL;
Performing failover NOW. Please wait...
Operation requires restart of site "Standby2"
Shutting down site Standby2...
database not mounted
ORACLE instance shut down.
Restarting site Standby2...
Started "Standby2" as new primary
Failover succeeded. New primary is "Standby2"
Example 2

The following example performs a forced failover operation:

DGMGRL> FAILOVER TO 'Standby4' FORCED;
Performing failover NOW. Please wait...
Operation requires restart of site "Standby4"
Shutting down site Standby4...
database not mounted
ORACLE instance shut down.
Restarting site Standby4...
Started "Standby4" as new primary
Failover succeeded. New primary is "Standby4"

HELP

Displays online help for the Data Guard command-line interface.

Format

HELP [<topic>];

Command Parameters

topic

The topic for which you want to display help information. If you do not specify a topic, the command lists all of the topics and the format. Valid topics are:

ALTER
CONNECT
CREATE
DISABLE
ENABLE
EXIT
FAILOVER
HELP
QUIT
REMOVE
SHOW
SHUTDOWN
STARTUP
SWITCHOVER

Usage Notes

A database connection is not required to execute this command.

Command Examples

Example 1

The following examples get help on the HELP and CONNECT commands.

DGMGRL> HELP HELP;
Display the help for a given command
DGMGRL> HELP CONNECT;
Connect to a server
connect <user>/<password>@<connect>;
Example 2
DGMGRL> HELP ALTER;
edit a configuration, site or resource
alter configuration set state = '[ONLINE|OFFLINE]'

alter configuration set protection mode as
  '[MaxProtection|MaxAvailability|MaxPerformance]'

alter site '<site name>' set state = '[ONLINE|OFFLINE]'

alter site '<site name>' set auto pfile='<pfile>'

alter resource '<resource name>'
   [ on site '<site name>'] set state = '<state>'

alter resource '<resource name> [ on site <site name> ] '
   set property '<property name>' = '<value>';

QUIT

Exits the Data Guard command-line interface.

Format

QUIT;

Usage Notes

Command Examples

Example 1

The following example shows how to quit (exit) the command-line interface.

DGMGRL> QUIT;

REMOVE CONFIGURATION

Removes all of the broker configuration information from the Data Guard configuration file, and removes management of all of the site and database resource objects associated with the broker configuration.


Caution:

When you use the REMOVE CONFIGURATION command, all information is deleted from the Data Guard configuration file and cannot be recovered.


Format

REMOVE CONFIGURATION;

Command Parameters

None.

Usage Notes

Command Examples

Example 1

The following example shows how to remove configuration information from the configuration file.

DGMGRL> REMOVE CONFIGURATION;
Removed configuration.

REMOVE SITE

Removes the specified standby site object from the broker configuration.


Caution:

When you use the REMOVE SITE command, all of the information about the standby site and its database resource is deleted from the Data Guard configuration file and cannot be recovered.


Format

REMOVE SITE site-name;

Command Parameters

site-name

The name of the standby site that you want to remove.

Usage Notes

Command Examples

Example 1

The following example shows how to remove information about the site object named San Francisco.

DGMGRL> REMOVE SITE 'San Francisco';
Removed site "San Francisco" from configuration.

SHOW CONFIGURATION

Displays a brief or a detailed summary about the broker configuration.

Format

SHOW CONFIGURATION [VERBOSE] [property-name];

Command Parameters

property-name

The name of the property for which you want to display summary information. Available properties are:

ENABLED
EXPLICIT_DISABLE
INTENDED_STATE
HEALTH_CHECK_INTERVAL
STATUS

See Section 2.8 for complete information about properties.

Usage Notes

Command Examples

Example 1

The following example provides a brief summary of the Sales configuration.

DGMGRL> SHOW CONFIGURATION;
Configuration 'Sales' is
  Primary Site is 'Boston'
  Standby Site is 'San Francisco'
Current status for "Sales":
SUCCESS
Example 2

The following example uses the VERBOSE option to show complete information about the Sales configuration.

DGMGRL> SHOW CONFIGURATION VERBOSE; 
Configuration 
  Name:             'The SUPER cluster' 
  Enabled:          'yes' 
  Default state:    'ONLINE' 
  Intended state:   'ONLINE' 
  Protection Mode:  'MaxPerformance' 
  Number of sites:  2 
  Sites: 
    Primary Site is 'Primary'
    Standby Site is 'Standby2' 
Current status for "The SUPER cluster": 
SUCCESS 
Example 3

The following example shows the STATUS property for the Sales configuration.

DGMGRL> SHOW CONFIGURATION STATUS;
  STATUS = 'SUCCESS'

SHOW DEPENDENCY TREE

Displays a dependency tree that shows a static map of the broker configuration and the default online states for each database resource in the configuration.

Format

SHOW DEPENDENCY TREE;

Usage Notes

For detailed information about the configuration, use the SHOW CONFIGURATION command.

Command Examples

Example 1

The following example shows a configuration named Sales with two sites (Boston and San Francisco) and database resource objects called Sales_db and reportingdb. The database resource object (Sales_db) is brought online in its default state of READ_WRITE_XPTON when Boston is running as the primary site. The other database resource object, reportingdb, is brought online in its default state of PHYSICAL_APPLY_ON when San Francisco is running as the standby site.

DGMGRL> SHOW DEPENDENCY TREE;
Sales
Sales[ONLINE]->Boston
Sales[ONLINE]->Boston[PRIMARY]->Sales_db
Sales[ONLINE]->Boston[STANDBY]->Sales_db
Sales[ONLINE]->San Francisco
Sales[ONLINE]->San Francisco[PRIMARY]->reportingdb
Sales[ONLINE]->San Francisco[STANDBY]->reportingdb

Default Path:
Sales[ONLINE]->Boston[PRIMARY]
Sales[ONLINE]->Boston[PRIMARY]->Sales_db[READ-WRITE-XPTON]
Sales[ONLINE]->San Francisco[STANDBY]
Sales[ONLINE]->San Francisco[STANDBY]->reportingdb[PHYSICAL-APPLY-ON]

In the example, the reportingdb database resource has a dependency on whether or not the San Francisco site is in the primary or the standby role. Furthermore, the reportingdb database resource object will go to the PHYSICAL-APPLY-ON state when the San Francisco site is a standby site.

Example 2

The following example shows the dependency tree output for a configuration that has multiple standby sites.

DGMGRL> SHOW DEPENDENCY TREE;
The SUPER cluster
The SUPER cluster[ONLINE]->Primary
The SUPER cluster[ONLINE]->Primary[PRIMARY]->db
The SUPER cluster[ONLINE]->Primary[STANDBY]->db
The SUPER cluster[ONLINE]->Standby2
The SUPER cluster[ONLINE]->Standby2[PRIMARY]->reportdb2
The SUPER cluster[ONLINE]->Standby2[STANDBY]->reportdb2
The SUPER cluster[ONLINE]->Standby3
The SUPER cluster[ONLINE]->Standby3[PRIMARY]->reportdb3
The SUPER cluster[ONLINE]->Standby3[STANDBY]->reportdb3

Default Path:
The SUPER cluster[ONLINE]->Primary[PRIMARY]
The SUPER cluster[ONLINE]->Primary[PRIMARY]->db[READ-WRITE-XPTON]
The SUPER cluster[ONLINE]->Standby2[STANDBY]
The SUPER cluster[ONLINE]->Standby2[STANDBY]->reportdb2[PHYSICAL-APPLY-ON]
The SUPER cluster[ONLINE]->Standby3[STANDBY]
The SUPER cluster[ONLINE]->Standby3[STANDBY]->reportdb3[PHYSICAL-APPLY-ON]



SHOW LOG

Displays the Data Guard configuration log or database alert log from the named site object.

Format

SHOW LOG [ALERT] [LATEST] ON SITE site-name;

Command Parameters

ALERT

Displays the database alert log for the specified site object.

LATEST

Specifies the last 20 lines of the SHOW LOG command output.

site-name

The user-friendly name of the site for which you want to display the Data Guard configuration log or the database alert log.

Usage Notes

If you omit the ALERT parameter, then the Oracle Data Guard configuration log for the named site is displayed (if the site is enabled).

Command Examples

Example 1

The following example displays the last 20 lines of the SHOW LOG command output for the Boston site.

DGMGRL> SHOW LOG LATEST ON SITE 'Boston';
DRSLOG
LINE  OBJECT_ID DATE                LOG
--------------------------------------------------------------------------------
 2961       913 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2962       914 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2963       915 2000-11-02-09:29:33  Parent 33554433 child 33554690 vinst
33554690 state 5 (PRIMARY) name reportingdb
 2964       915 2000-11-02-09:29:33  Parent 33554433 child 33554691 vinst
33554691 state 6 (STANDBY) name reportingdb
 2965       915 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=219)
 2966       916 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2967       917 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2968       918 2000-11-02-09:29:33  Parent 1 child 16777217 vinst 16777217
state 1 (ONLINE) name Boston
 2969       918 2000-11-02-09:29:33  Parent 1 child 33554433 vinst 33554433
state 1 (ONLINE) name San Francisco
 2970       918 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=204)
 2971       920 2000-11-02-09:29:33  Parent 16777217 child 16777474 vinst
16777474 state 5 (PRIMARY) name Sales_db
 2972       920 2000-11-02-09:29:33  Parent 16777217 child 16777475 vinst
16777475 state 6 (STANDBY) name Sales_db
 2973       920 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=201)
 2974       922 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2975       925 2000-11-02-09:29:33  Parent 33554433 child 33554690 vinst
33554690 state 5 (PRIMARY) name reportingdb
 2976       925 2000-11-02-09:29:33  Parent 33554433 child 33554691 vinst
33554691 state 6 (STANDBY) name reportingdb
 2977       925 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=219)
 2978       928 2000-11-02-09:29:33  DMON: DRS OP 204: success. (len=61)
 2979       929 2000-11-02-09:29:33  DMON: DRS OP 207: success. (len=79)
 2980       935 2000-11-02-09:29:34  DMON: DRS OP 207: success. (len=79)
Example 2

The following example displays the last 20 lines of the database alert log for the Boston site.

DGMGRL> SHOW LOG ALERT LATEST ON SITE 'Boston';
DRSLOG
LINE LOG
--------------------------------------------------------------------------------
 1672 Thu Nov  2 09:28:07 2000
 1673 ALTER SYSTEM SET fal_server='' SCOPE=MEMORY SID='bstn';
 1674 ALTER SYSTEM SET fal_client='bstn' SCOPE=MEMORY SID='bstn';
 1675 Thu Nov  2 09:29:31 2000
 1676 ALTER SYSTEM SET fal_server='' SCOPE=MEMORY SID='bstn';
 1677 ALTER SYSTEM SET fal_client='bstn' SCOPE=MEMORY SID='bstn';
 1678 Thu Nov  2 09:29:31 2000
 1679 Beginning log switch checkpoint up to RBA [0x11.2.10], SCN:0x0000.00011b11
 1680 Thread 1 advanced to log sequence 17
 1681   Current log# 2 seq# 17 mem# 0: /ade/ctrezza_bstn/oracle/dbs/t_log2.f
 1682 Thu Nov  2 09:29:31 2000
 1683 ARC0: Beginning to archive log# 1 thread 1 seq# 16
 1684 ARC0: Completed archiving  log# 1 seq# 16 thrd# 1
 1685 Thu Nov  2 09:29:32 2000
 1686 ALTER SYSTEM SET fal_server='' SCOPE=MEMORY SID='bstn';
 1687 ALTER SYSTEM SET fal_client='bstn' SCOPE=MEMORY SID='bstn';
 1688 ALTER SYSTEM SET fal_server='' SCOPE=MEMORY SID='bstn';
 1689 ALTER SYSTEM SET fal_client='bstn' SCOPE=MEMORY SID='bstn';
 1690 Thu Nov  2 09:29:33 2000
 1691 Completed checkpoint up to RBA [0x11.2.10], SCN: 0x0000.00

SHOW RESOURCE

Displays a brief or a detailed summary and status of the specified database resource object.

Format

SHOW RESOURCE [VERBOSE] resource-name [property-name] [ON SITE site-name];

Command Parameters

resource-name

The name of the database resource object for which you want to display information.

property-name

The name of the property for which you want to display summary information. See Section 4.3 for a list of database resource properties.

site-name

The name of the site object that has the database resource for which you want a brief summary.

Usage Notes

Command Examples

Example 1

The following example shows a brief summary of the database resource object called Sales_db.

DGMGRL> SHOW RESOURCE 'Sales_db';
Resource 'Sales_db' on site 'Boston'
  depends on 'Boston'
Current status for "Sales_db":
SUCCESS
Example 2

The following example uses the VERBOSE option to show complete information about the database resource object called Sales_db on the Boston site.

DGMGRL> SHOW RESOURCE VERBOSE Sales_db;
Resource
  Name:             reportdb2
  Manager Type:     internal
   Standby Type:     PHYSICAL
Online States:
  ONLINE
  PHYSICAL-APPLY-READY
  PHYSICAL-APPLY-ON
  READ-ONLY
  LOGICAL-APPLY-READY
  LOGICAL-APPLY-ON
  READ-WRITE
  READ-WRITE-XPTON
Properties:
  INTENDED_STATE                  = 'PHYSICAL-APPLY-ON'
  ENABLED                         = 'yes'
  IGNORE_STATUS                   = 'no'
  LogXptMode                      = 'ARCH'
  Dependency                      = ''
  Alternate                       = ''
  DelayMins                       = '0'
  Binding                         = 'OPTIONAL'
  MaxFailure                      = '0'
  ReopenSecs                      = '300'
  AsyncBlocks                     = '2048'
  LogShipping                     = 'ON'
  ApplyNext                       = '0'
  ApplyNoDelay                    = 'no'
  ApplyParallel                   = '1'
  StandbyArchiveDest              = '/oracle/dbs/a2'
  LogArchiveTrace                 = '4095'
  StandbyFileManagement           = 'AUTO'
  ArchiveLagTarget                = '0'
  LogArchiveMaxProcesses          = '5'
  LogArchiveMinSucceedDest        = '1'
  DbFileNameConvert               = 'dbs/t, dbs/s2t, dbs/s3t, dbs/s2t'
  LogFileNameConvert              = 'dbs/t, dbs/s2t, dbs/s3t, dbs/s2t'
  LogArchiveFormat                = 'r_%t_%s.arc'
  InconsistentProperties          = '(monitor)'
  InconsistentLogXptProps         = '(monitor)'
  SendQEntries                    = '(monitor)'
  LogXptStatus                    = '(monitor)'
  SbyLogQueue                     = '(monitor)'
Properties for 'PRIMARY' state:
  DEFAULT_STATE    = 'READ-WRITE-XPTON'
  EXPLICIT_DISABLE = 'no'
  REQUIRED         = 'yes'
Properties for 'STANDBY' state:
  DEFAULT_STATE    = 'PHYSICAL-APPLY-ON'
  EXPLICIT_DISABLE = 'no'
  REQUIRED         = 'yes'
Current status for "Sales_db":
SUCCESS
Example 3

If you see the ORA-16792 error message when you use the SHOW RESOURCE command, you can specify the "InconsistentProperties" property on the command to show a detailed report of the properties that are causing the error.

DGMGRL> SHOW RESOURCE db ; 
Resource 'db' on site 'Primary' 
  depends on 'Primary' 
Current status for "db": 
Warning: ORA-16792: Some configurable property value is inconsistent with the 
database setting 
DGMGRL> SHOW RESOURCE db 'InconsistentProperties' ; 
INCONSISTENT PROPERTIES 
       PROPERTY_NAME       DATABASE_VALUE         SPFILE_VALUE       METADATA_VALUE 
    ArchiveLagTarget                  100                  100                   -1 

SHOW SITE

Displays a brief or detailed summary of the specified site object.

Format

SHOW SITE [VERBOSE] site-name [property-name];

Command Parameters

site-name

The name of the site object for which you want to display information.

property-name

The name of the property for which you want to display summary information. Available properties are:

ENABLED
EXPLICIT_DISABLE
INTENDED_STATE
HEALTH_CHECK_INTERVAL
STATUS

See Section 2.8 for complete information about site properties.

Usage Notes

Command Examples

Example 1

The following example shows a brief summary of the site object called Boston.

DGMGRL> SHOW SITE 'Boston';
Site 'Boston' is
  Hostname is 'boston'
  Instance name is 'bstn'
  Service name is 'bstn'
  Standby is maintained as 'physical'
  Site has 1 resource
    Resource is 'Sales_db'
Current status for "Boston":
SUCCESS
Example 2

The following example uses the VERBOSE option to show complete information about the site object called Boston.

DGMGRL> SHOW SITE VERBOSE 'Boston';
Site
  Name:                          'Boston'
  Hostname:                      'boston'
  Instance name:                 'bstn'
  Service Name:                  'bstn'
  Standby Type:                  'physical'
  Number Built-in Processes:     '2'
  Number Generic  Processes:     '0'
  Enabled:                       'yes'
  Required:                      'yes'
  Default State:                 'PRIMARY'
  Intended State:                'PRIMARY'
  PFILE: 
  Number of resources:  1
  Resources:
    Name: Sales_db (default) (verbose name='Sales_db')
Example 3

The following example shows the status property of the site object called Boston.

DGMGRL> SHOW SITE 'Boston' STATUS;
  STATUS = SUCCESS

SHUTDOWN

Shuts down a currently running Oracle instance.

Format

SHUTDOWN [ ABORT | IMMEDIATE | NORMAL ];

Command Parameters

None.

Usage Notes

Command Examples

Example 1

The following command shuts down the database in normal mode.

DGMGRL > SHUTDOWN;

Database closed. 
Database dismounted. 
Oracle instance shut down.

STARTUP

Starts an Oracle database instance with any of the following options:

Format

STARTUP

[FORCE]

[RESTRICT]

[PFILE=filename]

[MOUNT [database-name] | OPEN [open-options] [database-name] | NOMOUNT];

Command Parameters

filename

The name of the initialization parameter file to be used when starting the database instance. If you do not specify the PFILE parameter option, then the default SPFILE startup parameter file (specific to your operating system) is used.

database-name

The name of the database to mount or open. If you do not specify the database-name parameter, the database name is taken from the initialization parameter DB_NAME.

open-options

The mode of access in which you want the specified database to start. The possible modes are:

READ ONLY
READ WRITE

Usage Notes

Command Examples

Example 1

The following examples show two different methods for starting a database instance. Each command starts a database instance using the standard parameter file, mounts the default database in exclusive mode, and opens the database.

DGMGRL> STARTUP;
DGMGRL> STARTUP OPEN database;
Example 2

The following command shuts down the current instance, immediately restarts it without mounting or opening the database, and allows only users with restricted session privileges to connect to it.

DGMGRL > STARTUP FORCE RESTRICT NOMOUNT;
Example 3

The following command starts an instance using the parameter file testparm without mounting the database.

DGMGRL > STARTUP PFILE=testparm NOMOUNT;
Example 4

The following command shuts down a particular database, immediately restarts and opens it in parallel mode, allows access only users with restricted session privileges, and uses the parameter file MYINIT.ORA.

DGMGRL > STARTUP FORCE RESTRICT PFILE=myinit.ora SHARED OPEN database;
Example 5

The following example starts and mounts a database instance, but does not open it.

DGMGRL> STARTUP MOUNT; 

SWITCHOVER

A switchover operation is a planned transition in which the primary site changes roles with one of the standby sites. When you issue the switchover command, the current primary site becomes a standby site, and the selected target standby site becomes the primary site.

Format

SWITCHOVER TO site-name;

Command Parameters

site-name

The name of the standby site that you want to change to the primary role.

Usage Notes

Command Examples

Example 1

The following example shows a successful switchover in which the standby site, Standby2, transitions into the primary role.

DGMGRL> SWITCHOVER TO 'Standby2'
Performing switchover NOW. Please wait...
Operation requires restart of site "Primary"
Operation requires restart of site "Standby2"
Shutting down site Primary...
database not mounted
ORACLE instance shut down.
Shutting down site Standby2...
database not mounted
ORACLE instance shut down.
Restarting site Primary...
Restarting site Standby2...
Started "Primary" as standby
Started "Standby2" as new primary
Switchover succeeded. New primary is "Standby2"
Example 2

This switchover example shows a switchover operation that succeeded but returns an error because the CLI cannot shut down and start up the primary and standby databases.

DGMGRL> SWITCHOVER TO 'Standby2';
Performing switchover NOW. Please wait...
Operation requires restart of site "Primary"
Operation requires restart of site "Standby2"
Shutting down site Primary...
ORA-01031: insufficient privileges

You are no longer connected to ORACLE
Please connect again.
Unable to shut down Primary
You must restart site "Primary" manually.
You must restart site "Standby2" manually.
Switchover succeeded. New primary is "Standby2"


Note:

For the CLI to restart instances automatically, you must connect to the database as SYSDBA using the username and password you specified in the remote password file before you begin the switchover operation. The username and password must be the same on the primary and standby databases.


You must manually issue the SHUTDOWN and STARTUP commands to restart the 
new primary and standby database instances in this configuration.

Go to previous page Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback