Creating Batch Statspack Reports Without Prompts

Q: I want to create 1 day statspack reports in batch mode
A: Only if provide parameters in advance to spreport script, that is all.

Example
 sh create_batch_statspack_report.sh "2007/12/26 00:00:00" "2007/12/27 23:59:59" >batch_statspack_report.sql
 echo "exit;" >>batch_statspack_report.sql
 sqlplus -S perfstat/****** @batch_statspack_report.sql
 zip statspack_20071226_20071227.zip *.txt
 
Note
Above example used follow procedure to run statspack silently.
 define begin_snap=$START_ID
 define end_snap=$END_ID
 define report_name=$REPORT_NAME
 @?/rdbms/admin/spreport

Advertisements

About Pang

Oracle DBA working in database, fusion middleware and identity management and cloud.
This entry was posted in Oracle database. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s