Oracle 10gr2 Introduce new option for capture performance problem.
What is ASH ?
Whenever you want to know information about blocker and waiter identifiers and their associated transaction IDs and SQL.
About V$ACTIVE_SESSION_HISTORY
1. The V$ACTIVE_SESSION_HISTORY view provides sampled session activity in the instance.
2. Active sessions are sampled every second and are stored in a circular buffer in SGA.
3. Any session that is connected to the database and is waiting for an event that does not belong to the Idle wait class is considered as an active session.
4. This includes any session that was on the CPU at the time of sampling.
5. Each session sample is a set of rows and the V$ACTIVE_SESSION_HISTORY view returns one row for each active session per sample, returning the latest session sample rows first. Because the active session samples are stored in a circular buffer in SGA, the greater the system activity, the smaller the number of seconds of session activity that can be stored in the circular buffer. This means that the duration for which a session sample appears in the V$ view, or the number of seconds of session activity that is displayed in the V$ view, is completely dependent on the database activity.
6. Using the Active Session History enables you to examine and perform detailed analysis on both current data in the V$ACTIVE_SESSION_HISTORY view 7. Historical data in the DBA_HIST_ACTIVE_SESS_HISTORY view, SQL identifier of SQL statement.
What information provide ASH view ?
1. Object number, file number, and block number
2. Wait event identifier and parameters
3. Session identifier and session serial number
4. Module and action name
5. Client identifier of the session
6. Service hash identifier
How to generate ASH report ?
It is New feature of 10GR2(10.2.0.1.0)For report creation we have to use ASHRPT.SQL script.
Located: In $ORACLE_HOME/rdbms/admin directoryHow to run ASHRPT.SQL script
To generate a text report of ASH information, run the ashrpt.sql script at the SQL prompt:
@$ORACLE_HOME/rdbms/admin/ashrpt.sql
First, you need to specify whether you want an HTML or a text report.
Enter value for report_type: text
Specify the time frame to collect ASH information by first specifying the begin time in minutes prior to the system date.
Enter value for begin_time: -10
Note: here you have to just put number in minutes eg: 10 for 10 minutesNext, enter the duration in minutes that the report for which you want to capture ASH information from the begin time. The default duration of system date minus begin time is accepted in the following example:
Enter value for duration:
Note: left blank for default value. Default value is SYSDATE
The report in this example will gather ASH information beginning from 10 minutes before the current time and ending at the current time. Next, accept the default report name or enter a report name.
The default name is accepted in the following example:
Enter value for report_name:
Using the report name ashrpt_1_0310_0131.txt
Note: Left it blank for default value.The session history report is generated
Further details, please check metalink note: 243132.1
Reference: http://dbataj.blogspot.com/2007/10/active-session-history-ash.html
March 04, 2009
What is Active Session History (ASH)
September 11, 2008
Reference: http://www.java-interview-questions-bank.blogspot.com/2008/06/senior-oracle-dba-questions.html
- This site has Senior DBA Questions and Java Interview questions
Question Bank is available for Oracle,PL,SQL,PHP, Strut
Reference:http://www.java-interview-questions-bank.blogspot.com/2008/06/senior-oracle-dba-questions.html
Senior Oracle DBA Questions
1. How many memory layers are in the shared pool?
1/3 of physical memory, can be 2/4k depending on bit of 32 or 64
2.How do you find out from the RMAN catalog if a particular archive log has been backed-up?
The database should be in ARCHIVE mode if you are going to use RMAN as backup method.
3. How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?
4. Define the SGA and:• How you would configure SGA for a mid-sized OLTP environment?• What is involved in tuning the SGA?
5. What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
6. Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
7. How do you tell what your machine name is and what is its IP address?
8. How would you go about verifying the network name that the local_listener is currently using?
9. You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
10. What view(s) do you use to associate a user's SQLPLUS session with his o/s process?
11. What is the recommended interval at which to run statspack snapshots, and why?
12. What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
13. Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.
14. How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
15. What do the 9i dbms_standard.sql_txt() anddbms_standard.sql_text() procedures do?
16. In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?
17. How would you best determine why your MVIEW couldn't FAST REFRESH?
18. How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?
19. Which dictionary view(s) would you first look at tounderstand or get a high-level idea of a given Advanced Replication environment?
20. How would you begin to troubleshoot an ORA-03113 error?
21. Which dictionary tables and/or views would you look at to diagnose a locking issue?
22. An automatic job running via DBMS_JOB has failed. Knowing only that "it's failed", how do you approach troubleshooting this issue?
23. How would you extract DDL of a table without using a GUI tool?
24. You're getting high "busy buffer waits" - how can you find what's causing it?
25. What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?
26. Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
27. Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracle's. What database recovery options are available? Database is in archive log mode.
28. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
29. How do you increase the OS limitation for open files (LINUX and/or Solaris)?
30. Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
31. Explain how you would restore a database using RMAN to Point in Time?
32. How does Oracle guarantee data integrity of data changes?
33. Which environment variables are absolutely critical in order to run the OUI?
34. What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?
35. Why does Oracle not permit the use of PCTUSED with indexes?
36. What would you use to improve performance on an insert statement that places millions of rows into that table?
37. What would you do with an "in-doubt" distributed transaction?
38. What are the commands you'd issue to show the explain plan for "select * from dual"?
39. In what script is "snap$" created? In what script isthe "scott/tiger" schema created?
40. If you're unsure in which script a sys or system-owned object is created, but you know it's in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?
41. How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?
42. You create a private database link and upon connection, fails with: ORA-2085: connects to . What is the problem? How would you go about resolving this error?
43. I have my backup RMAN script called "backup_rman.sh". I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell scriptfrom the o/s such that it would run as a background process?
44. Explain the concept of the DUAL table.
45. What are the ways tablespaces can be managed and how do they differ?
46. From the database level, how can you tell under which time zone a database is operating?
47. What's the benefit of "dbms_stats" over "analyze"?
48. Typically, where is the conventional directory structure chosen for Oracle binaries to reside?
49. You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?
50. How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.
51. Draft one mock email requesting your on-technical management grant you downtime to (provide justification where applicable) complete the following tasks:(1) Generate statistics on a large table;(2) Generate an RDA – if you don't know what an RDA is please say so.(3) Rename datafiles.
52) Schema A has some objects and created one procedure and granted to Schema B. Schema B has the same objects like schema A. Schema B executed the procedure like inserting some records. In this case where the data will be stored whether in Schema A or Schema B?
53) In exception handling we have some NOT_FOUND and OTHERS. In inner layer we have some NOT_FOUND and OTHERS. While executing which one whether outer layer or inner layer will check first?
54) Dual table explain. Is any data internally storing in dual table. Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why?
55) How can you see the source code of the package?
56) You are regularly changing the package body part. How will you create or what will you do before creating that package?
57) How do you increase the performance of %LIKE operator?
58) Shall we create procedures to fetch more than one record?
59) If the SQL * Plus hangs for a long time, what is the reason?
60) All the users are complaining that their application is hanging. How you will resolve this situation in OLTP?
61) How to check to memory gap once the SGA is started in Restricted mode?
62) In which situation whether peak time or off peak time you will execute the ANALYZE TABLE command. Why?
63) If the large table contains thousands of records and the application is accessing 35% of the table which method to use: index searching or full table scan?
64) What are the differences between database designing and database modeling?
65) What are the differences you have seen while installing Oracle on NT and Unix platform?
66) How to do the scheduled task/jobs in Unix platform?
67) What is bulk SQL?
68) If the entire disk is corrupted how will you and what are the steps to recover the database?
69) What is mutated trigger, is it the problem of locks. In single user mode we got mutated error, as a DBA how you will resolve it?