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

SQL Server 2016 OpenQuery Performance problem

$
0
0

I used Excel Odbc connection to select a table in AS/400, the download speed can be 50-60Mb/s

when I run a script in SQL Server query windows, 

IF EXISTS(SELECT * FROM sys.tables WHERE name ='AS400TBL')
BEGIN
DROP TABLE [dbo].[AS400TBL]
END
select * into dbo.AS400TBL From
OpenQuery(ASWDBB
Select * from BLP400.BLP800CFBL.AS400TBL
')

the max download speed is around 1-2 Mb/s.

both are running on the same server, but huge different in the download speed.

Do you know any parameter in the SQL server that I can try to speed it up?

In addition, I change the database to SETRECOVERY SIMPLE.

but cannot see any performance gain.


Errors DBCC CHECKDB in RECOVERY PENDING

$
0
0

I have

select @@VERSION

Microsoft SQL Server 2016 (SP1-GDR) (KB4458842) - 13.0.4224.16 (X64)   Aug 18 2018 09:00:06   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: ) (Hypervisor)

and I have several databases like RECOVERY PENDING.

I run this commands:

ALTER DATABASE BBDD_XXXX SET EMERGENCY;
GO
ALTER DATABASE BBDD_XXXX set single_user
GO

And this commands:

DBCC CHECKDB (BBDD_XXXX , REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
DBCC CHECKDB (BBDD_XXXX , REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;
GO

I get the error:

Database 'XXX' cannot be opened due to inaccessible files or insufficient memory or disk space



I run

SELECT database_id, name, state_desc, user_access_desc, recovery_model_desc from sys.databases
GO

13 BBDD_XXXX  RECOVERY_PENDING SINGLE_USER SIMPLE

SELECT database_id, name, physical_name AS current_file_location 
FROM sys.master_files

13 BBDD_XXXX   D:\DATA\BBDD_XXXX.mdf
13 BBDD_XXXX_log D:\DATA\BBDD_XXXX_log.ldf


SYSTEM user  has full control about D:\DATA

Too the group SQLServer2005SQLBrowserUser$ComputerName

mdf and ldf files not marked as readonly.
Any suggestions?


www.kiquenet.com/profesional

Microsoft Azure Backup Server - problem with backup MS SQL database

$
0
0
Hello. I have a backup problem - I once created protection group and archives sql databases from one server. Now I've created an additional database on the same server. I want to modify - add this created base in my protection group but unfortunately I do not see it on the list. Even if I add a new protection group and I want to add a database for archiving from this server, I do not see the database on the list - I can see all the others. What could be the reason? Thank you for your help.

Regarding to Backup Strategy!!!

$
0
0

Hi there,

I want to set backup strategy for a specific database in my SQL server.

In my case, I need to set database full backup every the first monday on month and also need to set database differential backup everyday except the first monday on month.

for example, the schedule is like below

The Monday of the first week: perform only full backup

After that, Differential backup is performed everyday by the end of the month.

and next month, again, the monday of the first week, only Full backup will be performed on that day and then from the next day(=from the tuesday of First week) Differential Backup will be performed.

In this case, how can I set this schedule in SQL Server?

There are no example in Technet so could you please help to do this?

Actually I'm considering T-SQL IF statements but not sure and I'd like to operate this just using UI.

Please help me!

Performance Issue: Worker threads ccassionally run out then SQL server rejects connections

$
0
0

I need your help on resolving this performance issue with our production database server.

 

We have a 24 x 7 Content Management System (CMS) running on asp/asp.net 2.0 and SQL server 2005 (I will give details of SQL server at the end of the post). Occassionally, or at least once every 2 weeks, we run into the situation of very high number of user connections to the database and SQL server worker threads maxed out, so the SQL server appears to be unresponsive. It could last for a couple of minutes or even more than half an hour. When we were notified about the issue, our only workable fix at this point is to kill all user connections and it recovers when connections are terminted. Once or twice, it went undetected and by the time we got it, it resolves itself in terms of user connections dropped back to normal.

 

More details on the sympton:

 

1. our normal number of user connections is about 1000, when this happens, it is over 2000 or 3000 or even over 4000 at one time.

2. No blocking was found in master..sysprocesses when this happens

3. We caught long-run SQL statements during the time, none of them stands out, because when we rerun those after the incident, they all finish quick enough. So it appears to be a general slowdown of the whole server.

4. On Windows perfmon side, when this happens overall cpu is down noticeably, and rebounce when we kill all user connections, I/O is also down, while no much change on memory side (in terms of cache hitratio, SQL server memory, page lifeexpectancy, etc.). One thing increased dramatically is number of LatchWaits (from around 100 to over 3000)

5. The server is running on an active-inactive clustered configuration, and when it happens, it does NOT cause failover, nor did we resolve by manual failover

 

We have snapshot of the following views:

 

master..sysprocesses

master..sysperfinfo

dm_os_schedulers

dm_os_threads

dm_os_workers

dm_os_waiting_tasks

 

I am waiting for your comments and suggestions. Thanks a lot

 

>>>>

SQL Server:

Microsoft SQL Server 2005 - 9.00.3215.00 (X64)

Dec 8 2007 17:58:16

Copyright (c) 1988-2005 Microsoft Corporation

Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

 

CPU: 8-way

 

Server memory setup

physical memory: 32G

min = 16384 MB

max = 28672 MB

 

max worker threads: 960

No manual Affiintiy control was setup.

<<<<<<

Support for SQL Server 2008 R2 after End of Support (July 2019)

$
0
0

Will Microsoft entertain a call for support for SQL Server 2008 R2 Enterprise Edition Database Engine after July 2019? We do not intend to purchase extended support for security updates and we understand that there will be no hot fixes either. But my main question is can we still call Microsoft Support for any assistance with the database for known issues?  We are currently using the pay-as-you-go model.

Thank you

SQL Server Cluster C: drive read write IOPS and latency

$
0
0

I have a sql server cluster with two nodes, both C: drive are local disk mirrors , with diskspd measurement the IOPS are less than 800 and read write latency are around 100ms, while other same hardware servers with IOPS over 30k  and latency less than 1.7ms.

Wondering if any one has same issue?

WriteRatioThreadsOutstandingBlock
404328192




SQL 2017 sp_xml_preparedocument

$
0
0

From the following link

https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-xml-preparedocument-transact-sql?view=sql-server-2017

"A parsed document is stored in the internal cache of  SQL Server. The MSXML parser uses one-eighth the total memory available for  SQL Server. To avoid running out of memory, runsp_xml_removedocument to free up the memory. "

1. does it mean using "Total server memory" of SQL server ? or memory that not govern by "max server memory"?

2. Can check how many memory used by MSXML parser currently ?

3. I got "XML document could not be created because of server memory is low" . So what's need to check ?


MSDTC cluster or MSDTC Local ??

$
0
0

What's the different of using MSDTC cluster or MSDTC Local ??

Seems windows 2016 clustering no need to have a cluster MSDTC resource

Error: 8623

$
0
0

Hi,

I am getting below error on SQL Server 2016 Enterprise With SP2.

Message
The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

Message
Error: 8623, Severity: 16, State: 1.

Getting error trying to connect to local server

$
0
0

I installed SQL Server 2016 Developer Edition on my work laptop with Windows 10 Enterprise. Everything worked fine after I installed it.  I downloaded the lastest version of SQL Server Management Studio (SSMS) V 17.9 and everything still worked fine.  I setup SSMS to connect to the local server and that worked fine.  The following week it stopped working and I get this error message:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to connect to server XXXXXXXXX. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
ADDITIONAL INFORMATION:

The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476

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

No process is on the other end of the pipe

------------------------------
BUTTONS:

OK
------------------------------

What could have happened?

I can access other servers with no problems.  Also our company has taken local admin permissions from our domain user account that we use to login our computers  and we need to get a temporary local admin user to install software.  I used the default users when installing SQL Server on my laptop.

Fred



SQL Server transaction log restore process

$
0
0

Hello,

I have a question related to SQL Server transaction log restore process.
Our purpose is sync our local SQL server database with third party's SQL Server instance 
every midnight they provide us a full backup file
and every half an hour, they provide us a transaction log file.
eg:
Sunday Midnight: full backup file
48 transaction log files
Monday Midnight:full backup file
 48 transaction log files
Tuesday Midnight: full backup file

Because the size of the full backup file is big, >20G, which take more than 7hrs to download to our local
My solution is restored One previous day full backup file+ 48 transaction log files of the day
For example, On Monday morning 1 AM, we start to download the Sunday midnight full backup file, and on Monday midnight, we download all the 48 transaction log files generated by Monday, and restore 
all of them. This solution works, but the size of the full backup file is still a problem.

My question is if its ok to download the full backup file once a week.
such as Monday morning, I still download the Sunday full backup file, and Monday midnight we download 48 transaction log files,the restore is Sunday full+ 48 Monday trans
On Tuesday, we only download that days trans, and restore  Sunday full+ 48 Monday trans+48 Tuesday
On Wednesday restore  Sunday full+ 48 Monday trans+48 Tuesday trans+48 Wednesday trans

Will this works?

Thanks

Linus


Cluster network name resource failed registration......

$
0
0

Hello,

I have a 2 node (Active/Passive) SQL Cluster .   I see the following error in Failover Cluster Manager - Cluster Events.

"Cluster network name resource 'SQL Network Name' failed registration of one or more associated DNS name(s) for the following reason: DNS operation refused.Ensure that the network adapters associated with dependent IP address resources are configured with at least one accessible DNS server."

Please advise how do I fix this?

Thanks,

Veena Srinivas


SQLServer 2016 - A time-out occurred while waiting for buffer latch -- type 3 and Message A time-out occurred while waiting for buffer latch -- type 4

$
0
0

All,

I see the below errors happening and one of our process timed out around the time this error also showed up. The version is 

SQLServer 2016 Enterprise Edition with AlwaysOn implemented - (SP1-GDR) (KB4057118) - 13.0.4210.6 (X64)  

The below CU8 for SP1 seems to be addressing the issue but I'm thinking that we should apply SP2.   

https://support.microsoft.com/en-us/help/4089819/time-out-error-when-using-availability-groups-in-sql-server-2016-201

I dont see any STACK DUMP  in the error log. Have others too got these errors before? 

Rgn

Below are the errors that I see in the Error Log:

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

Date10/19/2018 12:12:21 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid36s

Message
A time-out occurred while waiting for buffer latch -- type 4, bp 000000FB6D65DC80, page 1:1, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B02FC28 : 0, waittime 300 seconds, flags 0x1000000039, owning task 0x000001238B10B088. Not continuing to wait.

Date10/19/2018 12:07:54 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid54

Message
A time-out occurred while waiting for buffer latch -- type 3, bp 000000FB61CED200, page 3:614688, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B057848 : 0, waittime 300 seconds, flags 0x19, owning task 0x000000FB3DAEB468. Not continuing to wait.

Date10/19/2018 12:07:21 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid36s

Message
A time-out occurred while waiting for buffer latch -- type 4, bp 000000FB6D65DC80, page 1:1, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B02FC28 : 0, waittime 300 seconds, flags 0x1000000019, owning task 0x000001238B10B088. Not continuing to wait.

Date10/19/2018 12:07:16 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid78s

Message
A time-out occurred while waiting for buffer latch -- type 3, bp 000000FB7E8C8340, page 4:614688, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B047088 : 0, waittime 300 seconds, flags 0x19, owning task 0x000000FB3DAEB468. Not continuing to wait.

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

I also see lot of messages like the following:

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

Date10/19/2018 12:16:35 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 46 ms, user 769250 ms. Process Utilization 34%. System Idle 64%. Interval: 853345 ms.

Date10/19/2018 12:15:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 713515 ms. Process Utilization 34%. System Idle 64%. Interval: 793095 ms.

Date10/19/2018 12:14:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 657828 ms. Process Utilization 34%. System Idle 64%. Interval: 732845 ms.

Date10/19/2018 12:13:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 602140 ms. Process Utilization 34%. System Idle 64%. Interval: 672595 ms.

There are quite a few more of these messages.

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


SQL cluster on windows 2016

$
0
0

Hi All I have some questions on clustering . Here is the setting

1. SQL server 2016, windows server 2016

2. 4 nodes clusters + fileshare witness

3. Siteareness is enabled , and preferred site configured to node 1 and node 2,   node 3 and node 4 are secondary site

The questions

1. will there be impact on the preferred node order when configured siteareness ?

2. and also node ID impact on the node voting ?

3. For the behavior or dynamic voting, I did a test: If I reboot any node on secondary site (for example node 4), active node on node 1, I checked the dynamic voting of node 4 become zero, and another node in primary site also become 0. So the question is, HOW cluster choosing WHICH node in a site to lower down it's dynamic voting ??

4. cross-site network failure question, what's the outcome of the following

-  Crosssite link down, FSW on backup site, and sql instance owned currently at preferred site

-  Crosssite link down, FSW on preferred site , and sql instance owned currently at preferred site

-  Crosssite link down, FSW on backup site, and sql instance owned currently at backup site

-  Crosssite link down, FSW on preferred site , and sql instance owned currently at backup site


Changing Polybase Service account errors -- Access issues.

$
0
0

Hi,

We are on Microsoft SQL Server 2017 (RTM-CU9) (KB4341265) - 14.0.3030.27 (X64). We changed the Service account on the Polybase DMS and Engine and now we are getting the 

Internal Query Processor Error: The query processor encountered an unexpected error during the processing of a remote query phasewhen running DMVs SELECT * FROM sys.dm_exec_compute_nodes.

After verifying logs, it says that : Dms authorization failed due to [Domain\account] is not member of group [PdwDataMovementAccess] Do we have reinstall polybase again? Is there a better solution?


Procedure take more time

$
0
0

sometimes particular SP take more time.  ( no blocking / deadlocks happens)

what are the workaround ? how to identify a cause? 

normally takes 10 ~ 15min   , some times takes 2hrs. ( but data result volume not high).

Query to track the activity for Logins, Tables used

$
0
0

We are going to migrate the app <g class="gr_ gr_22 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="22" id="22">dbs</g> to re-route to <g class="gr_ gr_229 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="229" id="229">a enterprise</g> data and <g class="gr_ gr_231 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="231" id="231">i</g> am trying to work on a script to look for logins, <g class="gr_ gr_142 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="142" id="142">dbs</g>, tables, if possible, client <g class="gr_ gr_188 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="188" id="188">ip</g> address, or hostname connecting to the server

Is there a script that can look for these details

Thanks

Vamshi 


vamshi

Azure SQL Managed Instance xp_cmdshell 'unsupported' or simply won't work?

$
0
0

Hi

Looking to move to a SQL Managed Instance and establishing what changes we'll need to make to our internal monitoring code and see that xp_cmdshell is unsupported in MI does this mean it will work still but isn't supported or it simply will not work in a MI?

...asking here as opposed to Azure forum as there isn't a MI section as yet!

Thanks

SQL Server Database Mail does not use TLS1.2

$
0
0

I have a Windows 2016 DataCenter Version 10.0.14393 Build 14393.

I also have SQL Server 2017 with CU9 Version 14.0.3030.27 installed.

.Net framework is above 4.6.2

TLS 1.0 is turned off.

I can't get database mail to send email to the SMTP server. The error is as follows:

A fatal error occurred while creating a TLS client credential. The internal state is 1003.

Certificate is good.

Please assist.

Viewing all 12554 articles
Browse latest View live


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