Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
2answers
48 views

How to find the list of SQL Server jobs using PowerShell?

I need to create Windows PowerShell Scripts that will check and list down all SQL Jobs scheduled on a given database server. Is it possible to find out the list using PowerShell Scripts? If yes, how ...
1
vote
4answers
59 views

replace all references to a drive inside the jobs to another drive

I have a server where all my sql server backups are currently being saved to the G: drive. Now there is no enough disk space on drive G: to keep backups for the last 5 days. I have asked to add ...
0
votes
0answers
46 views

length of the result exceeds the > length limit (2GB) of the target large type

Getting the following error message on the Sql Server Error Log: SQLServer Error: 599, WRITE: The length of the result exceeds the length limit (2GB) of the target large type. [SQLSTATE 42000] (...
0
votes
1answer
46 views

job send email to developers upon complexion and include DBAs if it fails

I have a job that sends an email to an operator (which contains a list of emails within it) upon complexion. Some of these people that are on that list are the developers who build everything in that ...
0
votes
1answer
78 views

Even out disk i/o

We noticed that when a few of our Microsoft SQL server jobs run disk I/O goes from a background of 1-5 disk queue length to 100-700 disk queue length. The thing is the jobs only run for 1-2 minutes so ...
2
votes
1answer
885 views

How do I find a job that sends a specific email?

I had a job sending an irrelevant email to a group of users. The title of the email was Staging -> [AUPAIR] arrivalDate trigger issue. When I query the jobs table in the msdb database using the ...
0
votes
0answers
31 views

Is there a date modified timestamp for steps in a job on msdb?

I need to figure out which steps have been modified since the beginning of the month. I can find which jobs have been modified, but some of the jobs have 20+ steps, so knowing which specific step was ...
1
vote
1answer
20 views

Scheduled tasks in Oracle 11g

I have a scheduled task in Oracle 11g scheduled to run at 12:00 and 17:00 each day. If the first run takes more than five hours, what would happen to the second scheduled run? Would it simply be ...
0
votes
0answers
17 views

Agent Job Activity Time Last Run Not in Sync with Computer Clock

I am updating jobs in a database in preparation for log shipping. I ran a full back up and noticed in the Job Activity Monitor that the time last run is showing for the time zone I am in and not for ...
0
votes
1answer
39 views

Job Activity Monitor - Log File Viewer is showing Duration for running jobs

As you can see in Log file Viewer it has a column Duration which change for a running job. I want to include this column in my query (from where I get jobname etc) Any idea to make a SIMPLE script? ...
-1
votes
1answer
44 views

Job duration email

I have need to be able to generate two types of alerts: We have a sql job which runs every 1 hour. I need an alert to let us know the time it took to complete the job As the count for Table1 ...
0
votes
0answers
46 views

SQL Job agent get running jobs, failed and canceld jobs in same query

I have 2 queries I want to combine into one, as below. I want to build on these queries due to restrictions I have as a user against the server. I can run exec sp_help_job @execution_status (it gives ...
1
vote
2answers
109 views

How do I get a run duration in minutes for each individual step in a single Job?

The Run_Duration in sysjobhistory of the the complete job. Is there a way to get this? [msdb].[dbo].[sysjobactivity] only has the last step.
0
votes
1answer
28 views

Job Agent sysjobhistory run_status=0 failure but which last step was a failure?

I am getting confusing results from sysJobHistory. The message can sometimes say last step was 2 but the row from instance_id says 0. Below are some examples below when run_status=0. Any idea how ...
1
vote
1answer
33 views

Multiple procedures to schedule jobs

I have a package named pkg_cd. In it there are 8 procedures: pkg_cd.PRC_CD_CASEDATAENTRY; pkg_cd.PRC_CD_DEDUP; pkg_cd.PRC_CD_CIBIL; pkg_cd.PRC_CD_TVR; pkg_cd.PRC_CD_SANCTION; pkg_cd.PRC_CD_DOWNPAY; ...
2
votes
2answers
175 views

View SQL Server Agent jobs -> MSDB roles

When attempting to view the jobs' properties in SSMS, the users would get the error execute was denied on the object sp_help_targetserver. This is a sys SP in MSDB. The users have ...
1
vote
1answer
53 views

Measure Agent Job failure and running jobs with 'execution_status'

Considerations I need to create a Dashboard with job failure AND running jobs. I have a code to get run_status etc. I am not interested in succeed jobs. I extract failure from run_status = 0. ...
0
votes
0answers
68 views

Ola Hallengren's Backup solution error message after migrating to SQL 2012 using sqlcmd stops job, t

I am using Ola Hallengren's Maintenance script, and I am having an issue executing scripts. I'm getting the below error. If I reboot SQL Server Agent Services and re-ran the jobs it works fine for a ...
1
vote
0answers
87 views

SSIS FTP Package job fails when scheduling through SQL Server Agent job

I am using WinSCP inside SSIS Execute task for downloading and moving the file in FTP location. It works great through visual studio. I am passing parameters inside the SQL Server Agent job and the ...
1
vote
1answer
111 views

Cannot run a job to update table on a linked server

I am running SQL Server 2012 on a server (server 1) and have set up a job to run a stored procedure which will summarize data from a series of tables and update a table on a linked server (server 2) ...
0
votes
2answers
622 views

T-SQL: How create job that run monthly

I already know how to schedule monthly jobs using SQL Server Agent > Jobs, I now would like to learn how to schedule such job using T-SQL. I know how to schedule a job daily at a specific time: ...
1
vote
4answers
153 views

SQL Server Agent Job - Adding Version Number

I would like to know how to add a version number to a SQL Server Agent job without using the description field, and with it being an attribute of the job. A similar question was asked at ...
0
votes
0answers
99 views

Same Domain Linked Server Login Failing

I have several SQL Server instances. All of them are setup in the same domain, and have been working for years. One of these instances serves as an aggregator for the data of the others, and a sync ...
1
vote
1answer
43 views

Number of databases on a server. Should I try to consolidate these objects together? [closed]

Background Hi, as a BI developer I create various scripts for a middle-size company (200-300 employees). These scripts are used to manipulate / aggregate / clean data from different sources and ...
0
votes
0answers
23 views

SQL Agent scheduled job under AlwaysOn run twice on failover machine [duplicate]

Has any experienced this: -SQL Agent scheduled job running over 7 years -Using AlwaysOn for last 3 years -Runs itself (?) within milliseconds but only on the 2ndary machine -SQL Agent only shows one ...
0
votes
2answers
222 views

PLS-00306 dbms_scheduler.create_job

I'm not an expert about DBMS_SCHEDULER.CREATE_JOB and i've been asked to create a job. When i run it i get these errors: ORA-06550: line2,column 2 PLS-00306: wrong number or types of arguments in ...
0
votes
0answers
206 views

Query Syntax - Sum of different values in same column

I need to write a query that will look at the SQL job run history and return the amount of times each job has failed or succeeded. To be more specific a DTSX package will go out to group of servers ...
-1
votes
1answer
59 views

DST Back up plan

Back up schedule for log backup (using Ola's scripts) as follows: Start Time - 2AM End Time - 11.59.59PM Interval - Every 15 minutes. On November 5th, all the back ups went as detailed above. ...
-2
votes
1answer
45 views

reattach database jobs to another identical schema

I have a working DB holding schema1. I needed to clone the schema1 to schema2. I did this with expdp and impdp. Everything worked fine, least when doing impdp for metadata I got the following error: ...
1
vote
1answer
153 views

Change logging level programmatically for multiple jobs

I have multiple Sql Agent jobs, with multiple steps each. For a large subset of these jobs, I want to set the logging levels to PERFORMANCE instead of BASIC - the logs are taking a lot of log space, ...
3
votes
1answer
79 views

Delete inactive users - how to prevent jobs and reports to stop working

We have several Microsoft SQL servers in our organization and the previous DBA have not performed user reviews on any of them, so some servers are filled with inactive local users. I have a script ...
1
vote
1answer
180 views

SQL Server Jobs - syspolicy_purge_history fails

The job syspolicy_purge_history fails at the 3rd step. The error that I get is the following one: Executed as user: UserABC. A job step received an error at line 1 in a PowerShell script. ...
3
votes
0answers
109 views

Change FROM in Sql Server Notification to Cell phone [closed]

We have pager notifications set up on our SQL Server for jobs that fail. However, when the notification arrives on my pager, the sender's text message number ends in a 3 digit IDENTITY column so it ...
1
vote
3answers
63 views

Full backup on failure

I have created a maintenance plan to take a full backup of all my databases every Sundays and a differential backup every day. Also, a log backup is triggered every hour. However, there is an issue ...
1
vote
2answers
454 views

How to add a step in all existing jobs in sql server

IF (SELECT ars.role_desc FROM sys.dm_hadr_availability_replica_states ars INNER JOIN sys.availability_groups ag ON ars.group_id = ag.group_id AND ars.is_local = 1) <> 'PRIMARY' ...
-3
votes
1answer
112 views

SQL Server: How to set time in a human readable format

I found this useful query here and I use it to monitor SQL Server jobs. SELECT sJobHis.[server], sJobStep.database_name, SJob.name, SJob.enabled, CASE WHEN SJob.enabled = 0 THEN '0' WHEN sJobStep....
2
votes
1answer
202 views

SQL Server 2016 Job running forever

I have created a SQL Server Job on SQL 2016. This is a job that runs a full backup from our backup utility DDBoost. When I execute the job, the backup completes in 5 mins for all databases. However, ...
1
vote
0answers
77 views

How to verify DBCC CHECKDB

I am logging the DBCC CHECKDB job output to a table. When I look at the job log using the below command, I want to verify that all is well. use msdb EXEC dbo.sp_help_jobsteplog @job_name = N'...
1
vote
1answer
341 views

Working SSIS package fails as a job, probably due to data flow connection

I'm working in SQL Server 2012. I've built out an SSIS package that is made up of a few scripts and 2 data flow tasks. The data flow tasks move data from the local SQL server out to an Amazon SQL ...
2
votes
1answer
194 views

Calling stored procedure from job does nothing

I have very simple stored procedure CREATE PROCEDURE FillMissingBirthDateFromMemberNumber AS BEGIN UPDATE Members SET BirthDate = CASE WHEN CONVERT(DATE, SUBSTRING(m....
-1
votes
1answer
368 views

Troubleshooting ORA-12012, ORA-02194 and ORA-06512 errors

On one of installations I see the following errors during job execution: alert.log: Wed Aug 16 16:57:27 2017 Errors in file c:\oracle\product\10.2.0\admin\db\bdump\db_j009_3868.trc: ...
0
votes
1answer
438 views

how to drop job with lowercase name ORACLE (=> ORA-27475 )

How can I drop a job with lowercase name in Oracle? It gives me an error ORA-27475 "JOB_NAME" must be a job BEGIN DBMS_SCHEDULER.stop_job(job_name => 'MY_JOB_name'); END; / The job exists for ...
2
votes
3answers
87 views

Dumps after CHECKDB error

I have a little problem with a two-node mirror and customer requirements: There is a maintenance window every night from 01:30 to 03:00, within which I have to run rebuild/reorg and checkdb (...
2
votes
2answers
176 views

Intermittent EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb'

I have a job that runs every 2 minutes and sends an email to users after it has gathered job information. Most of the time it is successful but every couple of days it fails with the Execute ...
0
votes
3answers
63 views

Hi folks, In one of my Agent Job is running by every minute

One of my SQL agent Job is running every minute, the job has failed . I need the job history of past five days. Is there any way we can get the history details? I have searched in the log but not ...
2
votes
1answer
130 views

Multi server administration: Job that runs both on master and targets servers?

I'm trying to set up multiserver administration on SQL Server 2016. I have two servers, one master and one target. I created a test job that does a simple select statement and then sends an email. I ...
0
votes
0answers
37 views

MSSQL Server agent jobstep permission in master

Got a job step that is checking if database is in server with Primary role. What does jobstep owner login need, to be able to query in master? Grant VIEW SERVER STATE is what the error message suggest....
5
votes
1answer
3k 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 ...
1
vote
1answer
107 views

Create a job from dbms_scheduler with stream redirection?

I want to create a simple job who have to execute this shell command: echo some_text > some_file The attributes some_text and some_file can change between two calls to run_job so I need to use ...
7
votes
2answers
889 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 ...