Quantcast
Channel: Lalit Kumar B
Browsing latest articles
Browse All 44 View Live

Image may be NSFW.
Clik here to view.

How to generate trace file – SQL Trace and TKPROF in Oracle

It is a frequently asked question in almost all the Oracle forums. There have had been numerous questions/posts regarding “But how to generate the trace file?” Well, it might seem a heck of a task,...

View Article



Image may be NSFW.
Clik here to view.

SQL*Plus error logging – New feature release 11.1

One of the most important things that a developer does apart from just code development is, debugging. Isn’t it? Yes, debugging the code to fix the errors that are raised. But, in order to actually...

View Article

Image may be NSFW.
Clik here to view.

Oracle – Case Insensitive Sorts & Compares

Oracle enhanced it’s case-insensitive sorts and compares feature with 10g Release 2. Version 11g has the following types of sorts: • Binary sort • Monolingual linguistic sort • Multilingual linguistic...

View Article

Image may be NSFW.
Clik here to view.

Understanding Oracle Deadlock

Being a database application developer, a lot of times we come across deadlock errors. We know that a deadlock detected message is actually a clue to understand that it is a application design level...

View Article

Image may be NSFW.
Clik here to view.

Oracle – Insert Comma separated string values into Table

This is a small demonstartion of how to insert the values of a comma separated string to a table as different rows. This is not something new, Tom Kyte has already demonstrated it lot of times in...

View Article


Image may be NSFW.
Clik here to view.

ORA-06503: PL/SQL: Function returned without value

An important thing regarding function, you would agree with me that, at least once a PL/SQL developer must have heard that “A function MUST ALWAYS RETURN a VALUE of proper datatype”. Having been said...

View Article

Image may be NSFW.
Clik here to view.

WHEN OTHERS THEN NULL – A bug

A when others is almost always a BUG unless it is immediately followed by a RAISE.                        — Quote from Thomas Kyte’s excellent thread on similar topic Remember, for errors, RAISE –>...

View Article

Image may be NSFW.
Clik here to view.

SQL*Plus error logging – workaround for ROLLBACK issue

In my previous post SQL*Plus error logging – New feature release 11.1, as a NOTE I stated an issue that whenever ROLLBACK is issued in the session, the feature fails to log the errors. Thanks to Jacek...

View Article


Image may be NSFW.
Clik here to view.

Oracle EXPLAIN PLAN – How to create, display and read

This post is to demonstrate the ways to create and display explain plan. But before we proceed with the steps of creating and displaying explain, the schema must have the PLAN_TABLE. A lot of times...

View Article


Image may be NSFW.
Clik here to view.

Order of item list in declaration part of PL/SQL anonymous block – PLS-00103

In an anonymous PL/SQL block, if you do not follow the order of the item list in the declaration part, you might just end up with PLS-00103 error. Per Oracle documentation on Anonymous Block following...

View Article

Image may be NSFW.
Clik here to view.

PL/SQL Developer Settings

Being an Oracle database application developer, we come across a lot of client tools like SQL*Plus, SQL Developer, TOAD, PL/SQL Developer etc. In this post I will be explaining the most common settings...

View Article

Image may be NSFW.
Clik here to view.

Lock user SYS and Connect without SYSDBA

Many times this question comes up “Whether we could login as SYS but not as SYDBA”. Related questions are “Whether you could lock SYS account”. The answer to both the questions is YES. Let’s see how :...

View Article

Image may be NSFW.
Clik here to view.

A myth about Row Exclusive Table Lock on SELECT FOR UPDATE with no rows

Recently I came across a question in Stackoverflow about row exclusive lock after executing SELECT..FOR UPDATE with no rows selected. The fact was that the query returned no rows, but Oracle applies a...

View Article


Image may be NSFW.
Clik here to view.

V$RESERVED_WORDS & X$KWDDEF – Interesting facts!

It’s a lazy Friday and I saw an interesting question in Stackoverflow about “Why are there two “null” keywords in Oracle’s v$reserved_words view?” And I spent next 2 hours digging into knowing the...

View Article

Image may be NSFW.
Clik here to view.

Find specific/similar words in a string using REGULAR EXPRESSION in Oracle

This is supposed to be one of the most common question among all the Oracle discussion forums, and especially folks looking for REGULAR EXPRESSION over web, would have definitely come across such a...

View Article


Image may be NSFW.
Clik here to view.

Why are junk values/special characters/question marks displayed on my client?

There have been numerous questions on almost all the Oracle discussion forums about “Why are junk values displayed on my client” or ” Why do I see question marks or special characters in the table”....

View Article

Image may be NSFW.
Clik here to view.

Find all columns having at least a NULL value from all tables in the schema

Spending a good amount of time answering the questions on multiple Oracle forums, like OraFAQ, Stack Overflow, OTN, dBforums etc. I could now figure out the most common questions by amateurs in Oracle...

View Article


Image may be NSFW.
Clik here to view.

Oracle 12c Post Installation Mandatory Steps

Since 12c was made available for Windows 64bit OS Desktop class, people started using it immediately. And, some/few/most/all must have encountered issues while installation and especially post...

View Article

Image may be NSFW.
Clik here to view.

SYS_OP_C2C Oracle internal function, implicit conversion and performance impact

SYS_OP_C2C is an internal function which does an implicit conversion of varchar2 to national character set using TO_NCHAR function. SQL> CREATE TABLE t AS SELECT 'a'||LEVEL col FROM dual CONNECT BY...

View Article

Image may be NSFW.
Clik here to view.

Split single comma delimited string into rows in Oracle

NOTE : This post is about splitting a single comma delimited string. If you have to apply it on a table with multiple rows having comma delimited strings, then look at Split comma delimited strings in...

View Article

Image may be NSFW.
Clik here to view.

DBMS_UTILITY.COMMA_TO_TABLE

The DBMS_UTILITY package provides various utility subprograms. One such useful utility is COMMA_TO_TABLE procedure, which converts a comma-delimited list of names into a PL/SQL table of names. Let’s...

View Article


Image may be NSFW.
Clik here to view.

Quoting string literal technique to avoid errors due to single-quotation...

I have seen many questions on the Oracle forums on how to avoid the error due to single-quotation marks in the string literal. One such question was...

View Article


Image may be NSFW.
Clik here to view.

Flashback DML changes on a table after COMMIT

I see frequent questions regarding “How to Rollback database changes after commit” or “How to flashback my table to previous state”. One such questions was asked here...

View Article

Image may be NSFW.
Clik here to view.

Varying IN list of values in WHERE clause

One of the frequent question on Oracle forums is about the Varying IN list in WHERE clause. One such question was asked here...

View Article

Image may be NSFW.
Clik here to view.

SQL to Search for a VALUE in all COLUMNS of all TABLES in an entire SCHEMA

One of the tricky questions asked in almost all the Oracle forums “How to search for a VALUE in all COLUMNS of all TABLES in an entire SCHEMA”. One such question is asked in Stack Overflow...

View Article


Image may be NSFW.
Clik here to view.

Auto-increment primary key in Pre 12c releases (Identity functionality)

Oracle 12c has introduced the IDENTITY COLUMN functionality which provides an automatic functionality of a trigger-sequence approach for populating the primary key of a table. However, for Pre 12c...

View Article

Image may be NSFW.
Clik here to view.

IDENTITY column autoincrement functionality in Oracle 12c

Oracle 12c has introduced the IDENTITY column which is the automatic method over the old trigger-sequence based approach to auto-populate the primary key of a table. In my previous post, Auto-increment...

View Article

Image may be NSFW.
Clik here to view.

Why *_PROCEDURES view doesn’t show the PROCEDURE_NAME

Recently I saw a question in Stack Overflow “Unable to find procedure in DBA_PROCEDURES view“. Similar questions are: Why can’t I see my procedure in user_procedures view? Why is the procedure_name...

View Article

Image may be NSFW.
Clik here to view.

Split comma delimited strings in a table in Oracle

NOTE : This post is about splitting multiple comma delimited column values in a table. If you have to apply it on a single value then look at Split single comma delimited string into rows in Oracle In...

View Article



Image may be NSFW.
Clik here to view.

Performance difference between Explicit and Implicit Cursors in Oracle PL/SQL

There are many articles over the web about the difference between an explicit and implicit cursor. Theoretically, an implicit cursor is nicer and way faster. For an implicit cursor, Oracle takes care...

View Article

Image may be NSFW.
Clik here to view.

Why DELETE takes longer than INSERT

There was a question on Stack Overflow why does delete take longer than insert. The question is too broad to be addressed as there could be many reasons and statistics behind the two operations....

View Article

Image may be NSFW.
Clik here to view.

Returning the sequence number of Identity column after Insert

One of the frequently asked questions about sequences is “How to return the last sequence inserted?” Now, with the introduction of Identity column, I saw a similar question in Stack Overflow, Returning...

View Article

Image may be NSFW.
Clik here to view.

Reverse the order of comma separated string using Oracle SQL

There was a question on Stack Overflow about “Oracle:how to reverse the string ‘ab,cd,ef’ to ‘ef->cd->ab’” Now, the question might look straight forward to simply reverse the string. However, it...

View Article


Image may be NSFW.
Clik here to view.

Generate Date, Month Name, Week Number, Day number between two dates in...

This is a frequently asked question in most of the forums. Recently saw such question in Stack Overflow Generate Month Name, Day name, Week number and Day number between two dates. Typical questions...

View Article

Image may be NSFW.
Clik here to view.

Why not use WM_CONCAT function in Oracle?

String aggregation related questions are frequently asked questions and every now and then someone provides a solution using WM_CONCAT function. And it really annoys me to repeat the same thing every...

View Article

Image may be NSFW.
Clik here to view.

UTL_MATCH string comparision technique in Oracle

The UTL_MATCH package facilitates matching two records. It comes very handy for data entry validation and string matching. Setup DROP TABLE t_utl_match; CREATE TABLE t_utl_match ( id   NUMBER, col1...

View Article


Image may be NSFW.
Clik here to view.

Find range of consecutive values in a sequence of numbers or dates

One of the frequently asked questions is about Gaps and Islands problems which involve finding a range of missing values (gaps) or a range of consecutive values (islands) in a sequence of numbers or...

View Article


Image may be NSFW.
Clik here to view.

Find range of missing values in a sequence of numbers or dates

One of the frequently asked questions is about Gaps and Islands problems which involve finding a range of missing values (gaps) or a range of consecutive values (islands) in a sequence of numbers or...

View Article

Image may be NSFW.
Clik here to view.

Outer-joins Oracle vs ANSI syntax

this is one of the frequently asked questions about the use of “+” operator in Oracle join syntax. For beginners it is usually a confusion to interpret the different syntax. One of the good reasons to...

View Article

Image may be NSFW.
Clik here to view.

Oracle String Aggregation Techniques

This is a frequently asked question “How to display multiple rows in a single row as a delimited string”. It is basically string aggregation. I will demonstrate the various techniques of string...

View Article

Image may be NSFW.
Clik here to view.

root.sh : Enter the full pathname of the local bin directory

While installing Oracle using Oracle Universal Installer (OUI), there are few scripts which needs to be run as “root” user in the OS. One such script is the “root.sh” which resides in $ORACLE_HOME....

View Article


Image may be NSFW.
Clik here to view.

ORA-12547: TNS :lost contact when try to connect to Oracle

ERROR: ORA-12547: TNS :lost contact when try to connect to Oracle There could be many reasons for the above error, but one of the common issue is due to incorrect permissions to the oracle binaries in...

View Article

Image may be NSFW.
Clik here to view.

sqlplus / as sysdba : ORA-01031: insufficient privileges

ERROR: ORA-01031: insufficient privileges If you get the above error with / as sysdba i.e. when you are trying to connect to LOCAL instance as specified in the environment variables ORACLE_HOME and...

View Article


Image may be NSFW.
Clik here to view.

ORA-12578: TNS:wallet open failed

If you get the following error message: ORA-12578: TNS:wallet open failed then edit your sqlnet.ora file and modify SQLNET.WALLET_OVERRIDE parameter value from TRUE to FALSE. Change this:...

View Article
Browsing latest articles
Browse All 44 View Live




Latest Images