Skip to main content

Questions tagged [jobs]

A scheduled task managed by the database, for example using SQL Server Agent, Oracle dbms_job, or MySQL Event Scheduler.

Filter by
Sorted by
Tagged with
67 votes
4 answers
147k views

How to run recurring tasks on Postgresql without an external cron-like tool?

I would like to call a stored procedure on a regular basis. On Oracle, I would create a job for this. I have found that Postgresql can mimic this well by using an external tool (cron etc) and PgAgent. ...
Stephan's user avatar
  • 1,463
52 votes
5 answers
173k views

Sql Server Maintenance Plan - Best Practices on Tasks and Scheduling

I am tasked with devising a maintenance plan for our Sql Server 2005 databases. I know for backups I want to do a daily full database backup and transactional log backups every 15 minutes. My problem ...
Josh's user avatar
  • 683
25 votes
4 answers
104k views

Grant permissions to run a SQL Server job

I have a job on my SQL Server 2005 instance that I want to allow any database user to run. I'm not worried about security, since the input to the job's actual work comes from a database table. Just ...
Shahar Mosek's user avatar
21 votes
7 answers
187k views

Script to see running jobs in SQL Server with Job Start Time

how to write script to see running jobs in SQL Server with Job Start Time? SELECT sj.name, sja.run_requested_date, CONVERT(VARCHAR(12), sja.stop_execution_date-sja.start_execution_date, 114) ...
zerbug's user avatar
  • 329
21 votes
4 answers
90k views

What is the Query to display the failed sql jobs

What is the Query to display the failed sql jobs,so that I can get all the failed job information with one query
Avi's user avatar
  • 327
19 votes
4 answers
12k views

Task scheduler for SQL Server Express

I have an ASP.NET MVC app which works with database under SQL Server 2008 R2 Express edition. There is a need to perform a regular task on updating some records in the database. Unfortunately the ...
rem's user avatar
  • 1,555
19 votes
4 answers
33k views

How to changes or update local server connection in Maintenance plan job

Two days back our client changed one of our Dev Server name After Server Renamed, All my maintenance jobs and other jobs are failing because server name mismatch. We are using sql server 2012 ...
sairam's user avatar
  • 291
13 votes
3 answers
49k views

Calling a SQL Server job within another job

Is it possible to call a SQL Server job to run within another job? I know we can add all steps of Job 1 to Job 2, but I prefer not to do that. First the Job 2 is already quite big and second I couldn'...
Sky's user avatar
  • 3,684
13 votes
2 answers
680 views

Does @os_run_priority in sp_add_jobstep actually work in SQL Server 2008 R2?

Does @os_run_priority in sp_add_jobstep actually work, in SQL Server 2008 R2? It is described as "reserved" or "undocumented". However, I see it in the sp_add_jobstep definition: @os_run_priority ...
benik9's user avatar
  • 351
12 votes
1 answer
31k views

Allow non-sysadmin, non-owner of a SQL Server Agent job to execute it

I have a job that runs an SSIS package. Currently the owner is a proxy account. I can run the job manually from a sys-admin account. Our web service logs in using a limited account. It needs to ...
Cruncher's user avatar
  • 223
12 votes
2 answers
60k views

deleting large volumes of rows from table efficiently in SQL Server [duplicate]

I have a table that has gotten a little out of control. I am not a DBA per se but seem to recall that deleting a huge volume of rows in one shot can cause transaction log issues, hamper overall system ...
JoeGeeky's user avatar
  • 1,267
12 votes
3 answers
4k views

How does SQL Server store the information in Job Schedule Properties?

I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the ...
joe's user avatar
  • 319
12 votes
1 answer
32k views

Where EVENTS history are logged/recorded in MySql?

I just setup some stored procedures to run in the event scheduler using CREATE EVENT. I'm trying to find where (if somewhere) the history of it running is stored. I looked at the docs but couldn't ...
tucaz's user avatar
  • 245
10 votes
2 answers
21k views

How to clear an Error 15404 after a DB restart (besides rebooting)

Every so often (e.g. ~months) a SQL Server Agent hourly Job will begin reporting an Error 15404 and continue to do so until intervened with. [298] SQLServer Error: 15404, Could not obtain ...
crokusek's user avatar
  • 2,120
9 votes
2 answers
6k views

How to schedule jobs in Sql server 2008 for less than 10 sec?

I want to run a job every 3 seconds, however in SQL Server 2008 we cannot define an interval of less than 10 seconds. The job is used to insert/update visitor information, and segmentation ...
Musakkhir Sayyed's user avatar
9 votes
2 answers
7k views

Error running Powershell Script in SQL Server Agent

I have a SQL job that runs via SQL Server Agent (Running SQL Server 2012 Enterprise). The last step of the job is to run an application located on a network share. Unfortunately I don't know the name ...
Greg's user avatar
  • 3,262
9 votes
2 answers
15k views

Transaction and Try-catch in SQL Server Job

We have DML operations in each step of a SQL Server job. To ensure the update/insert will be rolled back in case something goes wrong, I have wrapped the data modifications of each step in TRY CATCH ...
Sky's user avatar
  • 3,684
9 votes
2 answers
18k views

The metadata could not be determined because statement invokes an extended stored procedure

in sql server 2012 I used to have a look at the jobs by getting the output of SP_HELP_JOB -- https://www.sqlservercentral.com/Forums/Topic259078-8-1.aspx -- getting data from sp_help_job into a temp ...
Marcello Miorelli's user avatar
8 votes
2 answers
19k views

What is considered for output from an sql server job step?

In short: It seems I only get PRINT messages to my SQL Server job history. What is the definition of valid history output? Background: Just executing a statement like UPDATE product SET ... will ...
Andreas Jansson's user avatar
8 votes
1 answer
2k views

How do I ensure only one instance of a job is running?

SQL Server 2014 Standard Edition. We have a job that runs from 20-40 min. We only want one instance of this job running, but we don't want huge gaps between runs. So, scheduling it every 60 min is ...
Jonesome Reinstate Monica's user avatar
8 votes
2 answers
15k views

How do you get an average of job history times?

The following is a script I found online that has most of the elements of what I desire in the result set. The only thing missing is how I can get an average of the run times over a decided time ...
AKDiscer's user avatar
  • 1,385
8 votes
2 answers
8k views

How to find Jobs that ran between two times

Is there a query to check what a Jobs that ran between to given times. I can check the Jobs that are scheduled between two times but I dont want that. Example I want to know what the Jobs that ran ...
Pரதீப்'s user avatar
8 votes
1 answer
11k views

SQL Server Agent logging actions and changes done to jobs

Is there a way to track changes done to SQL Server Agent jobs? If you had a reason to believe somebody is playing around with your job settings. How would you proceed to track who did it and from ...
Peter's user avatar
  • 151
7 votes
3 answers
18k views

Disabling certain steps in a job

I have a project coming this weekend where all the jobs has to be stopped but only 1 step in a particular job has to be run. for eg: i have a a 2 step job and the second step must run and the first ...
user48062's user avatar
7 votes
3 answers
38k views

Passing parameters to a procedure executed by DBMS_SCHEDULER

I have a scheduler program that runs a stored procedure that requires input parameters. BEGIN DBMS_SCHEDULER.DROP_PROGRAM (program_name => 'MYSCHEMA.EXPORT_SCHEMA_STARTING'); END; /...
Herman Plani Ginting's user avatar
7 votes
2 answers
44k views

Insufficient disk space in Filegroup

One of my jobs is failing and it shows below message. Error: Could not allocate a new page for database 'Reporting' because of insufficient disk space in Filegroup ‘PRIMARY’. Create the necessary ...
Aruna Raghunam's user avatar
7 votes
2 answers
44k views

SQL Server: Frequent Login timeout expired in Linked server

I am using SQL Server 2012. I have scheduled a job to run every 1 hour, with 1 step calling 1 simple Stored Procedure. The Stored Procedure migrates around 1K data from production server to our local ...
Shiva's user avatar
  • 787
6 votes
1 answer
13k views

INSERT failed in SQL Job because of incorrect SET options 'QUOTED_IDENTIFIER'

I created a sql job to query the plan cache and get the serial plans alone and then clear it from the plan cache. As part of step 1 in the SQL job,i filter only the serial plans and insert it into a ...
user9516827's user avatar
  • 1,315
6 votes
1 answer
3k views

Was 'ActiveX Scripting' step type secretly removed from SQL Server 2016?

Migrating our database from SQL Server 2012 to 2016, we can't recreate an SQL Agent job that involves an ActiveX Scripting step written in VBScript. The error message suggests that 'ACTIVESCRIPTING' ...
GSerg's user avatar
  • 1,352
6 votes
2 answers
21k views

How can I run a SQL job every 1 second? [duplicate]

I have an SQL Job which processes minimum amount of rows at a given time. Currently its running every 10 seconds which is the minimum available in Job Scheduler. But because of that the table used ...
AnOldSoul's user avatar
  • 471
6 votes
2 answers
11k views

Run an exe file that exists on a different server from a SQL Server Job

We have an .exe file on a server, say Server1 which should be run from a SQL Server job that exists on a different server, e.g.: Server2. How can it be done? I know if it's a local file, I can use ...
Sky's user avatar
  • 3,684
6 votes
2 answers
10k views

Ola Hallengren backup failed

I have been using on my SQL Server 2008R2 server Ola Hallengren solutions for almost two years. Last night backups failed, both System databases and user databases with error below. Example of ...
SQL_DBA_Bini's user avatar
6 votes
1 answer
32k views

Login failure when running a SSIS package from a SQL Server job

I have a SSIS package that migrates data from a Sybase database to SQL Server. The connection to the source database has been made through an ODBC connection. If I run the package directly on my ...
Sky's user avatar
  • 3,684
5 votes
2 answers
2k views

Can an SQL Job Deletes itself after its end date?

I have created a job which will sets up its start date and end date automatically with a dynamic value. For example: Job will run for eight days and at eighth day it needs to automatically deletes ...
Sudheer Muthusamy's user avatar
5 votes
4 answers
2k views

How to prevent parallel running of SQL Agent jobs

What would be good ways to design a group of jobs such that they can never run at the same time? I am looking for a generic concept, like a semaphore, which makes it easier to ensure that some jobs ...
askolotl's user avatar
  • 255
5 votes
1 answer
4k views

What's the values for the Freq_Interval column in MSDB.dbo.SysSchedules when Freq_Type is weekly and more than one day is selected in the schedule?

I'm reading up on the SysSchedules table in the Microsoft API, and am trying to incorporate using this table in a query. In the documentation, the Freq_Interval column seems to be defined out for ...
J.D.'s user avatar
  • 38.1k
5 votes
2 answers
5k views

Adding SQL Agent output to text file for all agent jobs in one go

As a best practice, i am trying to schedule an activity where all SQL agent jobs should log output to text file. Manually i can do this for single job. But i am looking for a better way either by ...
BeginnerDBA's user avatar
  • 2,170
5 votes
5 answers
68k views

How to succesfully run a batch file in an SQL Agent job?

I have a SQL Agent Job which generates a specific report in PDF-file and then copies the PDF to a network directory and then deletes the PDF file in the source directory. The SQL Jobs consists of 2 ...
Nazeem's user avatar
  • 163
5 votes
4 answers
3k views

Find Job Calling Another Job

We have a job that is not scheduled to run but was kicked off by what we suspect was another job. There is no job history but it does appear in the error logs. How can we find out if this is being ...
Marvel's user avatar
  • 51
5 votes
1 answer
5k views

Schedule Query and Export

Is it possible, to schedule a simple Query to run Daily and export the received data into an excel file?
TheJoeIaut's user avatar
5 votes
1 answer
20k views

"current security context is not trusted" for job running as a SQL login accessing linked server

I'm running into the error "Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274)" while trying to run a stored procedure from a job,...
Keith's user avatar
  • 535
5 votes
2 answers
2k views

FileWatcher Troubleshooting Options

I have setup a Credential/Procedure/Program/File Watcher/Job to monitor a folder for new files, but it is not working. I am trying to figure out what I can check to troubleshoot why this isn't ...
Leigh Riffel's user avatar
  • 23.9k
5 votes
1 answer
996 views

Isssue with Database Links converting OEM Job to DBMS_Scheduler Job

We had an OEM job that would run a PL/SQL block using a particular database users credentials. The credentials are the same for two different databases, so there was no problem for the block to use a ...
Leigh Riffel's user avatar
  • 23.9k
5 votes
2 answers
5k views

Issues running SSIS package as SQL Server Agent job

I've got some ridiculously stubborn difficulties when trying to run SSIS packages SQL Server Agent jobs on two SQL Servers, one in a domain and one without. I've read hundreds of posts on dozens of ...
gemisigo's user avatar
  • 343
4 votes
2 answers
1k views

Why does this query fail when I run it from a SQL Server job?

I know how to solve the issue, but I don't understand the technicality of why the below query would work when I run it from SSMS, but the same query fails when I add it as a job in the SQL Server ...
SAKA UK's user avatar
  • 100
4 votes
2 answers
38k views

How to create jobs in PostgreSQL?

How to create scheduled jobs in PostgreSQL?
sree's user avatar
  • 129
4 votes
3 answers
3k views

Save multiple SQL jobs in single files

I'm using SQL Server 2005 and I need to save every SQL agent job in single 'create in' *.sql files. The problem is that I got about 20 SQL Server with 15 (up to 51) SQL jobs. How can I export these ...
hellskitchen's user avatar
4 votes
2 answers
3k views

Start job from another SQL server instance

I have a job on an SQL 2008 server (Server A) (I know this is not ideal... That issue is being addressed). The agent runs under NT AUTHORITY\NETWORK SERVICE. I want to add a step that runs a job that ...
Round's user avatar
  • 123
4 votes
2 answers
51k views

How to call a stored procedure in an Oracle Scheduler job

I want to call a stored procedure in an Oracle Scheduler job. My procedure and job are shown below: Stored procedure create or replace PROCEDURE emp_test ...
Pydi Raju's user avatar
  • 514
4 votes
2 answers
5k views

Automated SP_WhoIsActive SQL Activity Capturing Issue

I have an SQL Agent Job on a production server that keeps failing with the below messages. It is supposed to be capturing SQL Server activity using the SP_WHOISACTIVE stored proc, at regularly ...
LeraningDBA's user avatar

1
2 3 4 5
8