Oracle DBA Interview PERFORMANCE TUNING Question-1
Oracle DBA Interview PERFORMANCE TUNING Question-1
Tuning
Oracle Performance Tuning Interview Questions and Answers
More:
1. Run TOP command in Linux to check CPU usage.
2. Run VMSTAT, SAR, PRSTAT command to get more information on CPU, memory
usage and possible blocking.
3. Enable the trace file before running your queries, then check the trace
file using tkprof create output file.
According to explain plan check the elapsed time for each query, then tune
them respectively.
If you are getting high “Busy Buffer waits”, how can you find the reason
behind it?
Buffer busy wait means that the queries are waiting for the blocks to be
read into the db cache. There could be the reason when the block may be
busy in the cache and session is waiting for it. It could be undo/data
block or segment header wait.
Run the below two query to find out the P1, P2 and P3 of a session causing
buffer busy wait
then after another query by putting the above P1, P2 and P3 values.
SQL> Select p1 "File #",p2 "Block #",p3 "Reason Code" from v$session_wait
Where event = 'buffer busy waits';
SQL> Select owner, segment_name, segment_type from dba_extents
Where file_id = &P1 and &P2 between block_id and block_id + blocks -1;
¦ Latch waits
¦ Top SQL
¦ Instance activity
¦ File I/O and segment statistics
¦ Memory allocation
¦ Buffer waits
How can you track the password change for a user in oracle?
Oracle only tracks the date that the password will expire based on when it
was latest changed. Thus listing the view DBA_USERS.EXPIRY_DATE and
subtracting PASSWORD_LIFE_TIME you can determine when password was last
changed. You can also check the last password change time directly from
the PTIME column in USER$ table (on which DBA_USERS view is based). But If
you have PASSWORD_REUSE_TIME and/or PASSWORD_REUSE_MAX set in a profile
assigned to a user account then you can reference dictionary table
USER_HISTORY$ for when the password was changed for this account.
SELECT user$.NAME, user$.PASSWORD, user$.ptime,
user_history$.password_date
FROM SYS.user_history$, SYS.user$
WHERE user_history$.user# = user$.user#;
Why we need CASCADE option with DROP USER command whenever dropping a user
and why "DROP USER" commands fails when we don't use it?
If a user having any object then ‘YES’ in that case you are not able to
drop that user without using CASCADE option. The DROP USER with CASCADE
option command drops user along with its all associated objects. Remember
it is a DDL command after the execution of this command rollback cannot be
performed.
When a Tablespace reaches 90%, what action you will take? How you decide
whether to go for Resize or Add datafile?
SUPPOSE A QUERY IS RUNNING SLOW OR HUNG STATE, What will you do?
As a DBA what Pro active steps do you take for a Highly utilized Undo?
Wait Events?
What is Fragmentaion?
What is ORA-600?
Row Chaining:
A row is too large to fit into a single database block. For example, if
you use a 4KB blocksize for your database, and you need to insert a row of
8KB into it, Oracle will use 3 blocks and store the row in pieces.
Some conditions that will cause row chaining are: Tables whose rowsize
exceeds the blocksize. Tables with LONG and LONG RAW columns are prone to
having chained rows. Tables with more then 255 columns will have chained
rows as Oracle break wide tables up into pieces.
So, instead of just having a forwarding address on one block and the data
on another we have data on two or more blocks.