Solved

statspack scheduling

Posted on 2011-09-20
7
467 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 76

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 76

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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 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.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now