Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15889 articles
Browse latest View live

Getting errors while trying to get SQL Server Agent to work

$
0
0

I am trying to get SQL Server Agent on an instance of 2014 and an instance of 2016 to run. Currently both of them start up but then immediately stop with the message: The SQL Server Agent (VERSION16) service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

I read on other issues that this is typically due to a permission issue. I checked the event viewer but all I saw was Event ID 101: SQLServerAgent service successfully started. followed by Event ID 102: SQLServerAgent service successfully stopped.

In order to rule out a permissions issue I went into SQL Server Configuration Manager running as an admin, went to the agent properties and switched Log on to the Built-in account: Local System. When I click OK I am getting the following error: The process terminated unexpectedly. [0x8007042b].

I am unsure where to go from here. I need this agent up as there are several nightly jobs that need to be run on a production database running on this instance. One of these is a nightly backup that is currently never executing. I am logged into the system as a user that is both a local and domain admin so there shouldn't be any permission issue here, please let me know if you can think of anything else I can try to get this working.



Upgrade advisory report failure on SQL Server 2019

$
0
0

HI,

We are doing impact assessment analysis for SQL Server 2019. 

ENV1: SQL Server 2019 on Windows Server 2016

ENV2: SQL Server 2019 on Windows Server 2019

When we run Microsoft Data Migration Assistant (5.1.4591.1), it runs fine for all databases in ENV1 but failing for some databases in ENV2. 

Errors in ENV2

The assessment of database 'Db1' on server 'MachineAK' failed.

Failed to determine supported target platformsfor source platform 'SqlOnPrem' of '15.0.2000.5' version. This source platform version is currently not supported to assess.

The assessment of database 'Db2' on server 'MachineAK' failed.

Failed to determine supported target platforms for source platform 'SqlOnPrem' of '15.0.2000.5' version. This source platform version is currently not supported to assess.

The assessment of database 'Db3' on server 'MachineAK'failed.

Failed to determine supported target platforms for source platform 'SqlOnPrem' of '15.0.2000.5' version. This source platform version is currently not supported to assess.

Could you please advise what is the issue and how to fix it ? 

Appreciate your help and support !!

Disable TDE - Error 33109

$
0
0

Hello,

I have enabled TDE encryption on a SQL Server 2012 database which is around 8TB. 

Now when I tried to disable it, it gives me below error message 

USE master;
GO
ALTER DATABASE XXX SET ENCRYPTION OFF;
GO

Msg 33109, Level 16, State 1, Line 1
Cannot disable database encryption while an encryption, decryption, or key change scan is in progress.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

Note: i was running checkdb on this database to check the impact of TDE after the encryption, but the checkdb failed after 160 hours due to space issue.

if I query sys.dm_database_encryption_keys

it shows 

encryption_state_desc
Encryption in progress

Please help.




What happens with SQL Log volumes run out of space?

$
0
0
Is it just TLOGS not happening anymore or are there other SQL issues that happen as well. Thanks!

SSIS Job Failing

$
0
0

I have an SSIS job which will hit MS SQL database, while running the specified job am getting below error message.

 Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description:"Unable to complete login process due to delay in opening server connection".  End Error  Error: 2020-01-21 01:44:02.39     Code: 0xC0202009

During this failure am not finding any useful hints in event viewer or in SQL server error logs.

Can you please help me to fix this issue.

Connectivity failure on sql 2012 instance

$
0
0

Hi All,

I am seeing below connectivity error while executing queries on a database. how can we fix this.

ERROR:
Transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

Brief background:
If we connect to a jump server and make a connection to server and execute the query, the query runs successfully.
However, when we try to connect to the server from a local desktop or a laptop and run the same query, it runs for sometime and we get above error.

SQL Server Version
Microsoft SQL Server 2012 (SP4) (KB4018073) - 11.0.7001.0 (X64)
    Aug 15 2017 10:23:29
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)



Regards,
Sam



Cannot enlist in the transaction because the transaction does not exist. Error: 3922, Severity: 16, State: 1.

$
0
0

Hi, we are having this error message in random times from random <g class="gr_ gr_99 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" data-gr-id="99" id="99">spids</g>. 

I've done some research but with no luck so far, it seems to be related to FILESTREAM (Which is heavily used by this application )

2018-07-01 18:50:05.87 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:50:05.87 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:50:05.87 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:50:05.87 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:54:27.12 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:54:27.12 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:54:27.12 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:54:27.12 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:55:28.30 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:55:28.30 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:55:28.30 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:55:28.30 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:58:50.66 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:58:50.66 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:58:50.66 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:58:50.66 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:59:18.61 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:59:18.61 Cannot enlist in the transaction because the transaction does not exist.
2018-07-01 18:59:18.61 Error: 3922, Severity: 16, State: 1.
2018-07-01 18:59:18.61 Cannot enlist in the transaction because the transaction does not exist.

How can I bulk insert into deltastore? HOW TO use SqlBulkCopy on a table with Non-Clostered columnstore index efficiently ?

$
0
0

Hello SQL server community,

We have an application that is loading data events in batches.

The application inserts events into SQL Server table with Bulk insert (System.Data.SqlBulkCopy). (in batches of 1-10000)

We have added a non-clustered columnstore index to the table.

Now each bulk insert results in COMPRESSED row group with the size of the batch and after a while things get a bit inefficient => you get lots of relatively small compressed rowstore groups and using the index becomes MUCH slower. 

Essentially we are back to times when there was no deltastore on NCCIs

Of course you can run a costly REORGANIZE on your NCCI to merge those tiny closed rowgroups into big ones.


If you execute an insert statement, index records it in the deltastore. And things are handled much more efficiently. 

 

Therefore my question: Is there any way to ask SQL server to treat Bulk insert as normal insert when updating columnstore indexes ?

Another formulation: Is there any way to disable BULKLOAD rowgroup trim reason for columnstore index when bulk-loading data?

Thank you very much,

Alexander

This scripts explains the question more precise:

To run it you need to create a file on filesystem for BULK INSERT 

It will create a DB and will clean it up afterwards 

SQL Server 2017 (14.0.3223.3) was used. 

Behavior is the same on Microsoft SQL Azure (RTM) - 12.0.2000.8   Aug 27 2019 17:56:41

USE [master]
GO

THROW 51000, 'Create a file C:\TestColumnStoreInservVSBulkInsert.txt with content: "test, 1" and comment this line', 1;  

CREATE DATABASE TestColumnStoreInservVSBulkInsert 
GO
use [TestColumnStoreInservVSBulkInsert]

CREATE TABLE [Table](
[value] [varchar](20) NOT NULL INDEX  IX_1 CLUSTERED,
[state] int not NULL
)

CREATE NONCLUSTERED COLUMNSTORE INDEX [NCI_1] ON [dbo].[Table]
(
[value],
[state]
)WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) 

insert into [Table] values (('TestInitail'), (1))

DECLARE @IndexStateQuery VARCHAR(MAX)  
SET @IndexStateQuery = 'SELECT i.object_id,   
    object_name(i.object_id) AS TableName,   
    i.name AS IndexName,   
    i.index_id,   
    i.type_desc,   
    CSRowGroups.*
FROM sys.indexes AS i  
JOIN sys.dm_db_column_store_row_group_physical_stats AS CSRowGroups  
    ON i.object_id = CSRowGroups.object_id AND i.index_id = CSRowGroups.index_id   
ORDER BY object_name(i.object_id), i.name, row_group_id;  '

EXEC (@IndexStateQuery)
-- Creates a COMPRESSED rowGroup with 1! record  
--QUESTION: How to make this statement add data to Open Rowgroup ?
BULK INSERT [Table] FROM 'C:\TestColumnStoreInservVSBulkInsert.txt' WITH ( FORMAT='CSV', ROWS_PER_BATCH = 1);

EXEC (@IndexStateQuery)
-- Adds one record to existing open rowgroup 
insert into [Table] select top 1 * from [Table]
EXEC (@IndexStateQuery)

--Costly fix. Merge and recomrpess closed rowgroups
--ALTER INDEX NCI_1   ON [Table] REORGANIZE   
--EXEC (@IndexStateQuery)


--Cleanup
use [master]
alter database [TestColumnStoreInservVSBulkInsert] set single_user with rollback immediate
drop database [TestColumnStoreInservVSBulkInsert]

 



Modifying SQL script to allow the script executed daily via SQL agent job ?

$
0
0

People,

I'm running a small physical server with SQL 2019 Standard with just 256 GB of SSD in a far remote location. Hence extending the C: drive is not possible.
At the moment the SQL DB of software called VeeamOne is taking most of the disk space.

I have already set the recovery model to Simple, but still, disk space is running low when I issue delete command manually when the disk space is reaching 50 MB free space left.

I assume by setting the recovery mode to simple, it is better than Full which taking up the disk space by growing .LDF files

Therefore I need some help from the SQL guru here to modify the below SQL script so I can always keep the last 60 days of data by deleting unused performance metrics. So I can run it as SQL Agent job every night to maintain the disk space usage in control.

Especially in this section: SET @dt = CONVERT(DATETIME, '2019-10-01 00:00:00.001' ,120)

ALTER DATABASE VeeamOne SET RECOVERY SIMPLE
GO

CHECKPOINT
DECLARE @dt DATETIME
SET @dt = CONVERT(DATETIME, '2019-10-01 00:00:00.001' ,120)

WHILE EXISTS (SELECT * FROM [monitor].[Event] WITH(NOLOCK) WHERE [time] < @dt)
BEGIN
    BEGIN TRAN
    DELETE TOP (500) FROM [monitor].[Event] WHERE [time] < @dt
    COMMIT TRAN
    CHECKPOINT
END​

WHILE EXISTS (SELECT * FROM [monitor].[perfsamplelow] WITH(NOLOCK) WHERE [timestamp] < @dt)
BEGIN
    BEGIN TRAN
    DELETE TOP (500) FROM [monitor].[perfsamplelow] WHERE [timestamp] < @dt
    COMMIT TRAN
    CHECKPOINT
END​

DBCC SHRINKFILE (N'VeeamOne_log' , 0, TRUNCATEONLY)
GO
DBCC SHRINKFILE (N'VeeamOne' , 0, TRUNCATEONLY)
GO
Thanks in advance.


/* Server Support Specialist */


The primary key is fragmented seriously?

$
0
0
Yesterday I rebuild all index, But today found that the fragmentation of primary key is much more serious than other indexes。WHY?Do you have relevant documents

spid 55 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION

$
0
0

Hello

We are running SQL server 2019 version 15.0.4003.23 – January 2020 on Windows server 2016

and it is producing the following error

01/10/20 15:10:21 spid 55 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000071C4D388 at 0x00007FFD91694CC4
01/16/20 14:06:43 spid 63 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:43 spid 63 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:43 spid 0 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:43 spid 15 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:43 spid 17 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:43 spid 0 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/16/20 14:06:45 spid 0 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 0000000067E1B7E8 at 0x00007FFABB39192B
01/22/20 09:19:02 spid 55 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 00000000E3A15E18 at 0x00007FFBADB04CC4
01/22/20 09:20:59 spid 56 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 000000007CE99CB8 at 0x00007FFBADAE08DB

-----------------

2020-01-16 14:01:40.04 Server      Software Usage Metrics is enabled.
2020-01-16 14:06:42.95 spid63      Open of fault log C:\MSSQL\MSSQL15.MSSQLSERVER\MSSQL\log\exception.log failed.
2020-01-16 14:06:42.95 spid63      CImageHelper::Init () Version-specific dbghelp.dll is not used
2020-01-16 14:06:42.95 spid63      Using 'dbghelp.dll' version '4.0.5'
2020-01-16 14:06:42.95 spid63      SqlDumpExceptionHandler: Process 63 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Can you please put me to the right direction to resolve the issue.

Many Thanks

How to install a replication feature via command while OS is core edition and sql server 2016 is there

$
0
0
How to install a replication feature via command while OS is core edition and sql server 2016 is there

Thanks, /\J/\Y GUPT/\ SQL DBA ..India..

table column data type [dbo].[Varchar_Value] on 2008 r2

$
0
0
Hi. I saw this data type  [dbo].[Varchar_Value] in a table definition.  what is that?  selecting @@version I see ...2008 R2.   I looked for synonyms in the same db, master, model, msdb and found nothing.

Shrinking SQL .MDF & LDF file size not working?

$
0
0

Hi All,

May I know what's the command to shrink down the .MDF and .LDF files?

Because when I execute this command below, it does not reduce the disk space used, even after I purge some of the old data content.

ALTER DATABASE AppDB SET RECOVERY SIMPLE
GO

DBCC SHRINKFILE (N'AppDB_log' , 0, TRUNCATEONLY)
GO
DBCC SHRINKFILE (N'AppDB' , 0, TRUNCATEONLY)
GO


Thank you in advance.


/* Server Support Specialist */

Tempdb growth issue

$
0
0
Hello, We have SQL 2016 Ent environment. Yesterday tempdb grew all of a sudden. We are trying to find the root cause as to what led to tempdb growth. How can I find the queries that led to yesterday's tempdb growth? Thanks.

sqldev


TSQL script for Deadlocks

$
0
0

Hello,

Is there a way to capture via a TSQL script, the deadlocks which last 10 minutes or longer for a particular database? 

Please advise.

Thanks,

Veena

Linked servers cannot be used under impersonation without a mapping for the impersonated login

$
0
0

So I have seen other forum posts, but they haven't exactly matched the issue I am having (though I am getting this same error!)

I am trying to run a sql server agent job that runs a stored procedure that queries a linked server (another MSSQL instance) and writes to a table in a database.  I am trying to run the account job as a domain account ie..  DOMAIN\SVC_REPORT.  This account has rights on the local database for writing, has the permission on msdb to run agent jobs, and has rights to query the data on the destination server.   I can log onto this database server as this user, run the stored procedure and it works with passthrough authentication.  However when I schedule it through an agent job I get the above error.  Security it set to be made using the login's current security context.  If I set up mappings, using either the SQL Service account for the instance OR DOMAIN\SVC_REPORT and map it to a local sql account on the destination server with rights to the data it also works.  So I have the work around, I just don't know why I can't run the agent job and have it pass authentication credentials through to the target without the mapping? 

Thank you for any replies!!

Jay

Transaction log space reclaim

$
0
0

Hi I am new to the organization as DBA and looking after SQL instance. One F: as transaction logs and used 50GB. Application users asked me to get clear this folder to some amount space. I am not sure why this transaction log is growing and not initialized after full backup. any solution for this. how to reclaim space with out impacting backup policy.

regards

How to export and import a database with all users from one server to another

$
0
0
We have a production server and need to export and import the database in development. What would be steps that I need to follow to create a copy of the database with users.

Microsoft.ACE.OLEDB.16.0 provider is not registered on the local machine. (System.data)

$
0
0

Trying to import data from Excel is giving this message.

Office365 64-bit

Here's what I tried:

1) I installed the 64-bit Access database engine 2016

2) I tried the 2010 & 2007 versions as well

3) I reinstalled Office365

I'm out of ideas. What else could be going on here?

Viewing all 15889 articles
Browse latest View live