Oracle(R) Enterprise Manager Getting Started with Oracle(R) Change Management Pack
Release 2.1

A76919-01

Library

Product

Contents

Index

Prev Next

A
Command Line Interface Appendix

Oracle Change Management Pack provides a command line interface that is available on Windows NT. This appendix provides the following sections that provide more information about the command line interface:

Possible Uses for the Command Line Interface

You can use the Oracle Change Management Pack command line interface to perform various Change Management Pack tasks without accessing the Change Management Pack graphical user interface. Some of the tasks that you can perform using the command line interface include:

Understanding the Notation Used for the Command Syntax

The reference sections that describe each command in the Oracle Change Management Pack's command line interface use the following notation to describe command syntax:

Square brackets [...] denote optional elements.

Braces {...} denote a required element which can be one of two or more options separated by vertical bars |.

Square brackets enclosing options separated by vertical bars indicate an optional element consisting of one of the options.

Italics denote elements to be substituted by the user, or elements that are further defined elsewhere.

All other characters are keywords and punctuation that should be typed as shown in the command descriptions.

The commands and keywords are not case-sensitive.

Requirements for Using the Command Line Interface

When you enter the command line interface commands interactively at the MS-DOS prompt, preface each command with the ocm keyword, for example:

ocm command-name

When you use the command line interface, replace command-name with the name of a command line interface command.

You can enter the command line interface commands in a .BAT file. You can then parameterize the .BAT file and run it at specified times and/or intervals using operating system facilities. The commands return a status code, which allows flow- of-control within the containing .BAT file. If you are entering the commands in a .BAT file, use the MS-DOS call command to preface calls to the command line interface commands, for example:

call ocm command-name

The commands and keywords are not case-sensitive. The names of change plans, baselines, and comparisons are case- sensitive.

The Oracle Management Server (OMS) must be running when you use the command line interface.

Using the Command Line Interface Commands

Table A-1 lists each command line interface command and provides a brief description of the command's function:

Table A-1 Overview of Command Line Interface Commands
Command  Use of the Command  For More Information 

login  

Establishes the administrator credentials to use during a command line interface session.  

See "login command"  

logout  

De-establishes the administrator credentials established with the previous login command.  

See "logout command"  

capture  

Captures a new baseline for an existing baseline specification.  

See "capture command"  

compare  

Compares databases, baselines, or a baseline and a database using an existing comparison specification.  

See "compare command"  

generate  

Generates a script from a change plan.  

See "generate command"  

execute  

Executes a script, undoes changes made by a previously-executed script, or cleans up after the successful execution of a script.  

See "execute command"  

login command

The login command establishes administrator credentials to use during a command line interface session. You can use the login command to establish or change credentials during the session. If you have not established credentials and identity, subsequent commands will fail.

The syntax for the command is:

ocm login OMS-connect-string

The OMS-connect-string identifies an Oracle Enterprise Manager administrator. It consists of an Oracle Enterprise Manager administrator's name, the password for the administrator, and the name of the node on which the Oracle Management Server is running. For example:

ocm login sysman/manager@oemadmin-pc

This command sets the Oracle Management Server (OMS) credentials in the user's environment that are used until one of the following occurs:

logout command

The logout command de-establishes the administrator credentials established with the previous login command. Commands issued following logout will fail.

The syntax for the command is:

ocm logout

capture command

The capture command captures a new baseline for an existing baseline specification.

The syntax for this command is:

ocm capture baseline-specification-name

The baseline-specification-name must be the name of an existing baseline specification that was previously created using the Oracle Change Management Pack graphical user interface. The baseline specification name is case-sensitive. Enclose the baseline-specification-name within double quotation marks if it contains special characters, for example:

ocm capture "Baseline Specification Name With Spaces"

compare command

The compare command compares databases and/or baselines using an existing comparison specification.

The syntax for this command is:

ocm compare comparison-specification-name

Each comparison specification has a series of comparisons associated with it; the compare command creates another comparison in the series. The comparison-specification-name must be the name of an existing comparison specification that was previously previously created using the Oracle Change Management Pack graphical user interface. The comparison-specification-name is case-sensitive. Enclose the comparison-specification-name within double quotation marks if it contains special characters, for example:

ocm compare "Comparison Specification Name With Spaces"

generate command

The generate command generates a script. Generation is the process of applying the change requests in a plan to a destination database, producing a script that will carry out the change requests. Another possible output of the process is a non- success status code indicating some level of problem with the generation process.

The syntax for this command is:

ocm generate plan destination-database

The plan and destination-database pair identifies the deployment. This deployment (plan and destination database) must have been already created using the Change Management Pack graphical user interface. The plan is case-sensitive. The destination-database is not case-sensitive, but it must match the name of the destination database as it appears in the Oracle Change Management Pack graphical user interface.

Enclose the plan name within double quotation marks if it contains special characters, for example:

ocm generate "Plan Name With Spaces" personnel_db

execute command

The execute command executes a script, undoes a previously-executed script, or cleans up after the successful execution of a script. The script must be in an appropriate state for the requested operation or the command will fail.

The syntax for this command is:

ocm execute plan destination-database
       [ [ -d  {forward|backward|cleanup} ]
       [ -s {cleanup|exit} ]
       [ -e {undo|exit} ] ]

The plan and destination-database pair identifies the deployment. This deployment (plan and destination database) must have been already created using the Change Management Pack graphical user interface. The plan is case-sensitive. If the plan name contains special characters, enclose it within double quotation marks. The destination-database is not case-sensitive, but it must match the name of the destination database as it appears in the Oracle Change Management Pack graphical user interface.

Specifying the Direction in Which to Execute the Script

Use the -d option to specify the direction in which the script should be executed or to specify that you want to clean up after the successful execution of the script. The -d options are:

By default, the script is executed in the forward direction (from the start or from the last successfully completed step, as applicable).

Specifying Completion Actions for a Script Execution

The -s and -e options are used to specify completion actions.

Use the -s option to specify the action to be taken if the script executes successfully. The cleanup option only makes sense when the script is executed in the forward direction.

Use the -e option to specify the action to be taken if errors occur when the script executes. The undo option only makes sense when the script is executed in the forward direction. The default action is to exit on success or error.

Examples of Using the Execute Command

For example, to execute a script in the forward direction, keeping the changes if the execution completes successfully and undoing the changes if the execution fails, you would use a command like the following:

ocm execute plan15 corporate.world
       -d forward
       -s cleanup
       -e undo

To execute a script in the forward direction, undoing the changes if there is an error and simply exiting otherwise, you would use a command like the following:

ocm execute plan15 corporate.world
       -e undo

To keep the changes made by a script that has already executed successfully in the forward direction, use a command like the following:

ocm execute plan15 corporate.world
       -d cleanup

You can also execute a script in the backward direction, which undoes the changes made a script that has been executed in the forward direction. The backward option works only if the script was previously executed in the forward direction, either to completion or to a point of failure. To do this, use a command like the following:

ocm execute update_plan my_database.world
       -d backward

Enclose the plan name within double quotation marks if it contains special characters, for example:

ocm execute "Plan Name With Spaces" personnel_db
       -d forward
       -s cleanup
       -e undo

Status Codes Returned by the Command Line Interface

After you execute each command line interface command, the command line interface returns an exit status code for the command that you entered.

Table A-2 shows the meaning of each exit status value that can be returned.

Table A-2 Exit Status Codes Returned by the Command Line Interface
Exit Status  Description 

0  

Operation completed successfully.  

1  

Syntax error in command line.  

2  

The Oracle Management Server specified in the login command does not exist or the Oracle Management Server is not running.  

3  

There was an error when trying to login to the Oracle Management Server. Make sure that you specify correct credentials for the Oracle Management Server in the login command.  

4  

General, catchall error.  

5  

The baseline specified does not exist.  

6  

The comparison specified does not exist.  

7  

The change plan specified does not exist.  

8  

The script for that plan and database is already executing.  

9  

An error occurred during execution of the script.  

10  

Generation completed. Impact log contains warnings.  

11  

Generation completed. Impact log contains errors.  

12  

Generation failed. No script generated.  

13  

A problem occurred with the target database. For example, it does not exist.  

14  

Preferred credentials are not defined for the target database. Use the Oracle Enterprise Manager console to set preferred credentials for the database, then retry the operation.  

15  

You must use the login command to specify credentials for the Oracle Management Server before you can issue other command line interface commands.  

To obtain more information about an error or warning status code returned after a generate or execute command, use the Change Management Pack graphical user interface to view the impact log or execution log.




Prev

Next
Oracle
Copyright © 2000 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index