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

Wednesday, 29 June 2011

Conditional compilation in Oracle PL/SQL

Hi all,

Check out my latest publication at Exforsys.

Conditional compilation in Oracle PL/SQL.

Do read it and post your feedback.

Thanks, SBH

Saturday, 18 June 2011

Overloading in Oracle

Hi,

Overloading is a generic concept for a programming language. In conventional terms, it implies the different behavior of like named objects upon different calls. Different languages provide add ons upon overloading implementation, depending upon their language support and featured concepts.

I have recently got my article published at exforsys.com. Check it out the below link.

Oracle program overloading

Do post your feedback and comments.

Bye, SBH

 

Thursday, 16 June 2011

Read Only tables explained

Hi guyzz,

Check out my new online work at exforsys on Oracle 11g Read Only tables

Read Only Tables

Don't forget to post your feedback. These days bit busy with Object model, I'll be back soon with many more findings on Oracle stuffs.

Bye for now-SBH

Thursday, 9 June 2011

Wednesday, 8 June 2011

Check out "Recalling Oracle subprograms" on Oracle Community














Oracle Community
The social network for Oracle people















Saurabh Gupta

Saurabh Gupta
Check out the blog post 'Recalling Oracle subprograms'
Recall Oracle functions and procedures at Oracle Functions and Procedures

Blog post link:
Recalling Oracle subprograms

About Oracle Community
For anyone interested in Oracle databases, applications and related technologies.








 8691 members
486 photos
67 videos
953 discussions
213 Events
530 blog posts


 


Thursday, 2 June 2011

Oracle 11g Collections

Check out my new publication at exforsys.com

Oracle 11g Collections.

Do post your feedbacks.

Thanks - SBH

Monday, 30 May 2011

Oracle 11g Virtual Columns

Check out my latest publication

Oracle 11g Virtual Columns.

Do post your feedbacks !!

Check out "Invisible indexes" on Oracle Community














Oracle Community
The social network for Oracle people















Saurabh Gupta

Saurabh Gupta
Check out the blog post 'Invisible indexes'Hi,

View my latest publication..

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

Do post your feedback !!

Blog post link:
Invisible indexes

About Oracle Community
For anyone interested in Oracle databases, applications and related technologies.








 8655 members
486 photos
67 videos
948 discussions
212 Events
523 blog posts


 


Tuesday, 26 April 2011

Oracle Hints

Introduction

Performance is one of the primary objectives of a database. Fine tuned data retrieval and database operations can save lot of time for users and avoid troubleshoot nightmares of database developers.

The root cause of database performance degradation lies with the working of optimizer. Optimizer speed lowers and hence the query speed. There are multiple approaches and many ways to achieve database process performance. Thorough analysis of the data, explain plan is required to adopt the most feasible method to tune a SQL query. 

Out of these many approaches, Oracle SQL hints are one of the tricks to tune a query. SQL hints are optimizer directives which were introduced in Oracle 8.1.0 release. They instruct optimizer to follow an alternative path of query execution. At times, a developer can analyze a complex data better than an Optimizer. Therefore, he may choose a better execution plan than the optimizer by enforcing hints in the queries.  Like other approaches, it is not a full proof method of tuning but it is suggestible in case of complex queries.

SQL Hints Usage  Below are some situations when Hints are required to be used when the Optimizer fails:- 

  • Bugs

  • Use of Bind Variables which disable Histograms

  • Poorly written SQLs

  • High frequency of Change of Data

  • Faulty (incomplete) Configuration Settings

  • Dynamic vs. Static SQL 


Other circumstances where the use of Hints may be required:- 

  • Hints can be used to join external tables.

  • Hints can be used to force the optimizer to choose different join paths which will fetch different results in the query execution.

  • Hints are used to tell the optimizer which data access method to use (as for example in a flashback query). The method may be a full table scan or a different index. 


Note: - Sometimes, the optimizer can ‘lock’ the statistics when they look ideal. In such a case ‘Hints’ lose their importance.

Syntax:-  Hints appear as comments to the SELECT and DML statements. Without these keywords, they hold no meeting and would only appear as a comment. Hints can be used in any of the following ways: 

  • /*+ hint */

  • /*+ hint (argument) */

  • /*+ hint (argument-1 argument-2) */


Notes 

  • Hints can be used in SELECT, INSERT, UPDATE or DELETE statements

  • It can be a part of subquery too

  • It can appear in any of the participating queries of a compound query using SET operator

  • There should be no schema names in hints

  • All hints except the /*+ rule */ cause the Cost Based Optimizer (CBO) to be used

  • Hints operate on a simple view but not on a complex view 


Illustration 

1. The query below uses ALL_ROWS hint to select employee details from EMPLOYEE table 

SELECT /*+ ALL_ROWS */ EMPNO, ENAME, SALARY, DETPNO
FROM EMPLOYEE WHERE EMPNO=100


2. The SQL query below uses RULE hint to change the optimizer mode from COST based to RULE based

SELECT /*+ RULE */ EMPNO, ENAME, SALARY, DETPNO 

FROM EMPLOYEE WHERE EMPNO=100

3. The FULL hint used in the below SQL query enforces optimizer to do FULL TABLE SCAN

SELECT /*+ FULL(E) */ EMPNO, ENAME, SALARY

FROM EMPLOYEE E WHERE DEPTNO IN (SELECT DEPTNO 

                                 FROM DEPARTMENT

                                 WHERE LOCATION_ID=1009)

Types of Hints

Based on their usage area, SQL hints can be classified as below. 

  • Hints for Optimization Approaches and Goals

  • Hints for Access Paths, Hints for Query Transformations

  • Hints for Join Orders

  • Hints for Join Operations

  • Hints for Parallel Execution

  • Additional Hints 




























Hints for Optimization Approaches and Goals
HintFunctionUse
ALL_ROWSInvokes the CBOUsed for batch processing, data warehousing systems
FIRST_ROWSInvokes the CBOUsed for On Line Transfer Processing (OLTP) systems
CHOOSEInvokes the CBOIt lets the server choose between ALL_ROWS and FIRST_ROWS, based on the statistics gathered by the CBO

 Hints for Access Paths 























CLUSTERINDEXINDEX_FFS
FULLINDEX_ASCINDEX_JOIN
HASHINDEX_COMBINENO_INDEX
ROWIDINDEX_DESCAND_EQUAL

Hints for Query Transformations 























FACTNO_FACT
MERGENO_MERGE
NO_EXPANDNOREWRITE
NO_EXPAND_GSET_TO_UNIONREWRITE
USE_CONCATSTAR_TRANSFORMATION

Hints for Join Operations 























DRIVING_SITEMERGE_AJUSE_HASH
HASH_AJMERGE_SJUSE_MERGE
HASH_SJNL_AJUSE_NL
LEADINGNL_AJ 

 Hints for Parallel Execution 


















NO PARALLEL
PARALLEL
NOPARALLEL_INDEX
PARALLEL_INDEX
PQ_DISTRIBUTE

Miscellaneous Hints 



































































ANTIJOINDYNAMIC_SAMPLING
APPENDINLINE
BITMAPMATERIALIZE
BUFFERNO_ACCESS
CACHENO_BUFFER
CARDINALITYNO_MONITORING
CPU_COSTINGNO_PUSH_PRED
NO_PUSH_SUBQORDERED_PREDICATES
NO_QKN_BUFFPUSH_PRED
NO_SEMIJOINPUSH_SUBQ
NOAPPENDNOCACHE
STARSEMIJOIN
SWAP_JOIN_INPUTSSEMIJOIN_DRIVER
USE_ANTIOR_EXPAND
USE_SEMIORDERED
QB_NAMESELECTIVITY

Hint introduced in Oracle 11g 

RESULT_CACHE – The hint was introduced to cache the result of the SELECT query for the same set of inputs and values. It results in better performance if the same query has to be executed for multiple numbers of times.

Undocumented Hints 



















































































































BYPASS_RECURSIVE_CHECKCURSOR_SHARING_EXACT
BYPASS_UJVCDEREF_NO_REWRITE
CACHE_CBDML_UPDATE
CACHE_TEMP_TABLEDOMAIN_INDEX_NO_SORT
CIV_GBDOMAIN_INDEX_SORT
COLLECTIONS_GET_REFSDYNAMIC_SAMPLING
CUBE_GBDYNAMIC_SAMPLING_EST_CDN
SYS_PARALLEL_TXNSYS_RID_ORDER
REMOTE_MAPPEDRESTORE_AS_INTERVALS
SYS_DL_CURSORNO_UNNEST
SQLLDRUSE_TTT_FOR_GSETS
NESTED_TABLE_GET_REFSNESTED_TABLE_SET_SETID
NESTED_TABLE_SET_REFSNO_FILTERING
EXPAND_GSET_TO_UNIONPIV_GB
FORCE_SAMPLE_BLOCKTIV_GB
GBY_CONC_ROLLUPSAVE_AS_INTERVALS
GLOBAL_TABLE_HINTSNOCPU_COSTING
HWM_BROKEREDPQ_NOMAP
NO_PRUNE_GSETSNO_ORDER_ROLLUPS
INDEX_RRSSCN_ASCENDING
INDEX_SSOVERFLOW_NOMOVE
INDEX_SS_ASCPQ_MAP
INDEX_SS_DESCNO_STATS_GSETS
LIKE_EXPANDUNNEST
LOCAL_INDEXESSKIP_EXT_OPTIMIZER
MV_MERGEPIV_SSF
TIV_SSFIGNORE_ON_CLAUSE
IGNORE_WHERE_CLAUSE 

Obsolete Hints RULE – Its usage has been deprecated by Oracle after 9i release. Earlier, it used to work similar to the current COST hint i.e. to toggle over the optimizers.

Thursday, 21 April 2011

Hello Oracle

Hi Techizzzz,

I have started this blog to dump all my key experiences at one place and share the knowledge which may help the professionals from time to time.

I would wish to have your full support and I shall make sure we all have great TechFun here.

We are Oracles !!

SBH