Quantcast
Viewing all 12963 articles
Browse latest View live

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

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

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

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

Image may be NSFW.
Clik here to view.

Need help with a query

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


Question on log file truncation

Hello!

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

Image may be NSFW.
Clik here to view.

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

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

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

SQL Server Polybase External Table with Hadoop HDFS issue

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 obtainblock: BP-243674277-172.17.0.2-1529333510191:blk_1073743046_2226 file=/user/raj_ops/TP/Sacramentorealestatetransactions.csv

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

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




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

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




Downgrade from SQL 2014 Enterprise Edition to SQL 2014 Standard Edition

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? 

Who owns linked server Providers

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 Image may be NSFW.
Clik here to view.

 


Kiran

Extended Events always find sql abort?

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?

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Can you use Copy-Only for a filegroup backup

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

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.

Getting errors while trying to get SQL Server Agent to work

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

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

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?

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

SSIS Job Failing

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

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.)

Image may be NSFW.
Clik here to view.

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



Viewing all 12963 articles
Browse latest View live


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