Quantcast
Viewing all 12963 articles
Browse latest View live

High Disc Write latencies on 3 servers simultaneously

Hello,

I would like to share an issue which is bothering our company's environment. We have a SQL Sentry monitoring tool (freshly set-up), and we're currently monitoring 5 instances on 4 servers.

3 servers are virtual (Windows 2012), 1 SQL Server 2012 and two SQL Server 2008 - only these 3 are suffering from the issue
1 server is physical (Windows 2008), SQL Server 2008

All servers share the same SAN.

For some reason, I am getting alerted on High Disk latencies on 3 of the servers once a day in exactly the same time on all 3 of virtual servers them. 

Here is a shot from SQL Sentry dashboard:

Image may be NSFW.
Clik here to view.

And here a shot from Disk Activity screen for the same period:

Image may be NSFW.
Clik here to view.

As you can see, there is a significant activite in TempDB log and also outside of the SQL Server datafiles (the white "Other" file).

However when I inspect TopSQL queries, I can see none with such write activity. I even ran a quicktrace during the period, and I still haven't found anything with comparable numbers in terms of writes.

Maybe I am missing something, does anyone have any ideas? The fact that it happens simultaneously on all 3 servers once per day (usually between 7:50 to 8:15, this slightly varies, but its always the same across all 3 servers on a given day), would suggest that it might be something in a SAN, but I want to be 100% sure its not inside SQL Server before I run to my SAN admin.

I did pose a general question "are you running something significant in SAN during that period" before, and answer was negative.

Many thanks for any hints on how to solve this mystery of mine.






Linked server set in Cluster Environment

Need to set up a linked server in two node SQL Cluster pointing to a standalone SQL thru security setting "be made using current login's security context". It's double hop Kerberos setup. Cluster uses a domain account, so we manually set SPNs for that account with both instance name and protocol as well (set up these SPNs with SQL virtual name only). Also, constrained delegation has been  set to that stand alone SQL services (MSSQLSvc).

Both SQL cluster and standalone servers are in same domain, cluster service account is domain account and standalone SQL uses default SQL local service account.

Coming to SQL, when I create linked server, sometimes it lets me create without issues and sometime it throws this below warning and even if I create it won't work.

 Login failed for user 'NT AUTHORITY/ANANOMOUS LOGIN'.  Need help. thanks. Prabhu


Prabhu Boggavarapu

User created with FOR LOGIN and login does not exist?

I hope my question is clear.  For testing I made a group in Active Directory named MyDatabaseReadOnly with one user as a member.  Ido not have a login in SQL Server by the same name.  I created a database user with the following script.

USE [MyDatabase]
GO

CREATE USER [MyDatabaseExec] FOR LOGIN [MyDomain\MyDatabaseReadOnly]
GO

The script created the user MyDatabaseExec in MyDatabase.  I gave the user MyDatabaseExec permission to execute one stored procedure.  I then logged in as the lone member of the MyDatabaseReadOnly group and was able to execute the stored procedure in SSMS.

How does this work since there is no login MyDomain\MyDatabaseReadOnly? I understand (I think) that you can create database userswithout a login but I don't understand how I'm able to run the proc.


Kevin


Need a query/function to handle subsidiaries in a company tree

Hi, not sure this is the right forum category but here you go:

I have a holding tree with more than 200 companies, and several layers. Each company is defined by:

- a unique ID

- a direct parent ID --> the company immediately above in the tree

- an ultimate parent ID --> the company that owns the entire tree, it is the same for all

Now I am looking for a function that returns the list of all companies below a given one in the tree, and there could be several layers underneath. Doing that for the ultimate parent is easy because all companies now who their ultimate parent is, but I am struggling to build a function that works for an intermediary parent in a dynamic way.

I am sure I am not the first one trying to solve this problem ;-)


Thanks for your tips.

An error 1069 - )The service did not start due to logon failure) occurred while performing this service operation ...

Hi All,

 

We seem to be being plagued by the error below by our SQL Server agent. This happens almost everytime we restart the server that has been running for a day or two.

 

Our SQL Server Agent uses a none expiring domain credential. I understand that this problem only happens when the profile being used by the SQL Servr Agent has changed (password change). What puzzles me is that the login is A ok and no changes has been made to it's password.

 

We always resolve this problem by changing the login used in the SQL Server Agent to local and after that, returning it back to it's original domain login. Unfortunately, we cant always do this everytime something goes wrong.

 

Can anyone please help us shed a light on this? We're using SQL2k with SP3a. Thanks!

 

Error:

An error 1069 - )The service did not start due to logon failure) occurred while performing this service operation on the SQLServerAgent service.

 

 

Regards,

Joseph

Error in import\export packages when the package sceduled through sql agent

Hi All,

We have got DB cloud server(public IP) in to which data must be pushed on daily basis from our internal DB server.

 when we are using import\export wizard or SSDT for this task it is working fine, but for the same when we are creating SSIS package in import wizard and scheduling through agent it is throwing below error.

''  Code: 0xC0016016     Source: Package      Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2015-05-02 12:29:34.53     Code: 0xC0016016     Source: Package      Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2015-05-02 12:29:34.58     Code: 0xC0202009     Source: Package Connection manager "xxx.xx.xx.xx.packgestest.import"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E4D.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E4D  Description: "Login failed for user 'import'.".  End Error  Error: 2015-05-02 12:29:34.58     Code: 0xC020801C     Source: Data Flow Task OLE DB Destination [2]     Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "xxx.xx.xx.xx.packgestest.import" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error: 2015-05-02 12:29:34.58     Code: 0xC0047017     Source: Data Flow Task SSIS.Pipeline     Description: OLE DB Destination failed validation and returned error code 0xC020801C.  End Error  Error: 2015-05-02 12:29:34.58     Code: 0xC004700C     Source: Data Flow Task SSIS.Pipeline     Description: One or more component failed validation.  End Error  Error: 2015-05-02 12:29:34.58     Code: 0xC0024107     Source: Data Flow Task      Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:29:34 PM  Finished: 12:29:34 PM  Elapsed:  0.546 seconds.  The package execution failed.  The step failed.''

-->login is working fine in both the server.

-->we have selected do not save sensitive data in package protection level

-->cloud DB server agent is running with NTSERVICE, and i have given full rights for NTSERVICE account to the folder where package resides

-->internal server agent is running with our windows account

-->Package automation is throwing same error in both ways (i.e, if package created in our internal server and scheduled their OR in cloud DB server)

-->both the server are on windows 2012r2,64 bit with SQL server 2012 enterprise edition

Could some one please help me in this, so that I can automate the process.

With Regards,

Ram




Suspend Change Data Capture

Hi,

Is there a way to suspend / resume Change Data Capture for a table? 

While doing certain operations, I need to prevent change tracking of data (the changes should never be recorded), but I cannot disable CDC because that will remove all CDC information. Is is possible to just temporarily disable cdc and then enable it again, without losing history?

-Thanks!


Way to check last db index reorg date and time

Hi ~ Are there anyway I can check my last database reorg date and time using Tsql ?

MEMORY LIMIT value while restoring database

Hi Experts,

While restoring a large database (700G+) for testing purpose I was trying to improve the restore time than the earlier restore time of the same database. I was using a dedicated test machine with 32GB RAM, 4TB NAS using SQL SERVER 2012 Dev. edition. From some articles I came to know to tune two parameters i.e.,

1). buffercount
2). maxtransfersize

I enabled some trace parameters given in http://blogs.msdn.com/b/psssql/archive/2008/02/06/how-it-works-how-does-sql-server-backup-and-restore-select-transfer-sizes.aspx blog and enabled the stated flags.

After executing the restore job I reviewed the output of the sql server error log and found about the MEMORY LIMIT: 1538M, Please help that how sql server engine calculate the MEMORY LIMIT.

here is the full log information regarding 

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

Encode Buffer Count:14
Media Buffer Size:1024KB
Media Buffer Count:14
Filesystem i/o alignment:512
TXF device count:0
filestream device count:0
Fulltext data device count:0
Tabular data device count:1
Total Buffer Space:28MB
Min MaxTransferSize:64K
MaxTransferSize:1024 KB
Sets of Buffers:2
BufferCount:14
Memory limit:1534MB

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

Please advise what could be the optimal values of Buffercount and Maxtransfersize for a MEMORY LIMIT of 1538M.


Best Regards

Khalil



SQL TimeOut 逾時過期

Hi~ I often experience Timeout from application team.

I am wondering the timeout setting should be set on program side or on mssql side ?

sp_configure

remote login timeout (s)

remote query timeout (s)

As a DBA, how we can help to trace down the timeout from program ? server side trace? profiler ?

User And DB role can't able to drop ???

I have created two users and assign a database role. I tested object privileges behavior, when testing done I revoked the permissions and trying to drop user and db role but its giving following errors:

For User:

=======================


Drop failed for Login 'irfan'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.5058.0+((SQL11_PCU_Main).140514-1820+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+Login&LinkId=20476

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

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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

Server principal 'irfan' has granted one or more permission(s). Revoke the permission(s) before dropping the server principal. (Microsoft SQL Server, Error: 15173)

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

For Role:

======================
Drop failed for DatabaseRole 'myrole'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.5058.0+((SQL11_PCU_Main).140514-1820+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+DatabaseRole&LinkId=20476

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

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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

The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)

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

Lock pages in Memory allocationg huge memory

Hi All,

One of production server Physical Memory is showing 99% . I checked in task manager SQLSERVER is using only 170 MB.

I checked remaining processes also but all are using less memory.

I checked with wintel team they are suggesting AWE is allocating huge memory.

SQL2012 Version.

SQLServer Maximum memory:16 GB

RAM:24 GB

I verified lock pages in memory , it is also using  16 GB.

Can anyone suggest to resolve this issue.

High Memory Consumption on Use and No Memory Release after Use

Hi,

I am using SQL Server 2008 R2 Enterprise on my server.. It has 32 GB of RAM and SQL RAM configuration is set as Min / Max (0/22GB).

Applications are configured to use this SQL Server from various Clients. Some jobs are running also through SQL Agent and Windows Task scheduler through Batch Files which are using SQL Server.

As soon as the use of SQL Server started through various applications / jobs, the memory consumption starts increasing but when all the applications / jobs are not running, the memory consumption still displays the same like 17-18GB.

Next day when the application / jobs start again, it start increasing from that 17-18GB onwards.. After sometime when the memory consumption reach / cross 22GB which is configured as Max, the applications / jobs start getting stuck.

Therefore, I restart all the SQL Server Services every morning.

If anyone has solved this problem, please let me know How to configure the Release of Memory when the SQL Server Services are not in use.


Appreciate your co-operation.

Thanks and Regards,

Rakesh Kumar

IT Head

Mysore Saree Udyog LLP


where-object - filter array list

Hello all,

using powershell...

Trying to  filter where none of the file names are in the array list.

Not working against Array list....

any help would be great?

$Dir =  Get-ChildItem  $DirSource -filter "*.cdr" |
		Where-Object {($_.PSIsContainer -eq $false)	-and ($_.BaseName -notcontains $DBexcludeList)}

		ForEach($file in $dir)
		{
			$file.BaseName

		}

gv



Sword




Question about Transaction's Atomicity property

Hi Guys,

According to Microsoft document about transaction, there is a feature called atomicity. 

https://technet.microsoft.com/en-us/library/ms190612(v=sql.105).aspx

Basically it means within a transaction, either all of its data modifications are performed, or none of them is performed.

Now I have the following T-SQL code

SET IMPLICIT_TRANSACTIONS OFF

CREATE TABLE class (c_id int primary key, c_name varchar(10))
INSERT INTO class VALUES (11, 'yuwen'),(12,'shuxue'),(13,'lishi')
CREATE TABLE student (s_id int primary key, s_name varchar(10), c_id int foreign key references class (c_id))

BEGIN TRANSACTION
	INSERT INTO student VALUES (1,'bill',11)
	INSERT INTO student VALUES (2,'bill',14)
COMMIT

SELECT * FROM student
Can anyone explain why when we are looking at the student table, we can see that the first INSERT statement performed successfully, while the second didn't. I read from book saying that "foreign key violations do not cause all the statements to roll back", however, this conflict against the very basic transaction requirement regarding atomicity. How should I think about this?


October dates losing hour on table insert

I have a datetime field used to store a date of birth. When inserting the date of birth into the table it works fine. But when the date of birth is in the month of October, it takes an hour off. For example, if the date is 04-OCT-1993, it inserts as 03-OCT-1993 23:00.

It only happens for dates in October. It's being inserted via a .Net table adapter. It just so happens that October is the month that daylight savings kicks in parts of Australia (an hour is added), but I think this must be a coincidence.

Has anyone experienced this? Any ideas on how to correct it?

Thanks

SCOPE_IDENTITY() blocking

First, some background....  Long-standing system, multiple applications and web apps communicating with SQL Server through a farm of load-balanced app servers.  The app servers are running a common "business object" that we refer to as the data-source factory (DSF, for short), it's purpose is to translate object calls into database queries (i.e., a client record from the database becomes a "Client" object with various attributes representing values from the database).  This system has been in existence for several years, and began life running against SQL Server 7, upgraded to 2000, 2005, and for the past year, 2008 R2.  At any given point in time, there will be 400-500 connections to the database, any number of which can be doing work.  Server is not taxed,  48 cores, 512GB RAM, no performance issues of any kind.

From the beginning, we've seen a rare issue (2-3 times a year) where we'll suddenly have a handful of SPIDs start blocking, each claiming to be running "SELECT SCOPE_IDENTITY()".  If ignored, more and more SPIDs will exhibit the same behaviour, to the point where we've seen 200 or more, all blocking, all waiting on SCOPE_IDENTITY().  Often, attempting to kill the offending SPIDs is unsuccessful, as they are immediately respawned, presumably by our DSF.  Multiple attempts to kill those SPIDs is sometimes effective, but on occasion we are forced to restart the DSF's.

Trace log analysis of these incidents has not revealed a common table or query, the issue seems to affect all inserts into all tables.  Of particular interest, "wait_type" and "wait_resource" for these offending SPIDs are both reported as NULL.

For the first time in over a year (since upgrading to 2008 R2), this "event" occurred again this morning.  I'm tired of not being able to explain it, but I don't know where else to look, I've poked into every dark corner of SQL Server that I know to poke, and I've found nothing.  I'm not convinced that this is a SQL Server problem, I think it's something within our DSF, but I don't know how to prove (or disprove) that theory.

Suggestions?  Web searches for "SCOPE_IDENTITY blocking" have come up empty, reaffirming my belief that this is not a SQL issue, but something unique to our app.

Below is a snippet from my blocking log for this morning's occurrence, showing the first two blockers.  Within 10 minutes, there were over 50 blocking SPIDs, all waiting on SCOPE_IDENTITY():

********** Start time: 28 Dec 2011 05:11:00:427 ********** [SQLSTATE 01000]
session_id                      blocker                                                                                              status                         wait_type                                                        wait_resource                                                wait_time   command                          cpu_time    logical_reads        memory_usage login_time                     last_request_begin_time        last_request_end_time          client_net_address                       net_transport                            database_id
------------------------------- ------- -------------------- -------------------- -------------------------------------------------- ------------------------------ ---------------------------------------------------------------- ------------------------------------------------------------ ----------- -------------------------------- ----------- -------------------- ------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------- ---------------------------------------- -----------
320*                            0       a_web2               10.25.246.25                                                            sleeping                       (null)                                                           (null)                                                       (null)      (null)                           1724659     40185412             2            27 Dec 2011 18:42:57:260       28 Dec 2011 05:10:19:420       28 Dec 2011 05:10:19:420       10.25.246.25                             TCP                                      (null)
564*                            0       a_web2               10.25.246.25                                                            sleeping                       (null)                                                           (null)                                                       (null)      (null)                           2010        22632                2            28 Dec 2011 05:10:31:830       28 Dec 2011 05:10:58:360       28 Dec 2011 05:10:58:360       10.25.246.25                             TCP                                      (null)
169                             564     a_vts                10.25.246.24                                                            running                        LCK_M_U                                                          KEY: 6:395455534989312 (34ca69ce595f)                        664         UPDATE                           873         55748                2            28 Dec 2011 05:08:49:543       28 Dec 2011 05:10:59:810       28 Dec 2011 05:10:57:527       10.25.246.24                             TCP                                      6
514                             320     a_vts                10.25.246.20                                                            running                        LCK_M_U                                                          KEY: 6:72057594146652160 (86c97ce8fc81)                      41210       UPDATE                           16746       662206               2            28 Dec 2011 02:06:20:723       28 Dec 2011 05:10:19:230       28 Dec 2011 05:10:19:223       10.25.246.20                             TCP                                      6
session_id blocker resource_type        resource_subtype               resource_database_id resource_associated_entity_id request_mode                                                 database_name        object_name                                        resource_description
---------- ------- -------------------- ------------------------------ -------------------- ----------------------------- ------------------------------------------------------------ -------------------- -------------------------------------------------- ----------------------------------------------
514        320     KEY                                                 6                    72057594146652160             U                                                            Vue                  (null)                                             (86c97ce8fc81)
169        564     KEY                                                 6                    395455534989312               U                                                            Vue                  (null)                                             (34ca69ce595f)

---------------------------------------
***** session_id=320 *****

SELECT SCOPE_IDENTITY()

***** session_id=564 *****

SELECT SCOPE_IDENTITY()

Blocking Time = 0:41 [SQLSTATE 01000]


SQL 2008 r2 Upgrade Advisor, interpret results

We are updating an old production database server to a more current structure. Old is Server 2003 (x86) running SQL 2000 product version 8.00.760. The plan is to update the database to SQL 2008r2 then on to SQL 2012.

Downloaded and installed the SQL Server 2008r2 upgrade advisor on a workstation(Win7 pro 64) with SQL Server 2008r2 sp2 installed. Took a backup of the 2000 database and moved the .bak file to the workstation and restored the bak file, leaving it in the original compatibility mode, DBCC returned no errors.

Ran the Upgrade Advisor against the old server and receive a list of 19 method errors.. all PreUpgrade labeled. (I didn't install UA on the old server as it's still running production jobs and is Seriously under powered.)

Message"Method not found: 'System.Collections.Generic.IEnumerable`1<Microsoft.SqlServer.Management.SqlParser.Parser.Error> Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlCodeObject.get_Errors()'." the methods are:

DROPSYSOBJ
OLDSYSTEMTABLES
FTCATALOGNAMERESTRICTION
ORDERBYORDINALS
VIEWFORBROWSE
FTPROPS
DUMPLOAD
SPHELPTRIGGERNEWCOL
MERGE
FTCATPROPITEMCOUNT
SYSPERFINFO
INVALIDCHAR
NONANSIOUTER
XPAGENTPROXY
SPCONFIGURE
HOSTIDRETURN
DEPRECATEDSP
OLDDBCC
ORDERBYALIAS
DBCCCONCURRENCYVIOLATION
INFOSCHEMATA
TRACEFLAGS
BACKUPRESTORETRANSACTION
DBCOMPTLEVEL
BACKUPLOG
LARGECONSTTYPE
VIEWCHECKOPT
SYSLOCKINFO

FORXMLAUTO

Still haven't found a way to address these, not sure they have to be (??). Came across some posts that seemed to indicate these are generated by running Upgrade Advisor remotely against older targets.

Just for fun ran the upgrade advisor against the backup that was restored onto theWin7 box and received one error which is DEPRECIATEDSP method. I updated the compatability level to 100 ran Upgrade Advisor again with same results, the subsequent DBCC CheckDB would indicate no errors. From what I have been able to find in the forums, it looks like all is well for this part of it (maybe). Are these issues/errors really no longer of concern or are they just ignored(?) masked by the new version of SQL and still in play? ( I don't know if that makes sense it's the best way I can word it at this time)?   


no service SQL Server Management Studio

i had install sql express 2012 when i startup my SQL Server Management Studio i can not see any server name

[Solved] Can't restore - SQL Server 2012 thinks I am out of space

Our vCloud setup is a little odd, in that D: is a very small physical drive with virtual directory links to D:\SQL Data and D:\SQL Logs, each of which reside on much larger separate volumes (don't ask me why).

The result is that even though D:\SQL Data has beaucoups of empty space on it, D:\ only has a few hundred MB free.

All of which brings me to my problem.  I go to restore a database, foobar.bak, but I get an error because rather than looking at how much free space I have on D:\SQL Data, it's looking at how much free space I have on D:\ .

Is there a way I can configure it to look at the available space in the actual target folder D:\SQL Data, rather than the parent directory D:\?


PBS


Viewing all 12963 articles
Browse latest View live


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