Wednesday, December 28, 2016

OBIEE 12c : Single script to export the service instance

As we are all aware, in OBIEE 12c all the code movements are recommended to be performed using the service instance export files called BAR ( BI Application Archive) files.

In General we will have to open the Weblogic command in offline mode and use the export service instance command with parameters as described in my previous post Export and Import Service Instances. But we can also make all this steps into a single script and the just run that so everything happens on it own. This helps you save time as each time you have to navigate to different locations and remember directories and write export script which might have typo errors etc.

Lets see what we can do, if we have the Work and Export Directories fixed then we can decide on  the export instance command, which generally will not change. Mine is as below.

exportServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARWorkDir','/userhome/oraclebi/Desktop/BARExpDir','','','',true,'Admin123')

now save this command in a file with extension .py and make sure to give full permissions to user who runs the script. My case the file name is  SIExport.py located in below location


/home/oracle/scripts/SIExport.py 

Now all you need is to run this against the WLST  opened in offline mode. to do this we can actually use the below syntax.


java weblogic.WLST /home/oracle/scripts/SIExport.py 


But if you run this directly you will not be able to initialize the weblogic scripting tool, we need to set the environment before this using the below command.

source setWLSEnv.sh


Now we know the order and what needs to be done, include all the commands in a .sh file in required sequence. my file is ServiceInstanceExport.sh which is as below.


#!/bin/bash
# Purpose : Export the Service Instance
# Author : Rampradeep Pakalapati


ORACLE_HOME=/oracle/systems/apps/Middleware/Oracle_Home
WL_PATH=$ORACLE_HOME/wlserver/server/bin
source $WL_PATH/setWLSEnv.sh
sleep 5
java weblogic.WLST /home/oracle/scripts/SIExport.py


#End of File

Now if you just run the file as ./ ServiceInstanceExport.sh , your service instance will be exported to the mentioned export directoty.

OBIEE 11g : All services are running but unable to Login to analytics

During a recent installation of OBIEE 11.1.1.7.0 on one of my personal machines i have noticed something strange which has not happened to be before. The installation went on to complete successfully and the analytics page popped up as usual, but surprisingly i was not able to login to analytics. Admin Console and Enterprise Manager allowed the weblogic login with out any issues.


Verified all the deployments and was able to see no issues, restarted to see if that fixed the issue. Even the status of all opmn components is Alive.SO then i decided to go on to have a look at the Server log files. As this is something related to Analytics login only usually my first preference is to look at bi_server1.log, bi_server1-diagnostic.log, NQserver.log and sawlog.log files.


I found these below errors in bi_server1-diagnostic.log and NQserver.log

bi_server1-diagnostic.log

 WSM-02557 oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "/policies/oracle/wss_username_token_service_policy" is queued for later retrieval.

[WSM-02353] [oracle.wsm.resources.policymanager] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: ] [ecid: f2c8df7ec64d12f7:1c25f84e:14402c30fe1:-8000-0000000000001049,0] [APP: wsm-pm] Unable to get the Action Executor.

NQServer.log:

[WSM-02557] oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "/policies/oracle/no_authentication_service_policy" is queued for later retrieval

 [nQSError: 43126] Authentication failed: invalid user/password.


When i saw thw Authntication failed message, I directly went into Administration Console to see if have the BISystemUser available as this is quite a famous issue. To my surprise its there however OracleSystemUser is missing from the list. I contacted a friend of mine in Oracle and found that this can be created directly as below.

  • Create a User with the name OracleSystemUser
  • Assign OracleSystemGroup to the user created, if group is missing then create one.
  • Make sure the OracleSystemRole under "Roles and Policies" --> "Global Roles" has the OracleSystemGroup added to it.
  • If OracleSystemRole role is missing create one with "Manage Global Roles" link in "How do I" section on the left.
  • Add the OracleSystemGroup manually to Role using "Add Conditions" option.
  • Restart the OBIEE services.
This fixed my issue, for some only role is missing and for others user is missing, so this process will fit for both the cases. Hope this helped your case.

Monday, December 12, 2016

OBIEE 12c: Uploadrpd and Downloadrpd Commands

Its more than a year 12c is into market and people are Testing it, Trying it out and also some using it. However, there are still questions around RPD deployments and offline access to RPD.

As per Oracle documentation Uploadrpd and Downloadrpd are meant for offline repository diagnostic and development purposes such as testing, only. And in all other cases of repository development and maintenance situations, you should use BAR to utilize BAR's repository upgrade and patching capabilities and benefits.

Now we will look at how we can use the uploadrpd and downloadrpd commands. For us, to either upload or download rpd, we will have to look at the launcher script datamodel.sh (Linux) or datamodel.cmd(Window) from version 12.2.1.1.
This same functionality is available as data-model-cmd.sh in OBIEE 12.2.1 Version, we find many online posts with this command.

Downloadrpd command

Syntax

downloadrpd -O RPDname [-W RPDpwd] -SI service_instance -U cred_username [-P cred_password] [-S hostname] [-N port_number] [-SSL] [-H]

O - Repository Name you want to Download.
W - Password for RPD download mandatory, if not specified in command will ask when we run it.
SI - Service Instance Name
U - OBIEE username
P  - Password for the OBIEE Username
All the above are Mandatory, where as the below are needed if you are using the command from a client installation
S - OBIEE server name
N - Port number
SSL - If SSL is enabled use this
H - displays the usage information and exits the command.

Example:- 

./datamodel.sh downloadrpd -O liverpd.rpd -W Admin123 -SI ssi -U weblogic -P Admin123 




Uploadrpd command

Syntax

uploadrpd -I <RPDname> [-W <RPDpwd>] -SI <service_instance> -U <cred_username> [-P <cred_password>] [-S <hostname>] [-N <port_number>] [-SSL] [-H]

I - RPD name you are uploading
W - Password for RPD download mandatory, if not specified in command will ask when we run it.
SI - Service Instance Name
U - OBIEE username
P  - Password for the OBIEE Username
All the above are Mandatory, where as the below are needed if you are using the command from a client installation
S - OBIEE server name
N - Port number
SSL - If SSL is enabled use this
H - displays the usage information and exits the command.

Example:- 

./datamodel.sh uploadrpd -I liverpd.rpd -W Admin123 -SI ssi -U weblogic -P Admin123




Thursday, December 1, 2016

OBIEE 12c : Export and Import Service Instance (BAR) files

This is once of the best features in OBIEE 12c, FYI my system is on 12.2.1.1. The way you can export your RPD, catalog, security model all at once without you having to worry about going to places and backing up files is just AWESOME.

I will keep it as simple as possible, BI Application Archive Files (BAR) are just like zip files but in BI application readable format. The basic idea behind this concept is to enable us to migrate the RPD, Catalog and Security Model all at once, to keep it simple. Its a command line utility and there is no other way around it.

First thing is to understand that it is a WebLogic Scripting Tool (WLST) utility, and can be executed only against it. To open a WLST command line utility open the below location on command prompt.

[ORACLE_HOME]/oracle_common/common/bin/

and run the file wlst.sh using the ./wlst.sh


Now before we start we need to know few details like DOMAIN_HOME, Service Instance Name, Administrator Username/Password which are already available as part of installation. Now we need two directories (for export) one for TempWorkSpace and other for saving the Exported BAR file.

Giving mine for an idea

DOMAIN_HOME/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi

Service Instance Name = ssi (definitely this one if dont know what it is)

you can find the same using the listBIServiceInstances('[DOMAIN_HOME') command where it will display the key.

Work Dir/userhome/oracle/Desktop/BARWorkDir 

Export Dir/userhome/oracle/Desktop/BARExpDir


We have prepared enough and now its time for action, Invoke the wlst.sh file and it will start in offline mode, dont worry about offline lets take it for another day. Today only concentrate on import and export Service instances.

The magical commands at last exportServiceInstance()    and  importServiceInstance() , definitely not expected them to be so simple when they are doing so much.

All the wlst commands are case sensitive so you must remember them as is. Let s see how to use.


exportServiceInstance()

Obviously this will export the service instance with RPD, Webcatalog and security info without any question, but we will need to specify some parameters to it, there are 9 of them, 4 mandatory.

1st -- DOMAIN _HOME
2nd -- Service Insatnce Name
3rd -- Work Dir
4th -- Export Dir
5th -- No Use as of now, Future Use
6th -- no Use as of now, Future Use
7th -- no Use as of now, Future Use
8th -- true or false ( will decide on exporting user specific info like personal folders etc)
9th -- Password for exporting DB credentials, if not given then DB details are not exported

Now we can either go for 1-4 and leave rest as below

exportServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARWorkDir','/userhome/oraclebi/Desktop/BARExpDir')

or leave the 6,7 and 8 as blanks and give 8th and 9th as below

exportServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARWorkDir','/userhome/oraclebi/Desktop/BARExpDir','','','',true,'Admin123')

Both the cases a Folder is created in Export Dir, with data and time as folder name with a file generally as ssi.bar , You are done by the way.

importServiceInstance()

So no more explaining on what it does, we look at how to get it done directly. Even import command needs some parameters 7 on the whole and 3 mandatory

1st -- DOMAIN_HOME
2nd -- Service Instance Name
3rd -- BAR file location with name
4th - Boolean to import RPD
5th -- Boolean to import Catalog
6th -- Boolean for User info
7th -- Password for DB credentials import

Now lets just use 3 , to get the RPD and catalog imported as below

importServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oracle/Desktop/BARExpDir/20161130_151519/ssi.bar')

To get everything imported from BAR file use below

importServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARExpDir/20161130_151519/ssi.bar','true','true','true','Admin123')

You can change the 4,5 & 6 Boolean parameters as per your need. Oracle doesn't say anything about restarts after the Import but i did notice some inconsistencies it can be anything may not be even related at all, but i did a restart of services. You can too if had a chance.

OBIEE 11g - Find where the RCU schemas are hosted

Many of the times i hear people asking for details of the database where the RCU schemas are hosted. Its hard when the system is there for sometime and people who have installed BI would have left and responsibilities have shifted to others and so on you tend to forget the details.

But we always have the details within OBIEE, the only problem is many of us are not aware where to look. I my self suffered for sometime to find this out.

Login to Enterprise Manager, using the URL   http://hostname:portno/em

Now as soon as you Login you will see two icons Farm and Topology right Below the Oracle logo. Adding image to save your time.

Clicking on Topology will lead you to an architectural diagram where you will see a database with the JDBC connection details as below


Now from the URL, jdbc:oracle:thin:@Pied-PC:1521/ORCL we can get the below details.

Hostname of Database : Pied-PC
Port of Database : 1521
Service Name : ORCL

Now all it takes is login details , which ofcourse you cannot find in OBIEE. We can find only the user name of BIPLATFORM schema from the below location

Business Intelligence --> Corepplication --> Deployment --> Scheduler 


I'm sure it comes in handy especially if you are new to Administration.

OBIEE 12c - Display Images to Show the Trend

OBIEE 12c has not only changed in terms of  architecture,but also in the way we do reporting. Everything has become so simple and easy to understand (of course if you have know earlier versions well). The display of images next to data  to instantly understand the trend is one of the ways. Earlier version the same can be done but we have to do a bit of ground work for that, 12c gets it done a lot easier.

Let me consider a small report as shown in image below, where we display the Year, Office , Revenue and Target Revenue. Which is quite simple.

Now we have a lot more ways to highlight the data to show if the Revenue as met the Target.


Write a conditional format where you check if Revenue is higher than Target Revenue then Display in Green and if not in Red as shown below.



This looks good where as not presentable, you cant show red and green in presentations, it will be far better if we can use some arrows with Green and directed upwards for green and Red with looking down.  This can be achieved using the Image option given in Column Format.

I will write a small conditional Format on the column Revenue to fullfill this. 



Similarly for downward trend select a Red arrow going down. The report will look like below.



There are three options on the position of image, Left, Right and Image Only.

Left  -  to display the image on the Left on Data Value
Right - to display the Image on the Right of Data Value , which is also the system default

Image Only - to display the image alone and suppress the Data Value from the Report, Like Below.





Hope this helped !