Thursday, January 28, 2010

Oracle interview questions 1

What is a mutating trigger? How would you resolve it?


---- Mutating trigger is trigger that is currently being modified by DML operation.



To avoid Mutating trigger there are many ways. One of the best approach is to make use of the after trigger which clearly takes care of concurrency problems associated with mutating triggers .When after trigger is used only after the process of current updating is finished the next process gets processed.



What is the difference between owner’s rights and definers rights in PL/SQL?



-----By default, stored procedures and SQL methods execute with the privileges of their owner, not their current user. Such definers’ rights subprograms are bound to the schema in which they reside, allowing you to refer to objects in the same schema without qualifying their names. For example, if schemas SCOTT and BLAKE both have a table called dept, a procedure owned by SCOTT can refer to dept rather than SCOTT.DEPT. If user BLAKE calls SCOTT's procedure, the procedure still accesses the dept table owned by SCOTT.



How would you prevent unauthorized use of privileges granted to a Role?



----By creating a Role with a password



What is a deadlock? What causes it and how can it be resolved?



--- A dead lock can occur when two or more users are waiting for data locked by each other. We can resolve this by rolling back one of the statements involved in dead lock.



How can you tell if a tablespace has excessive fragmentation?



--- If a select against the dba_free_space table shows that the count of tablespaces extents is greater than the count of its data files, then it is fragmented.



What is the replacement for Stats pack in 10g?



--- Automated Workload Repository (AWR) feature, and the proactive monitoring it provides through Automatic Database Diagnostic Monitor (ADDM). It is the replacement for STATSPACK.



In which data dictionary table or view would you look to determine at which time a snapshot or MVIEW was last successfully refreshed?



--- You can query the DBA_REGISTERED_MVIEWS data dictionary view at a master site or ... view site to obtain the last refresh times for each materialized view



You’re getting "busy buffer waits" – how can you find out what is causing it?



---- Buffer busy waits are common in an I/O-bound Oracle system, as evidenced by any system with read (sequential/scattered) waits in the top-five waits in the Oracle STATSPACK report



The main way to reduce buffer busy waits is to reduce the total I/O on the system. This can be done by tuning the SQL to access rows with fewer block reads (i.e., by adding indexes).



What is the replacement for export/import in 10g



--- Oracle 10g's new Data Pump utility is designed as the eventual replacement for the original Oracle Import and Export utilities.



No comments:

Post a Comment