Oracle9i Data Guard Broker Release 2 (9.2) Part Number A96629-01 |
|
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.
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>
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:
Echoes command input and output to the default display device. If you do not use this parameter, only the output from the command is displayed.
Suppresses the display of the DGMGRL (DGMGRL>
) command prompt on your default display device. This option is useful if you are directing the command output to a file or to another display tool.
The following subsections specify the command format that you enter at the DGMGRL>
command prompt.
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.
To use the Data Guard command-line interface, the following must be true:
DG_BROKER_START
dynamic initialization parameter is set to TRUE
.See Also:
Chapter 6 for more information about preparing and starting Oracle Data Guard. See the Oracle9i Database Administrator's Guide for more information about setting up the network files and listener on the standby database. |
SERVER=DEDICATED
) process instead of the shared server process. In addition, the connection between the CLI and the database instance must also use a dedicated server link.See Also:
Oracle9i Data Guard Concepts and Administration, the Oracle9i Database Administrator's Guide, and your operating system-specific documentation to set up remote access using the |
CONNECT
command, even if the last CONNECT
command was used to connect to another site. Thus, the remote password file for the site must contain the username and password given in the last CONNECT
command.ALTER SITE (AUTO PFILE)
command, or the PFILE or the SPFILE for the site can be found at the default directory location.
See Also:
Oracle9i Database Administrator's Guide for more information about setting up remote password files and the default location of the PFILE and SPFILE initialization parameter files. |
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.
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.
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.
Alters the current protection mode setting for broker configuration.
ALTER CONFIGURATION SET PROTECTION MODE AS protection-mode;
The data protection mode in which you want the configuration to run when the configuration is enabled. The possible protection modes are:
Perform the following steps before you use the ALTER CONFIGURATION
command to set the protection mode:
MAXPROTECTION
or MAXAVAILABILITY
protection mode, ensure that standby redo logs are configured on a standby site.MAXAVAILABILITY
mode, you must use the ALTER RESOURCE
command to set the SYNC
mode for log transport services. For example:
ALTER RESOURCE 'Sales_db' ON SITE 'Boston' SET PROPERTY LogXptMode=SYNC;
The following table shows the configuration protection modes and the minimum corresponding settings for log transport services:
Protection Mode | Log Transport Mode | Require Physical Standby Database and Standby Redo Logs? |
---|---|---|
|
|
Yes |
|
|
No |
|
|
No |
See Also:
Chapter 4 for more information about the protection modes and log transport modes |
SHOW CONFIGURATION VERBOSE
command to display the current protection mode for the 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: Primary Standby Site: Standby2 Current status for "The SUPER cluster": SUCCESS
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.
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.
Alters the intended (runtime) state of the broker configuration.
ALTER CONFIGURATION SET STATE = state;
The state in which you want the configuration to be running when management of the configuration is enabled. The possible states are:
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.
Allows you to change the value of a property for the specified database resource object.
ALTER RESOURCE resource-name [ON SITE site-name]
The name of the database resource object for which you want to set a property value.
The name of the site object where the database resource object is located.
The name of the property for which you want to set a new value. Section 2.8 describes the database resource properties in detail.
The new value for the property. Section 2.8 describes the values for each property.
ALTER RESOURCE
command, the property change does not take effect until you enable broker management of the configuration.ORA-16792
, ORA-16801
, ORA-16804
). When this happens, check which property has the problem by investigating monitorable properties, InconsistentProperties, InconsistentLogXptProps, and by looking at the Data Guard console logs. Reset the property with the correct value.LOG_ARCHIVE_DEST_
n
initialization parameter to be successful. In this case, disable the database resource, correct all property values, and then re-enable the resource again.DbFileNameConvert
property (which corresponds to the DB_FILE_NAME_CONVERT
initialization parameter) would require that you stop and start the database. See Chapter 8 for information about which properties are static and dynamic.ALTER RESOURCE
command returns an error message. You must re-issue the ALTER RESOURCE
command and specify a site name with the ON SITE
option.MAXAVAILABILITY
protection mode, you must use the ALTER RESOURCE
command to set the SYNC
mode for log transport services. For example:
ALTER RESOURCE 'Sales_db' ON SITE 'Boston' SET PROPERTY LogXptMode=SYNC;
The following table shows the configuration protection modes and the corresponding settings for log transport services:
Protection Mode | Log Transport Mode | Require Physical Standby Database and Standby Redo Logs? |
---|---|---|
|
|
Yes |
|
|
No |
|
|
No |
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.
Allows you to change the state of the specified database resource object.
ALTER RESOURCE resource-name [ON SITE site-name]
The name of the database resource object for which you want to change the state.
The name of the site object that contains the database resource object that you want to alter.
The state to which the database resource will transition when it is enabled.
ALTER RESOURCE
command returns an error message. You must issue the ALTER RESOURCE
command again and specify a site name with the ON SITE
option.ONLINE
or OFFLINE
state. The ONLINE
state has the following substates:
PHYSICAL-APPLY-READY PHYSICAL-APPLY-ON (default state for a physical standby database) READ-ONLY LOGICAL-APPLY-READY LOGICAL-APPLY-ON (default state for a logical standby database) READ-WRITE READ-WRITE-XPTON (default state for a primary database)
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.
Allows you to change the state of a site object.
ALTER SITE site-name
The name of the site object for which you want to change state.
The state to which the site will transition when management of the site is enabled. The possible states are:
DGMGRL> ALTER SITE 'Boston' SET STATE='online'; Succeeded.
Allows you to specify an initialization parameter file that will be used to automatically restart the database of the site.
ALTER SITE site-name
The name of the site object for which you want to specify the automatic restart initialization parameter file.
The name of the PFILE initialization parameter file that will be used to automatically restart the database of the site.
SET AUTO PFILE=OFF
option and you receive a message telling you to restart a site, use the SHUTDOWN and STARTUP commands to restart your databases.SET AUTO PFILE=''
, which indicates using the default PFILE name to restart databases.VERBOSE
option to display the current parameter file information for a site.DGMGRL> ALTER SITE 'Boston' SET AUTO PFILE='/oracle/dbs/initbs.ora'; Succeeded.
DGMGRL> ALTER SITE 'Boston' SET AUTO PFILE=OFF; Succeeded.
Connects a given username to the specified database.
CONNECT username/password[@net-service-name];
Represents the username and password with which you want to connect to the database.
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.
CONNECT
command returns an error, check to see that you specified a valid service name.LISTENER.ORA
file must specify the use of a dedicated server (SERVER=DEDICATED
) process, not a shared (SERVER=SHARED
) process.)This example connects to the default database on the local system.
DGMGRL> CONNECT sys/change_on_install; Connected.
This example connects to a remote database whose service name is prmy.
DGMGRL> CONNECT sys/change_on_install@prmy; Connected.
Creates a new broker configuration, and creates and adds a primary site object and a database resource object to the configuration.
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;
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.
A user-friendly name for the primary site object.
A user-friendly name for the database resource object to be created for the primary site.
The host name of the primary site, as shown in the V$INSTANCE
view.
The instance name of the primary database, as shown in the V$INSTANCE
view.
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.
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.
LISTENER.ORA
file must specify the use of a dedicated server (SERVER=DEDICATED
) process, not a shared (SERVER=SHARED
) process.)host-name
and instance-name
parameters specify information the broker requires to uniquely identify a site in the configuration. To obtain the proper values for the host-name
and instance-name
parameters, use the values returned from the V$INSTANCE fixed view.
The following example shows a SQL*Plus statement that selects these values from the V$INSTANCE fixed view. In the example, the values boston
and bstn
should be supplied for the hostname
and instance-name
parameters in the CREATE CONFIGURATION
command.
SQL> CONNECT sys/change_on_install AS SYSDBA; SQL> SELECT HOST_NAME, INSTANCE_NAME FROM V$INSTANCE; HOST_NAME INSTANCE_NAME --------------------------------------------------------------- boston bstn
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.
Creates a new standby site object and database resource object and adds it to an existing broker configuration.
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;
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.
A user-friendly name for the database resource object to be created for the standby site.
The host name of the standby site.
The instance name of the primary database.
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.
Specify PHYSICAL
or LOGICAL
for this parameter to indicate the type of standby database that this site will contain.
See Also:
Oracle9i Data Guard Concepts and Administration for information about creating a standby database |
CREATE SITE
command, you must create the broker configuration using the CREATE CONFIGURATION command.CREATE SITE
command after you have connected to the primary database using the CONNECT
command.CREATE SITE
command, the site object is created in a disabled state to allow you to change properties before the site goes online.LISTENER.ORA
file must specify the use of a dedicated server (SERVER=DEDICATED
) process, not a shared (SERVER=SHARED
) process.)host-name
and instance-name
parameters specify information the broker requires to uniquely identify a site in the configuration. To obtain the proper values for the host-name
and instance-name
parameters, use the values returned from the V$INSTANCE fixed view.
The following example shows a sample SQL*Plus statement that selects these values from the V$INSTANCE fixed view. In the example, the values sf
and sfdb
should be supplied for the host-name
and instance-name
parameters in the CREATE SITE
command.
SQL> CONNECT sys/change_on_install AS SYSDBA; SQL> SELECT HOST_NAME, INSTANCE_NAME FROM V$INSTANCE; HOST_NAME INSTANCE_NAME --------------------------------------------------------------- sf sfdb
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.
Disables broker management of a broker configuration and all of its site objects and database resource objects.
DISABLE CONFIGURATION;
None.
DISABLE CONFIGURATION
command.The following example disables management of the broker configuration and all of its sites and database resources.
DGMGRL> DISABLE CONFIGURATION; Disabled.
Disables broker management of a database resource object.
DISABLE RESOURCE resource-name [ON SITE site-name];
The name of the database resource object that you want to disable.
The name of the site containing the database resource that you want to disable.
DISABLE RESOURCE
command returns an error message. You must re-issue the DISABLE RESOURCE
command and specify a site name with the ON SITE
option.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.
Disables broker management of the specified standby site object in the broker configuration and any database resource objects on the site.
DISABLE SITE site-name;
The name of the standby site that you want to disable.
DISABLE SITE
command. Use the DISABLE CONFIGURATION command to disable the primary site.The following example demonstrates how to disable broker management of the San Francisco standby site.
DGMGRL> DISABLE SITE 'San Francisco'; Disabled.
Enables the broker to actively manage the broker configuration including all of its site objects and database resource objects.
ENABLE CONFIGURATION;
None.
READ-WRITE-XPTON
state), a physical standby database resource object is enabled in the PHYSICAL-APPLY-ON
state, and a logical standby database resource object is enabled in the LOGICAL-APPLY-ON
state. You can change the state of the database resource using the ALTER RESOURCE (state) command, but not when the resource or a configuration is disabled.The following example enables management of a broker configuration.
DGMGRL> ENABLE CONFIGURATION; Enabled.
Enables the broker to actively manage the specified database resource object.
ENABLE RESOURCE resource-name [ON SITE site-name];
The name of the database resource object you want to manage with the broker.
The name of the site object containing the database resource object that you want to enable.
ENABLE RESOURCE
command will remain disabled (and cannot be managed by the broker) until you enable the site. See the ENABLE SITE command.PHYSICAL-APPLY-ON
state and a logical standby database resource object is enabled in the LOGICAL-APPLY-ON
state). You can change the state of the database resource using the ALTER RESOURCE (state) command, but not when the database resource, site, or configuration is disabled.ENABLE RESOURCE
command returns an error message. You must re-issue the ENABLE RESOURCE
command and specify a site name with the ON SITE
option.The following example enables broker management of the database resource object named Sales_db.
DGMGRL> ENABLE RESOURCE 'Sales_db'; Enabled.
Enables the broker to actively manage the specified standby site object, including its database resource object.
ENABLE SITE site-name;
The name of the standby site object you want to manage with the broker.
DISABLE
command).PHYSICAL-APPLY-ON
or LOGICAL-APPLY-ON
state. You can change the state of the database resource using the ALTER RESOURCE (state) command.The following example enables management of the standby site named San Francisco.
DGMGRL> ENABLE SITE 'San Francisco'; Enabled.
Exits the command-line interface.
EXIT;
The following example demonstrates how to exit (quit) the command-line interface.
DGMGRL> EXIT;
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. |
FAILOVER TO site-name {GRACEFUL | FORCED};
The name of the standby site object you want to fail over to the primary site role.
FAILOVER
command:
GRACEFUL
: A graceful failover automatically recovers some or all of the original primary database application data. A graceful failover allows the new primary database to communicate with the bystanders and attempt to keep the active (enabled) bystanders in the configuration. This is the recommended failover option.FORCED
: A forced failover may result in lost application data even when standby redo logs are configured on the standby database.FAILOVER
command, verify that you are connected to the standby site that will become the new primary site. If necessary, issue a CONNECT command to connect to the standby site.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"
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"
Displays online help for the Data Guard command-line interface.
HELP [<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:
A database connection is not required to execute this command.
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>;
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>';
Exits the Data Guard command-line interface.
QUIT;
The following example shows how to quit (exit) the command-line interface.
DGMGRL> QUIT;
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;
None.
The following example shows how to remove configuration information from the configuration file.
DGMGRL> REMOVE CONFIGURATION; Removed configuration.
Removes the specified standby site object from the broker configuration.
Caution: When you use the |
REMOVE SITE site-name;
The name of the standby site that you want to remove.
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.
Displays a brief or a detailed summary about the broker configuration.
SHOW CONFIGURATION [VERBOSE] [property-name];
The name of the property for which you want to display summary information. Available properties are:
See Section 2.8 for complete information about properties.
VERBOSE
option to display a detailed summary of the configuration.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
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
The following example shows the STATUS
property for the Sales configuration.
DGMGRL> SHOW CONFIGURATION STATUS; STATUS = 'SUCCESS'
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.
SHOW DEPENDENCY TREE;
For detailed information about the configuration, use the SHOW CONFIGURATION command.
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.
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]
Displays the Data Guard configuration log or database alert log from the named site object.
SHOW LOG [ALERT] [LATEST] ON SITE site-name;
Displays the database alert log for the specified site object.
Specifies the last 20 lines of the SHOW LOG
command output.
The user-friendly name of the site for which you want to display the Data Guard configuration log or the database alert log.
If you omit the ALERT
parameter, then the Oracle Data Guard configuration log for the named site is displayed (if the site is enabled).
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)
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
Displays a brief or a detailed summary and status of the specified database resource object.
SHOW RESOURCE [VERBOSE] resource-name [property-name] [ON SITE site-name];
The name of the database resource object for which you want to display information.
The name of the property for which you want to display summary information. See Section 4.3 for a list of database resource properties.
The name of the site object that has the database resource for which you want a brief summary.
VERBOSE
option to display a detailed summary.SHOW RESOURCE
command returns an error message. You must re-issue the SHOW RESOURCE
command and specify a site name with the ON SITE
option.SHOW RESOURCE
resource-name property-name
command to show monitorable properties.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
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
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
Displays a brief or detailed summary of the specified site object.
SHOW SITE [VERBOSE] site-name [property-name];
The name of the site object for which you want to display information.
The name of the property for which you want to display summary information. Available properties are:
See Section 2.8 for complete information about site properties.
VERBOSE
option to display a detailed summary.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
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')
The following example shows the status property of the site object called Boston.
DGMGRL> SHOW SITE 'Boston' STATUS; STATUS = SUCCESS
Shuts down a currently running Oracle instance.
None.
STARTUP NOMOUNT
command, then enable the database resource object and allow the broker bring the database to the correct state.SHUTDOWN
command with no arguments is equivalent to using the SHUTDOWN NORMAL
command.SHUTDOWN
command:
ABORT
Proceeds with the fastest possible shutdown of the database without waiting for calls to complete or for users to disconnect from the database. Uncommitted transactions are not rolled back. Client SQL statements currently being processed are terminated. All users currently connected to the database are implicitly disconnected, and the next database startup will require instance recovery. You must use this option if a background process terminates abnormally.
IMMEDIATE
Does not wait for current calls to complete or users to disconnect from the database. Further connections are prohibited. The database is closed and dismounted. The instance is shut down, and no instance recovery is required on the next database startup.
NORMAL
This is the default option which waits for users to disconnect from the database. Further connections are prohibited. The database is closed and dismounted. The instance is shut down, and no instance recovery is required on the next database startup.
The following command shuts down the database in normal mode.
DGMGRL > SHUTDOWN; Database closed. Database dismounted. Oracle instance shut down.
Starts an Oracle database instance with any of the following options:
SHUTDOWN
ABORT
mode before restarting it.RESTRICTED SESSION
system privilege to connect to the instance.DB_NAME
.STARTUP
[FORCE]
[RESTRICT]
[PFILE=filename]
[MOUNT [database-name] | OPEN [open-options] [database-name] | NOMOUNT];
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.
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
.
The mode of access in which you want the specified database to start. The possible modes are:
STARTUP NOMOUNT
command, then enable the database resource object and allow the broker bring the database to the correct state.STARTUP
command if the broker management of the configuration is enabled.STARTUP
command with no arguments is equivalent to using the STARTUP OPEN
command.FORCE
option when you use the STARTUP
command and the current database instance is running, an error results. The FORCE
option is useful when you are debugging and when error conditions are occurring. Otherwise, it should not be used.RESTRICT
option to allow only Oracle users with the RESTRICTED SESSION
system privilege to connect to the instance. Later, you can use the ALTER SYSTEM
command to disable the restricted session feature.PFILE
option to specify the initialization parameter file, the STARTUP
command uses the default SPFILE server parameter file, if it exists. Else, it uses the default initialization parameter file. The default files are platform specific. For example:
$oracle_home
/DBS/INIT$oracle_sid
.ORA
%oracle_home
%\DATABASE\INITORCL.
ORA
See your operating system-specific documentation for more information about the default parameter files.
MOUNT
option to mount a primary database or a logical standby database without opening it. If you do not specify a database name, the database name is taken from the initialization parameter DB_NAME
.OPEN
option to mount and open the specified database.NOMOUNT
option starts the database instance without mounting the database. You cannot use the NOMOUNT
option with the MOUNT
or OPEN
options.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;
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;
The following command starts an instance using the parameter file testparm
without mounting the database.
DGMGRL > STARTUP PFILE=testparm NOMOUNT;
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;
The following example starts and mounts a database instance, but does not open it.
DGMGRL> STARTUP MOUNT;
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.
SWITCHOVER TO site-name;
The name of the standby site that you want to change to the primary role.
SWITCHOVER
operation completes. If the standby site contains logical standby databases, then neither the primary database nor the logical standby database is restarted.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"
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"
You must manually issue the SHUTDOWN and STARTUP commands to restart the new primary and standby database instances in this configuration.
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|