Solved

statspack scheduling

Posted on 2011-09-20
7
472 Views
Last Modified: 2012-08-14
We want statspack to take snapshots every 15 minutes  excluding during the window starting midnight until 7am, at this h time we would like snapshots taken every 2 hours(midnight, 2, 4 and 6).
0
Comment
Question by:it-rex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 36571303
What is your database 9i or 10g.
In 10g you can use dbms_workload_repository package with
a. dbms_schedule to schedule a job or
b. make entry in cronjob.
0
 
LVL 11

Author Comment

by:it-rex
ID: 36573122
a. dbms_schedule to schedule a job or
I need the code for that.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 36573358
All you need to know about dbms_scheduler is in the docs:
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sched.htm#ARPLS72260

You probably want to set up a schedule with dbms_scheduler.create_schedule.  There is an example in that link.  Look for: Combining Schedules
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Author Comment

by:it-rex
ID: 36573805
how about crontab?
0
 
LVL 15

Assisted Solution

by:Devinder Singh Virdi
Devinder Singh Virdi earned 250 total points
ID: 36574158
For cronjob, you need to write small shell script that will call one sql file.
Put DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT.
call this shell file in cronjob like
0,15,30,45 8-23 * * * YOUR_SHELL_FILE.sh
0 0,2,4,6 * * *  YOUR_SHELL_FILE.sh

You are calling shell file two times to maintain two diff thing.

Why you want to take snapshot like that. Is there any Performance issue going on?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36574455
>>how about crontab?

You can use it but do you really want to involve the OS to perform a database activity?  If you use dbms_scheduler, everything is contained inside the databsae.
0
 
LVL 11

Author Closing Comment

by:it-rex
ID: 36574615
thanks all
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question