Oracle® Warehouse Builder API and Scripting Reference 11g Release 1 (11.1) Part Number B31279-01 |
|
|
View PDF |
After you design and configure the logical definitions of your target system, you can deploy and create the physical instance of your target. You can then start deployed mapping and process flow scripts to load or update your data.
This chapter contains the following topics:
Numerous SQL scripts are installed with Warehouse Builder so that you can manage jobs using other administrative tools.
Table 3-1 describes the scripts that you can use to manage deployment jobs, execution jobs, and Control Centers from SQL*Plus. The scripts are located in \owb\rtp\sql
in the Oracle home directory for Warehouse Builder. Comments in the scripts explain how to use them.
Table 3-1 SQL Scripts for Managing Jobs and Control Centers
Script | Description |
---|---|
|
Stops an execution that is currently busy. |
|
Stops a deployment job at the unit level. A deployment unit is a collection of objects that are being deployed to the same location with the same deployment action. |
|
Deactivates a deployment job. |
|
Deactivates an execution job. |
|
Deletes an object from a Warehouse Builder repository. |
|
Displays the value of a platform property. These properties control how the Control Center service behaves. |
|
Moves a deployment job to the top of the list of pending jobs. |
|
Lists the details of any active deployment or execution requests. |
|
Starts a specified job in the background. This template must be copied into a user-defined SQL*Plus job in Enterprise Manager. You can obtain the task status and return result from the public views. The views have names that begin |
|
Creates a new, parameterized job or submits a new job for immediate execution. This template must be copied into a user-defined SQL*Plus job in Enterprise Manager. |
|
Prints the audit execution hierarchy and details about the individual executions associated with an audit ID. |
|
Prints the audit execution hierarchy and details of all executions that are incomplete and were started since a provided date. |
|
Purges deployment audit data or execution audit data. |
|
Resets the registration details for a Control Center. |
|
Displays the details of the runtime repository and its registered locations. |
|
Displays diagnostics about the Control Center repository and its service. |
|
Sets the platform properties associated with an Enterprise Manager home directory. These properties enable the Control Center to locate Enterprise Manager components. |
|
Sets the value of a platform property. These properties control how the Control Center service behaves. |
|
Sets the repository password, which is used by the Control Center service at startup. |
|
Displays the current status of the Control Center service. |
|
Starts the specified object in the background. You can obtain the task status and return result from the public views. The views have names that begin |
|
Starts a job as described in "Starting ETL Jobs in SQL*Plus". |
|
Starts a Control Center Service. |
|
Stops a Control Center Service. |
In addition to executing objects using the Control Center Manager, you can use SQL*Plus. To do this, use a script provided with Warehouse Builder named sqlplus_exec_template
. Alternatively, you can use sqlplus_exec_background_template
to run a job in the background.
Take these steps to run the SQLPLUS_EXEC_TEMPLATE
script in SQL*Plus:
From the Warehouse Builder Tools menu, choose SQL*Plus.
The SQL*Plus window opens.
Connect as a Warehouse Builder user, not as a repository owner.
Start the script, using syntax such as the following.
@%ORACLE_HOME%\owb\rtp\sql\sqlplus_exec_template MY_RUNTIME MY_WAREHOUSE PLSQL MY_MAPPING "," ","
See Also:
The SQLPLUS_EXEC_TEMPLATE SQL Script for a complete description of the syntax.After you successfully deployed a mapping or a process flow, you can schedule it to run in Oracle Enterprise Manager. This is an alternative to using the Warehouse Builder scheduler described in the Oracle Warehouse Builder User's Guide.
See Also:
Oracle Enterprise Manager Concepts and the Enterprise Manager Help system for information about creating jobs and schedules.To schedule a mapping or process flow in Enterprise Manager:
Successfully deploy the mapping or process flow in Warehouse Builder.
Connect to Enterprise Manager as a Warehouse Builder repository user or owner.
Create a scheduler job that uses the WB_RT_API_EXEC.RUN_TASK
function in a PL/SQL block.
For more information about this function, see "The WB_RT_API_EXEC.RUN_TASK Function".
Create a schedule for running the job.
This script enables you to start the ETL process from SQL*Plus, and to use scheduling tools such as cron, AT, Autosys, and Tivoli.
The sqlplus_exec_template.sql
script is located in the following directory: ORACLE_HOME
/owb/rtp/sql
.
Return Value
1
= Success2
= Warning3
= Error
Syntax
SQLPLUS_EXEC_TEMPLATE rt_owner location task_type task_name system_params custom_params
Arguments
Provide a value for each of the following arguments.
rt_owner
: The repository owner
location
: For PL/SQL mappings and process flows, specify the location you used for deployment.
For SQL*Loader and SAP mappings, set this parameter to PlatformSchema
. This is a case-sensitive variable.
task_type
: Enter the appropriate task type for the mapping or the process flow:
PLSQLMAP
: PL/SQL mapping
SQLLOADERCONTROLFILE
: SQL*Loader mapping
PROCESSFLOW
: Process flow
ABAPFILE
: SAP mapping
DATAAUDITOR
: Data Auditor mapping
SCHEDULEDJOB
: Warehouse Builder scheduled job
task_name
: The physical name of the mapping or the process flow.
system_params
: Values of system parameters for this task type. These values override the default values. Enter the parameters in the form name
=value
. Separate multiple parameters with commas, and enclose the entire string in double quotes. A backslash (\) is the escape character, when you need to include commas or double quotes as literal text.
The following examples are correct:
"," "this_param=true" "this_param=true, that_param=2"
custom_params
: Values of a custom parameter defined for this task. Refer to system_params
for the syntax.
Examples
In each of the following examples, you may need to provide the path to sqlplus.exe
and to sqplus_exec_template.sql
.
sqlplus user/password@tns_name @sqlplus_exec_template MY_RUNTIME MY_WAREHOUSE PLSQL MY_MAPPING "," "," sqlplus user/password@tns_name @sqlplus_exec_template MY_RUNTIME PlatformSchema SQL_LOADER MY_LOAD "," "," sqlplus user/password@tns_name @sqlplus_exec_template MY_RUNTIME MY_WORKFLOW PROCESS MY_PROCESS "," "," sqlplus user/password@tns_name @sqlplus_exec_template MY_RUNTIME PlatformSchema ABAP MY_SAP "," ","
The RUN_TASK
function of the WB_RT_API_EXEC
PL/SQL package enables you to schedule and run the ETL process from Warehouse Builder.
Return Value
The return value is affected by the parameters of the function.
When background
=0
and oem_friendly
=0
:
1
= Success2
= Warning3
= ErrorWhen background
=0
and oem_friendly
=1
:
0
= Success or Warning3
= ErrorWhen background
=1
:
0
= Task successfully submitted for execution1
= Task not successfully submitted
Syntax
RUN_TASK ( location IN VARCHAR2, task_type IN VARCHAR2, task_name IN VARCHAR2, custom_params IN VARCHAR2 DEFAULT NULL, system_params IN VARCHAR2 DEFAULT NULL, oem_friendly IN NUMBER DEFAULT 0, background IN NUMBER DEFAULT 0 ) RETURN NUMBER;
Provide a value for each of the following parameters:
location
: For PL/SQL mappings and process flows, specify the location you used for deployment.
For SQL*Loader and SAP mappings, set this parameter to PlatformSchema
. This is a case-sensitive variable.
task_type
: Enter the appropriate task type for the mapping or the process flow:
PLSQLMAP
or PLSQL: PL/SQL mapping
SQLLoader
or SQLLoaderControlFile
or SQLLoaderMap
: SQL*Loader mapping
Process
or ProcessFlow
: Process flow
ABAPFile
or SAPMap
or SAP
: SAP mapping
DataAuditor
: Data auditor mapping
ScheduledJob
: Warehouse Builder schedule object
AppsCMScheduler
: Concurrent Manager schedule job
DBMSScheduler
: Database schedule job
Note:
Previously, you could specifytask_type
using both, a numeric value as well as a literal value. For example, you could use 3 to specify ProcessFlow
, or 4 to specify SAP
and so on. But starting with 11g Release 1 (11.1), numeric values are no longer valid. It is mandatory to use the literal value. The value can be in uppercase, lowercase, or in mixed case. For example, PROCESSFLOW
, ProcessFlow
, and processflow
are all valid.task_name
: The name of the mapping or the process flow.
custom_params
: Values of a custom parameter defined for this task. Refer to system_params for the syntax.
system_params
: Values of system parameters for this task type. These values override the default values. Enter the parameters in the form name
=value
. Separate multiple parameters with commas, and enclose the entire string in double quotes. A backslash (\) is the escape character, when you need to include commas or double quotes as literal text.
The following examples are correct:
"," "this_param=true" "this_param=true, that_param=2"
oem_friendly
: Controls the return values. Set to 1 for execution in Enterprise Manager, or set to 0 for other environments.
background
: Controls execution of the task. Set to 1 for background, or set to 0 for foreground.
Example
The following example displays the return value of the function, which runs a mapping named CUSTOMER_MAP
in SALES_TARGET_LOCATION
.
BEGIN DBMS_OUTPUT.PUT_LINE('Result: ' || TO_CHAR(gccrep.wb_rt_api_exec.run_task( 'SALES_TARGET_LOCATION','PLSQLMAP','CUSTOMER_MAP', null, null, 1))); END;
The repository owner may occasionally need to run a SQL script to manager a control center.
Disabling Automatic Recovery
Warehouse Builder automatically restarts jobs that were interrupted as the result of Oracle Database shutting down. You can control this behavior for all jobs associated with a particular Control Center by setting the RECOVERY
platform property:
TRUE
: Automatically restarts jobs. (Default)
FALSE
: Jobs require manual restart.
To turn off automatic recovery:
Open SQL*Plus and connect as the repository owner.
Use the SET_PLATFORM_PROPERTY
script to set the RECOVERY
property to FALSE
.
The following example sets the property on a Windows platform:
@%ORACLE_HOME%\owb\rtp\sql\set_platform_property RECOVERY FALSE
ORACLE_HOME
is the Oracle home directory for Warehouse Builder.
Unregistering Locations
If a location cannot be unregistered using the Control Center Manager or an OMB*Plus script, you can use a SQL script. This problem may occur if the control center becomes inaccessible for any reason, such as disk failure or simply deleting the control center without first unregistering the locations.
Note:
Only use this method of unregistering locations when the usual methods are unsuccessful.To unregister a location: