Thursday, October 18, 2012

[OBIEE 11g] Deployment RPD Using Shell Script


How to Deploy the RPD using Shell Script  


In OBIEE 11g the deployment procedure of RPD is handling by the Enterprise manager, but while doing the deployment of RPD using Enterprise Manager I feel it is more time consuming as some time enterprise manager takes time to load the graphics.

To over come from such situation the OBIEE provides WLST(Weblogic Scripting tool), so I thought I can  pulled the hand completed, by launching the WLST and then running the RPD deployment script.then question arises can we call the WLST and the command related to WLST in shell script and I crested the following script
echo "Enter user : "
read user
echo "Enter password : "
read password
echo "Enter host(ex. adminAddress:adminPort) : "
read host
echo "Enter RPD Path and Name (ex. /~/rpd_name.rpd) : "
read rpd_path
echo "Enter RPD Password : "
read rpd_password
/export/home/oracle/

Middlewarehome/OracleBI/wlserver_10.3/common/bin/wlst.sh
connect(user,password,host)
domainCustom()
cd('oracle.biee.admin')
# Lock
print 'Obtaining lock...'
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 'Already locked'
# Lock Complete
cd('..')
# Upload
print 'Uploading repository...'
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)
# Upload Complete
cd('..')
# Commit
print 'Applying changes...'
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 'Not Locked'
#Commit Complete
exit()


/export/home/oracle/Middlewarehome/OracleBI/instances/instance1/bin/opmnctl stopall

echo OPMNCTL Starting.......

/export/home/oracle/Middlewarehome/OracleBI/instances/instance1/bin/opmnctl startall

/export/home/oracle/Middlewarehome/OracleBI/instances/instance1/bin/opmnctl status
 I ran this script in Unix shell but rather than completing the deployment the control stopped at the "WLST:offline>" it means that user needs to provide the parameter and there is no use of opmnctl command.
 But I want to pull out hands so it is necessary to deploy the RPD and restart the services from shell script only, so I created two file once shell script and another is .PY as WLST accept only the  jython.



Deploy.sh


echo "Enter the path (from current directory) of .py file: "
read pp
[weblogic_Home]/common/bin/wlst.sh $pp
[oracle_Home]/instances/instance1/bin/opmnctl stopall
echo OPMNCTL Starting.......
[Oracle_Home]/instances/instance1/bin/opmnctl startall

[Oracle_Home]/instances/instance1/bin/opmnctl status



RPD_Deployment.py


user = raw_input("Enter user : ")
password = raw_input("Enter password : ")
host = raw_input("Enter host(ex. adminAddress:adminPort) : ")
rpd_path = raw_input("Enter RPD Path and Name (ex. C:/~/rpd_name.rpd) ")
rpd_password = raw_input("Enter RPD Password : ")
connect(user,password,host)

domainCustom()

cd('oracle.biee.admin')

# Lock

print 'Obtaining lock...'

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 'Already locked'
# Lock Complete
cd('..')
# Upload
print 'Uploading repository...'
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)
# Upload Complete
cd('..')
# Commit
print 'Applying changes...'
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 'Not Locked'
#Commit Complete
exit()

Now...I call the WLST launch command and all the function required to deploy the RPD through the shell script itself in Deploy.sh and provide the path of RPD_Deployment.py.
Note:To avoid the parameter pass on the shell we can also create parameter and there values in to the separate the script and use the values of them in RPD_Deployment.py


1 comment:

  1. Page would have been really rice if we can read the blog. Wording is too light to read. Either bold everything or change to another color for text.

    ReplyDelete