/ OBIEE

Load RPD using WLST

Intro

I was talking to PedroF over at #obihackers today, and I realized it might be helpful if I start to post some of the scripts that I use regularly. So today I bring you RPD file deployment!

The Code

11g

rpd_path = "/tmp/RPDfile2Upload.rpd"
rpd_password = "Admin123"

connect('weblogic', 'Password123', 't3://localhost:7001')

# Be sure we are in the root
cd('..\..')

print 'Connecting to Domain ...'
try:
        domainCustom()
except:
        print 'Already in domainCustom'

print 'Go to biee admin domain'
cd('oracle.biee.admin')

# Lock system
cd ('oracle.biee.admin:type=BIDomain,group=Service')
objs = jarray.array([], java.lang.Object)
strs = jarray.array([], java.lang.String)
try:
        invoke('lock', objs, strs)
except:
        print 'System already locked'


# Migrate Metadata

print 'Uploading repository...'
cd('..')
cd('oracle.biee.admin:type=BIDomain.BIInstance.ServerConfiguration,biInstance=coreapplication,group=Service')
params = jarray.array([rpd_path,rpd_password],java.lang.Object)
sign = jarray.array(['java.lang.String', 'java.lang.String'],java.lang.String)
invoke( 'uploadRepository', params, sign)

# Commit changes 
cd ('..')
cd ('oracle.biee.admin:type=BIDomain,group=Service')
objs = jarray.array([], java.lang.Object)
strs = jarray.array([], java.lang.String)
try:
        invoke('commit', objs, strs)
except:
        print('System not locked')


disconnect()
exit()

12c

Coming Soon..?

Running WLST scripts

As always, this is how you would execute the script

source $ORACLE_HOME/wlserver/server/bin/setWLSEnv.sh
java weblogic.WLST theRPDScript.py