|
Oracle Warehouse Builder 10g |
| Scripting Language - Navigation and Display |
The navigation and display section describes the commands that allow you to navigate around the metadata repository and display folder structures and contents.
Table of Contents
Navigation Concepts
Navigating and Display allows you to move around the Warehouse Builder structures and then display the content of position. The Warehouse Builder repository is a hierarchical structure visualized in the Console Tree in the User Interface. To navigate around the Warehouse Builder structures it is important to understand the levels and context options. The following table explains which objects can be found at what level in the hierarchy:
Level |
Available Objects (scripting name)
|
| Root Level |
PROJECT
SNAPSHOT |
| |
Project Level |
COLLECTION
FLAT_FILE_MODULE
ORACLE_MODULE
PROCESS_FLOW_MODULE
RUNTIME_REPOSITORY_CONNECTION
SNAPSHOT
|
| |
|
Module Level |
ADVANCED_QUEUE
CUBE_TABLE
DIMENSION_TABLE
EXTERNAL_TABLE
FLAT_FILE
FUNCTION
LOCATION
MAPPING
MATERIALIZED_VIEW
PACKAGE
PROCEDURE
SEQUENCE
SNAPSHOT
TABLE
VIEW
|
| |
|
|
Location |
CONNECTOR |
| |
|
|
PL/SQL Package |
FUNCTION
PROCEDURE |
| |
|
|
Process Flow Package |
PROCESS_FLOW |
At log on to the repository you will always be at the root level of the repository. Do note that the repository view is slightly different from a UI perspective. When you open the modules in the tree they are located in certain groups (e.g. Databases, Public Transformations etc.). Not all of these are present in the navigation of the repository through scripting.
When you move into a certain level you can work on the objects described above. It is for example not possible to create a project when you are at the module level. If you want to create a project, you must be at the root level.
Back to Top
OMBCC
To move around the structure described above one needs to use the OMBCC command. OMBCC (or OMBCHANGECONTEXT) allows you to move up and down the hierarchy much like you would move through a file structure. From the root level of a repository you can navigate. When you are the root level you can move into a project by issuing:
OMBCC 'MY_PROJECT'
You can also move several levels in one command. The following moves you from the root into the Oracle module SCRIPTING. Note that the names used are case sensitive.
OMBCC 'MY_PROJECT/SCRIPTING'
Back to Top
OMBCONNECT (OMBCONN)
Before you can start using the OMB*Plus application it is mandatory to connect to a repository. You will need to know a Warehouse Builder username and password before connecting. Also you must know the fully qualified connect string. In scripting TNS Names entries cannot be used as part of a connect string. Connecting to a repository with the default arguments works like this:
OMBCONNECT owb92/owb92@localhost:1521:orcl92
You can also work in single user mode if you require a lock on the repository. This is done by using:
OMBCONNECT owb92/owb92@localhost:1521:orcl92 USE SINGLE_USER_MODE
The single user mode is for example required if you want to modify the repository and add user defined properties.
Back to Top
OMBCONNECT RUNTIME
To work on the runtime repository you must connect from a design repository to the runtime. To do this use the following commands:
OMBCONNECT RUNTIME 'RTR_CONN' USE PASSWORD 'rtu92'
This connects you to the runtime platform and will allow you to deploy to this runtime platform. For more details on creating a runtime repository connection (the RTR_CONN in the above statement) go here.
Back to Top
OMBDCC
It is crucial to understand where you are when navigating the repository. OMBDCC displays the context in which you currently are and is comparable to the PWD command in Unix.
OMB+> OMBDCC
/
If you are at a module level you will see:
OMB+> OMBDCC
ORACLE_MODULE /MY_PROJECT/SCRIPTING
Back to Top
OMBDISCONNECT (OMBDISC)
To move between repositories or users you must disconnect from the Warehouse Builder repository. Do this by issuing OMBDISCONNECT at the command prompt. To reconnect use the OMBCONN command again.
OMB+> OMBDISC
Disconnected.
Back to Top
OMBENV
This command will list the values for all set OMB Plus environment variables. OMB Plus environment variables are regular Tcl variables, so they can be set using standard Tcl "set" command, and unset using standard "unset" command. OMB has a number of specific variables:
| Variable |
Values |
|
| OMBPROMPT |
<current context> |
If set displays the current context as prompt |
| OMBLOG |
<any directory> |
If set with a file writes logging information to this file |
| OMBTIMER |
no values |
If set shows the duration of execution for a command |
| OMBCONTINUE_ON_ERROR |
no values |
If set continues the execution of a script even if an OMB command produces an error |
To set the OMBPROMPT variable issue:
set OMBPROMPT on
After you issue your first OMBDCC the prompt will display your current context, and will change with every OMBCC:
OMB+> set OMBPROMPT on
on
OMB+> OMBDCC
PROJECT /MY_PROJECT
/MY_PROJECT> OMBCC 'SCRIPTING'
Context changed.
/MY_PROJECT/SCRIPTING>
To set a OMBLOG variable issue the following command:
set OMBLOG c:\\temp\\log.txt
The result will be on the command prompt:
c:\temp\log.txt
When you now use the OMBENV command you will see that not only the environment variables are spooled to the OMB Plus screen, they are also logged in the log.txt file. If this file does not yet exist OMB will create it for you. Note you will require write privileges to this directory.
To set the OMBTIMER issue:
set OMBTIMER on
OMB+> OMBVALIDATE ORACLE_MODULE 'SCRIPTING'
Valid.
Time elapsed: 1,502 milliseconds.
After each command OMB will present the elapsed time for the command. Do not set this variable if you want to process the output of a command, as this is appended to that output.
To set the OMBCONTINUE_ON_ERROR:
set OMBCONTINUE_ON_ERROR on
Back to Top
OMBHELP
The OMBHELP command allows you to find help on any of the OMB Plus commands, simply issue the OMBHELP with the command you want help on as shown here.
OMBHELP OMBLIST
This will display the same information as you can find in the Scripting Reference Guide.
Back to Top
OMBLIST
The OMBLIST command is exceptionally useful. At any time when you want to see the content of a folder (for example a project or a module) you can issue the OMBLIST command. OMB Plus displays a list of requested objects present in that container. As a result of issuing the OMBLIST command the view of the repository is synchronized with the database.
OMBLIST TABLES
Gives as a result (when issued in the SCRIPTING module):
GEOGRAPHIES TEST_PART_TAB TEST_TABLE_1
Back to Top
OMBLIST SNAPSHOT
Snapshots are special objects in the Warehouse Builder repository. You cannot just list the snapshots, you can list snapshots for specific objects. If you issue:
OMBLIST SNAPSHOTS
You get all snapshots available:
SN_1 SN_2
If you want to inspect whether or not a snapshot contains a certain object you can work with the following commands:
OMBLIST SNAPSHOTS FOR ORACLE_MODULE 'SCRIPTING'
This will list all snapshots that contain the SCRIPTING module. In our case the result is:
SN_1
You can substitute the ORACLE_MODULE keyword with the list of key words in the Scripting Reference Guide. The quoted string will hold the object you are looking for.