Using OMBPlus to deploy a series of mappings

Arnoud van der Giessen September 29th, 2007

After working with Oracle Warehouse Builder 10g R2 for several months, I’m now back to working with OWB 9.2. One sometimes frustrating feature of version 9.2 is the inability to deploy objects and edit objects at the same time (in one instance of OWB). As deploying mappings takes too long due to temporary performance issues, I looked into OMBPlus scripts to improve my efficiency, as OMBPlus scripts run independent of OWB.

Below you see a OMBPlus script that will deploy mappings in a given project and module. It is assumed that all mappings are in one and the same module of one and the same project. A parameter needs to be entered to select which mappings will be deployed. Either sum up the mappings using a space as a separator (eg. MAP1 MAP2) or state one name that includes a wildcard (e.g. MAP&). Of course, the script can be altered to deploy any type of objects.

proc deploy_mappings {} {
# Connect to the repository
OMBCONNECT user/password@DB USE REPOS 'repos'

#Change context to the desired project.
OMBCC 'YOUR_PROJECT'

# Change context to the desired module.
OMBCC 'YOUR_MODULE'

# Connect to the runtime repository
OMBCONNECT RUNTIME 'runtime' USE PASSWORD 'xxx'

#
puts "What mapping(s) do you want to deploy? "
puts "Give either one mapping name (which can contain wildcards) "
puts "or sum up all the mappings to deploy"
puts -nonewline "Mapping(s)? "
gets stdin mappings

set mystring [string first " " $mappings]
if {$mystring != -1} {set mapList $mappings} else {set mapList [ OMBLIST MAPPINGS '$mappings.*' ]}
puts mapList

set J 1
foreach mapName $mapList {
puts [concat "Deploying" $mapName "at" [clock format [clock seconds] ] ]
OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN' \
ADD ACTION 'DEPLOY_MAP' SET PROPERTIES (OPERATION) \
VALUES ('CREATE') SET REFERENCE MAPPING \
'$mapName'

OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN'

OMBDROP DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN'

OMBCOMMIT

incr J
}

puts " "
puts [concat "Deployment finished succesfully at" [clock format [clock seconds] ] "." ]
puts [concat [expr $J - 1] "mapping(s) have been deployed." ]
OMBDISCONNECT
}

I hope this example shows it’s relatively easy to use the OMBPLus scripting language. For more information, see Oracle Warehouse Builder 10g Scripting Language – Home Page for more information. Please note that the information is also valid for OWB 9.2.

Leave comment

Comments: (0)

Leave your comment: