GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  Database Administration
Go To First  |  Previous Question  |  Next Question 
 Database Administration  |  Question 124 of 231    Print  
When a user comes to you and asks that a particular SQL query is taking more time. How will you solve this?

  
Total Answers and Comments: 2 Last Update: January 18, 2009     Asked by: anjibabu padala 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 16, 2007 02:56:33   #1  
senthil_s14        

RE: When a user comes to you and asks that a particula...
Hi

If you find the Sql Query (which make problem) then take a Sqltrace with explain plan it will show how the sql query will executed by oracle depending upon the report you will tune your database

for example: one table have 10000 record but you want to fetch only 5 rows but in that query oracle does the full table scan.

only for 5 rows full table is scan is not a good thing so create a index on the particular column by this way to tune the datatabse


Senthil Kumar

 
Is this answer useful? Yes | No
January 17, 2009 07:44:12   #2  
tunakishore Member Since: July 2008   Contribution: 1    

RE: When a user comes to you and asks that a particular SQL query is taking more time. How will you solve this?
Hi I just reviewed your answer. Anyway thanks for your effort to give us response.


But I have a concern .Suppose a user just reported us that his query running slow and we checked the execution plan but I think we need more tuning and investigation before applying index on that table.

I think first of all we need to check either user requirement is more than 80 data from query table and we need to determined table size ? if that is the case I think if we create index again user will get poor performance . because oracle will get contention on db buffer cache since first of all index block need to be picked up as well as almost all block from that table will be pull out . hence it will increase the I/O also other user request may get slow performance since existing data in cache will be flush out and reload .

and also additionally we need to check system level performance too either any problem with dbwn and check alert log file too ? either dbwn writing slow any modified data which is in buffer to datafile and either user server process is waiting to for space in buffer cache ? if user query needed join or sorting either there is not enough space in temporary tablespace for now ?

and if user complain again after fixing the issue once index applied (if user really not required more of data) or fixing any of db level issue . then we need drill down to check either any issue with table block level . eiher table defragment require if watermark reached high ....
like this we need to tuning more things for that query. if still user query having problem after followed various step as i said above then may be we need to tune the query .

if you have any concern or question . please let me know I'll really appreciate.

Thanks
Tuna

 
Is this answer useful? Yes | No

 Related Questions

 The set of objects owned by user account is called the schema. 
Latest Answer : Schema is collection of database object. ...

 It consists ofone or more data files.one or more control files.two or more redo log files.The Database containsmultiple users/schemasone or more rollback segmentsone or more tablespacesData dictionary 

Latest Answer : SELECT A.ROLE,A.PRIVILEGEFROM ROLE_SYS_PRIVS A,DBA_ROLE_PRIVS BWHERE A.ROLE=B.GRANTED_ROLE ANDB.GRANTEE='SCOTT'UNIONSELECT null role, A.PRIVILEGEFROM dba_sys_privs aWHERE a.grantee = 'SCOTT' ...

You can query dba_data_files and dba_temp_files 
Latest Answer : select substr(to_char(sum(bytes)/1024/1024, '999,999,999.99'), 1, 15) "TOTALMB", substr(to_char(sum(bytes)/1024/1024/1024, '999,999.99'), 1, 11) "TOTALGB" from dba_data_files; ...

query v$log 
Latest Answer : select sum(bytes)/1024/1024 size_in_mb from v$log; ...

Latches are low level serialization mechanisms used to protect shared data structures in the SGA. The implementation of latches is operating system dependent, particularly in regard to whether a process 
Latest Answer : Latches are simple, low-level serialization mechanisms to protect shared data structures in the system global area (SGA). For example, latches protect the list of users currently accessing the database and protect the data structures describing the blocks ...

Enqueues are another type of locking mechanism used in Oracle. An enqueue is a more sophisticated mechanism which permits several concurrent processes to have varying degree of sharing of "known" 
Latest Answer : An enqueue is a sophisticated locking mechanism that permits several concurrent processes to share known resources to varying degrees. Any object that can be used concurrently can be protected with enqueues. For example, Oracle allows varying levels of ...

This is extract from Oracle10g Advanced Replication Book. How Materialized Views Work with Object Types and CollectionsOracle object types are user-defined datatypes that make it possible to model complex 

Thhere are 3 different ways :-1) SELECT name, value FROM v$parameter WHERE name = 'spfile'; //This query will return NULL if you are using PFILE2) SHOW PARAMETER spfile // This query will returns 
Latest Answer : select * from v$parameter where name='spfile'; ...

These are a few of the advantages of using DBCA:You can use its wizards to guide you through a selection of options providing an easy means of creating and tailoring your database. It allows you to provide 
Latest Answer : The Database Configuration Assistant guides you through the process of creating a new database, changing the configuration of an existing database, or deleting a database. Many of the database creation tasks you would normally perform manually are performed ...


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape