Is there a way to run a Firebird stored procedure at specific time? - firebird

Is there a way to run a Firebird stored procedure at specific time from the server itself ? something like a schedule task service in SQL Server.

There is no builtin scheduler in Firebird. But it should be relatively easy to set up a task in system scheduler which uses isql to execute an sql script which does what you want.

No it's not possible internally. You should use a third party tool.
Please take a look at this issue

Related

Run Powershell script every hour on Azure

I have found this great script which backs up SQL Azure database to BLOB.
I want to run many different variations of this script - e.g. DB1 goes to Customer1Blob, DB2 goes to Customer2Blob.
I have looked at Scheduler Job Collections. However I can only see options (Action settings) for HTTP(S)/ Storage Queue / Service Bus.
Is it possible to run a specific .ps1 script (with commands) scheduled?
You can definitely run a Powershell script as a WebJob. If you want to run a script on a schedule, you can add a settings.job file containing a chron expression with your webjob. The docs for doing so are here.
For this type of automation tasks, I prefer to use the Azure Automation service. You can create runbooks using powershell and then schedule this with the use of the Azure scheduler. You can have it run "on azure" so you do not need to use compute power that you pay for (rather you pay by the minute the job runs) or you can configure it to run with a hybrid worker.
For more information, please see the documentation
When exporting from SQL DB or from SQL Server, make sure you are exporting from a quiescent database. Exporting from a database with active transactions can result in data integrity issues - data being added to various tables while they are also being exported.

How to create JOB in AS400?

I'm new to AS400 DB2 , I have 3 procedures in AS400, now those procedure should be execute by calling single job in AS400.
Can you tell me please how to create a job and execute job in AS400 DB2 Mainframe ?
You're probably not using an AS/400 running OS/400; they have been obsolete for 10 years. You're probably using a POWER server running IBM i.
POWER servers are not mainframes, they are mid-range systems.
On the IBM i, a job is how the operating system organizes, tracks, and processes work. On other platforms, you'd call it a process.
Jobs are the basis of work management
When you sign onto a 5250 session, the system starts an "interactive job" to service your requests. You can't call procedures directly, but you can call a program that then calls the procedures.
There are plenty of common jobs tasks. Including the use of Submit Job (SBMJOB) command to submit a job to run in batch.
From what I understand, you want to run 3 programs in by invoking a single command. Is that it?
In OS/400 (haven't used it in over a decade) you put the commands for the programs into a CL source and compile it. Unlike .bat files on Windows, CL isn't going to run without compilation.
Refer to https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rbam6/creat.htm for how to create a CL program.

How to call SQL Agent Job Wizard from PowerShell?

I need it to automate modification of SQL Server Scheduled jobs and want to reuse functionality of SSMS Scheduled job wizard.
Is it possible to popup SSMS Scheduled job wizard using PowerShell, use it and then close?
Update: I am aware of how to modify jobs using SPs and PS. The wizard is just one step in automated process. The next steps are to read the job settings and generate job script as per company's standard (that is important as out of the box Drop and Create script is not good enough), set encoding of the file etc.
You call a job via integrated MS SQL procedure sp_start_job. You call this SQL via Invoke-SqlCmd.
To modify/create the job you have to use sp_add_job, sp_add_jobstep, sp_update_job and sp_add_jobschedule.

Scheduling procedures in mongoDB in Windows

How can I create a mongodb procedure that can be scheduled to run once every day, at a fix time, say sharp at midnight GMT?
This google group link says you cannot schedule a task in mongoDB, they have a Jira for this, but you can use Window Task Scheduler which is described in this link. Is this the only way to achieve it? Is this a good way to do it?
Quoting the comment by #Markus,
As written in a different answer, running MongoDB on Windows is a bad idea for various reasons. Under Linux, you could use crond to run a .js file easily. If your requirement is to run MongoDB and have a reliable scheduler, the right tool for the job is Linux.
This answer also mentions the way to solve this.
This is done on Windows the same way you do on Linux.
ONE: Make a script in JavaScript to manage the task. This can be done in other languages if you prefer. This is a JavaScript script to rotate logs.
use admin
db.runCommand( { logRotate : 1 } )
TWO: Create a task in Task Scheduler to run the script. This can be done with the GUI, the API, or in XML. I usually set it up in the GUI and export the XML to allow parameterization of the database server, password, port, and user.
THREE: Include the execution of the script in the task
$MONGO_HOME/Mongo localhost:27017 -u myMongoServiceAccount -p somepassword LogRotate.js
The same concept can be applied to index management, gathering database stats, or managing stale locks.

Run SSIS Package from T-SQL

I noticed you can use the following stored procedures (in order) to schedule a SSIS package:
msdb.dbo.sp_add_category #class=N'JOB', #type=N'LOCAL', #name=N'[Uncategorized (Local)]'
msdb.dbo.sp_add_job ...
msdb.dbo.sp_add_jobstep ...
msdb.dbo.sp_update_job ...
msdb.dbo.sp_add_jobschedule ...
msdb.dbo.sp_add_jobserver ...
(You can see an example by right clicking a scheduled job and selecting "Script Job as-> Create To".)
AND you can use sp_start_job to execute the job immediately, effectively running SSIS packages on demand.
Question: does anyone know of any msdb.dbo.[...] stored procedures that simply allow you to run SSIS packages on the fly without using sp_cmdshell directly, or some easier approach?
Well, you don't strictly need the sp_add_category, sp_update_job or sp_add_jobschedule calls. We do an on-demand package execution in our app using SQL Agent with the following call sequence:
- sp_add_job
- sp_add_jobstep
- sp_add_jobserver
- sp_start_job
Getting the job status is a little tricky if you can't access the msdb..sysjobXXX tables, but our jobs start & run just fine.
EDIT:: Other than xp_cmdshell, I'm not aware of another way to launch the the SSIS handlers from withinSQL Server. Anyone with permissions on the server can start the dtexec or dtutil executables; then you can use batch files, job scheduler etc.
Not really... you could try sp_OACreate but it's more complicated and may not do it.
Do you need to run them from SQL? They can be run from command line, .net app etc
In SQL Server 2012+ it is possible to use the following functions (found in the SSISDB database, not the msdb database) to create SSIS execution jobs, prime their parameters, and start their execution:
[catalog].[create_execution]
[catalog].[set_execution_parameter_value]
[catalog].[start_execution]