Friday, September 26, 2014

What is SQL

SQL - Structured Query Language is a language of database, simply put its the language which a database can understand. SQL is an ANSI (American National Standards Institute) standard but there are many different versions of the SQL language.

What is SQL?

SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database. SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.

Also, they are using different dialects, such as:
  • MS SQL Server using T-SQL, 
  • Oracle using PL/SQL, 
  • MS Access version of SQL is called JET SQL (native format) etc. 
Why SQL? 
  • Allows users to access data in relational database management systems.
  • Allows users to describe the data. 
  • Allows users to define the data in database and manipulate that data. 
  • Allows to embed within other languages using SQL modules, libraries & pre-compilers. 
  • Allows users to create and drop databases and tables. 
  • Allows users to create view, stored procedure, functions in a database. 
  • Allows users to set permissions on tables, procedures, and views 
History:
  • 1970 -- Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He described a relational model for databases. 
  • 1974 -- Structured Query Language appeared. 
  • 1978 -- IBM worked to develop Codd's ideas and released a product named System/R. 
  • 1986 -- IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software and its later becoming Oracle. 
SQL Process:

When you are executing an SQL command for any RDBMS, the system determines the best way to carry out your request and SQL engine figures out how to interpret the task.There are various components included in the process. These components are Query Dispatcher, Optimization Engines, Classic Query Engine and SQL Query Engine, etc. Classic query engine handles all non-SQL queries but SQL query engine won't handle logical files.

Following is a simple diagram showing SQL Architecture:
SQL Architecture
SQL Commands:
The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP. These commands can be classified into groups based on their nature:

DDL - Data Definition Language:
CommandDescription
CREATECreates a new table, a view of a table, or other object in database
ALTERModifies an existing database object, such as a table.
DROPDeletes an entire table, a view of a table or other object in the database.
DML - Data Manipulation Language:
CommandDescription
SELECTRetrieves certain records from one or more tables
INSERTCreates a record
UPDATEModifies records
DELETEDeletes records
DCL - Data Control Language:
CommandDescription
GRANTGives a privilege to user
REVOKETakes back privileges granted from user

Monday, September 15, 2014

FAILED_CONTACTING_OPMN Unrecognized oracle instance id OBIEE 11g

This error bumped in when we upgraded the OBIEE 11.1.1.7 to the latest patch 11.1.1.7.140225 ,the problem is simple, Presentation server is not coming up along with the scheduler.

All others are doing fine. When we checked out the logs came across this error

FAILED_CONTACTING_OPMN  Unrecognized oracle instance id: instance1 


We never got to the root cause but was able to find the workaround solution, since the error says it is not able to recognize the instance ,we thought of registering the instance once again. Luckily it worked for us.Steps to follow.

We can use the OPMN command line to register the instance. After registering, restart all the services.


$ORACLE_INSTANCE/bin/opmnctl registerinstance 
 [-adminHost hostname] 
 [-adminPort weblogic_port] 
 [-adminUsername weblogic_admin] 
 [-adminPasswordFile 'FILE_WITH_WEBLOGIC_ADMIN_PASSWORD']



OBIEE 11g : What happens when a User Logs in ?

Did you ever wonder what is happening when a user logs in to OBIEE 11g , What exactly happens when he hits enter after entering credentials ,how the system components react to this action ,which component reacts first and what happens next, what is being invoked and what are getting retrieve and from where.  I used to have this question for a long time ,at last found the solution.

I just couldn't wait to share this....the picture speaks it all





OPSS - Oracle Platform Security Services

Friday, September 12, 2014

Hide Column Headings in OBIEE 11g

Sometimes there are some requirements where you have to hide the Column Headings, Now we will see how can we hide the headings with out doing anything unusual.


Just edit the View and go to the "Columns and Measures" section and go to the Layout Edit Properties. Uncheck or Deselect the "Display Heading" option.



This is simple option, to hide the heading with out doing any changes to the columns or their properties.

Set Log level and disable cache hit for single report in OBIEE 11g

Generally we do not have the Log Levels enabled in production environments because of the performance issues ,but when we are doing debugging we have the need for the query so we may have to enable log level for that particular report.

We could use the advanced tab to achieve this , just set the log level using the below line.

                  SET VARIABLE LOGLEVEL=5;

We may also have the need to disable cache hit. Use the below line for this

                 SET VARIABLE DISABLE_CACHE_HIT=1;
There will be time where we need to do both on same report ,then we can write as below

                 SET VARIABLE LOGLEVEL=5,DISABLE_CACHE_HIT=1;


Removing/Hiding Section borders in OBIEE 11g

This are always some requirements which want you to do some magic on the dashboard ...like hiding a section or a report for some purpose. The most common among these is removing the borders for a section.

This is a very straight forward requirement and also has a simple solution.

Add the display:hidden tag in the Css Style options in both the text boxes.

section properties -> Custom CSS style options ->  display:hidden


This will only disable the visibility of the borders ,this is not going to remove the border completely.

Thursday, September 11, 2014

No Results Issue Post upgrade to OBIEE 11.1.1.6 from OBIEE 10.1.3.4

I like the way people having fun with upgrades and issues, because experience is what it matters at the end of the day. If you cant learn from your experience , at least learn from some one else's.

I came across a interesting thing because of my friend who just did a upgrade from 10.1.3.4 to 11.1.1.6 , other than the general issues like aggregation failures and formatting changes he came across an issue with some of the reports.

No Results even though its available in DB and the 10g version is getting things done just fine.

We have investigated and found its a BUG 14084943

Bug 14084943 - REQUEST FOR HELP : REPORTS SHOW NO RESULTS AFTER UPGRADE

However there is workaround provided by Oracle for temporarily fixing the issue. The cause of this BUG is due to a feature called "Grouping Sets" that has been bought in with 11g to increase performance.

To fix the issue modify the database features in Repository (RPD) physical layer to remove the feature GROUP_BY_GROUPING_SETS_SUPPORTED.

After disabling this feature, the SQL generated in 11g should be almost the same than the one from 10g. This is a temporary workaround and the bug has been logged to identify the root cause and provide a fix