In My production Server,
There is Agent Job routine
**Backup Database Task-->Check Database Integrity task-->Rebuild index task-->Shrink Database Task-->Update Statistics Task.**
Each Task runs in some time interval.
My Question is
If I change this Agent Job routine like below
Backup Database Task-->Check Database Integrity task-->Shrink Database Task-->**Update Statistics Task-->Rebuild index task**-->
**Any issues/Performance issue would occur or not?**
![alt text][1]
Note:
My DBA has recently changed this Statistics update task runs before instead of Index rebuild task
[1]: /storage/temp/923-job+agent+schedule.gif
↧
If we change Agent Job routine in DBA Task? Pros or Cons?
↧
Sql server agent to look for files
Is there a way to create a sql server agent job where the program will keep looking for a directory to find certain files and if the files are found then move to the next job? I guess I’m looking something similar to file system watcher in C#. So every day I receive files at a different time via FTP and it’s not at any specific time. Once I receive the all the required files only then I can start the update process. I’m trying to automate the process by creating a job that will look for files and if the job becomes successful then start the update process. Thanks.
↧
↧
sql server Agent Job issue
I create one job to perform some task. I configered well and its schudelued well and good. The problem is the job not doing its work but am not getting any earrors related to that job, its agent history not showing any earrors. when i run the job manually its success but work was not done how can i trouble shoot that job pls give me better suggation.
↧
how to find child PID in sql server
i have sql agent job running which launch an .exe file when i checked it is waiting with PREEMPTIVE_OS_PIPEOPS, if i stop it job will be stopping but in background this spid keeps running, i took the hostProcess and checked on the server, it is the sqlagent PID. is there any way to find child PID or the PID associate with it ??
hostProcess spid kpid blocked waittype
5224 68 26688 0 PREEMPTIVE_OS_PIPEOPS
↧
SSIS job fail due to ADO NET Source has failed to acquire the connection
Hello,
I have an SQL server 2012 SSIS package that runs fine in Visual Studios (BIDS) but when I try to schedule it in SQL Agent Service Job, I get the following error:
Description: ADO NET Source has failed to acquire the connection {E06725D4-46B5-4B9D-929E-3AAD98D98354} with the following error message: "ERROR [28000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]Invalid user authorization specification. ERROR [01S00] [Pervasive][ODBC Client Interface]Invalid connection string attribute. ERROR [01S00] [Pervasive][ODBC Client Interface]Invalid connection string attribute. ERROR [28000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]Invalid user authorization specification.
My connection is to an offsite server and I've created the ODBC connection to the server and provided the login to the Application on the connection string. However, I don't see in the connection string in the job the connection to the server, it only has the ODBC connection name and username for the application. I've added the password in the connection string to the application. I'm thinking that I need to provide the username and password for the connection to the server in the job. Can someone please assist in resolving the above error? Any help is greatly appreciated.
Thanks,
Doug
↧
↧
SQL Agent Job Fails in the middle of the job
I have an agent job that normally runs weekly on a scheduled time and it usually runs without any problem. I ran the same job twice manually by right clicking the job and clicked “start job” but both times the job failed in the middle of the job but at a different stage of the job. I’m a member of a sysadmin and the job runs under a service account. I’m running Microsoft SQL Server 2012 (SP1) on a Windows Server 2012. I looked at the audit log and received this error
“Msg 0, Sev 0, State 1: Unspecified error occurred on SQL Server. Connection may have been terminated by the server. [SQLSTATE HY000]”
I’m not sure if there’s a way I can look whether I lost a sql server connection but I looked at the windows server uptime and it was up and running during that time. Is there a better way to track this problem and see what is causing the job to fail at a different stage each time when I run it manually?
↧
SQL Server Agent will not start
My problem started with a broke logon trigger. When I went to sqlcmd and did the disable and logged back in the agent would not start again. I have done a repair of the SQL server installation. I have the following messages from the system:
Could not load the DLL xplog70.dll, or one of the DLLs it references. Reason: (null).
Any help on how I can get this fixed short of reinstalling SQL Server would be greatly appreciated.
↧
Procedure Hangs from SQL Agent Job, Same Proc Runs fine in SSMS 2008 R2 Linked Servers
Hello,
I have a Linked server to another SQL Server 2008 R2, and a stored procedure which executes queries utilizing both the local server and the linked server. When the procedure executes from a step in a SQL Agent Job, it intermittently hangs\slows down to a crawl (10-15 minutes to execute). When I stop the sql agent job and execute the procedure from SSMS, it executes just fine and normally under 30 seconds. Any ideas why this only happens from SQL Agent and how to fix this?
Here is a sample of the batch sql executing from the procedure:
--JWP Modified 4/3/14: Had client deploy truncate statement to stored proc
Print 'Delete From RB_ImportShipmentBatches'
Delete From [lnkServer1].AAD.dbo.RB_ImportShipmentBatches
EXEC [lnkServer1].AAD.dbo.usp_import_RB_ImportShipmentBatches
Declare @BatchCount INT
Select @BatchCount = Count(*) From DXBatchQueue WHERE TableName = 't_al_host_shipment_master' AND DateProcessed Is Null
PRINT 'Starting Unprocessed Batch Count = ' + Convert(Varchar,@BatchCount)
If @BatchCount = 0
Begin
PRINT 'Nothing to do'
RETURN
End
Print 'Delete From ImportShipmentDetail Pass #1'
Delete isd
From ImportShipmentDetail isd
JOIN ImportShipmentMaster ism ON isd.OrderNumber=ism.OrderNumber
JOIN [lnkServer1].AAD.dbo.RB_ImportShipmentBatches tb ON ism.HostGroupID = tb.HostGroupID
...
↧
Growing working set and private bytes for sqlserver and sql agent
We have SQL Server 2012 Standard SP1 to be used by sharePoint 2013. We are monitoring working set and private bytes for SQL server and sql agent. It is increasing everyday by few MBs. I suspect in few weeks it will be very high and will not leave any memory for other processes. We had similar situation few weeks back, but server restart released all memory. But now again it has started chewing up memory.
↧
↧
Unable to start SQL Agent
Hi All,
When i try to start my agent services, I am getting This error.
please help me,
ERROR Details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
Server stack trace:
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.FindObjectExplorerFrame()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.GetObjectExplorer(Boolean activateWindow)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ShowError(Exception e)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Service.Start()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ServiceActionHandler.EndInvoke(IAsyncResult result)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ServiceControlProgress.ActionCompletedHandler(IAsyncResult result)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3643 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ControlService
Assembly Version: 10.0.0.0
Win32 Version: 2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/ControlService.exe
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3643 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.NetEnterpriseServers.ExceptionMessageBox
Assembly Version: 10.0.0.0
Win32 Version: 10.0.5500.0 ((Katmai_PCU_Main).110921-2358 )
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.NetEnterpriseServers.ExceptionMessageBox/10.0.0.0__89845dcd8080cc91/Microsoft.NetEnterpriseServers.ExceptionMessageBox.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3637 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3639 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.SqlServer.SString
Assembly Version: 10.0.0.0
Win32 Version: 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.SString/10.0.0.0__89845dcd8080cc91/Microsoft.SqlServer.SString.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
ObjectExplorer
Assembly Version: 10.0.0.0
Win32 Version: 10.0.5500.0 ((Katmai_PCU_Main).110921-2358 )
CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/ObjectExplorer.DLL
----------------------------------------
System.Management
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Microsoft.SqlServer.SqlTools.VSIntegration
Assembly Version: 10.0.0.0
Win32 Version: 10.0.5500.0 ((Katmai_PCU_Main).110921-2358 )
CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.SqlTools.VSIntegration.DLL
----------------------------------------
Microsoft.VisualStudio.Shell.Interop
Assembly Version: 7.1.40304.0
Win32 Version: 7.10.6071
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Shell.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.dll
----------------------------------------
Microsoft.VisualStudio.OLE.Interop
Assembly Version: 7.1.40304.0
Win32 Version: 7.10.6070
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.OLE.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.OLE.Interop.dll
----------------------------------------
SqlWorkbench.Interfaces
Assembly Version: 10.0.0.0
Win32 Version: 10.0.5500.0 ((Katmai_PCU_Main).110921-2358 )
CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/SqlWorkbench.Interfaces.DLL
----------------------------------------
Microsoft.VisualStudio.Shell
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1826 (QFE.050727-1800)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Shell/2.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.dll
----------------------------------------
Microsoft.VisualStudio.Shell.Interop.8.0
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1826 (QFE.050727-1800)
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Shell.Interop.8.0/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.8.0.dll
----------------------------------------
Microsoft.SqlServer.Management.SDK.SqlStudio
Assembly Version: 10.0.0.0
Win32 Version: 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
CodeBase: file:///C:/Program%20Files/Microsoft%20SQL%20Server/100/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Management.SDK.SqlStudio.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
↧
SQLExpress 2012 SP2 issues
I installed SQLExpress 2012 with advanced services on my new Win 8.1 laptop. Since windows update is allowed to update all microsoft products, SP2 was installed also.
After the update, i noticed 2 strange things: 1) SQL Agents appears in the configuration manager (not able to start) 2) Reporting about number of logical and physical CPU is changed (screwed up). The laptop has an 'AMD A6-6310 APU with AMD Radeon R4 Graphics' which was identified as 1 physical en 4 logical CPUs. Now it's 0 Physical and 1 logical CPUs. (no bugfix found on CU1) Any ideas? I thought service packs are supported on Express...
↧
Where does SQL server store job failure error messages?
I have a job that inserts records in 10 tables every day at 10 pm. However, if any insertion in any table fails the job stops. I want to know what is the cause of failure. Where does SQL server store the error messages?
↧
Merge agent failure-SQL Merge replication
Hi All,
I have a a publisher which runs as a distributor and 4 subscribers. Using push merge replication.
When I checked my replication monitor, I noticed that one subscriber was not synchronizing data showing the error messages below:
The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Publisher for changes not yet sent to the Subscriber. You must reinitialize the subscription (without upload). (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199402)
Get help: http://help/MSSQL_REPL-2147199402
I fear to reinitialize because I might lose the data entered at the subscriber after the error manifested.
I have tried several advise from Google search but I have not got a solution yet.
Kindly advise how I can solve this problem without losing data at the subscriber.
Am using SQL Server 2005 and Win 2008.
Thank you.
↧
↧
what is the fifth job that will be created in log shipping?
what is the fifth job created in log shipping Apart from
1.backup job on primary
2.copy job , restore job on secondary
and alert job
↧
PowerShell versions in SQL Server Agent 2008 R2 - How to upgrade from V1.0 to higher versions
I have question about using PowerShell in SQL Server Agent on SQL Server 2008 R2.
* What circumstances would lead to only having PowerShell V1.0 available in SQL Server Agent task steps (even when launching PowerShell.exe from a cmdexec step), and how can I get more advanced versions?
Googling has revealed to me that the sqlps "mini-shell" used by the PowerShell steps in SQL Agent typically returns a version of 2, but is very constrained in terms of the cmdlets actually available to it. Therefore, it is common to launch new PowerShell.exe processes to get access to either v2.0 or v3.0 functionality.
However, when I schedule steps that launch PowerShell in SQL Agent, the shell appears to be version 1. I am beginning to suspect that this server only HAS version 1 installed (originally, I was mislead by launching the SQLPS shell from within SSMS on my workstation and finding version 3.0 available when I would launch PowerShell.exe within the sqlps console - I am reasonably sure that process was launched from my workstation, not whatever is available server side).
Working through this question, I think the answer might be that I need to talk to the sysadmin about updating either the operating system (I think that version number indicates the OS is Windows Server 2003) or install PowerShell V3.0 (or maybe both). Does anyone have any cautionary tales about upgrading PowerShell and SQL Agent? Do we need to uninstall PowerShell V1.0? Will SQL Server Agent be able to pick up the new version of PowerShell without trouble?
Addendum - Version info:
From a PowerShell script run in SQL Agent, using an operating system task (CMDEXEC), which launched powershell.exe and returned $Host.Version information:
Major Minor Build Revision
----- ----- ----- --------
1 0 0 0
The server version:
SELECT @@Version
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) Jun 28 2012 08:36:30 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) (Hypervisor)
↧
Sql agent job failed with sql_severity = 16 and sql_message_id = 16389.
There is no error message in the job history.
Is there any other table from where I can get the error info????
The job has sql_message_id = 16389 and sql_severity = 16. What does they mean????
↧
Can anyone help with a sql script that queries msdb to get failed agent jobs and sends out an email ?
Can anyone help with a sql script that queries msdb to get failed agent jobs and sends out an email ?
↧
↧
SQL Server 2012 Agent Service runs for about 4 minutes then stops
I am experiencing a really odd issue at a client site. They have SQL Server 2012 Standard edition and their SQL Agent Service starts without an issue and then after about 4 minutes it stops. I can execute jobs within the 4 minute window and they work. The default Windows AD account is used for the SQL Agent Service. I do get an Agent XPs changed from 1 to 0 information message (together with the associated reconfigure with override message) in the SQL Agent log. Does anyone have any clue as to what is happening?
↧
Check if SQL job is running or not
If I execute below statement to check SQL job running status, it gives me correct result.
DECLARE @JOB_NAME NVARCHAR(100),
@JOB_ID AS UNIQUEIDENTIFIER,
@StopDate DATETIME;
SET @JOB_NAME = N'MyJobName';
SELECT @JOB_ID = JOB_ID
FROM MSDB.DBO.SYSJOBS
WHERE NAME=@JOB_NAME;
SELECT @StopDate = STOP_EXECUTION_DATE
FROM MSDB.DBO.SYSJOBACTIVITY
WHERE JOB_ID=@JOB_ID;
IF @StopDate IS NOT NULL
EXEC MSDB.dbo.SP_START_JOB @JOB_NAME;
ELSE
PRINT 'Error:Job is running'
**But if I add order by START_EXECUTION_DATE DESC clause it fails.**
DECLARE @JOB_NAME NVARCHAR(100),
@JOB_ID AS UNIQUEIDENTIFIER,
@StopDate DATETIME;
SET @JOB_NAME = N'MyJobName';
SELECT @JOB_ID = JOB_ID
FROM MSDB.DBO.SYSJOBS
WHERE NAME=@JOB_NAME;
SELECT @StopDate = STOP_EXECUTION_DATE
FROM MSDB.DBO.SYSJOBACTIVITY
WHERE JOB_ID=@JOB_ID
ORDER BY START_EXECUTION_DATE DESC;
IF @StopDate IS NOT NULL
EXEC MSDB.dbo.SP_START_JOB @JOB_NAME;
ELSE
PRINT 'Error:Job is running'
why?.
Logically it should work.
↧
How do we sync Jobs in AlwaysOn Availability Groups
I have two servers, Server A and Server B. I have linked server between Server A and Server B. I have SAME JOBS on Server A and Server B. I need TSQL to get below information in 1 table
1. Schedule and name of those jobs which are not same on both Servers
2. Names of those jobs which are not same on both Servers
3. Names of disabled jobs on Server A, only if the same job is not disabled on Server B
4. Names of disabled jobs on Server B , but are active on Server A
Can anyone help me please? In short for AlwaysOn Availability Groups I am trying to keep jobs in sync on both primary and secondary
↧