Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

statspack scheduling

Posted on 2011-09-20
7
Medium Priority
?
477 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
  • 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 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 1000 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 78

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

772 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