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

Connection failed when running automated script in SQL

$
0
0

Hi, 

I have a batch script that calls for winscp.com with a script parameter and if I restart SQL server solves the matter for a couple of week and then it starts to connection fail even if I try to restart SQL services still doesn't help only reboot SQL VM, also when I try to connect from winscp GUI I did not see any problem

thank you for your help



ERROR: (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

$
0
0

we have serverA  (sql box),   

server B  (application server)

server C  (IIS server, application servr)

Server D  (application server)


getting error from Server C  - ERROR: (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 

no other server throw this msg...

when restart IIS @ server C  issue solved.   


i do't see any longrunning, blocking issue on sql server , & i configured Replication ( act as publication& distribution)  do't see any replication command pileup in distribution.

-------

i thought , network may down between Server C to Server A

 or any IIS issue happen on Server C ?  how to check this?

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

SQL 2016 Ent migrate to SQL 2019 Ent

$
0
0

Hi

we have serverA (windows 2019 , sql 2016 ent) as publication ,

server B (windows 2019 , sql 2016 ent ) subscriber 1, 

server c (windows 2016 , sql 2016 std) subscriber 2, 

now we are going to migrate sql 2019 for all servers.  

  • how to accomplish this ? 
  • In-place upgrade ? possible?
  • Replication need to stop or remove before migration?

Problem with XML parser memory leak

$
0
0

We're using xml parameters to send a collection of data to stored procedure.
Typical (little simplified) use case would look like:

DECLARE @Values varchar(max) = '<Root><S>1</S><S>2</S><S>3</S></Root>', @h int
DECLARE @Val TABLE(ID smallint)

EXEC    sp_xml_preparedocument @h OUTPUT, @Values
INSERT INTO @Val(ID)
SELECT DISTINCT ID FROM OpenXML(@h,'Root/S',8)  WITH (ID smallint 'text()')
EXEC sp_xml_removedocument @h

SELECT * FROM @Val

We know we have to properly "pair" sp_xml_preparedocument /sp_xml_removedocument to avoid memory leaks.
Normally, our server works for months without any problems.

(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message)    https://imgpile.com/i/I5kAUR

At some point in time we're able to observe a constant growth of xml parser memory usage.
Our system still works, but it appears as if no document is being properly "removed", so our memory
usage graph begins to steadily grow.

(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message)    https://imgpile.com/i/I5kLYg

In the graph above 1.5K represents 1500MB. The only way to stop this endless growth is to restart
SQL Server service. After that it starts working just fine.

Is there a way to reclaim back all memory (some kind of overall xml parser memory "reset") without
rebooting the whole service?
Since our stored procedures are running pretty quickly (few seconds max.) is there a way to reclaim
all memory allocated by sp_xml_preparedocument which execution moment is older then some predefined time
(that would simply deallocate all "old" memory used by "old" xml documents)?

Any help would be very useful.

We're using version: Microsoft SQL Server 2014 (SP3-CU4) (KB4500181) - 12.0.6329.1 (X64)   Jul 20 2019 21:42:29   Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )

We also had identical problem with SQL Server 2012.

Restore from SQL managed instance

$
0
0

Hi all,

With the recent updates to SQL server 2019 versions we have encountered an issue with the version compatibility to Azure managed instance SQL versions.

I am getting this error message when trying to restore a backup file created from a DB on the managed instance - 

database was backed up on a server running version 15.00.2000. That version is incompatible with this server, which is running version 15.00.4003. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.

On the local server i have the latest CU1 installed and still it is not working although the version is higher.

The DBs are from an older instance so mostly compatibility level 110 (SQL server 2012).

Unfortunately the Data-tier export is also failing due to different reasons so i cant use that approach until fixing those.

Any idea on how to complete a restore with the new versions?

Before Azure went to version 15.00.2000 the normal restore process on the SSMS went without any issues when restoring the bak file.

Any help would be appreciated.

Thanks in advance

SQL database VSS differential backup API returns huge partial range when no data changed

$
0
0

I am calling VSS APIs to do a differential backup on a database (mdf file is ~16GB, log is ~15GB), which runs on SQL server 2014 sp 1. The partial range returned by IVssComponent::GetPartialFile() shows ~5GB data change in total, but I did not do any modification operations (insert, delete, etc) on the db after a full backup (which happened ~10min before). The native differential backup shows only ~2MB data backed up. The db has no index.

The partial ranges are small when the db file is small (< 8GB), that makes sense. For a large db, how the differential range is so big? 

Reading rows from the sys.sysobjvalues system table for a database - SQL Server 2016

$
0
0

Hi,

I need to verify the data inside the system table named sys.sysobjvalues for a my database: does it exist the corresponding system view to do it, please?

Thanks


Indexes are not used

$
0
0
We have massive performance issues with a SQL Server. The system is fast in the morning and will be slow in the afternoon.
It could be determined that indexes over several tables are no longer used from a certain point in time and therefore table / index scans were executed, which burden the whole system.
The statistics are up-to-date, index fragmentation is low (-1%).
Only after all indexes are recreated will the better execution plan be selected again.
That happened yesterday and the day before yesterday.
The problem is expected to re-appear today.
A SQL Server 13.0.4001.0 is used.

Kiran

Get Currency Conversion Rates

$
0
0

Hi 

I am working on one project wherein "Sales" amount is there in fact table and the currency like USD, GBP and there is also one column "Date" available. I am looking for any option available that can provide currency exchange rate for each day because we do not store exchange rates.

Create Database in Azure Blob Storage Error

$
0
0

SQL Server Version:  2019 (15.0.2070.41)

OS Version: Ubuntu: 16.04

Followed instructions to create:

- Azure Storage account

- Storage Account Container 

- Access Policy/Permissions

- Generated Shared Access Signature (SAS)

When attempting to create database receive the following error:

Msg 1802, Level 16, State 4, Line 12
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 5159, Level 24, State 5, Line 12
Operating system error (null) on file "https://<storage_account_name>.blob.core.windows.net/data/testdb_log.ldf" during MakePreviousWritesDurable.
Msg 596, Level 21, State 1, Line 11
Cannot continue the execution because the session is in the kill state.
Msg 0, Level 20, State 0, Line 11
A severe error occurred on the current command.  The results, if any, should be discarded.

I receive this error through SSMS and SQLCMD directly on the Ubuntu server.

Note:  I am able to backup my a DB to this newly created storage account successfully.

Best place to start learning Sql Server Internals?

$
0
0
I am looking for online resources for SQL DBA to learn sql server internals. Any suggestions please? 

SQL 2019 Upgrade

$
0
0

Team,

we have SQL 2016 running on our environment.

  • can you pls share Pros & cons to upgrade sql 2019 environment?
  •  recently SQL 2019 release with CU1, shall we wait for first quarter to fix some bugs in sql 2019?
  • apart from analytics, is this gives sqlengine  Performance compare with sql 2016.
  • in-place upgrade / side-by-side upgrade which one best & safe ( in production).
  • we have SSRS (native) running on production. during in-place upgrade this existing SSRS removed . and we need to install SSRS feature alone & setup SSRS using restore encriptionkey/db backup.
  • & we have Transcational Replication ServerA (pub+distribution) to Subscriber.  So first update Publication then Subscriber is possible?  ( we cannot upgrade subscriber then publisher? )


capture SP historic metrics running report

$
0
0

need to create report for all SP running metrics,

  SP (historic ) running time start ,end time , duration, with parameters.

  

monthly report need to create for above requirement.  

how to capture SP  with above metrics into  physical Table.  ( profiler will cause some Resource)

  • Xevent ?
  • DMV?

SQL Server 2017 CU18 Python Update Failure

$
0
0

We keep receiving the error of "Unable to connect to remote server" when trying to run the Python portion of the CU18 update for SQL Server 2017.  I've copied all CAB files over to the server, and specify the directory they are in each time the update is run.

This server is offline and my team does not want to open this up to the internet.  Has anyone else experienced the issue with this update and found a work around without simply opening it up to the internet?

I'm retrieving the CAB files from this link:  https://docs.microsoft.com/en-us/sql/advanced-analytics/install/sql-ml-cab-downloads?view=sql-server-2017  It does not have any CAB files for CU 17 or 18 yet, so I'm using what is listed for CU16.

We are on RSetup.exe version: 9.2.0.58.  

Here's a short section of the log in RSetup from one of my attempts.  I've specified the file location before this run, and previously, I'd tried simply copying the files to this location, but that still failed with the same "Unable to connect to the remote server" error.

2020-01-10T18:43:04INFO        Using default cache directory: C:\Users\username\AppData\Local\Temp\
2020-01-10T18:43:05WARNError making request: Unable to connect to the remote server
2020-01-10T18:43:05INFO        Error caught on attempt 1 - will retry after 2 second delay.
2020-01-10T18:43:08WARNError making request: Unable to connect to the remote server
2020-01-10T18:43:08INFO        Error caught on attempt 2 - will retry after 4 second delay.
2020-01-10T18:43:13WARNError making request: Unable to connect to the remote server
2020-01-10T18:43:13INFO        C:\Users\username\AppData\Local\Temp\SRO_3.3.3.1400_1033.cab: cache file found


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?     

Viewing all 12963 articles
Browse latest View live


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