Saturday, 25 February 2012

Methodical Performance Tuning Part 2 by Arup Nanda: AIOUG webcast

Arup Nanda delivers yet again a useful webcast on Oracle performance tuning practices. This time he shows the utilization of V$ views to analyse the session level waits and statistics.

Download links are as below

http://arup.blogspot.in/2011/10/aioug-webcast-methodical-performance.html

http://arup.blogspot.in/2012/02/aioug-webcastmethodical-performance.html

Besides, the reviewing activities on "Book in Making" are going smooth. My regards to Ronald Rood, Kamran Agayev and Mohan Dutta, who are investing their efforts and valuable time in reviewing the book. Thanks for all  your responses on the book listing.

Saurabh

 

Sunday, 19 February 2012

Upgrading to Oracle 11gR2, presented by Syed Jaffar Hussain

Oracle ACE Director Syed Jaffer Hussain presents a webinar on upgrading database systems to Oracle 11gR2.

http://www.youtube.com/watch?v=QcH7Z3w2AbM

Have a learning and enjoyable experience

Thanks

Saurabh

 

Wednesday, 1 February 2012

Discovering the Author within me: My upcoming book

Happily I would announce the listing of my upcoming book at PacktPub publishers website. The book is expected to be released by May, 2012.

The book is for the Oracle Associate professionals who are aspiring for Professional level exam (1Z0-146 certification).

"The Oracle Advanced PL/SQL Developer Professional Guide helps you master advanced PL/SQL concepts. Besides the clear and precise explanation on advanced topics, it also contains example code and demonstrations, which gives a sense of application and usage to readers. The book gives a deep insight that will help transform readers from mid-level programmers to professional database developers. It aims to cover the advanced features of PL/SQL for designing and optimizing PL/SQL code."--From PacktPub webpage

http://www.packtpub.com/oracle-advanced-pl-sql-developer-professional-guide/book

Wait until May but surely book your copies in advance.

Thanks to Oracle and Luv u All,

Saurabh

Saturday, 28 January 2012

A Conversation with Hans Forbrich

Hans Forbrich, an Oracle ACE Director, talks about his path to becoming a prized speaker at Oracle User Group meetings around the world.

http://medianetwork.oracle.com/video/player/961894745001

Enjoy all

Saurabh

Tuesday, 17 January 2012

Revise Partitioning Concepts in Oracle

Hi all,

Partitioning is one of the most stable, proven and efficient features of Oracle. It defines proper segregated format of data management along with boosting up the query performance. Recently, I published my article on Partitioning concepts at Exforsys. The article covers theoretical concepts involved in the feature. Continue reading the complete story from the below link

http://www.exforsys.com/tutorials/oracle-11g/oracle-partitioning-overview.html

Hope you all enjoy the reading. Post your feedback and comments.

Thanks all. I'll be back with some more news and sharings. Bye for now

Saurabh

Thursday, 29 December 2011

Warm wishes for New Year 2012

Hi All,

Before the dawn reaches the dusk, before the verticals meets horizons, let us together welcome a New Year of warmth, prosperity and growth.

May the yer 2012 brings all greats, loads of love, happiness, and ample of opportunities of growth and survival.



SbhOracle would enter into its second year. 2011 has been a great year of establishment, reachability and credibility. And yes, it made a mark in alot more interactions in techworld.

Happy New year in Advance!!

Love you all,

Saurabh

Saturday, 24 December 2011

My publication at RMOUG SQL> Update


 Hi Guyzz,

Finally I made my publication into Winter issue of SQL>Update, the quartely journal of RMOUG. Thanks to Peggy King and Pat Van Buskirk for the great work and support in the process. Really it looks as an achievement to share the cover page with Tom Kyte  (Ask Tom)

 





 

 

 

 

 

 

 

 

 

My article reads about Inheritance in Oracle. As one of my earlier post talks about the abstract, the paper show the implementation of object model with a sample case study and forecasts it as an upcoming data model. Surely, the object model comfortably fits into OOPs based application requirements and offers better integration too.

You can find the complete story of the paper from the below link

Inheritance in Oracle by Saurabh Gupta (SQL Update Winter11 Issue RMOUG)

Do post your commets and feedback/suggestions. See you RMOUG again in Spring Issue.

Bye for now

Saurabh

 

Saturday, 17 December 2011

Sangam11 pics

Here I come with the pics from Sangam11

[gallery link="file" columns="1"]

Enjoy

Sunday, 11 December 2011

AIOUG Sangam 11

Hi Guyzzz

Just back from AIOUG Sangam11. Wonderful effort, event, sessions and most important grrat stage to share with some great names. Arup Nanda, Murali Vallath, Kuassi Mensah and many more. Kudos to the arrangement and and event management too.



The Day 1 (9th Dec) started off with registration. Was glad to see our bags and great material. Saw Murali at the doorstep and the day started off.

Murali addressed the session and thanked the event management team and introduced Arup to kick off the session. Arup Nanda 'The LONGTIME DBA' was the Show Stopper of the whole event. And he should be !!

Rich Niemiec started off with a session on Rolta. He showed us some pics of Oracle Corp...was amazed to be the part of it.





 

 

 

 

 

 



Arup started off with a session on Profiler in PL/SQL. Great sessions, great views and great information. Kuassi Mensah delivered a nice session on Oracle Net security. Murali too gave a presentation on RAC subject, but couldn't catch up match as I have no background. Hemant came up with the day to day challenges of a DBA, their role and expectations. Fabulous !!

Day 2 (10th Dec) again saw a long session from Arup until Lunch. Superb stamina and grasp !! Got to know some new concepts on Cache fusion, DBA best practices, and introduced the logic behind Exdata. I could see the roadmap of DBA to DMA (Database Machine Administrator). Again a good one!!

Meanwhile I got introduced to Arup Nanda with a handshake and told him about myself. Told him about my online works and he asked me to get in touch for SELECT journal too. Nice chat time !!

Later I attended session by Hemant on Partitioning. Though it was an elementary one but enough to fill up 1 hour session. The next session by Prabhakar Gongloor was another masterpiece where he showed some screendumps of Oracle 12C. I believe we would be only of those few ones who could see it within 2 months of the version release. I could see him hiding something by saying its 'Special Technique' through which EM can connect to DB even if it is down (as far as I could understand).

As I referred one of my colleague for the seminar, I received a coupon worth INR500, redeemable on the same day against the books at the counter. I got one copy of Oracle XML DB.

The conference ended with photo sessions. I too got few with Arup, Bryn, Rich and Mensah. Soon I would publish on my blog. Received a Tshirt from OTN too.

Next year, it would be in August, 2012...I will be happy to volunteer the event and would surely like to see myself at the stage right there :)

Once again, Thanks Oracle, Thanks AIOUG !!

By for now

Saurabh

Friday, 25 November 2011

Register for Sangam 2011 at AIOUG



Don't miss chance to meet ACEs and some great Oracle DBA and Developer sessions.

Sangam 2011.

See you all there !!

Thursday, 17 November 2011

Create a table with only scale specification for a column

Hi All,

Just came across a peculiar way of specifying only the column scale and not its precision, so thought of sharing with all. It looks pretty simple but could be a handy tip for table designs.

Scenario: Create a table CONT_EMPS where Salary column must store values upto 2 places of decimals (i.e. scale is 2). Here, note that no precision has been specified for the Salary column. Lets see how to do it.

SQL> CREATE TABLE CONT_EMPS
2 (EMPID NUMBER,
3 EMPNAME VARCHAR2(256),
4 SAL NUMBER(*,2))
5 /
Table created.


SQL> DESC CONT_EMPS
Name         Null?    Type
------------ -------- ----------------------------
EMPID                 NUMBER
EMPNAME               VARCHAR2(256)
SAL                   NUMBER(38,2)


When I specify '*' in place of precision, Oracle treats it as the maximum precision allowed for the column. Additionally, this convention doesn't applies to PL/SQL data type declaration.
 
Bye for now.
Saurabh

Related articles

Sunday, 6 November 2011

PL/Scope and PL/SQL Hierarchical Profiler in Oracle 11g

Hello world,

Ever since the release of Oracle 11gR2 in 2009 under the theme "Consolidate. Compress. Control", its new features have always been the talk of the conferences and meetings. But besides the compression, control and other development features, there were several other features which have got less weightage. I shall present my walkthrough experience in the below link (which has been published by Exforsys).

PL/Scope and DBMS_HPROF

Hope you enjoy reading the complete story and post your feedback and comments.

Thanks, bye

Saurabh


Saturday, 5 November 2011

Enable Encryption for SecureFiles

Last week, I was trying to enable ENCRYPTION property for Oracle 11g Secure File. But I couldn’t find sufficient information on the web. However, I have tried it now and would like to demonstrate on my blog.

Suppose I have a table EMPLOYEES where employees image (BLOB) has to be loaded into the database. You want to compress it and encrypt it as per AES192 encryption standard.

 Let us see how to do it. 

1. Compression can be easily enabled for the BLOB as below

ALTER TABLE EMPLOYEES
MODIFY LOB (IMAGE)
(
COMPRESS HIGH
)
/

Table altered.


2. Enabling the encryption feature for the IMAGE column in EMPLOYEES table

The TDE is an encryption system which encrypts the columns value with a confidential key. An encrypted key can hold multiple encrypted columns of same table. There exists second level of security where the column keys are again encrypted with database’s master key. But note that none of the keys are stored in database. They reside within an Oracle wallet. An encryption wallet has to be set as an external security module before enabling the feature for the LOB column.

Step 1: Create a Folder C:\ExternalSecurity\Wallets\ on the Oracle database server to store the Transparent Data Encryption (TDE) wallet.



Step 2: Edit the SQLNET.ora file at \\ORACLE_HOME\NETWORK\ADMIN location on the server. Include the ENCRYPTION_WALLET_LOCATION to indicate the location of the TDE wallet.

ENCRYPTION_WALLET_LOCATION=
(SOURCE=(METHOD=FILE)
(METHOD_DATA= (DIRECTORY= C:\ExternalSecurity\Wallets)
)
)




Step 3: Open the command prompt on the server machine to reload the server

Reload the Listener using RELOAD command




Step 4: Now login as DBA

Set the encryption key along with its password

SQL> ALTER system SET ENCRYPTION KEY IDENTIFIED BY "wallet";

System altered.


The ALTER SYSTEM command above keeps the wallet open until the database is up. If the database is down and restarted subsequently, the wallet has to be explicitly opened.

The error message raised below is not an error since the wallet gets automatically opened while setting

SQL> ALTER system SET ENCRYPTION WALLET OPEN IDENTIFIED BY "wallet";
ALTER system SET ENCRYPTION WALLET OPEN IDENTIFIED BY "wallet"
*
ERROR at line 1:
ORA-28354: wallet already open


Step 5: Login as SCOTT user

Enter user-name: SCOTT/TIGER
SQL> ALTER TABLE EMPLOYEES
2 MODIFY
3 (
4 IMAGE ENCRYPT USING 'AES192'
5 );

Table altered.

SQL> SELECT *
2 FROM user_encrypted_columns;

TABLE_NAME COLUMN_NAME ENCRYPTION_ALG SAL INTEGRITY_AL
---------- -------------- ----------------------------- --- ------------
EMPLOYEES IMAGE AES 192 bits key YES SHA-1


Step 6: Verify the server wallet location. Check the ENCRYPTED WALLET LOCATION directory. You can find the ewallet.p12 filer created.



Note that the table carrying encrypted column(s) cannot participate in conventional export or import process. But data pump rescues the situation by supporting encrypted exports and imports.

Tuesday, 25 October 2011

Happy Diwali to all

Dear All,
I wish you all a very happy, safe, cracking, sparkling and colourful Diwali.  Have a great year ahead !!!

 



[caption id="attachment_268" align="alignleft" width="111" caption="India breaks away"]India breaks away[/caption]


 

 

 

 

Indian cricket has already gifted the Diwali gift with cracking clean sweep over England :)

 
 

 

Monday, 24 October 2011

Protect your database with VPD

Hi All,

Database security is an important aspect of database management and administration. Several database security solutions have been designed to prevent database from corruption, hacking threats, and unauthorized data access.

 Fine Grained Access Control (FGAC) is one of the security approaches which allow the logical and virtual partition of a database. In a multi user database environment, it becomes cumbersome activity to segregate schema and thus the data, based on user roles. Therefore, a security policy was required which can apply row level security and allows the current user to access only authorized data. For example, in an EMPLOYEE database, all managers can access only Managerial data, all HRs can view only HR related data and so on.

FGAC is also known as Virtual Private Database. It is because fine grained access can only be achieved after the database has been ‘virtually privatized’ for a user.

Thanks to Exforsys for publishing the paper. Read the complete story in the below link

Implement VPD in your database

Do post your comments/queries/feedback.

Saurabh

Thursday, 20 October 2011

Result Caching feature in Oracle 11g

Caching has always been the pick of the programmers world. These days applications formulate and maintain different strategy for Cache Manager. Database presents an efficient cache manager which is capable of caching the SQL query results, PL/SQL functions results and client OCI result cache.

In earlier versions of Oracle, caching mechanism was limited up to architectural concepts, but Oracle 11g makes it a programmer’s tool to explicitly govern the application performance.

My obligations to Exforsys to publish my write up on result cache feature in Oracle 11g

Read Result Cache in Oracle 11g

I 'll be back with some more new findings.

Bye, SBH

Tuesday, 18 October 2011

PLSQL_OPTIMIZE_LEVEL: The optimization strategy of Oracle

Oracle initialization parameter PLSQL_OPTIMIZE_LEVEL

The parameter was introduced in Oracle 10g to decide the level of optimization applicable for a program unit during compilation. The optimization during compilation means the removal of dead code, code movements to optimize iterative constructs, inline the calls if required, and choosing the best philosophy to optimally compile the program.

It is set by the DBA at system, session and object level. It is the object compilation parameter which is retained by the object library unit. It can be queried in USER_PLSQL_OBJECT_SETTINGS view for a given object.

Prior to 11g release, the parameter could accommodate only three valid values i.e. 0, 1, and 2. Oracle 11g introduced an additional optimization level 3. By default, the parameter value is 2. The compiler’s effort is directly proportional to the parameter value i.e. more the value, more the compiler’s effort.

It can be set using ALTER [SYSTEM | SESSON] command as shown below

/*To view the current parameter setting*/

Conn / as SYSDBA
Connected.

SQL> show parameter plsql_optimize_level

NAME TYPE VALUE
------------------------------------ ----------- -----------------
plsql_optimize_level integer 2

/*Modify the setting for the current session*/
ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 1
/

Session altered.

The description for each value is as below

Case 1: PLSQL_OPTIMIZE_LEVEL = 0

This level represents ‘No Optimization’ mode of the compiler. The compiler only maintains the code evaluation order and executes it without any efforts on code optimization.

Let us write a small program and compare the same with other optimization levels also

Scenario: In your application, you have to give insert a delay of approx 1 second during some user operations. You create a program which runs a large loop to delay the control transfer.

Conn / as sysdba
Connected.


ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 0;

Session altered.

DECLARE
L_START_TIME NUMBER;
L_END_TIME NUMBER;
A NUMBER; B NUMBER; C NUMBER;
BEGIN
L_START_TIME := DBMS_UTILITY.GET_TIME();
FOR I IN 1..1000000000
LOOP
A := 1;
B := 1;
C := A+1;
END LOOP;
L_END_TIME := DBMS_UTILITY.GET_TIME();
DBMS_OUTPUT.PUT_LINE('Execution time:'||TO_CHAR(L_END_TIME - L_START_TIME));
END;
/

Execution time:19294

PL/SQL procedure successfully completed.

Case 2: PLSQL_OPTIMIZE_LEVEL = 1

This level represents ‘Elementary and eliminative Optimization’ level by maintaining the same code order. The compiler optimizes the code by eliminating the code of irrelevant logic.

We shall re execute the previous PL/SQL block and check the difference.

Conn / as sysdba
Connected.


ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 1;

Session altered.

DECLARE
L_START_TIME NUMBER;
L_END_TIME NUMBER;
A NUMBER; B NUMBER; C NUMBER;
BEGIN
L_START_TIME := DBMS_UTILITY.GET_TIME();
FOR I IN 1..1000000000
LOOP
A := 1;
B := 1;
C := A+1;
END LOOP;
L_END_TIME := DBMS_UTILITY.GET_TIME();
DBMS_OUTPUT.PUT_LINE('Execution time:'||TO_CHAR(L_END_TIME - L_START_TIME));
END;
/

Execution time:7112

PL/SQL procedure successfully completed.

Note that the execution time has reduced by 60% during this optimization level.

Case 3: PLSQL_OPTIMIZE_LEVEL = 2

This is the standard level of optimization where the compiler intelligently does the code refactoring and uses advanced optimization techniques to modify the code structure in order to achieve the best.

Re executing the previous PL/SQL block to compare the ‘Execution time’ results.

Conn / as sysdba
Connected.


ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 2;

Session altered.

DECLARE
L_START_TIME NUMBER;
L_END_TIME NUMBER;
A NUMBER; B NUMBER; C NUMBER;
BEGIN
L_START_TIME := DBMS_UTILITY.GET_TIME();
FOR I IN 1..1000000000
LOOP
A := 1;
B := 1;
C := A+1;
END LOOP;
L_END_TIME := DBMS_UTILITY.GET_TIME();
DBMS_OUTPUT.PUT_LINE('Execution time:'||TO_CHAR(L_END_TIME - L_START_TIME));
END;
/

Execution time:0

PL/SQL procedure successfully completed.

Just observe the incredible intelligence of the PL/SQL compiler. The complete code has been re-structured. Analytically, the code inside the FOR loop is not relevant to the loop. So it has been moved outside the loop and now, the loop is completely ignored by the compiler. Therefore, the execution time comes out to be zero.

Case 4: PLSQL_OPTIMIZE_LEVEL = 3

This is the latest optimization level introduced in Oracle 11g. It is a sort of ‘Forced’ optimization level, which Oracle terms as ‘High Priority’ optimization. The code optimizer does the code refactoring and automatically inlines all program calls in the program unit.

Conn / as sysdba
Connected.


ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 3;

Session altered.

As mentioned earlier, the parameter is treated as the object compilation factors. Hence it is stored in the object library unit and can be queried in
[ALL | DBA | USER]_PLSQL_OBJECT_SETTINGS.

Refer Oracle 11g Documentation on the topic

Friday, 14 October 2011

My RMOUG abstract (Inheritance in Oracle)


Duke, the Java Mascot, in the waving pose. Duk...

 




Inheritance in Oracle: Exploring the Descendents
"The Abstract Object model of database is an under implemented and commercially unexplored flavor of database. In the late 1980s, relational model of Oracle faced several deficiencies, which forced the evolution of Object model. Undoubtedly, relational model did all well for flat data storage, maintenance of integral data, and information security but could not offer concrete approach to accommodate complex data structures of nested, hierarchical, and extensible type. These subtle restrictions led the adoption of OOPs concepts in database systems.

Object oriented model of database carries the essence of object oriented concepts like Inheritance, data instantiation and abstraction, and establishment of relationships among types. It ensures persistent data management, effective compatibility and integration with OOPs supported languages like C++, and JAVA, which are the best market flavors of application development.

The article shall be a fair effort to explore the Object model of Oracle. The scope of the study shall include the evolutionary background, comparative drive with RDBMS, commercial study and a lot more details. I shall present a sample case study to highlight the structure building implementation and demonstrate the working of common data tasks."

I shall post the link once the paper gets published at RMOUG journal.

Bye for now, SBH


Monday, 26 September 2011

Refresh constraints

 




[caption id="" align="alignright" width="158" caption="Image via CrunchBase"]Image representing Oracle Corporation as depic...[/caption]




Constraints are one of the fundamental concepts, which arrive at a very elementary stage of Database designing. Constraints are nothing but the rules on the data. This preserves the Entity integrity, Referential Integrity, and Domain Integrity of the data. While entity integrity focusses on uniqueness and NULLable property of a data, referential checks the data of a column 'in reference to' its parent column. Domain integrity defines a domain set for a column.

 They are imposed upon the table columns, where they act as barrier for the incoming data. Once the checks are activated, only the obedient data is allowed to grab the seat. System raises the 'Violating' exception, if the data fails the constraint rule.

My obligations to DBANotes.com, who published the content. Read the complete paper at the below link.

 http://www.dbanotes.com/database-development/understanding-oracle-11g-constraints/

Do post your feedback/comments/queries.

Saurabh

 

Tuesday, 13 September 2011

OakTable User Account

Hi,

Today, my user account at OakTable network(http://www.oaktable.net) has been approved. Just to share with you all, I am happy to be the subscribed user of OakTable N/W.
Thanks OakTable and Thanks all

SBH

[caption id="attachment_190" align="alignnone" width="150" caption=" "][/caption]

Sunday, 4 September 2011

Oracle 11g SecureFiles



[caption id="" align="alignright" width="300" caption="Image via Wikipedia"]Oracle Databases[/caption]


Hi All,

Oracle 11g saw through very significant PL/SQL feature i.e. Storage of external files/objects. These objects fall under unstructured data category and database recognises them as Large Objects. They are stored as LOB types in database. This normal storage was improved upon, after this philosophy slowly moved from 'featured one' to 'overhead' level in terms of application performance and security.

My obligations to Exforsys Inc, who have published my article on the usage of Oracle 11 Secure Files. Find the complete story at the link given below.

http://www.exforsys.com/tutorials/oracle-11g/oracle-11g-securefiles.html

Surely for the readers, come up with your comments, feedbacks and queries. I shall be thankful.

Bye, SBH

Wednesday, 17 August 2011

Refresh Oracle dependencies

Hi All,

Buzzzz !!!

From some time back, I was working on Oracle object dependencies. Oracle itself, is the director of all dependencies. I have compiled some of the concepts like dependency checks and verification, Fine grained concepts and version enhancements. Got the same published with Exforsys Inc. Check the same and post your queries/feedback/comments.

http://www.exforsys.com/tutorials/oracle-11g/manage-oracle-dependencies.html

Surely, it must thrust you to dig more into it. I shall be happy to see the reviews.

Over for now, SBH

Thursday, 11 August 2011

UTL_FILE

Hi All,

 

Hope u all r doing well !!

Check out my latest publication on UTL_FILE at Exforsys Inc

Working with UTL_FILE

Do post your feedbacks and queries.

Thanks !!

Bye, SBH

Sunday, 10 July 2011

Pragmas in Oracle

Hi Guyzz,

Check my publication at exforsys.com on Oracle Pragmas, updated until 11g version.

http://www.exforsys.com/tutorials/oracle-11g/oracle-pragma.html

I shall be happy to improvise upon your responses. Thanks !!

Bye for now-SBH