Wednesday, October 1, 2008

What is STATSPACK and how does one use it? (for DBA) or STATSPACK

What is STATSPACK and how does one use it? (for DBA)


Statspack is a set of performance monitoring and reporting utilities provided by Oracle from Oracle8i and above. Statspack provides improved BSTAT/ESTAT functionality, though the old BSTAT/ESTAT scripts are still available. For more information about STATSPACK, read the documentation in file $ORACLE_HOME/rdbms/admin/spdoc.txt.
Install Statspack:
cd $ORACLE_HOME/rdbms/admin
sqlplus "/ as sysdba" @spdrop.sql -- Install Statspack -
sqlplus "/ as sysdba" @spcreate.sql-- Enter tablespace names when prompted
Use Statspack:
sqlplus perfstat/perfstat
exec statspack.snap; -- Take a performance snapshots
exec statspack.snap;
o Get a list of snapshots
select SNAP_ID, SNAP_TIME from STATS$SNAPSHOT;
@spreport.sql -- Enter two snapshot id's for difference report
Other Statspack Scripts:
. sppurge.sql - Purge a range of Snapshot Id's between the specified begin and end Snap Id's
. spauto.sql - Schedule a dbms_job to automate the collection of STATPACK statistics
. spcreate.sql - Installs the STATSPACK user, tables and package on a database (Run as SYS).
. spdrop.sql - Deinstall STATSPACK from database (Run as SYS)
. sppurge.sql - Delete a range of Snapshot Id's from the database
. spreport.sql - Report on differences between values recorded in two snapshots
. sptrunc.sql - Truncates all data in Statspack tables

What are the common RMAN errors (with solutions)? (for DBA)
Some of the common RMAN errors are:
RMAN-20242: Specification does not match any archivelog in the recovery catalog.
Add to RMAN script: sql 'alter system archive log current';
RMAN-06089: archived log xyz not found or out of sync with catalog
Execute from RMAN: change archivelog all validate;

How can you execute the user defined triggers in forms 3.0 ? 
Execute Trigger (trigger-name)

What ERASE package procedure does ? 
Erase removes an indicated global variable.

What is the difference between NAME_IN and COPY ? 
Copy is package procedure and writes values into a field.
Name in is a package function and returns the contents of the variable to which you apply.

What package procedure is used for calling another form ? 
Call (E.g. Call(formname)

When the form is running in DEBUG mode, If you want to examine the values of global variables and other form variables, What package procedure command you would use in your trigger text ? 
Break.
SYSTEM VARIABLES

The value recorded in system.last_record variable is of type
a. Number
b. Boolean
c. Character. ? 

b. Boolean.

What is mean by Program Global Area (PGA) ? 
It is area in memory that is used by a Single Oracle User Process.

What is hit ratio ? 
It is a measure of well the data cache buffer is handling requests for data. Hit Ratio = (Logical Reads - Physical Reads - Hits Misses)/ Logical Reads.

How do u implement the If statement in the Select Statement 
We can implement the if statement in the select statement by using the Decode statement. e.g. select DECODE (EMP_CAT,'1','First','2','Second'Null); Here the Null is the else statement where null is done .


No comments:

Post a Comment

Thanks to given comments.......

My Blog List