Showing posts with label RPD. Show all posts
Showing posts with label RPD. Show all posts

Wednesday, November 9, 2016

Writeback with dropdown feature in OBIEE Report

In this blog we will see how to enable Writeback in OBIEE and one example like where users will be given option to choose values from dropdown to select any one and update in backend rather than typing in freeform text field in the OBIEE report. We will use Jquery to achieve it.
Below are the high level steps to enable write back in OBIEE.
·         File level configurations
·         RPD changes
·         Report changes

File level configurations

Step 1: Edit instanceconfig.xml
Here is the path to find instanceconfig.xml file
<Middleware>/instances/instance1/config/OracleBIPresentationServicesComponent/coreapplication_obipsn
And add below line under <DSN>
<LightWriteBack >true</LightWriteBack >
Step 2. Create WriteBack template  
We need to provide a template to the BI Server so that it will handle the writeback operation based on logic provided in template.
And place this template in below location in the Middleware server.
<Middleware>/instances/instance1/bifoundation/OracleBIPresentationServicesComponent/coreapplication_obips1/analyticsRes/customMessages

 Sample template code

<?xml version="1.0" encoding="utf-8" ?>
<WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
<WebMessageTable lang="en-us" system="WriteBack" table="Messages">
   <WebMessage name="Update_Comments">
     <XML>
      <writeBack connectionPool="Oracle Data Warehouse Connection Pool">
          <insert> </insert>
          <update>UPDATE EMPLOYEES set COMMENTS='@2' WHERE EMP_NAME='@1'</update>
<!-- Identify the columns that are to be referenced. We can use the column position like @1 for first column, or by column id as you see them in the XML definition/Table view. -->
        </writeBack>
      </XML>
    </WebMessage>
</WebMessageTable>
</WebMessageTables>


And name it like anything let say WriteBackTemplate.xml and copy to customMessages folder in the server.  

RPD Changes

Step 3: Enable Write Back in the RPD logical column
Navigate to to BMM table and expand column which you want to use for writeback
And enable the Writable checkbox under general table of logical column.










 
 
 
Step 4: Set Read/Write permission to Writable column
Navigate to Subject Area-> Presentation Table-> Writeable column (here column is comments in our example)

Double click on Permissions and select Read/Write for the application role for which you like to enable writeback feature










 






 






 
 
Here for BIAdministrator Read/Write permission enabled on this writable column.So that any user with this application role can writeback data from obiee report.

Step 5. Allow “Execute Direct Database Request” to database.
We need to set the permission to application role so that user with role should be able to contact database for insert/update data in backend.

Navigate Manage > Identity > Application Roles > BIAdministrator > Permission>Query Limits tab
And select “Execute Direct Database Requests” to Allow for the Database where in which you writable table or column    .




















 





Step 6. Disable Cacheable option for physical table.
Navigate to Physical Table and uncheck Cacheable checkbox.

Step 7. Grant Writeback privilege to Apllication Role or Users
Login Analytics and navigate to Administrator->Manage Privileges
And search for Write Back property and “Write Back to Database”
Grant access to BIAdministrator role 


Report Changes


Step 8. Create a OBIEE report
Create a report on this subject area and pull employee name and comments and another dummy column (Select Comment)

Note: Here Comments is the real write back column.whatever the value we select from the dropdown will be updated into this writeback column.
 


 






 


Here we will use the JQuery to display drop-down on "Select Comment" column
 
Edit formula and add below code.

'<select id="user_comment" onchange=obipswb.Grid.Change(event)>
<option value="No Comment">Select Comment</option>
<option value="Good">Good</option>
<option value="Bad">Bad</option>
</select>'
 













Make sure you selected checkbox for “Contains HTML markup”.

On clicking OK then it thrown error as 






We can ignore this error and proceed further.

Next override default data format to HTML.




Now enable Writeback to the Comments column










 


Create Table view and place this drop down column at second position in view (since we used @2 to update the value in the backend table).
Open table properties and provide WebMessage name (This should be taken from your WriteBackTemplate.xml).



Check the report to test WriteBack feature.



















Once you select any value from dropdown  then Apply button will be enabled and record can be updated on clicking apply. Note that drop-down column will not be updated with value you selceted and you can only see this value in the next column "Comments" which is write back column.ON clicking apply report will be refreshed and new value will be displayed on report.

Thursday, June 5, 2014

Usage Tracking Setup after Upgrade from 10g to 11g

The Oracle BI Server supports the collection of usage tracking data. When usage tracking is enabled, the Oracle BI Server collects usage tracking data for each query, and it writes statistics to a usage tracking log file or inserts them directly into a database table.
After upgrading 10 g to 11g , need to manually setup Usage tracking in new 11g environment. There are two ways
i)Still we can use old existing tables to write Usage information
ii)New schema DEV_BIPLATFORM can be used(Usage Tracking tables will be installed during the RCU installation)
This blog covers first case where Old existing tables can be used for Usage tracking. Below are the steps needed to be performed to enable Usage Tracking on existing 10g tables.
1. Check table structure of S_NQ_ACCT table in both 10g warehouse(existing) and 11g DEV_BIPLATFORM schema.(Here we can find some difference)
2. Alter old table S_NQ_ACCT structure to in synch with 11g table.
3. Add new columns in RPD S_NQ_ACCT table
4.Eanable Usage Tracking in Enterprise Manager
1. Checking S_NQ_ACCT table structure
In order to reuse the existing Usage Tracking tables , we have to make sure tables structure should be same in both 10g and 11g schemas.
Login to 10 g warehouse and describe S_NQ_ACCT
DESC S_NQ_ACCT
Name Null Type
—————— ——– ————–
USER_NAME
VARCHAR2(128)
REPOSITORY_NAME
VARCHAR2(128)
SUBJECT_AREA_NAME
VARCHAR2(128)
NODE_ID
VARCHAR2(15)
START_TS
DATE
START_DT
DATE
START_HOUR_MIN
CHAR(5)
END_TS
DATE
END_DT
DATE
END_HOUR_MIN
CHAR(5)
QUERY_TEXT
VARCHAR2(1024)
SUCCESS_FLG
NUMBER(10)
ROW_COUNT
NUMBER(10)
TOTAL_TIME_SEC
NUMBER(10)
COMPILE_TIME_SEC
NUMBER(10)
NUM_DB_QUERY
NUMBER(10)
CUM_DB_TIME_SEC
NUMBER(10)
CUM_NUM_DB_ROW
NUMBER(10)
CACHE_IND_FLG NOT NULL CHAR(1)
QUERY_SRC_CD
VARCHAR2(30)
SAW_SRC_PATH
VARCHAR2(250)
SAW_DASHBOARD
VARCHAR2(150)
SAW_DASHBOARD_PG
VARCHAR2(150)
PRESENTATION_NAME
VARCHAR2(128)
ERROR_TEXT
VARCHAR2(250)
RUNAS_USER_NAME
VARCHAR2(128)
NUM_CACHE_INSERTED
NUMBER(10)
NUM_CACHE_HITS
NUMBER(10)
Login to DEV_BIPLATFORM  schema in 11g  and do describe on S_NQ_ACCT.
DESC S_NQ_ACCT
Name Null Type
———————- ——– ————–
USER_NAME
VARCHAR2(128)
REPOSITORY_NAME
VARCHAR2(128)
SUBJECT_AREA_NAME
VARCHAR2(128)
NODE_ID
VARCHAR2(50)
START_TS
DATE
START_DT
DATE
START_HOUR_MIN
CHAR(5)
END_TS
DATE
END_DT
DATE
END_HOUR_MIN
CHAR(5)
QUERY_TEXT
VARCHAR2(1024)
QUERY_BLOB
CLOB
QUERY_KEY
VARCHAR2(128)
SUCCESS_FLG
NUMBER(10)
ROW_COUNT
NUMBER(20)
TOTAL_TIME_SEC
NUMBER(10)
COMPILE_TIME_SEC
NUMBER(10)
NUM_DB_QUERY
NUMBER(10)
CUM_DB_TIME_SEC
NUMBER(10)
CUM_NUM_DB_ROW
NUMBER(20)
CACHE_IND_FLG NOT NULL CHAR(1)
QUERY_SRC_CD
VARCHAR2(30)
SAW_SRC_PATH
VARCHAR2(250)
SAW_DASHBOARD
VARCHAR2(150)
SAW_DASHBOARD_PG
VARCHAR2(150)
PRESENTATION_NAME
VARCHAR2(128)
ERROR_TEXT
VARCHAR2(250)
IMPERSONATOR_USER_NAME VARCHAR2(128)
NUM_CACHE_INSERTED
NUMBER(10)
NUM_CACHE_HITS
NUMBER(10)
ID NOT NULL VARCHAR2(50)
Here columns  in maroon color are existed in 10 g warehouse tables, but need to be altered in terms of length and column rename.
Columns which are in Green color completely new in 11g,So these columns need to be added into existing old tables.
2. Alter old table S_NQ_ACCT structure to in synch with 11g table.
To synch 10 g usage tracking tables with 11g tables, need to perform below alterations on the 10g usage tracking tables.
ALTER TABLE S_NQ_ACCT MODIFY NODE_ID VARCHAR2(50);
ALTER TABLE S_NQ_ACCT MODIFY ROW_COUNT NUMBER(20);
ALTER TABLE S_NQ_ACCT MODIFY CUM_NUM_DB_ROW NUMBER(20);
ALTER TABLE S_NQ_ACCT RENAME COLUMN RUNAS_USER_NAME TO IMPERSONATOR_USER_NAME;
ALTER TABLE S_NQ_ACCT ADD (ID VARCHAR2(50) NOT NULL,QUERY_BLOB CLOB,QUERY_KEY VARCHAR2(128));
COMMIT
3. Add new columns in RPD S_NQ_ACCT table
Open RPD in Offline ,Navigate to Physicala Database Oracle Analytics Usage->Catalog->dbo Add the IMPERSONATOR_USER_NAME,ID,QUERY_BLOB,QUERY_KEY columns to the S_NQ_ACCT table as shown below.
And Make sure Not Null checked for required columns.
 










































4.Enable Usage Tracking in Enterprise Manager

To Enable Usage Tracking in EM ,perform below steps.
  1. Log into EM.
  2. Select WebLogic Domain>bifoundation_domain from the left navigation pane.

























3.Click the WebLogic Domain drop-down list in the right pane.




























4.Select System MBean Browser from the list





















5.Expand Application Defined MBeans>oracle.biee.admin.
























6.Expand bifoundation_domain and select BIDomain
 
7.Lock the domain to update it. Expand BIDomain and select the BIDomain MBean where group=Service. Note: Expand Show MBean Information in the right pane.































 8.Click the Operation tab.




























9.Click the Lock link. On the Operation:lock page, click the Invoke button












10.Click the Return button.
11.Expand BIDomain.BIInstance.ServerConfiguration, and then select the BIDomain.BIInstance.ServerConfiguration MBean.



















12.Click the Attributes tab. Scroll down and click UsageTrackingCentrallyManaged. Set Value to true in the drop-down list.





 13.Click the Apply button. When you see the confirmation message for the update, click the Return button.
14.Similarly, set the UsageTrackingEnabled attribute to true to enable usage tracking














15.Set the UsageTrackingPhysicalTableName attribute to the name of the fully qualified database table for collecting query statistic information, as it appears in the Physical layer of the Oracle BI repository. In this example, it is set as follows: Oracle Analytics Usage “.”Catalog”.”dbo”.”S_NQ_ACCT”


 16.Set the UsageTrackingConnectionPool attribute to the name of the fully qualified connection pool for the query statistics database, as it appears in the Physical layer of the Oracle BI repository. In this example, it is set as follows: Oracle Analytics Usage “.”Usage Tracking Writer Connection Pool”

 













 17. 
Note: For usage tracking insertions to succeed, the connection pool must be configured with a user ID that has write access to the back-end database. Also, it is recommended that the connectivity type support international data.After applying your changes, release the lock on the domain, as follows:
    • Return to the BIDomain MBean where group=Service under oracle.biee.admin, Domain:bifoundation_domain, BIDomain.
    • Click the Operations tab.
    • Click one of the first commit operations.























18.Go to the Oracle Business Intelligence Instance page and click Restart All on the Availability>Processes tab to Restart all the services.

Wednesday, June 4, 2014

Hiding Consistency Check Warnings in RPD

We can hide selected warnings from the Consistency Check Manager. Just follow below steps.
1.Go to the following directory
ORACLE_INSTANCE/config/OracleBIServerComponent/coreapplication_obisn
2.In that directory, create a text file called warn_off.ini. This file must be in ASCII format.
3.List the warning numbers that you want to add to the exclusion list in the Consistency Check Warnings dialog:
[CCOptions]
CC_WARNINGS_LIST = 39024,39077
Note the following:
    • All excluded warnings must be on one line and can be separated by a comma, a semicolon, or a space.
    • You cannot exclude errors. You can only exclude warnings from the Consistency Check Manager.
    • If you add warning numbers from the default exclusion list (39009, 39054, 39055, 39057, and 39059), they are ignored.
4.Save and close the file.
5.Close and then re-open the Consistency Check Manager. The new warnings appear in the Consistency Check Warnings dialog and are selected by default, meaning that those warnings will be excluded from consistency checks.

Source : http://docs.oracle.com/cd/E23549_01/relnotes.1111/e10132/biee.htm
and Doc ID 1365964.1

Tuesday, October 18, 2011

[nQSError: 14026] Unable to navigate requested expression

Today I came across this error in analytics

Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: Dim - GL Balance Details.Accounted Currency Code. Please fix the metadata consistency warnings. (HY000)
To fix this error, I set the content tab for the fact table, in fact here Dim - GL Balance Details is a Degenerated Dimension (because LTS is the Fact table),Here the Physical Join existing as
"Dim - GL Balance Details"."Accounted Currency Code" = "Fact - Fins - GL Balance"."Debit Credit Indicator”
Dim - GL Balance Details has the LTS- Fact_W_GL_BALANCE_F
Fact - Fins - GL Balance has the LTS- Fact_W_GL_BALANCE_F
and Fact_W_GL_BALANCE_A
1.So Created a Dimensional Hierarchy Table - GL Balance Details with Total and Detail levels


2.Add the GL Balance Details Detail level to the Fact - Fins - GL Balance LTS(i.e Fact_W_GL_BALANCE_F and Fact_W_GL_BALANCE_A ) in the Content tab


Assign the GL Balance Details Total level to The Aggregate LTS Fact_W_GL_BALANCE_A

Wednesday, December 22, 2010

Multi-User Environment for OBIEE

Generally only one user can edit the repository at a time, but a more efficient environment would allow developers to modify the repository simultaneously and then check in changes. Oracle BI allows multiple developers to work on objects from the same repository during group development of Oracle BI applications.
Steps for configuring Oracle BI multi-user development environment:
1)Create Project
In the Admin tool, open the Project Manager

Path:-Select Manage > Projects and then Action > New project for creating new project.

From the figure down below, you can notice two parts, in the left you can see objects that are available for the project and the right part consists of objects that can be added in projects. Select the objects from the left part that you want to add to the project and click the Add button. If you have selected the presentation catalog, all fact and dependent objects are selected in the project.

Besides the catalog, other objects such as USER, groups, Variables and initialization blocks can also be added in projects. Apart from this, you can also remove unwanted objects from project by clicking the Remove button.
2) Set up a shared network directory
Administrator needs to identify or create a shared network directory that can be accessible to developers to keep the repository file at that location. This repository is the master repository which is accessible to multiple developers to check in or check out the changes done. Developer has to point to this directory path when they use Admin tool at their machine.
Making changes in the Admin tool at the local machine to use as a multi-user development environment:
1)Point to multi-user directory:
Set up for Admin tool to point multi-user development directory.

Path:-Select Tools > Options and then select Multiuser tab.

From the figure, it can be seen that it is a two field, one multi-user development directory in which you have to browse the path of the shared directory where the original repository has been kept for development purposes. The other field full name is optional, but if the user mentions name in that field, it helps in tracking the changes made by each user and stored in the HKEY_CURRENT_USER part of registry and is therefore unique for each login on computer.
2. Check out project:-
After pointing to the multi-user development , the directory developer can check out desired projects.

To check out projects, go to path File > Multiuser > Checkout which will be only available when the multi-user environment is setup. After this, the developer is presented with a dialog box to select the master repository if one has more than one repository. Select the repository , then enter user name and password, it will navigate to select the project or projects to be imported.

After selecting the projects, user must enter the name of the new repository which will be stored in user’s local directory.
3.Admin tool task during checkout:-
During checkout , the admin tool performs the following task:-

* Makes a temporary copy of the master repository on the local machine.
* Saves local copy of projects in the new repository on the local machine.
* Saves second local copy of project in the new repository on the l
local machine with prefix as “original”.
* Deletes temporary copy of the master repository from the local machine.
4. Changes done in metadata:-
Changes can be performed on logical tables, table definitions and logical table sources. Developers can work on the same project but if one developer deletes objects, it will be migrated without any warning. So developers should keep in mind that modifications can affect others too.
5. Tasks done during check-in:-
The Admin tool perform the process of locking the master repository to prevent other developers from attempting to merge at the same time and copies the master repository to a local directory so that the developer will be merging with the latest or recent repository.
6. Check in changes:-
After performing modifications on the repository, the developer needs to check in changes and merge with the master repository in the shared path. Only one developer at a time can merge it. After selecting File > Multi-user >Merge local changes, the developer is shown a dialog box having full name and the option to write comments if any and after clicking ok , the admin tool performs the process of copying master from shared and keeps it on the local machine.

After developers lock the master repository, the merge process take place. After the merge process, developers have to publish to the network. Go to path File >Multi-user >Publish to Network to publish changes done in the repository. This will finally merge local repository changes to the master repository and at the same time a local copy of the repository has been removed from the local machine.