Questions tagged [jobs]
A scheduled task managed by the database, for example using SQL Server Agent, Oracle dbms_job, or MySQL Event Scheduler.
408 questions
0
votes
0
answers
31
views
One step in Azure SQL job does not retry
I have an Azure SQL Database with a weekly maintenance job. The job scales the database up, performs various tasks, potentially including an index rebuild if fragmentation is high, and then scales the ...
0
votes
0
answers
9
views
Oracle_Database_19C: dba_datapump_jobs
We're having an Oracle database 19c, in that few dumps was there. Regarding this we've kept the scheduled backup jobs for keep maintain the dump backups. But in these 2 dumps getting the error as ...
8
votes
6
answers
3k
views
How can we prevent Agent Jobs running twice when the clocks change?
Context
I have no idea where this is documented and was shocked that I could not find a duplicate. I only know it from seeing it go wrong several years in a row.
The Problem
On the day when the clocks ...
1
vote
1
answer
75
views
Disabled SQL Server job still being run
SQL Server 15.0.4395.2
We have a SSIS package that we run to interface with another system. It is (or was) run from a SQL Server Agent job, and scheduled to run every hour.
For reasons outside the ...
0
votes
0
answers
47
views
Index and Statistics Maintenance Scheduling Questions
I'm working on setting up a maintenance plans for some SQL Server instances. I'm trying to find a good/safe staring point to start the maintenance plan on and I can adjust and make appropriate changes ...
0
votes
2
answers
112
views
script to change the schedule of a job, it needs to find the schedule associated with the job
using Ola's backup strategy,
there is a job
databaseBackup - system databases full, as you can see on the picture below.
this job is scheduled to run once a week, on a sunday morning.
that is all good,...
1
vote
1
answer
98
views
sql server query to show the running jobs - what about the steps of the job?
I have been working on a query to show me the running jobs.
I got it right.
the script is below (enjoy):
DECLARE @JOB_NAME SYSNAME=NULL
SELECT job.name
,job.job_id
,...
0
votes
2
answers
56
views
how to prevent the diff backup running on days when the full backup is scheduled to run?
I have an environment that we want a full backup once a week (if we fail we can tolerate up to 2 weeks) but the diffs have to be running every day, every day but not the days when the full is ...
3
votes
1
answer
318
views
The run_duration column from the msdb.dbo.sysjobhistory returns negative values
From time to time the run_duration column from the msdb.dbo.sysjobhistory returns a negative value for one of the jobs see example below.
The job is successfully finished at the time of the query. ...
4
votes
1
answer
364
views
MSG 14262: The specified @server_name ('<server_name>') does not exist
We have an SQL Server 2019 instance (let's call it 'sample_instance') with server collation of Turkish_CI_AS. When I try to create a job, SSMS creates the part of the script that adds the target ...
0
votes
1
answer
74
views
SQL Server Replication - only ran once. How to configure scheduler from beginning
I have configured a transactional replication from server A to Server B some 2 month ago.
The source database is a new production server, and the data is being updated there constantly.
I have some ...
0
votes
0
answers
9
views
Serialisable Schedule but not View Serialisable
These are the definitions I have for Serialisable and View Serialisable.
I know that View Serialisability => Serialisability and I want to find an example of a schedule that is Serialisable but ...
-1
votes
1
answer
194
views
Can AWS services replace SQL Server Agent Jobs?
I've decided that I no longer want to use SQL Server Agent Jobs. They're tightly coupled to SQL Server, cause interesting security/permissions problems, and can be complicated to sequence. I instead ...
0
votes
0
answers
46
views
Run SQL Server Agent T-SQL Job step under another Windows Account
This may look like a duplicate of this post, but the case differs. Here is the complete situation:
I have access to 172.31.50.98 using my Windows Domain Account
I have added 172.31.50.98 to my ...
0
votes
1
answer
260
views
How automate backup and restore in Azure SQL Managed Instance?
I'm the DBA of one Azure SQL Managed Instance and one of our clients asked us if is possible automate a backup and restore in order to have a copy of one of the database before one of our ETL procces ...
1
vote
0
answers
105
views
SQL script to run from batch jobs
I have a sql script that truncates the table and insert into database from a linked server.Since the server is SQL express I will need to use batch jobs to schedule the jobs. Below is a snippet of the ...
1
vote
1
answer
318
views
Oracle: How can a job exist and not exist at the same time?
I am trying to fix a job by deleting it and then recreating it. But I can't because it seems to not exist when I try to drop, and then exist already when I try to create
Begin
dbms_scheduler....
0
votes
0
answers
106
views
Autogrow Alert/Job not working, WMI(FileName) not found
im trying to set up an alarm that notifies me when an auto grow is happening,im using this link material to create everything
https://www.mssqltips.com/sqlservertip/3128/monitor-sql-server-database-...
1
vote
0
answers
178
views
How to send job notifications with dbms_scheduler via ssl encrypted smtp
We have Oracle Enterprise 19 Databases installed on Linux and using job notification via smtp with Oracle dbms_scheduler for quite a long time. Defining jobs like this and having all the needed ...
0
votes
0
answers
95
views
What permissions does SQL Server Agent Account needs to run the job?
I am wondering what kind of permissions [NT SERVICE\SQLSERVERAGENT] accounts needs to run the job?
Below are the steps that have been impleemented yet the job doesn't run with correct results expected....
0
votes
0
answers
47
views
LSRestore job is taking more than 1 hr to complete. Threshold time is 45min
LSCopy and LSRestore job has been scheduled for every 10 mins. I got a trn file on my secondary server after every 6 min from Primary server. LSCopy is synced with LSBackup. The problem is that ...
1
vote
0
answers
52
views
Restore Job in MSSQL failing [duplicate]
The backup job of being completed, however, the restoring job is failing.
//EDIT
I am trying to perform logshipping
Getting the following errors:
Date 10/25/2023 4:45:00 PM
Log Job History (...
0
votes
0
answers
80
views
Cannot perform this operation while SqlServerAgent is starting problem
I use SQL Server 2017, this mornnig when i check jobs i got this error;
I searched a lot but couldn't find a solution.
Does anyone know the solution to the problem?
thanks.
1
vote
1
answer
245
views
SQL Server Jobs - fail on connection timeout
We have a LIVE set of 3 SQL Server instances on one network and a DEV set of 3 SQL Server instances on another. Being on different networks; LIVE cannot talk to DEV however the instances can talk to ...
0
votes
2
answers
377
views
Report to get difference in SQL Agent jobs across nodes in Availability Group
Is there a script or an article out there to check differences between SQL Agent jobs across nodes in AG and create a report based on the difference? I am not looking for dbatools.io as it syncs the ...
0
votes
1
answer
107
views
Schedule a job in SQL Server between two days
How to schedule a job in SQL Server that starts on Wednesday afternoon and it should end on Thursday EOD and between this the SSIS package should execute for every one hour if any error occurs in ...
0
votes
0
answers
121
views
Error while using linked server in job. The login is from an untrusted domain and cannot be used with Integrated authentication
In SQL managed instance, I have a job. In job procedure, it is using linked server which is also a SQL managed instance. With test login I can read the data using Linked server. I have created the job ...
0
votes
1
answer
1k
views
SQL Server Job running as different user
A year or so ago I started working on a project to set up a job to run a stored procedure. I've now come back to this to finish it off. When I run the job I get an error that he job is running under ...
-2
votes
1
answer
193
views
script to place all backup files(Full, diff &log) in same folder for all Databases in the server [closed]
I have downloaded script from here : https://ola.hallengren.com/sql-server-backup.html
Thank you for the SQL Server Backup script, it's creating separate folders & subfolders for each database.
...
1
vote
0
answers
522
views
Unable to create and install pgAgent service
I'm trying to install pgAgent on my device. During the installation using the stackbuilder, the last step requires me to add the operating system username and password as below:
However, after ...
0
votes
1
answer
3k
views
Why SQL Server Job fails with "EXECUTE AS LOGIN failed for the requested login"?
I created a SQL Server job, in which:
My user is set as the owner of the job
No user is specified for run as at any step.
The job failed with the error:
'EXECUTE AS LOGIN' failed for the requested ...
0
votes
1
answer
2k
views
PLS-00306: wrong number or types of arguments in call to 'CREATE_JOB'
we are getting this error when we try to create this scheduler_job but we try to create it give us this error:
BEGIN
DBMS_SCHEDULER.CREATE_JOB
( job_name=>'PROC_TKN_WA_FIX_ARREARS',
job_type=...
2
votes
2
answers
942
views
Create a Job Schedule that runs on the 1st of month only if it falls on a Sunday
This job already has one schedule that runs on the first of the month.
However, we need to run the job on a different schedule if the first of the month falls on a Sunday.
It appears to me that the ...
1
vote
1
answer
245
views
pgAgent unwanted delay between jobs start time
I've been trying to make jobs running continuosly, so after previous run is done, the next one starts immediately. I made some initial success with following trigger:
CREATE or replace FUNCTION ...
0
votes
1
answer
247
views
SQL 2019 multi-step job fails due to output file in use from previous step
We recently upgraded our SQL server from 2012 to 2019. (A long overdue process, I know.)
Prior to the upgrade all of our regular scheduled jobs worked just fine.
After the upgrade, one scheduled job ...
0
votes
2
answers
2k
views
PostgeSQL Schedule Jobs
I am looking a way that can give the ability to schedule jobs on PostgreSQL, for example to schedule execution of some procedures or statements based on interval or on specific schedule.
I tried ...
1
vote
1
answer
2k
views
How can I add time and date to a query output file name in sql server agent job
I have a query set up in SQL Server agent to return an output result file. The problem I have is how to set a date and time stamp so that the file name always includes the date and time.
On the SQL ...
-1
votes
1
answer
140
views
Any possibility that Ola Hallengren could add a job name prefix option to the script that creates all the maintenance jobs? [closed]
When creating the jobs, they sort together for most of them, but some of the jobs are alphabetically far away from the other Ola jobs on servers with hundreds of jobs.
I would find it easier to see ...
0
votes
0
answers
394
views
Job getting account disabled Error, but works as normal when executed manually
The account used in a linked external SQL Server was disabled, by the external server, temporaly. After the restoration of access, various job routines that used this account continued working, as ...
1
vote
3
answers
2k
views
How to prevent primary node's SQL jobs from running when the primary node goes into resolving state?
I have 2 nodes in an AG. Non-readable secondary, sync commit mode.
There are sql agent jobs setup on both machines. The schedules are turned off on secondary so those jobs wont run. If there is ...
1
vote
2
answers
150
views
Problem with Oracle Job Scheduling
I have a job that refreshes a materialised view refresh group on Oracle 19c. I wanted to refresh the group daily at midnight - trunc(sysdate)? The job was made using using the following PL/SQL:
...
0
votes
1
answer
328
views
On what basis is the sql job's step linked to a database?
I have couple of SQL jobs on source sql server, and on the job step a particular database is selected.
I want to move the databases and jobs on a new sql server, so I have scripted the jobs.
In the ...
0
votes
1
answer
69
views
What does it mean to reach a stable point during the execution of a job?
Trying to use sp_stop_job to stop a simple job that inserts data on a table when 100 rows were inserted I got confused to see the table end up with more than 100 rows every time.
Under the Remarks ...
1
vote
2
answers
2k
views
SQL Server Backup Jobs Failing. The error seems to be related to MaximumErrorCount, but I am not sure how to fix value or if changing it will resolve?
My backup jobs are failing with following error when check it's history. I have already checked this link regarding maximumerrorcount value: SQL Server 2008 - Change the MaximumErrorCount or fix the ...
4
votes
2
answers
2k
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 ...
0
votes
0
answers
139
views
Maintenance plan run date wrong
Win server 2019 & SQL Server 2017
On Jan 28th, 2022, I setup 3 maintenance plans to backup 3 databases from 3:00AM – 3:40AM. The last one finishes at 3:45AM. For a few weeks I confirmed that I am ...
0
votes
1
answer
46
views
Stop Changes to Maintenance Plan from Renaming Linked SQL Agent Job
Is there a way to stop a SQL job (which calls a maintenance plan) from being renamed every time i open and save that maintenance plan?
Each time i do that, a prefix of "_SubPlan" gets added ...
0
votes
4
answers
2k
views
SQL Agent Job - Change all job steps to go to a specific step when the job fails
I have a SQL Agent Job that I need to change, so that any time any step fails the 'ON FAILURE' action goes to a specific step.
Does anyone have a script or can you show me how to write this so that I ...
0
votes
1
answer
421
views
Scheduling Next Run date for weekly agent jobs
On SQL Server I used maintenance plan wizard to create three jobs:
Job
Schedule
Job 1
Every 3 week on Sunday
Job 2
Every 3 week on Sunday
Job 3
Every 3 week on Sunday
I want the three jobs to run ...
0
votes
1
answer
754
views
DBCC CHECKDB job failed on SQL Server 2014
We have a DBCC CHECKDB job that runs weekly on Saturdays. This job was created thorugh Maintenance Plan wizard. Typical duration for this job is 1.5 hours. This past weekend the job failed with the ...