2007/05/21

Deployment Script

OMB+ Script to Deploy Mappings

This script is tested for 10gR1 Release.
=====================================================================

puts " ******************* WARNING ********************"
puts ""
puts ""
puts " The proc owb_deploy_map is Created"
puts " To execute the proc call the above proc name at OMB+ command prompt "
puts ""
puts " ================================================="
puts "Requires the following parameters"
puts " Design Repos User"
puts " Design Repos Password"
puts " Host Name"
puts" Service Name"
puts " Port"
puts " Runtime Connection Name "
puts " Runtime User Password"
puts " ================================================"

puts "**************************************************************"
#
proc owb_deploy_map { desuser despwd host port srvc rtcon rtpwd } {
set fname [ open "c:/temp/deploy_maps.log" w]
puts $fname "----------------------------------------------------------"
puts $fname "Connecting to the Design Repository "
puts $fname "----------------------------------------------------------"
OMBCONNECT $desuser/$despwd@$host:$port:$srvc
set projList [ OMBLIST PROJECTS ]
#
foreach projName $projList {
OMBCC '$projName'
set projcon [OMBDCC]
puts $fname "current project context is $projcon"
puts $fname "CONNECTING TO RUNTIME REPOSITORY"
puts $fname "----------------------------------------------------------"
OMBCONNECT RUNTIME '$rtcon' USE PASSWORD '$rtpwd'
set ModList [OMBLIST ORACLE_MODULES ]
set i 1
OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'DWH_DEPLOY_MAP'
#
foreach ModName $ModList {
puts $fname " Working on : $ModName"
OMBCC '$ModName'
set curcon [OMBDCC]
set mapList [OMBLIST MAPPINGS]
set j 1
#
foreach mapName $mapList {
puts $fname " Creating Delpoyment Action Plans for :$mapName"

OMBALTER DEPLOYMENT_ACTION_PLAN 'DWH_DEPLOY_MAP' ADD ACTION '$mapName.DROP' SET PROPERTIES(OPERATION) VALUES ('DROP') SET REFERENCE MAPPING '$mapName'
OMBALTER DEPLOYMENT_ACTION_PLAN 'DWH_DEPLOY_MAP' ADD ACTION '$mapName.CREATE' SET PROPERTIES(OPERATION) VALUES ('CREATE') SET REFERENCE MAPPING '$mapName'

incr j
}

puts $fname " Executing the Deployment Action for MAPPINGS"


OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'DWH_DEPLOY_MAP'

OMBCOMMIT

OMBCC '..'
set curcon [OMBDCC]
puts $fname "context at the end is --- $curcon"
incr i

}
OMBCOMMIT
OMBCC '/'

}
#
# DROP THE DEPLOYMENT ACTIONS PLANS
#
OMBCC '$projval'
set depList [OMBLIST DEPLOYMENT_ACTION_PLANS]
set n 1

puts $fname "Dropping the Deployment Action Plans"

foreach specName $depList {

puts $fname "Dropped $specName"
OMBDROP DEPLOYMENT_ACTION_PLAN '$specName'
incr n

}
OMBCOMMIT
OMBDISC
#
#**********************************************************************************************
# END OF PROC owb_deploy_map
#**********************************************************************************************
}

No comments:

Post a Comment

File Handling with Python

This little utility is for copying files from source to target directories.  On the way it checks whether a directory exists in the target, ...