Skip to content

Category: DATABASE

Performance Tuning Basics 4 : Bind Variables

Bind variables are often known as one of the key feature for better SQL query performance. Bind variables as per Oracle documentation is a placeholder in a SQL statement that must be replaced with a valid value or value address for the statement to execute successfully. By using bind variables, you can write a SQL statement that accepts inputs or parameters at run time.

You can think of SQL query as a kind of “function” in any programming language and bind variables as “values” that you pass to the function.

Example:

Select * from EMP where EMP_ID=1;
Select * from EMP where EMP_ID=:a;

First statement uses a literal value (1) to run the query while the second SQL statement uses bind variable (:a) to run the SQL statement. The value of (:a) will be provide to Oracle at run time.

[Post Views: 133]

Leave a Comment

Performance Tuning Basics 3 : Parent and Child Cursors

A “cursor” is a memory area in the library cache that is allocated to the SQL statement which users execute. This memory area stores key information about the SQL statement like SQL text, SQL execution plan, statistics etc.

Each SQL statement has one Parent cursor and one or more child cursors.Let us understand what a parent and child cursors are.
Please keep in mind Cursor = Memory Area

[Post Views: 136]

Leave a Comment

Performance Tuning Basics 2 : Parsing

From performance tuning perspectives, it is very important to understand the concept of parsing. Parsing is primary phase in the SQL execution. It is followed by other stages: Execute and Fetch.

PARSING BASICS:

Whenever a SQL statement is executed, Oracle Engine performs below actions on it:

  1. Validate the Syntax
  2. Validate the objects being referenced in the statement
  3. Privileges assigned to user executing the Job
  4. Verifying if statement is already available in the shared pool. Oracle engine will calculate the hash value for the SQL statement and look in
  5. If statement is not already present then allocate shared memory and create a cursor in shared pool
  6. Generate the Execution Plan

[Post Views: 195]

1 Comment

Oracle EXPDP/IMPDP (DATAPUMP) Monitoring Scripts

Usually we monitor the EXPDP/IMPDP jobs by monitoring the log files generated by expdp/impdp process.  Also we monitor alert log too just in case some error pops up. This helps most of the time. If you have a long running expdp/impdp sessions as you are exporting/importing huge GBs then it helps to have a more detailed monitoring of the expdp/impdp jobs. Some of the useful queries which can be used to monitor the  Data Pump Jobs are mentioned below.

To start with some of the important tables/views that you should refer to monitor Data Pump Jobs are:

[Post Views: 775]

Leave a Comment

Connecting Oracle Database and SQL Server – Basic Concepts

It is required sometime to connect oracle database to SQL Server database using uni-direction or bi-direction methods. Since these are two different database so something as simple as direct DBLINK will not work here. Below are the basic concepts of making connection from SQL SERVER to Oracle and vice-versa.

[Post Views: 106]

Leave a Comment

“Wait for a undo record” OR “Wait for stopper event to be increased” database wait events

We faced a scenario in our database where users were complaining about database performance. Database seems to be hanging and queries were either stuck or not running at all.

It was also seen that UNDO tablespace consumption was increasing.

[Post Views: 493]

Leave a Comment

Oracle ASM – ORA-19504: failed to create file – SVR4 Error: 13: Permission denied

During one of our 11gR2 database restore activity we found below error message in the RMAN “duplicate database command”

channel aux4: ORA-19870: error while restoring backup piece /oraclone/ORCL/rman_clone/ORCL_F_20170605_c1s60alv_1_1
ORA-19504: failed to create file "+DATA3"
ORA-15045: ASM file name '+DATA3' is not in reference form
ORA-17502: ksfdcre:5 Failed to create file +DATA3
ORA-15081: failed to submit an I/O operation to a disk
ORA-27091: unable to queue I/O
ORA-27041: unable to open file
SVR4 Error: 13: Permission denied

[Post Views: 253]

Leave a Comment

Reorg tables and indexes in Oracle EBS Applications – Best Practices

Usually in OLTP environment like EBS Applications, tables are often get fragmented due to multiple DML activities that happens.Fragmented tables cause queries on those tables to slow down. It is very important to de-fragment this table and to reclaim the fragmented space from these objects.

For EBS we have also seen  that usually gathered statistics, indexing and proper SQL tuning is plenty to improve and maintain acceptable performance but sometime it is required to reorg the table.

One primary cause of fragmentation is that when you run delete command on the tables it delete the rows but doesn’t frees up the memory and also do not changes the high water mark.

[Post Views: 606]

Leave a Comment
error: Alert: Content is protected !!