Friday, March 29, 2013

WLST script that stops and then starts the BI publisher Java component




We can also start up or shut down individual Java components across your Oracle BI domain using WLST. The following example WLST script shows the steps to stop and then start the BI Publisher Java component.
1  .       Type the below script in notepad
import sys
import os
argLen = len(sys.argv)
if argLen -1 != 4:
    print "ERROR: got ", argLen -1, " args."
                print "USAGE: wlst.cmd restartBIP.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD"
                print " eg: wlst.cmd restartBIP.py localhost 7001 weblogic Welcome1"
                exit()
               
WLS_HOST = sys.argv[1]
WLS_PORT = sys.argv[2]
WLS_USER = sys.argv[3]
WLS_PW = sys.argv[4]

print 'Connecting to ' + WLS_HOST + ':' + WLS_PORT + ' as user: ' + WLS_USER + '...'

# Connect to the WLS
connect (WLS_USER, WLS_PW, WLS_HOST+ ':' + WLS_PORT);

print 'Connecting to the Servers Configuration MBean...'
cd('Servers')
ls()         
## Stop BI publisher
print 'Stopping BI Publisher Java component...'
progress=stopApplication('bipublisher#11.1.1')
## Start BI Publisher
print 'Starting BI Publisher Java component...'
progress=startApplication('bipublisher#11.1.1')

2  .       Save the file as restartBIP.py in the following location middleware_home\Oracle_BI1\common\bin. Save the file as .py extension
3  .       Call the above file (restartBIP.py) using command prompt as follows- middleware_home\Oracle_BI1\common\bin>wlst restartBIP.py localhost 7001 weblogic Welcome1 restart
We can substitute other application names if we wish to stop or start other java applications. We can use the Fusion Middleware Control to determine the names to use in the script by looking at the list of applications in the Application Deployments folder in the navigation tree menu.

Thursday, March 28, 2013

WLST Scripts that stops and starts or restarts System Componets


WLST script that stops, starts or restarts the entire Oracle BI instance (all the system components) is as follows-


1  .       Type the below script in notepad
import sys
import os
argLen = len (sys.argv)
if argLen -1 != 5:
   print "ERROR: got ", argLen -1, " args."
   print "USAGE: wlst StopStartRestartInstance.py WLS_HOSt WLS_PORT WLS_USER WLS_PASSWORD componentstatus"
   print " eg: wlst StopStartRestartInstance.py localhost 7001 weblogic welcome1 restart"
   exit()
WLS_HOST = sys.argv[1]
WLS_PORT = sys.argv[2]
WLS_USER = sys.argv[3]
WLS_PW = sys.argv[4]
componentstatus = sys.argv[5]
print 'Connecting to '+ WLS_HOST+ ':' + WLS_PORT + ' as user: ' + WLS_USER + ' ...'
# Connect to WLS
connect(WLS_USER, WLS_PW, WLS_HOST= ':' + WLS_PORT);
print 'Connecting to Domain...'
domainCustom()
cd ('oracle.biee.admin')
print 'Connecting to BIDomain MBean ...'
cd ('oracle.biee.admin:type=BIDomain,group=Service')
biinstances = get('BIInstances')
biinstance = biinstances[0]
print 'Connecting to BIInstance MBean ...'
cd ('..')
cd (biinstance.toString())
if (componentstatus == "restart"):
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus
     print 'Calling stop...'
     objs = jarray.array([], java.lang.Object)
     strs = jarray.array([], java.lang.String)
     invoke('stop', objs, strs)
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus
     print 'Calling start...'
     objs = jarray.array([], java.lang.Object)
     strs = jarray.array([], java.lang.String)
     invoke('start', objs, strs)
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus

  elseif
     componentstatus == "start":
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus
     print 'Calling start...'
     objs = jarray.array([], java.lang.Object)
     strs = jarray.array([], java.lang.String)
     invoke('start', objs, strs)
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus

  else :
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus
     print 'Calling stop...'
     objs = jarray.array([], java.lang.Object)
     strs = jarray.array([], java.lang.String)
     invoke('stop', objs, strs)
     servicestatus=get('ServiceStatus')
     print 'BIInstance Mbean; ServiceStatus: ' + servicestatus
exit()
2  .       Save the file as StopStartRestartInstance.py in the following location middleware_home\Oracle_BI1\common\bin. Save the file as .py extension
3  .       Call the above file (stopstartrestartinstance.py) using command prompt as follows- middleware_home\Oracle_BI1\common\bin>wlst StopStartRestartInstance.py localhost 7001 weblogic Welcome1 restart

Monday, March 4, 2013

Auto Start/Stop OBIEE 11g using Windows Services


Steps:

      1)      Stop any WebLogic Administration Servers or Managed Servers that are running.
     2)      Create a command file that will be used to create the Administration Server Windows Services using a text editor and name it installAdminServerService.cmd and enter the following:

SETLOCAL
set DOMAIN_NAME=bifoundation_domain
set USERDOMAIN_HOME=C:\Oracle\user_projects\domains\bifoundation_domain
set SERVER_NAME=AdminServer
set PRODUCTION_MODE=true
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
call "C:\Oracle\wlserver_10.3\server\bin\installSvc.cmd"
ENDLOCAL

While saving it, save it in double quotes (“”) so that will be saved as a command file.
For e.g. “installAdminServerService.cmd
Note: Change according to your environment

Save the command file in this folder C:\Oracle\wlserver_10.3\server\bin

    3)      Again, Create a Command file that will be used to create the Managed Server Windows Services using a text editor and name it InstallManagedServerService and enter the following:

SETLOCAL
set DOMAIN_NAME=bifoundation_domain
set USERDOMAIN_HOME=C:\Oracle\user_projects\domains\bifoundation_domain
set SERVER_NAME=bi_server1
set PRODUCTION_MODE=true
set ADMIN_URL=http://localhost:7001  (LocalHost: Computer Name)
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
call "C:\Oracle\wlserver_10.3\server\bin\installSvc.cmd"
ENDLOCAL

While saving it, save it in double quotes (“”) so that will be saved as a command file.
For e.g. “InstallManagedServerService.cmd
Note: Change according to your environment

Save the command file in this folder C:\Oracle\wlserver_10.3\server\bin


4) In the Environment Variables, create a new system variable called BI_ORACLE_HOME and set   the path to C:\Oracle_home\ORACLE_BI1. 


   

5) Run both the command scripts you just created and check in the list of services if they are both available or not. (Run them in command prompt)


 6)      Also, In the Registry Editor go to
HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services
And check if two keys got created
i)                    Beasvcbifoundation_domain_AdminServer
ii)                  Beasvcbifoundation_domain_bi_server1





7) Check if the services have been created and start the services.