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

Use DTA to analyse Query Store

$
0
0

I have a SQL 2017 database on Server 2019 with SSMS 18.4. I have turned on Query Store for a test database but when I select Query Store in the DTA Workload, I just get "99% of consumed workload has syntax errors" and there are no recommendations.

I'm sure I am doing something very silly wrong, but I can't think what and can't find any worked examples.


Error in creating backup directory using Ola Hallengren

$
0
0

I am getting the following error after the backup job running, when Ola is creating the directory it gives space between P-GYMDTSU1$P-GYMDTSU1 and \DAM (P-GYMDTSU1$P-GYMDTSU1 \DAM) and because of this the job failed and it is throwing an error 'the system can't find the path, I have uninstalled and reinstalled the Ola script reconfigured the job, I couldn't be successful. But when I take the backup manually it works fine since it has got the right backup path. but from the sql agent job I am getting the following error, if any one who can face this issue please help. 

Command: DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_create_subdir N'\\RDGS.local\backups\DBBackups\Prod\P-GYMDTSU1$P-GYMDTSU1 \DAM\FULL' IF @ReturnCode <> 0 RAISERROR('Error creating directory.', 16, 1)
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 3, 'The system cannot find the path specified.'
Msg 50000, Level 16, State 1, Line 1
Error creating directory.

Non-yielding scheduler on SQL Server 2019

$
0
0

We are getting a non-yielding scheduler error on our new SQL Server 2019 boxes.  This started when someone ran a query yesterday and in the error log it kicks off a BEGIN STACK DUMP  Looking at this:

https://support.microsoft.com/en-us/help/4338890/sql-server-appears-unresponsive-and-non-yielding-scheduler-error-occur

It seems this is due to bugs (subsequently patched) in SQL Server.  Others suggest it could also be an IO problem (IO is very low however, next to nothing). Can anyone advise?

Error extracted from log is below:

01/13/2020 10:45:50,Server,Unknown,Process 0:0:0 (0xa08) Worker 0x000001E6034CC160 appears to be non-yielding on Scheduler 8. Thread creation time: 13223301429074. Approx Thread CPU Used: kernel 0 ms<c/> user 192390 ms. Process Utilization 6%. System Idle 93%. Interval: 197693 ms.
01/13/2020 10:44:50,Server,Unknown,Process 0:0:0 (0xa08) Worker 0x000001E6034CC160 appears to be non-yielding on Scheduler 8. Thread creation time: 13223301429074. Approx Thread CPU Used: kernel 0 ms<c/> user 132140 ms. Process Utilization 6%. System Idle 93%. Interval: 137441 ms.
01/13/2020 10:43:50,Server,Unknown,Process 0:0:0 (0xa08) Worker 0x000001E6034CC160 appears to be non-yielding on Scheduler 8. Thread creation time: 13223301429074. Approx Thread CPU Used: kernel 0 ms<c/> user 70656 ms. Process Utilization 6%. System Idle 93%. Interval: 70658 ms.
01/13/2020 10:43:50,Server,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
01/13/2020 10:43:43,Server,Unknown,Stack Signature for the dump is 0x00000000000001B8
01/13/2020 10:43:43,Server,Unknown,* *******************************************************************************
01/13/2020 10:43:43,Server,Unknown,*
01/13/2020 10:43:43,Server,Unknown,* Non-yielding Scheduler
01/13/2020 10:43:43,Server,Unknown,*
01/13/2020 10:43:43,Server,Unknown,*   01/13/20 10:43:43 spid 6748
01/13/2020 10:43:43,Server,Unknown,* BEGIN STACK DUMP:
01/13/2020 10:43:43,Server,Unknown,*
01/13/2020 10:43:43,Server,Unknown,* *******************************************************************************
01/13/2020 10:43:43,Server,Unknown,***Unable to get thread context for spid 0
01/13/2020 10:43:43,Server,Unknown,Using 'dbghelp.dll' version '4.0.5'
01/13/2020 10:43:43,Server,Unknown,CImageHelper::Init () Version-specific dbghelp.dll is not used

Question on CEIP service in SQL Server 2019

$
0
0

Hi,

After SQL Server 2019 installation, we noticed three CEIP (Customer Experience Improvement Program) services - each one for database engine, analysis service and integration service have been installed. We don'r need them on customer production server hence we modified ini file and installed SQL Server without these services. 

My understanding is we don't need CEIP services either for patching or some other maintenance/update. in the following blog, someone mentioned 

NOTE : DO NOT REMOVE THESE SERVICES, AS THIS CAN IMPACT SQL SERVER SERVICE PACK INSTALLATION IN FUTURE.

https://mssqlfun.com/2018/04/26/sql-server-2016-sql-server-telemetry-ceip-services/

Kindly advise if not installing CEIP services would have no impact SQL Server usage and patching. 

Thank you for your time !!


can the tuning advisor make recommendations on specific queries

$
0
0

Hi we run 2019 std. I took a quick look at the tuning advisor yesterday and saw terms like file, workload, plan cache and query store.  I read a little too but could not come away with a quick decision if its a route I want to take for going further with recommendations on a specific query I have or even queries that may come up in the future.

I know the estimated execution plan made no recommendations on the specific query.  And yet, after taking the original query and first shaving off about 4 million data points from 2 billion to a special mart, then splitting the query into 2 with a temp table in between to force sql's hand a bit, and then tweaking the where clause, the query went from 14 minutes to 10 seconds.

Is the tuning advisor a tool that could have recommended even a portion of those steps I took?  Or equally good alternatives?  Does somebody just put the query in a file, choose file and push a button?     

does the tuning advisor use the same engine as estimated exec plan's recommendation?

$
0
0

Hi we run 2019 std. I learned a little about the tuning advisor with Olaf's help at https://social.msdn.microsoft.com/Forums/en-US/61b1d6c4-4df0-4dd2-bf46-646dc31a7f2c/can-the-tuning-advisor-make-recommendations-on-specific-queries?forum=sqldatabaseengine  .  Now I've become curious and more importantly interested in relying on the right tools in each situation.

does the tuning advisor (ta) use the same engine/algorithm as whatever generates estimated exec plan recommendations above the estimated plan graphic?  is the ta more advanced?  maybe the est plan's recommendation is more advanced?

I got 0 recommendations from ta on the original query discussed over at the other link.  But one index recommendation on the same query in the est plan's recommendation above the graphic.

Need help with a query

$
0
0

Can the column last_batch in sys.sysprocesses can be used to find the blockings that exists more than 5 min.

select * from sys.sysprocesses where blocked<>0 and datediff(mi,last_batch,getdate())>5


does the tuning advisor use the same engine/algorithm as estimated exec plan's recommendation?

$
0
0

Hi we run 2019 std. I learned a little about the tuning advisor with Olaf's help at https://social.msdn.microsoft.com/Forums/en-US/61b1d6c4-4df0-4dd2-bf46-646dc31a7f2c/can-the-tuning-advisor-make-recommendations-on-specific-queries?forum=sqldatabaseengine  .  Now I've become curious and more importantly interested in relying on the right tools in each situation.

does the tuning advisor (ta) use the same engine/algorithm as whatever generates estimated exec plan recommendations above the estimated plan graphic?  is the ta more advanced?  maybe the est plan's recommendation is more advanced?

I got 0 recommendations from ta on the original query discussed over at the other link.  But one index recommendation on the same query in the est plan's recommendation above the graphic.



Extended Events: How to use sys.dm_xe_object_columns and how to link type_name in that table

$
0
0

I want to write rows that are generated by various "ad-hoc" ExtendedEvents Sessions into custom tables.
In order to do that, we need to create tables that are properly created (column data types) created before the session is created.

So, we have these five tables that store the XE detail.
sys.server_event_sessions
sys.server_event_session_events
sys.server_event_session_actions
sys.server_event_session_targets
sys.server_event_session_fields

However, the data type for the captured events is in this table (dmv)

dmv: sys.dm_xe_object_columns    column: type_name

We have a join that uses the first five dmv's.  But could not figure out how to bring in the sys.dm_xe_object_columns (type_name) into the join, so that I can pre-prep the tables before the XE session is started.  Don't think joining on tghe name and\or object_name is a good idea .... It has to be by using the sys.dm_xe_object_columns.object_package_uid - I guess.

Any ideas?


SQL Server 2017 CU

$
0
0

May I know if I install CU18 will also include the previous GDR ??Or I need to install CU14+GDR and CU18 ?? Thanks

Question on log file truncation

$
0
0

Hello!

https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms179355%28v%3dsql.105%29


Q: Does that theory mean that with the default setting of autogrowth is enabled and the log file size = 2 097 152 MB the log file will grow up to 2TB even with daily log backups because the truncated VLFs would never be reused?

Thank you in advance,
Michael


How to Clean the SSISDB Size

$
0
0
Hi Experts,
 I have a SSISDB on server, which size is 93 GB when diagnosis this I found that the Contention values is 365, means this SSISDB is holding the log values of 365 days older. Now I have updated this values with 10 days, I invoke the job called "SSIS server maintenance job" which is cleaning this database. but it was running from last two days , its causing to slow down my DB server and also its just reduces 2 GB size. Is there any way to reduce the size of this SSISDB.

Regards Vikas Pathak

SQL Server 2019 snapshot agent error

$
0
0

Hello,

I was trying to configure an SQL Server 2019 transactional replication, but the snapshot agent returns the following error:

Error messages:
Message: An unspecified error had occurred in the native SQL Server connection component.
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowConnectionFailureException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.InitializeNativeBcpOutProvider(LogMessageCallback logMessageCallback, String strName, String strApplication, String strHost, String strServer, String strNetwork, Int32 encryptionLevel, String strDatabase, SecurityMode securityMode, String strLogin, SecureString strPassword, Int32 bcpBatchSize, Int32 loginTimeout, Int32 queryTimeout, Int32 packetSize, DeadlockPriority deadlockPriority, String strRowDelimiter, String strFieldDelimiter, Byte syncMethod, Boolean forceOdbcBcp, Boolean forceOleDbBcp, Boolean enableMultipleActiveResultSets, Boolean useReadPastHint, Boolean usePageLockHint, Boolean securePassword)
   at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.InstantiateBcpOutProviderWorker(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.InstantiateBcpOutProvider(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.Initialize()
   at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
   at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQL_REPL, Error number: MSSQL_REPL55012)
Get help: http://help/MSSQL_REPL55012

Any idea why?

Best regards,

José Cruz

Who owns linked server Providers

$
0
0

Under setup of a Linked Sever, the SQL Server has a list of Providers, who owns these?  Is it Microsoft or Oracle and how do we find out the version of this file

 


Kiran

SQL Server Polybase External Table with Hadoop HDFS issue

$
0
0

I am getting the following error accessing the HDFS file, the interesting things is ,PolyBase is connecting to HDFS and trying to access the correct file but somehow resulting into error, can't figure-out why ? Please find the External configuration below

Error:

Msg 7320, Level 16, State 110, Line 33

Cannot execute the query "Remote Query" against OLE DB provider "SQLNCLI11" for linked server "(null)".

 HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: BlockMissingException: Could not obtain block: BP-243674277-172.17.0.2-1529333510191:blk_1073743046_2226 file=/user/raj_ops/TP/Sacramentorealestatetransactions.csv

external table configuration


CREATE DATABASE SCOPED CREDENTIAL Hadoop_Cred WITH IDENTITY = 'raj_ops', Secret = 'raj_ops';
GO
CREATE EXTERNAL DATA SOURCE MyHadoopCluster WITH (  
      TYPE = HADOOP,
      LOCATION ='hdfs://192.168.0.107:8020',
      CREDENTIAL = Hadoop_Cred
);
CREATE EXTERNAL FILE FORMAT Hadoop_file_format WITH (  
      FORMAT_TYPE = DELIMITEDTEXT,
      FORMAT_OPTIONS (FIELD_TERMINATOR =',',
            USE_TYPE_DEFAULT = TRUE))

            DROP EXTERNAL TABLE HDFS_File

CREATE EXTERNAL TABLE [dbo].HDFS_File
(  
street nvarchar(500),city nvarchar(500),zip nvarchar(500),[state] nvarchar(500),beds nvarchar(500),baths nvarchar(500),sq__ft nvarchar(500),[type] nvarchar(500),sale_date nvarchar(500),
price nvarchar(500),latitude nvarchar(500),longitude nvarchar(500)
)  
WITH (  
      LOCATION = N'/user/raj_ops/TP/Sacramentorealestatetransactions.csv',  
      DATA_SOURCE =MyHadoopCluster,  
      FILE_FORMAT =Hadoop_file_format,  
      REJECT_TYPE = VALUE,  
      REJECT_VALUE = 0  
);

SELECT * FROM HDFS_File


Downgrade from SQL 2014 Enterprise Edition to SQL 2014 Standard Edition

$
0
0
I have SQL 2014 Enterprise edition. Can I take backup of the DBs and restore on other server which is on SQL 2014 Standard Edition? 

SCHEMA_ACCESS_OBJECT_GROUP Audit captures excessive amounts of data using the Data Engine Tuning Advisor

$
0
0

Our STIG requirement (Security Technical Implmentation Guide) is to add the SCHEMA_ACCESS_OBJECT_GROUP to the Server audit specifications.   In a recent test using the Data Engine Tuning Advisor (_dta), we ran a trace that allows _dta partitions to be created.  Being unfamiliar with the DTA for partitioning, the result was unexpected.   A database that is about 200 GIG in size was examined, dta partition schema / functions were created.  After the results were analyzed, the database was reverted to its original state with a backup (non-production environment). 

The size of the audit for that one day was 35 GIG.  Normally, the size of the audit file remains below 10 Meg.

DISCUSSION QUESTION:

SHOULD there be a setting that allows adding the SCHEMA_OBJECT_ACCESS_GROUP that will ignore information created by the Data Engine Tuning Advisor?

SECOND DISCUSSION QUESTION:

This seems like a bug to me.  Does anyone else see this as a possible bug or is my experience using the DTA for partitioning sorely lacking?


R, J




Extended Events always find sql abort?

$
0
0

for example,At the same time and diff transaction execute the same sql。both of sql exec very slow 、One of sql result is abort.

Ask me what will happen?

Can you use Copy-Only for a filegroup backup

$
0
0
We are running SQL Server 2014.  We have a database that has multiple filegroups defined.  We have various load jobs that run each night, each job loading a different filegroup.  I would like to use the Copy-Only feature and back up each individual filegroup before their respective load job runs.  This way if the load job fails, I only need to restore the filegroup that goes with that load job.  Has anyone done this?  Do you know if it will work?

Blockings

$
0
0

Last evening noticed blocking between these 2 statements. The first query was blocking the 2nd one.

-1.some select performed on fn_dblog with some where condition. (last_wait_type - ASYNC_NETWORK_IO)                

-2.alter index statement on a database. (last_wit_type - LCK_M_SCH_M)                    

fn_dblog function is used to read the transaction log records. What could be the resource that is common between the above 2 queries that could have caused the blocking.

Viewing all 15889 articles
Browse latest View live