Friday, August 4, 2017

Creating Windows Service for SOA Service

1.    Editing installSvc.cmd for SOA
      
Editing the installSvc.cmd as like below and rename it to new file installSvc_Soa.cmdThe Difference between the Admin Script and SOA Script is added -depend:"beasvc EPMSystem_AdminServer"
-delay:"120000"

So upon start of Server it will wait for Weblogic Admin Server to get complete start after that there will be delay of 120000 (milliseconds) = 2 mins then SOA Service will start.

Also it is creating new log file in below location with "stdout.txt” prefix.
 D:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\soa_server1\logs
 
rem *** Install the service -log entered by Vikram
"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -stopclass:javaclass -depend:"beasvc EPMSystem_AdminServer" -delay:"120000" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE% -log:"D:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\soa_server1\logs\%SERVER_NAME%-stdout.txt"

2.     Creating batch file to create SOA Windows Services

Write the batch file with below options:
 
echo off
SETLOCAL
set DOMAIN_NAME=EPMSystem
set USERDOMAIN_HOME=D:\Oracle\Middleware\user_projects\domains\EPMSystem
set SERVER_NAME=soa_server1
set PRODUCTION_MODE=true
set WLS_USER=epm_admin
set WLS_PW=<Password>
set WL_HOME=D:\Oracle\Middleware\wlserver_10.3
set ADMIN_URL=http://<servername>:7001
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setSOADomainEnv.cmd"
call "D:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc_Soa.cmd"
ENDLOCAL
 
Save the above batch file like installSoaServer_service.cmd


Run the above batch file it will create the Windows Services like:
" beasvc EPMSystem_soa_server1" it can be validated via Windows MMC (Services.msc)


3.     General Consideration after running the service

After creation of windows service you need to manually set some of the Configuration via Windows Registry

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\beasvc <your domain>_<managed server name>\Parameters


Open the CmdLine in Registry and update the

-jrockit -Xms512m -Xmx1536m
Host <Servername>
Port <8001>

Do the similar setting like above done for Admin Server.

Now, shut down the Admin & SOA server then start it from Windows Services.


Friday, March 25, 2016

TaskAudit and DataAudit Automation in Hyperion Financial Management (HFM)

Automation of TaskAudit and DataAudit in HFM


Table of Contents


1.       Introduction
2.       Scheduling the Command Script via Task Scheduler
3.       Invoking the Main Script TaskAudit_Email_Final.cmd
4.       Task and Data Audit Core Script
5.       Powershell Script for sending Reports as attachment
6.       Archive Folder
7.       Script Details



1.   Introduction

Task and Data Audit is data which every organization need on particular timeframe. In order to mitigate the risk to run over the Production Manual, script is been used to run on the specific time which reduce the Manual Work Load and intervention.

2.   Scheduling the Command Script via Windows Task Scheduler

Using the Windows Task Scheduler this script is scheduled to run the script every 1st of Month at 6 AM.

Location of Script: <Drive>:\TaskAuditAutomation


3.        Invoking the Main Script TaskAudit_Email_Final.cmd

Task Scheduler is going to invoke the TaskAudit_Email_Final.cmd script which consists of 2 scripts.

a)    TaskAudit.cmd
b)   final_sendemail.PS1

4.        Task and Data Audit Core Script

TaskAudit.cmd is the core script which generate the Task Audit and Data Audit in below mentioned folder. You can choose any folder like <Drive>:\TaskAuditAutomation\Reports folder

Data Parameter is defined in TaskAudit.cmd which will take last month 1st Day and last month last day, so that it will satisfy the required of taking Task Audit and Data Audit for last month.

5.        Powershell Script for sending Reports as attachment

final_sendemail.PS1 is PowerShell script which will take the report from the <Drive>:\TaskAuditAutomation\Reports folder and send to the desired recipients.

6.        Archive Folder


Once the mail is sent then TaskAudit_Email_Final.cmd script will archive the Reports which are generated to <Drive>:\TaskAuditAutomation\Reports\Archive Folder.



7.        Script Details

a.     TaskAudit.cmd
<Drive>:\Oracle\Middleware\EPMSystem11R1\products\FinancialManagement\Utilities\hfmauditextractcmdline_x64.exe -u "<Drive>:\Oracle\Middleware\EPMSystem11R1\products\FinancialManagement\Server Working Folder\<HFM_Server>.udl" -d <Drive>:\TaskAuditAutomation\Reports -a <HFM_Application_Name> -l; -s %moon% -e %sun% -t Enabled -x Enabled

b.     final_sendemail.PS1
$files=Get-ChildItem “<Drive>:\TaskAuditAutomation\Reports\” | Where {-NOT $_.PSIsContainer}
$smtpServer = "(Exchange Server or MailBox Server Name)"
$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "Your email id or Mailbox id"
$msg.To.Add("Your email id or Receipent Email id")
$msg.Subject = "TaskAudit and DataAudit Report"
$msg.Body = "<b>Greeting for the day!!!</b><br><br><br>Please find the attachment for the TaskAudit and DataAudit for the last month <b>$Server</b><br><br><br> Have a Nice DAY! <br><br><br>Best Regards, <br>Hyperion Team"
$msg.IsBodyHtml = 1
Foreach($file in $files)
{
Write-Host “Attaching File :- ” $file
$attachment = New-Object Net.Mail.Attachment –ArgumentList <Drive>:\TaskAuditAutomation\Reports\$file
$msg.Attachments.Add($attachment)
}
$smtp.Send($msg)
$attachment.Dispose()
$msg.Dispose()


c.      TaskAudit_Email_Final.cmd 


echo off

call <Drive>:\TaskAuditAutomation\TaskAudit.cmd

Timeout /t 5

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '<Drive>:\TaskAuditAutomation\final_sendemail'"

Timeout /t 5

move <Drive>:\TaskAuditAutomation\Reports\*.* <Drive>:\TaskAuditAutomation\Reports\Archive

Tuesday, February 23, 2016

Creating Windows Service for Weblogic Admin Server 10.3.6+

I am sure that you have gone through with many blogs and links which tell about how to create the Windows Services.


So, what is new in this post? I am covering step by step creation of Windows Service for Weblogic Admin Server and the issues which I have faced.


Step 1: Edit the installSvc.cmd file for creation of separate log files

You can find the installSvc.cmd file in your WL Home which be ideally in below folder in installation is in D Drive of Server

D:\Oracle\Middleware\wlserver_10.3\server\bin

It is been always recommend that keep the backup of Original file and do the edit the copy of that file.

Now, do the edit in your installSvc.cmd file so that it will create the new log file with the suffix of "stdout.txt". It should look like below"

"%WL_HOME%\server\bin\beasvc" -install -svcname:"%DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%" -cmdline:%CMDLINE%
-log:"E:\MiddelwareHome\user_projects\domains\bifoundation_domain\%SERVER_NAME%-stdout.txt"

Step 2: Creation of launcher file, 

Write the batch file with below options:

echo off
SETLOCAL
set DOMAIN_NAME=<Domain_Name>
set USERDOMAIN_HOME=D:\Oracle\Middleware\user_projects\domains\<Domain_Name>
set SERVER_NAME=AdminServer
set PRODUCTION_MODE=true
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd"
call "<WL_HOME>\server\bin\installSvc.cmd"
ENDLOCAL

Save the above batch file like installAdmServer_service.cmd

Run the above batch file it will create the Windows Services like:
"beasvc EPMSystem_AdminServer" it can be validated via Windows MMC (Services.msc)

Step3:  After creation of windows service you need to manually set some of the Configuration via Windows Registry

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\beasvc <your domain>_<managed server name>\Parameters

Even, we can creating all the registry settings via launcher batch file but I feel comfortable doing via registry. My intention is to create the windows services then do update the configuration so that removal of services and creation should be minimize.

Open the CmdLine in Registry and update the

-jrockit -Xms512m -Xmx1536m 
Host
Port



Since we are using jrockit JVM reason why you will see the -jrockit

Note: Make sure your server JAVA path is set to jrockit bin folder

Well, now you can start the Windows Services via Windows MMC.

If services went fine then you will see the beasvc.exe in your Task Manager.

Now, if you face the below issue similar like then follow me:

Issue1: While creating Windows Services below error can be caused by some of the Weblogic 10.3.6+ version

D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar\" -Dweblogic.Name=AdminServer -Dweblogic.management.username= -Dweblogic.ProductionModeEnabled=true -Djava.security.policy=\"D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webl
ogic.policy\" weblogic.Server"
'"oracle.fabric.common.classloaderurl.handler"' is not recognized as an internal
 or external command,
operable program or batch file.

This is because of multiple handlers in weblogic provided in setDomainEnv.cmd

So, follow the below workaround in installSvc.cmd file.

  1. Edit the installSvc.cmd script.
  2. Change the %JAVA_OPTIONS% string as follows:
    \"%JAVA_OPTIONS%\"
    For example, change from this:
    set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
    To this:
    set CMDLINE="%JAVA_VM% %MEM_ARGS% \"%JAVA_OPTIONS%\" -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
 For complete cause of this issue you may review the Doc ID 1276229.1

Issue2: When Starting the Admin Service via Windows Service, you may be likely to get the below error:

Before merging tokens =  -Dweblogic.ProductionModeEnabled=true -XX:-FlightRecorder -da -Dplatform.home=D:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -DEPM_ORACLE_HOME=D:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=D:\Oracle\Middleware\user_projects\epmsystem1 -Dcommon.components.home=D:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Djrockit.optfile=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\servers\AdminServer -Doracle.domain.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1 -Digf.arisidbeans.carmlloc=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\carml -Digf.arisidstack.home=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=D:\Oracle\Middleware\user_projects\domains\EPMSystem\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=D:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\AdminServer\tmp\_WL_user -Doracle.deplo[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] Thread created successfully
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] Reporting SCM of SERVICE_START_PENDING with delay=0
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] lpszHost = [10.14.74.33]
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] lpszPort = [7001]
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] pinging the host with max retry limit of 60
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:05 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:05 2016] [I] [StartJVM] Parsing JVM Arguments
[Sun Feb 21 21:47:05 2016] [I] [StartJVM] Initializing JVM
[Sun Feb 21 21:47:06 2016] [I] [RunJavaApp] Loading class -  -Dweblogic.ProductionModeEnabled=true -XX:-FlightRecorder -da -Dplatform.home=D:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -DEPM_ORACLE_HOME=D:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=D:\Oracle\Middleware\user_projects\epmsystem1 -Dcommon.components.home=D:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Djrockit.optfile=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\servers\AdminServer -Doracle.domain.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1 -Digf.arisidbeans.carmlloc=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\carml -Digf.arisidstack.home=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=D:\Oracle\Middleware\user_projects\domains\EPMSystem\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=D:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\AdminServer\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.ossoiap_11.1.1,D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.oamprovider_11.1.1,D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jps_11.1.1 -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol -Dweblogic.jdbc.remoteEnabled=false -da:org.apache.xmlbeans... -Dsoa.archives.dir=D:\Oracle\Middleware\Oracle_SOA1\soa -Dsoa.oracle.home=D:\Oracle\Middleware\Oracle_SOA1 -Dsoa.instance.home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\DemoTrust.jks -Dums.oracle.home=D:\Oracle\Middleware\Oracle_SOA1 -Dem.oracle.home=D:\Oracle\Middleware\oracle_common -Djava.awt.headless=true -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=D:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sysext_manifest_classpath
Exception in thread "Main Thread" java.lang.NoClassDefFoundError:  -Dweblogic/ProductionModeEnabled=true -XX:-FlightRecorder -da -Dplatform/home=D:\Oracle\MIDDLE~1\WLSERV~1/3 -Dwls/home=D:\Oracle\MIDDLE~1\WLSERV~1/3\server -Dweblogic/home=D:\Oracle\MIDDLE~1\WLSERV~1/3\server -DEPM_ORACLE_HOME=D:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=D:\Oracle\Middleware\user_projects\epmsystem1 -Dcommon/components/home=D:\Oracle\MIDDLE~1\ORACLE~1 -Djrf/version=11/1/1 -Dorg/apache/commons/logging/Log=org/apache/commons/logging/impl/Jdk14Logger -Ddomain/home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Djrockit/optfile=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle/jrf_11/1/1\jrocket_optfile/txt -Doracle/server/config/dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\servers\AdminServer -Doracle/domain/config/dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1 -Digf/arisidbeans/carmlloc=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\carml -Digf/arisidstack/home=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\arisidpr
Caused by: java.lang.ClassNotFoundException:  -Dweblogic.ProductionModeEnabled=true -XX:-FlightRecorder -da -Dplatform.home=D:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=D:\Oracle\MIDDLE~1\WLSERV~1.3\server -DEPM_ORACLE_HOME=D:\Oracle\Middleware\EPMSystem11R1 -DEPM_ORACLE_INSTANCE=D:\Oracle\Middleware\user_projects\epmsystem1 -Dcommon.components.home=D:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Djrockit.optfile=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\servers\AdminServer -Doracle.domain.config.dir=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1 -Digf.arisidbeans.carmlloc=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\carml -Digf.arisidstack.home=D:\Oracle\MIDDLE~1\USER_P~1\domains\EPMSYS~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=D:\Oracle\Middleware\user_projects\domains\EPMSystem\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=D:\Oracle\Middleware\user_projects\domains\EPMSystem\servers\AdminServer\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.ossoiap_11.1.1,D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.oamprovider_11.1.1,D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jps_11.1.1 -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol -Dweblogic.jdbc.remoteEnabled=false -da:org.apache.xmlbeans... -Dsoa.archives.dir=D:\Oracle\Middleware\Oracle_SOA1\soa -Dsoa.oracle.home=D:\Oracle\Middleware\Oracle_SOA1 -Dsoa.instance.home=D:\Oracle\Middleware\user_projects\domains\EPMSystem -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\DemoTrust.jks -Dums.oracle.home=D:\Oracle\Middleware\Oracle_SOA1 -Dem.oracle.home=D:\Oracle\Middleware\oracle_common -Djava.awt.headless=true -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=D:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sysext_manifest_classpath
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[Sun Feb 21 21:47:10 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:10 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:15 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:15 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:20 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:20 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:25 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:25 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:30 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:30 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:35 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:35 2016] [I] [ServiceStart] connection attempt failed. retrying
[Sun Feb 21 21:47:40 2016] [I] [ServiceStart] trying to open a connection to host
[Sun Feb 21 21:47:40 2016] [I] [ServiceStart] connection attempt failed. retrying

So, it bit tricky the issue is due to character encoding in the CmdLine of Windows Registry, This can be fixed by below:

Loading class -  -Dweblogic.ProductionModeEnabled=true
=====> What I have already seen:

User hand-edited the script in Word, hoping it would be easier.
Word replaces "minus sign" with something else "looking like a minus sign"...

Sending the output to a UniX and "vi" usually reveals the "minus sign" problem...

Please ERASE "-D" in the above and type "-D" in the command line...

As the JVM does not recognize "looking like a minus sign"D as a property, it believes it is a class name.
Thus the error message.

After doing the above recommendation most likely service will start.

I am sure that you may gone through with so many posts/blogs of creation of Windows Service of Weblogic Admin Server but dealing with above issues are bit less hence I have covered them all.

Feel free to provide your suggestion of ask me questions if you have.

Thanks for reading my post.

Regards,
Vikram

Tuesday, August 11, 2015

Automation of RPD Deployment in OBIEE


In post I will be explaining you How we can Automate the RPD Deployment in OBIEE.


Will provide you the script just you need to change the property file and provide the location of RPD in the script.
The concept is simple if you have the script just you need to schedule it via any scheduler making sure that latest RPD is available in mentioned folder.


Now reason why you are here is the beauty of this script is it is going to be CoreScript for your all the environment because suppose if you want to the deployment in another environment just you need to change location of properties file when batch or cmd file which you are going to invoke.


Below is the Command File which can be scheduled or can be invoked manually.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM This script created by Vikram and it take 2 parameter i.e. properties file and RPD location. It is mandatory to have the properties file and OBI rpd in mentioned folder.

@echo off

REM Calling the Python script DeployCore.cmd to deploy the RPD even this scipt will do the recycle of OPMN services via mbean.

call wlst <deploy_script_location>\DeployCore.cmd <location_of_properties_file>\server.properties <location_of_latest_RPD>\OBI.rpd

REM Once the RPD is deployed it the latest RPD must get copied from 01 server to Cluster environment. Below line will accompolish that.

xcopy \\servername\D$\OBIEE\instances\instance2\bifoundation\OracleBIServerComponent\coreapplication_obis1\repository\OBI_BI*.rpd \\server\D$\OBIEE\Cluster_RPD /s /d /Y

pause

exit
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Below is the script of the Deploying RPD (DeployRPD.cmd).
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This script will deploy the RPD and will recycle the OPMN services via mbean in 01 and 02 server
#
# Script expects the following arguments but all the information are passed by server.properties file.
#

import sys
import os

import java.io
from java.io import FileInputStream

# Check the arguments to this script are as expected.
# argv[0] is script name.

argLen = len(sys.argv)
if argLen -1 != 2:
    print "ERROR: got ", argLen -2, " args."
    print "USAGE: It must contains the properties file and latest OBI RPD location"
    print "   eg: wlst server.properties OBI.rpd"
    exit()

properties = sys.argv[1]
rpdlocation = sys.argv[2]

propInputStream = FileInputStream(properties)
configProps = Properties()
configProps.load(propInputStream)

adminUrl = configProps.get("admin.url")
adminUser = configProps.get("admin.username")
adminPassword = configProps.get("admin.password")
rpdpassword = configProps.get("admin.rpdpassword")

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

print 'This script is creating by Vikram Kumar For any comments please reach at vikram.kumar@abc.com'

connect(userConfigFile=adminUser,userKeyFile=adminPassword,url=adminUrl,timeout=0)

print 'Connecting to Domain ...'
domainCustom()

cd ('oracle.biee.admin')

cd ('oracle.biee.admin:type=BIDomain,group=Service')

# define the MBean parameters and data types as arrays

objs = jarray.array([],java.lang.Object)
strs = jarray.array([],java.lang.String)

# Invoke the lock operation from the BIDomainMBean
# (equivalent to the Lock and Edit Configuration button in
# Enterprise Manager

print 'Locking the domain ...'

invoke('lock',objs,strs)

# Read the name of the first instance from first entry
# in the BIInstances property within the BIDomainMBean
# (initially returned as an array, first value selected)

biinstances = get('BIInstances')
biinstance = biinstances[0]

# Connect to the corresponding BIInstanceMBean

print ('Connecting to BIInstance MBean')

cd ('..')
cd (biinstance.toString())

# Retrieve the name of the MBean for managing the
# BI Server configuration

biserver = get('ServerConfiguration')

# Connect to the ServerConfigurationMBean for this BI Server

cd ('..')
cd (biserver.toString())

# Now prepare for the RPD upload
# Prepare arrays for parameters and datatypes
# Load the parameters with the RPD name and password
# Then invoke the uploadRepository within the ServerConfigurationMBean

print ('Uploading repository ...')

argtypes = jarray.array(['java.lang.String','java.lang.String'],java.lang.String)
argvalues = jarray.array([rpdlocation,rpdpassword],java.lang.Object)

invoke('uploadRepository',argvalues,argtypes)

# Now go back to the BIDomainMBean and commit the change
# (equivalent to the Activate Changes button in Enterprise Manager)

print ('Committing the update ...')

cd('..')
cd('oracle.biee.admin:type=BIDomain,group=Service')
objs = jarray.array([],java.lang.Object)
strs = jarray.array([],java.lang.String)

invoke('commit',objs,strs)

print ('Now restarting the instance, to pick up the new RPD file')

print 'Connecting to BIInstance MBean ...'
cd ('..')
cd (biinstance.toString())

# The BIInstanceMBean controls the overall status of
# the Oracle instance, and if directed to stop or start
# will stop/start all components together

print 'Getting instance status ...'

# ServiceStatus property in BIInstanceMBean returns
# the current status of the instance

servicestatus=get('ServiceStatus')
print 'BIInstance MBean; ServiceStatus: ' + servicestatus

# Stop action, if invoked, will stop entire instance

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

# Start action will start the instance, and pick up
# the configuration change (the new RPD file path)

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

print 'RPD Upload now complete!'

exit()
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Below script is for the server.properties file
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
admin.url=t3://servername:7001
admin.username=<location of username>/configfileqa.secure
admin.password=<location of password>/keyfileqa.secure
admin.rpdpassword=ABCDEFG
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Now here you can see that admin username and password has been supplied configfileqa.secure and keyfileqa.secure respectively. So this is encryped username and password, it can be generated using below link:

https://blogs.oracle.com/bala/entry/encrypt_the_credentials_when_r

Please do reply me back if you have some new finding or comments.

Thanks.

Thursday, July 16, 2015

Creating VPN Connection from Home Machine and Connecting via SmartPhone.


As we all know that more than system we used to stick with SmartPhone so what if you want to connect to your home system and pull out from information.


Here you can achieve it, follow the below guidelines:

Creating a VPN Server

First, you’ll need to open the Network Connections window.

Press the Alt key, click the File menu that appears, and select New Incoming Connection.
windows-new-incoming-connection
You can now select the user accounts that can connect remotely. To increase security, you may want to create a new, limited user account rather than allow VPN logins from your primary user account. (Click Add someone to create a new user account.) Ensure the user you allow has a very strong password, as a weak password could be cracked by a dictionary attack.

Select the Through the Internet option to allow VPN connections over the Internet. You can also allow incoming connections over a dial-up modem, if you have the dial-up hardware.
allow-vpn-connections-through-the-internet
You can then select the networking protocols that should be enabled for incoming connections. For example, if you don’t want people connected to the VPN to have access to shared files and printers on your local network, you can uncheck the File and Printer Sharing option.
select-vpn-networking-protocols
Click the Allow access button and Windows will set up a VPN server.
allow-vpn-access-in-windows

Router Setup

You will now need to log into your router’s setup page and forward port 1723 to the IP address of the computer where you set up the VPN server
As I have BELKIN Router so I went to Virtual Server and did this settings. If you have it from some other (TPLINK, NETGEAR, etc) it can be done easily.
Make sure that it is allowed to the use the VPN Connection:
Now one setup you can do to avoid the IP Conflict from the connecting users:

Connecting to VPN Server


Via SmartPhone


Goto Setting -- Under Network (more) -- VPN --> Then Enable the VPN settings:

Note: When enable VPN Setting SmartPhone must have lock screen as PIN no. or Pattern.

Enable VPN should be appear like this:




Tap on the Add VPN




Upon tapping on the Add VPN now you can name it VPN (could be any name), type must be PPTP because the VPN server which you have create it uses PPT Protocol for communicate.

In the Server Address you need to type the IP address of the system for where you have created the VPN Server. Make sure you should what is the IP address is provided from your ISP (You may have to call up your service provider i.e Airtel, Verizon, etc). It is always recommended you should get static IP from your service provider so that connection will be persistent.


Once done then Tap on OK. Now you see that VPN connection is been created in your phone.



So, I have created a VKVPN is available Tap on it connect, then supply the credentials:

Bingo!! That's it You are connected


Now you can do Remote Desktop to your Home system or you can browse the file by using File Explorer in the SmartPhone Device.

As of now I have provided details for Andriod SmartPhones, Stay tuned will be sharing for iOS soon!

Thanks.