Quantcast
Channel: SQL Server Database Engine forum
Viewing all 15264 articles
Browse latest View live

Database Engine fails to install

$
0
0

I have a full version developer 2017 and version 18 ssms as well as SSDT 15 installed already.  This would be for a side by side (SXS) of SQL 2019 CTP 3.2 running on Win10 (plenty of RAM 24 GIG - dual hex CPU)

 The error above comes along with two others:

1) Unable to open the Server service performance object. The first four bytes (DWORD) of the Data section contains the status code.
2) The Open Procedure for service "WmiApRpl" in DLL "C:\Windows\system32\wbem\wmiaprpl.dll" failed.
3) The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed.

These occur while installing the SQL Server 2019 CTP 3.2 Database Engine only.   150 Folder installs and repairs - only the engine will not install.

The suggested fix is to uninstall and reinstall - which I have done.

Ten seconds prior (again event log)
Using 'xpsqlbot.dll' version '2017.140.1000' to execute extended stored procedure 'xp_qv'. This is an informational message only; no user action is required.


R, J





OPENQUERY on SSRS

$
0
0
I have two systems , one using MS SQL and the other one using mySQL and so am using a linked server with OPENQUERY on MS SQL to connect to mySQL and read data from mySQL Database. The query works 100% on SSMS "SELECT * FROM OPENQUERY(MYSQL,'SELECT * FROM Transaction')" but if I use the same query on SSRS datasets, I am getting the error message below. Any ideas how I can fix this error? 

Grant permission using sql procedure

$
0
0

Hi everybody,

I have a SQL database with 2 tables, which are updated every day at 9 am. I created new user, which has access only to those tables. Update process firstly drops, then creates new one. I tried granting permission for user to read these tables. However, after procedure run, user can't see them. How can I dynamicly grant permission or update content of table without dropping it?

Tables have same name as before, but I suppose, that permission is assigned by id.

Regards,

Yerkhan

Importing Data from Oracle .dmp file

$
0
0

Hi guys,

Someone shared a data with me that is in oracle .dmp file and I don't have Oracle.

I was wondering if there is a way to import this data to MSSQL to be able to view it.

Thanks


me

Where to download SQL Server 2014 Developer edition?

SQL Server Agent job fails , but works fine when user stays logged in

$
0
0

I have a SQL Server job that runs a SSISDB package. The package does some SQL database connection and creates an excelt file as output. Finally it runs a VB 2015 script that opens the created excel file and rcopies sheets from that to another excel file and then a macro is run. The jobs runs fine as a SQL server agent job while I'm still logged onto the server . However when I log out the VB Script task fails with the message ' Script Task Error: Exception has been thrown by the target of an invocation. '.

help !


minimum permissions in order to issue checkpoint and dropcleanbuffers

$
0
0

Hi we run 2017 standard.  What is the minimum permission(s) our dba needs to give me in order to run checkpoint followed by dbcc dropcleanbuffers on a dev server?  I have already read the do's and donts and have actually used dropcleanbuffers in the past at other sites.  I can already read tables etc on most of the db's on the targeted server.

the error I get is

Msg 2571, Level 14, State 1, Line 3

User 'public' does not have permission to run DBCC DROPCLEANBUFFERS.

restrictions on source tables that are replicated

$
0
0
Hi er run 2017 standard.  Our prod tables are replicated to a test environment. I've heard different things about replication including (maybe) the requirement for a primary key.  Are there any gotchas in a replication relationship?  Especially on the source tables in terms of performance issues, constraints etc?  I heard a rumor that deadlocks can occur when sql server replication is happening.

SQL 2016: Syscommittab - Cleanup Single Transaction Results in significant log run up.

$
0
0
Good Morning All,

Question: Alternate ways to cleanup syscommittab.

Situation:
An abused Change Tracking implementation established pre version upgrade and patching to (13.0.5233.0) and upon removing high transaction side-table resulted in several billion record delete, single transaction upon sys.syscommittab.

Specifically after discontinuing change tracking on the most egregious offending dataset (tens of millions of transactions daily) we found log runup to the order of a terabyte per billion records in sys.syscommittab.  I believe this is a product glitch in how the table is cleaned up and was looking for suggestions beyond what is outlined in cleaning up the side table (e.g. discontinuing change tracking on the offender essentially drops the side table hence no need to clean it up.  Should not side table are the "sys.change_tracking_ObjectID" tables.).

We were contemplating purging in an organized fashion (not in a single transaction as the system was doing but rather in reasonable chunks) directly the sys.syscommittab table.  Specifically we would target records beyond the retention period.  This is after we have performed side-table cleanup such as outlined in https://blogs.msdn.microsoft.com/sql_server_team/change-tracking-cleanup-part-1/.

To add to my question above, has anyone attempted this and if not any thought on what we might expect would be helpful.

Version: SQL Server 2016 Standard SP2 CU4 (13.0.5233.0)
Logging: Full and Mirrored.

Log runup problem has been mentioned numerous times in this and other forums.  It wasn't until we had a very large log run up event that we started to dig to diagnose the problem.

Compounding Symptoms: Checkpoint blocked by "Task Scheduler" which was actually performing the syscommittab cleanup and "CtCleanupTblMetadata".  The process that drove up a pair of log files to their maximum, approximately 4.1 terabytes, then rolled back.   We couldn't add on additional log files to the database to mitigate the 2TB limit per file due to checkpoint being blocked by the syscommittab process.

Thank you in advance for any assistance.

Trace Flag 8293 not working

$
0
0

After we enabled Change Tracking, we keep getting the alert below:

"Change Tracking autocleanup is blocked on side table of "tablename". If the failure persists, check whether the table "tablename is blocked by any process."

So we followed this KB article to set Trace Flag 8293, but still we get the alert (11 within one minute), anything we could be missing?

https://support.microsoft.com/en-us/help/4456883/fix-change-tracking-cleanup-message-22123-is-unexpectedly-recorded-in

PS: we are using SQL 2016 SP2


Performance issues using SQL CLR - High PAGEIOLATCH_SH

$
0
0

Dear community, 

let me describe my problem: 

Query: 

SELECT t.value1, t.value2, x.valueA

from My300GBTable t

CROSS APPLY MyTableValuedFunction(varbinary field from table t) x

Usually, this works fine. But in some cases the plan generation takes >30 minutes. The system is showing 0% CPU, 3mb/s disk read and low memory pressure (~700GB available). IO System is 72 disk array. Disk queue length on logical disk is around 1.

dm_exec_session_wait_stats shows high PAGEIOLATCH_SH for the session. 

Once the plan is ready, queries are running fast.

Any ideas how to troubleshoot that? 


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?

Capture Table usage - using Xevents

$
0
0

i need to capture particular table usage (hits - select ,insert,update,delete...)  metrics from a database.

how can i implement this via xevent

i used below xevent , but this one not capture data,


CREATE EVENT SESSION [Xevent_DBA_Capture_Specific_Object] ON SERVER 
ADD EVENT sqlserver.module_end(SET collect_statement=(1)
    WHERE ([sqlserver].[database_name]=N'DATABASENAME' AND [object_name]=N'TABLENAME')),
ADD EVENT sqlserver.rpc_completed(
    WHERE ([sqlserver].[database_name]=N'DATABASENAME' AND [object_name]=N'TABLENAME')),
ADD EVENT sqlserver.sp_statement_completed(
    WHERE ([sqlserver].[database_name]=N'DATABASENAME' AND [object_name]=N'TABLENAME'))
ADD TARGET package0.event_file(SET filename=N'X:\Backups\Xevent\Xevent_DBA_Capture_Specific_Object.xel')
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
GO

Computer scalar

$
0
0

May I know what exactly there are two computer scalar are doing ???

Check type of hash join

$
0
0

How to check the hash join type in a query execution plan ?

1)In-memory hash join

In build phase table fit completely in memory.<o:p></o:p>

2) Grace hash join

In build phase table does not fit completely in memory and spans to disk.<o:p></o:p>

3) Recursive hash join

In build phase table is very large and have to use many levels of merge joins.<o:p></o:p>



non clustered index with pk vs non clustered index without pk

$
0
0

Hi we run 2017 standard. I'm looking at some tables whose non clustered (nc) indexes are definitely being utilized in the execution plan but there is no pk and no clustered index.

Does an nc index perform as well on a table that doesn't have a pk?  Say in comparison with everything being equal except that the second table has a pk that is the clustered index?

looking for a technique to make date range joins perform better

$
0
0

Hi we run 2017 standard.  I've come across this challenge in the past but never solicited help on the matter.

Often, I come across situations where individual records in table A match only a SINGLE record in table B based on
a datetime range in table B that covers a single datetime column from table A.  And indices dont seem capable of making
the match as efficient as other business scenarios where a datetime range isnt involved.

What do i mean? Lets say table A is the incident table (see index also) shown in the code block and it has 30.5 million
records that are newer (start datetime) than 2 years ago.  and about 27 million older than 2 years ago. 

And table B is the job table (see index also, notice no physical pk defined) shown in the code block and it has 3.3 million
records of which about 1.7 million jobs get a match as explained below.  I should mention that presently endtime is null on jobs that arent finished yet.

It would be great if the following query would run much faster than 8-10 minutes.  I suspect if the match criteria
involved only 1 or 2 column equivalents, it would.  But date ranges seem to perform poorly.  I verified that the indexes
shown in the code block are being used in the execution plan.   Now that I look at the NC on the jobs table, I have to admit that I don't know what we were thinking.

select count(*) from
(

SELECT
       inc.pk,
       inc.StartTime,
       inc.EndTime,
       inc.machine

FROM dbo.incidents inc (NOLOCK)
JOIN dbo.jobs job (NOLOCK) ON inc.machine = job.machine  
                          AND inc.StartTime >= job.StartTime
                          AND (inc.StartTime < job.EndTime OR job.EndTime IS NULL)
                          AND job.building = inc.building
                          AND (job.EndTime >= DATEADD(MONTH, -24, GETDATE()) OR job.EndTime IS NULL)

WHERE
inc.StartTime >= DATEADD(MONTH,-24,GETDATE())
) x

USE [mydatabase]


SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[incident](
	
	[Id01] [int] NULL,
	[EndTime] [datetime] NULL,
	[Id02] [int] NULL,
	[machine] [int] NULL,
	[Id03] [int] NULL,
	[Id04] [int] NULL,
	[Id05] [int] NULL,
	[Id06] [int] NULL,
	[Id07] [int] NULL,
	[StartTime] [datetime] NULL,
	[pk] [int] NOT NULL,
	[Id08] [int] NULL,
	[building] [varchar](25) NOT NULL,
	
 CONSTRAINT [PK_incident] PRIMARY KEY CLUSTERED 
(
	[pk] ASC,
	[building] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

USE [mydatabase]
GO

CREATE NONCLUSTERED INDEX [IDX_Incident_NCI02] ON [dbo].[Incident]
(
	[StartTime] ASC
)
INCLUDE ( 	[id01],
	[End_Time],
	
	[machine],
	[id02],
	[id03],
	[id04],
	[id05],
	[id06],
	[id07]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO



USE [mydatabase]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[jobs](
	[Id01] [int] NULL,
	[EndTime] [datetime] NULL,
	[Id02] [int] NULL,
	[machine] [int] NULL,
	[jobId] [int] NOT NULL,--<-------------------this and building are unique
	[StartTime] [datetime] NULL,
	[building] [varchar](25) NOT NULL,
) ON [PRIMARY]
GO

USE [mydatabase]
GO

SET ANSI_PADDING ON
GO

CREATE NONCLUSTERED INDEX [IDX_Jobs_NCI02] ON [dbo].[Jobs]
(
	[StartTime] ASC,
	[EndTime] ASC,
	[machine] ASC,
	[building] ASC
)
INCLUDE ( 	[id02]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

Database Engine fails to install

$
0
0

I have a full version developer 2017 and version 18 ssms as well as SSDT 15 installed already.  This would be for a side by side (SXS) of SQL 2019 CTP 3.2 running on Win10 (plenty of RAM 24 GIG - dual hex CPU)

 The error above comes along with two others:

1) Unable to open the Server service performance object. The first four bytes (DWORD) of the Data section contains the status code.
2) The Open Procedure for service "WmiApRpl" in DLL "C:\Windows\system32\wbem\wmiaprpl.dll" failed.
3) The Open Procedure for service "Lsa" in DLL "C:\Windows\System32\Secur32.dll" failed.

These occur while installing the SQL Server 2019 CTP 3.2 Database Engine only.   150 Folder installs and repairs - only the engine will not install.

The suggested fix is to uninstall and reinstall - which I have done.

Ten seconds prior (again event log)
Using 'xpsqlbot.dll' version '2017.140.1000' to execute extended stored procedure 'xp_qv'. This is an informational message only; no user action is required.


R, J




tune query

$
0
0

Hi,

abcd..Price  table contains = 1.9billon records

below query take more time bcaz of missing index, how can i tune this with out index creation?

Query:

select itemid,max(ts) lastcostchange from abcd..Price with(nolock) where Price_type='cost' group by itemid

if i created below index that one eat up 70GB of space in my drive,

CREATE NONCLUSTERED INDEX [ncls_price_prictyp_incl_ts_itemid]
ON [dbo].[Price] ([price_type])
INCLUDE ([ts],[itemid]) with (online=on,fillfactor=80)

SQLServerLogMgr::LogWriter: Operating system error 170(The requested resource is in use.)

$
0
0
Hello Experts,

        We have SQL Server 2012 on Windows server 2012 Failover cluster(VM).  Few days back we have installed Anti virus on Cluster nodes and got the error SQLServerLogMgr::LogWriter: Operating system error 170(The requested resource is in use.) Later we removed antivirus on both nodes. After couple of days again we started getting the same error and sql services are goes to stopped state. And if i perform failover then sql services are starting . Then after couple of hours later again it went to stopped state with the same error. This happened quite frequently in Node2 but on Node 1 it is happening very rarely.  Both nodes has different service packs and Windows CU.

Initially we thought it could be AV and now we completely removed still we are facing the same issue. 

Please help me to solve this nightmare issue.  



system error log

1:20:30 am

BackupIoRequest::ReportIoError: write failure on backup device 'G:\Backup\Dif_bkp\SCMDB_backup_2019_08_14_010128_7899718.bak'. Operating system error 170(The requested resource is in use.).

1:20:30 am

SQLServerLogMgr::LogWriter: Operating system error 170(The requested resource is in use.) encountered.

1:20:30 am 

The log for database 'msdb' is not available. Check the event log for related error messages. Resolve any errors and restart the database.

1:20:30 am 

The system failed to flush data to the transaction log. Corruption may occur in VolumeId: G:, DeviceName: \Device\HarddiskVolume5.
({Device Busy}
The device is currently busy.)

1:20:31 am 

The system failed to flush data to the transaction log. Corruption may occur in VolumeId: H:, DeviceName: \Device\HarddiskVolume3.
({Device Busy}
The device is currently busy.)

SQL Server Errorlog- 

Date,Source,Severity,Message
08/14/2019 07:21:10,spid6s,Unknown,SQL Server shutdown has been initiated
08/14/2019 07:21:10,spid6s,Unknown,Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup<c/> repair it<c/> or rebuild it. For more information about how to rebuild the master database<c/> see SQL Server Books Online.
08/14/2019 07:21:10,spid6s,Unknown,Operating system error 170(The requested resource is in use.) on file "H:\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf" during FixupLogTail.
08/14/2019 07:21:10,spid6s,Unknown,Error: 5159<c/> Severity: 24<c/> State: 13.
08/14/2019 07:21:10,spid6s,Unknown,SQLServerLogMgr::FixupLogTail: Operating system error 170(The requested resource is in use.) encountered.
08/14/2019 07:21:10,spid6s,Unknown,Error: 17053<c/> Severity: 16<c/> State: 1.
08/14/2019 07:21:10,spid6s,Unknown,fcb status 0x42<c/> handle 0x00000000000007A8<c/> size 224 pages
08/14/2019 07:21:10,spid6s,Unknown,blankSize 0x3c0000<c/> blkOffset 0x11a<c/> fileSeqNo 884<c/> totBytesWritten 0x0
08/14/2019 07:21:10,spid6s,Unknown,SQLServerLogMgr::FixupLogTail (failure): alignBuf 0x000000001163E000<c/> writeSize 0xc00<c/> filePos 0x63400
08/14/2019 07:21:10,spid6s,Unknown,374 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
08/14/2019 07:21:10,spid6s,Unknown,Starting up database 'master'.
08/14/2019 07:21:10,Server,Unknown,Software Usage Metrics is disabled.
08/14/2019 07:21:10,Server,Unknown,CLR version v4.0.30319 loaded.
08/14/2019 07:21:10,Server,Unknown,Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
08/14/2019 07:21:10,Server,Unknown,Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
08/14/2019 07:21:10,Server,Unknown,Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
08/14/2019 07:21:10,Server,Unknown,This instance of SQL Server last reported using a process ID of 11160 at 8/14/2019 7:21:08 AM (local) 8/14/2019 3:21:08 AM (UTC). This is an informational message only; no user action is required.
08/14/2019 07:21:09,Server,Unknown,Using conventional memory in the memory manager.
08/14/2019 07:21:09,Server,Unknown,Detected 49151 MB of RAM. This is an informational message; no user action is required.
08/14/2019 07:21:09,Server,Unknown,SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
08/14/2019 07:21:09,Server,Unknown,SQL Server detected 1 sockets with 4 cores per socket and 4 logical processors per socket<c/> 4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
08/14/2019 07:21:09,Server,Unknown,Command Line Startup Parameters:<nl/>-s "MSSQLSERVER"
08/14/2019 07:21:09,Server,Unknown,Registry startup parameters: <nl/>-d H:\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf<nl/>-e H:\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG<nl/>-l H:\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
08/14/2019 07:21:09,Server,Unknown,The service account is 'account\sqlservice'. This is an informational message; no user action is required.
08/14/2019 07:21:09,Server,Unknown,Logging SQL Server messages in file 'H:\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
08/14/2019 07:21:09,Server,Unknown,Authentication mode is MIXED.
08/14/2019 07:21:09,Server,Unknown,System Manufacturer: 'VMware<c/> Inc.'<c/> System Model: 'VMware Virtual Platform'.
08/14/2019 07:21:09,Server,Unknown,Server process ID is 5280.
08/14/2019 07:21:09,Server,Unknown,All rights reserved.
08/14/2019 07:21:09,Server,Unknown,(c) Microsoft Corporation.
08/14/2019 07:21:09,Server,Unknown,Microsoft SQL Server 2012 (SP4) (KB4018073) - 11.0.7001.0 (X64) <nl/>Aug 15 2017 10:23:29 <nl/>Copyright (c) Microsoft Corporation<nl/>Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)



Thank you

Sai Nadh
Viewing all 15264 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>