One of my servers has developed a problem where it will restart during the restore of a SQL database. I've tried multiple databases and multiple backup files and it still happens every time....sometimes as early as the selection of the database backup file and sometimes as far as 60% completion of the restore job. There is no memory crash dump or information in the event log as to what caused it. Has anyone experienced this problem with SQL restores? Any suggestions on how to figure out what is going on?
Server reboots when trying to restore database
Suppressing message 978 in an Availability Group
We are running with Availability Groups in SQL2012 SP1 with a primary and a secondary replica that will allow access if you use application intent read only which we are not doing. We probably have some automatic polling by SCOM 2012 that throws the 978 message all the time causing a large SQL errorlog full of these messages and not much else.
is there a way to suppress these 978 messages?
Thanks
Chris
Error chain starting with write failure (error 655) during a DBCC CHECKDB caused the instance to restart with error 3449
Hello,
We experienced the following error chain (extracted from the SQL Server logs) that ultimately caused our instance to restart and fail over one of our primary AGs, causing us unexpected (albeit brief) downtime. We've never experienced (or though it was possible that) a CHECKDB could shut down the instance - does anyone have any ideas?
From the error logs (all spid 408):
The operating system returned error 665(The requested operation could not be completed due to a file system limitation) to SQL Server during a write at offset 0x0000034a90e000 in file 'redacted:\database.mdf:MSSQL_DBCC12'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Error: 3314, Severity: 17, State: 3. During undoing of a logged operation in database 'database', an error occurred at log record ID (742678:3728:21). Typically, the specific failure is logged previously as an error in the Windows Event Log service. Restore the database or file from a backup, or repair the database.
Error: 831, Severity: 20, State: 1. Unable to deallocate a kept page.
Error: 3449, Severity: 21, State: 1. SQL Server must shut down in order to recover a database (database ID 12). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.
And about 2 minutes later, on spid 10... SQL Server was unable to close sessions and connections in a reasonable amount of time and is aborting "polite" shutdown.
It is worth noting we do not have a database with an id of 12 - I've assumed that is referring to the internal snapshot DBCC was using though I haven't been able to confirm/deny that yet.
Several databases had completed their CHECKDB without issue (including one large database which takes ~2 hours to complete). The database which was being checked was under moderate load at the time, and was participating in an availability group as the primary replica, with synchronous commits going to a secondary.
We're running SQL2012 SP1 CU3 with hotfix KB2832017 (11.0.3350 x64 Enterprise).
When searching we found some references to the 'Kept Page' error though they all seemed to relate to 2005 and were fixed by a SP. We also investigated the file system filter driver route (as per Jonathan's blog entry) but we don't have any filters present.
This is the first time we've had the issue after several weeks of very similar workload patterns during the CHECKDB, and we're out of ideas for investigation.
One thing we have decided to do is to reschedule the CHECKDB for the database to occur at a time when less updates are happening and pay the CPU price during business hours (when the database has almost no writes), which our servers have the capacity for. We're hoping this prevents the situation happening but would like to gain a better understanding of what happened, and so far tests on development hardware (pushing write heavy workloads through a database while running a concurrent CHECKDB) haven't reproduced the issue, though we get IO bottlenecks on dev that don't exist in production.
Any thoughts, suggestions, or comments are welcome.
Kind Regards,
Tim
References:
Kept Page -www.sqlskills.com/blogs/paul/not-a-checkdb-error-unable-to-deallocate-a-kept-page/
Jonathan's blog entry - sqlblog.com/blogs/jonathan_kehayias/archive/2009/12/10/a-tale-of-checkdb-failures-cause-by-3rd-party-file-system-drivers.aspx
[Sorry for the lack of a hyperlink - account not yet verified]
how to rename a database and transaction log file.
i am using sql 2008 R2 server. i have deleted a database from the manage ment console. i want to clone other database with the same ( which i deleted) when i am trying to create a database it is saying that the name already exists. when i go there to the physical path and tried to rename the file it is saying like the file is in use. is there a way to rename the files?
Thanks in advance
Regards, Nag www.itsnag.info
Distributed Transactions fail on Linked server
We get the below error while performing a distributed transaction on linked server. We have several linked servers configured in the source server and all of them succeed with the distributed transaction except on one.
We did all the basic troubleshooting and moreover the distributed transactions work fine if we use a remote server instead.
Need your expert guidance in resolving this issue
Error:
OLE DB provider "SQLNCLI10" for linked server "SERVERNAME.REDMOND.CORP.MICROSOFT.COM" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 3
The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "SERVERNAME.REDMOND.CORP.MICROSOFT.COM" was unable to begin a distributed transaction.
Test code:
begindistributedtransaction
selecttop 10 *from [SERVERNAME.REDMOND.CORP.MICROSOFT.COM].master.sys.objects
ROLLBACK
Source server :
Microsoft SQL Server 2008 (RTM) - 10.0.1779.0 (X64)
Nov 12 2008 12:10:04
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6001: Service Pack 1) (VM)
Target server :
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)
Jul 9 2008 14:43:34
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 <X86> (Build 3790: Service Pack 2)
SQL Remote connection without specify PORT Number between different locations
Hello,
We need to connect SQL Server from one machine to another machine.
We have installed SQL server with instance name as SQLExpress.
We can able to connect remote connection with client machines in the same location without specifying port number.
But if i try to coonect sql server from different city or different country not able to connect without specifying Port number.
Could you please hep me to connect Sql server without specify PORT number from all locations.
Note :
1.Enabled Protocols.
2.Firewall exception created.
3.Allow remote connections enabled.
4.Authentication Mode changed to SQL Authentication.
Thanks and Regards,
Karthik.K
performance counter alert.
the sql server performance counter "number of deadlocks/sec"(instance'total') of objects mssql$dbssqlinst3:locks is nowabove the threshold of 0:00(the current value is 0:05
comment:deadlock event detected.
job run: dbssnapshotsys.processes.
Can anyone explain how to proceed for the above alert.
thanks in advance.
SQL Server 2012 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION
A query inserting into a view with instead of insert trigger is failing after migrating from SQL Server 2008 R2 to 2012.
Server version
Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)Dec 28 2012 20:23:12
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
SqlDumpExceptionHandler: Process 2792 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
and the stack dump
sqlmin!HoBtAccess::Initsqlmin!SingleColAccessor::CreateAccessor
sqlmin!RowsetNewSS::CreateInRowExprAccessor
sqlmin!CBitmapCompileContext::SetupInRowBitmap
sqlmin!CBitmapApi::Startup
sqlmin!CQScanRangeNew::CQScanRangeNew
sqlmin!CXteRange::QScanGet
sqlmin!CBpXte::PqsInitializeBatchProcessingTree
sqlmin!CQScanXProducerNew::CQScanXProducerNew
sqlmin!FnProducerThread
sqlmin!SubprocEntrypoint
sqldk!SOS_Task::Param::Execute
sqldk!SOS_Scheduler::RunTask
sqldk!SOS_Scheduler::ProcessTasks
sqldk!SchedulerManager::WorkerEntryPoint
sqldk!SystemThread::RunWorker
sqldk!SystemThreadDispatcher::ProcessWorker
sqldk!SchedulerManager::ThreadEntryPoint
kernel32!BaseThreadInitThunk
ntdll!RtlUserThreadStart
Any ideas what is causing it?
My blog: DBA musing
Sql Performance is slow
Hello
I found some strange issue.
My Server specification:
I have Windows Server 2012 as os in server. In that machine I had installed sql server 2012 standard edition.
RAM is 8 GB. & Processor Intel(R) zeon(R) CPU E5-2609
My Laptop specification:
WIndows 8 , 500 gb hard diisk 8 gb RAM.
Now Probem is,
I put my database in My server. Now I Run My Application on my laptop. I connect to server using LAN.
I try to access database put on server in my application.
It works fine. Performance is also good.
Now I put Database in my laptop. & I try to run My application in server. Connection Is done using LAN.
I try to access database which I put in my laptop. But this time application performance is very poor. It is working so slow. Database communication is very slow.
This Problem is not limited up to mine laptop.
I put Database on another server with same specification that is
I have Windows Server 2012 as os in server. In that machine I had installed sql server 2012 standard edition.
RAM is 8 GB. & Processor Intel(R) zeon(R) CPU E5-2609.
Lets name this server A.
another server has same specification . lets name it server B.
SO If I put database on server B & run My application in server A & try to access database from server B, then also connection is slow.
I use LAN for connection.
Same thing is done in reverse.
I put databse in server A & run my application in Server B & try to access database from Server B t
hen also performance is slow.
Performance only fast If I put Database in Server A & Run my application from my laptop or any other Computer then try to access database then performance is good.LAN is used for connection.
I am not getting why this strange issue occur?
Can any one tell me why this problem is happening? How to solve it?
Thanking you in advance..
Regards
Vipul Langalia
Hekaton: Composite Primary Key in create table statement
Hi,
I am trying out SQL 2014 Hekaton with Create table statement having Composite Primary key ( 2 columns).
I want to include something like
[Name, Number ] PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 1024)
in the create table statement. Is this possible ?
Hot to Data capture on secondary data file
Hi,
I had created 4 secondary data files across different disks on the same Primary file group. These 4.ndf files were created uniformly with initial size of 350GB and autogrowth of 2GB as was my existing.mdf file
After running Reindexing the secondary NDF files equally had data flow of 30GB each. The reindexing was not done on all the tables of the database and was done only on some selected 70tables.
Now i want to know real time validation to check if the secondary data file is getting utilized effectively ,that is DATA getting into the database is getting into these newly created secondary data files.
Can someone give me any T-SQL or an interesting method to get the output that objects are using these secondary data files.
No table partitioning has been done and these .ndf files are not under new file groups ,they are just added along with the primary file group.
Env : SQL server2008R2 SP2
Regards
Eben
Information on a Database that was restored with NO RECOVERY
Hello,
I'm working with SQL Server 2008Sp3.
I have a database that was restored from a full backup WITH NO RECOVERY and it then was restored with Transaction log backup files - also WITH NO RECOVERY.
At the moment the database is in Restoring status.
Let's say that couple of hours after the last transaction log restoration I want to continue restore the new 2 hourly transaction logs that were created, and then restore it WITH RECOVERY.
How can I query the status of the database, so I will know what was the last Transaction log backup that was restored on that database?
The reason I'm asking that is because I would like to automate this in a script -
I want to create a daily full restoration of a database on a separate server with all the available Transaction log backups WITH NO RECOVERY, and then upon request (when it's necessary), I'll be able to execute another script that will restore the new Transaction
log backups that were created since the end of the daily script + restore it WITH RECOVERY.
My question is regarding the second separate script - finding the rest of the needed Transaction log backups.
Thanks in advance,
Roni.
clustering request ques
HI,
in my clustering setup quorum and msdtc are locating one node and disks are locating in another node,
here clustering working or not?
Negative numbers found within sys.dm_io_virtual_file_stats
VIRTUAL FILE STATS - Any idea why a particualr server would be "bouncing" statistics?
*** This DOES NOT appear related to the sample_ms column issue ***
- Process collects sys.dm_io_virtual_file_stats and writes to custom table, on 15 min interval. This has been running since last Tuesday, using SQL Server Agent Job.
- This occurs for multiple databases and multiple files, but for READS ONLY. WRITES appear to increment.
- The same type of data is present in the custom table, or if I query the data directly out of sys.dm_io_virtual_file_stats.
- The server just "rolled over" sample_ms column, but this was occuring previously.
- I validated the elapsed time based on delta of insertdate in the custom table and by delta of sample_ms.
- Configuration: 10.50.2500.0 / 128GB / 24 lproc / 64-bit
- Server is new to our group. It is SAN attached (no details yet).
SAMPLE DATA.
The query properly joins a recorded copy of VFS to determine the previous record for the same DB/FileID. Notice how the READ values (CNT, BYTES, STALL) will decrement between subsequent recordings, then return back
InsertDatetime RID sample_ms ---------READ------------ --------WRITE------------ CNT BYTES STALL CNT BYTES STALL ---------------- ----- ----------- ----- ---------- -------- ----- ---------- -------- 2013-08-20 15:30 221 1851413611 62 3948544 785 0 0 0 2013-08-20 15:45 369 1852313363 62 3948544 785 0 0 0 2013-08-20 16:00 517 1853213161 57 3620864 827 0 0 0 2013-08-20 16:15 663 1854113349 61 3883008 882 0 0 0 2013-08-20 16:30 811 1855013428 61 3883008 882 0 0 0 2013-08-20 16:45 959 1855913086 61 3883008 882 0 0 0 2013-08-20 17:00 1107 1856812884 57 3620864 1212 0 0 0 2013-08-20 17:15 1255 1857712978 61 3883008 1258 0 0 0 2013-08-20 17:30 1403 1858613073 61 3883008 1258 0 0 0 2013-08-20 17:45 1551 1859513167 61 3883008 1258 0 0 0 2013-08-20 18:00 1699 1860412435 57 3620864 975 0 0 0 2013-08-20 18:15 1847 1861312655 61 3883008 1010 0 0 0 2013-08-20 18:30 1995 1862212749 61 3883008 1010 0 0 0 2013-08-20 18:45 2143 1863112953 61 3883008 1010 0 0 0 2013-08-20 19:00 2291 1864013079 54 3424256 955 0 0 0 2013-08-20 19:15 2437 1864912237 61 3883008 1033 0 0 0
SQL Server 2008 R2, Error: 701, Severity: 17, State: 123, There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:00:37.78 spid22s This instance of SQL Server has been using a process ID of 1268 since 5/15/2013 4:12:15 AM (local) 5/15/2013 8:12:15 AM (UTC). This is an informational message only; no user action is required.
2013-06-02 00:03:21.45 spid71 Error: 701, Severity: 17, State: 123.
2013-06-02 00:03:21.45 spid71 There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.20 spid53 Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.20 spid53 There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.25 spid59 Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.25 spid59 There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.26 spid58 Error: 701, Severity: 17, State: 123.
2013-06-02 00:12:23.26 spid58 There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:12:23.31 spid53 Error: 701, Severity: 17, State: 131.
2013-06-02 00:12:23.31 spid53 There is insufficient system memory in resource pool 'internal' to run this query.
2013-06-02 00:30:10.12 spid75 1 transactions rolled forward in database 'AppFabricMonitoringStoreDb' (9). This is an informational message only. No user action is required.
2013-06-02 00:30:14.12 spid75 0 transactions rolled back in database 'AppFabricMonitoringStoreDb' (9). This is an informational message only. No user action is required.
2013-06-02 00:30:20.78 spid75 Recovery completed for database AppFabricMonitoringStoreDb (database ID 9) in 13 second(s) (analysis 51 ms, redo 2264 ms, undo 2347 ms.) This is an informational message only. No user action is required.
2013-06-02 00:32:23.88 spid75 DBCC CHECKDB (AppFabricMonitoringStoreDb) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 2 minutes
20 seconds. Internal database snapshot has split point LSN = 0000e67d:00000593:0097 and first LSN = 0000e67d:00000591:0001. This is an informational message only. No user action is required.
2013-06-02 00:32:30.27 spid75 DBCC CHECKDB (AppFabricPersistenceStoreDb) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes
0 seconds. Internal database snapshot has split point LSN = 0000111b:000000b7:0001 and first LSN = 0000111b:000000b6:0001. This is an informational message only. No user action is required.
2013-06-02 00:32:31.40 spid75 DBCC CHECKDB (ReportServer$SQL2008) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds.
Internal database snapshot has split point LSN = 00000066:0000013f:0001 and first LSN = 00000066:0000013e:0001. This is an informational message only. No user action is required.
2013-06-02 00:32:31.91 spid75 DBCC CHECKDB (ReportServer$SQL2008TempDB) WITH all_errormsgs, no_infomsgs, data_purity executed by NT AUTHORITY\NETWORK SERVICE found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes
0 seconds. Internal database snapshot has split point LSN = 00000017:00000262:0001 and first LSN = 00000017:00000261:0001. This is an informational message only. No user action is required.
At the time of the error, the system is running a Job Agent Job created by Microsoft AppFabric called Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb. It has succeeded in every other invocation except this one at 5:06:30 AM. At the same time, the system runs another job named Microsoft_ApplicationServer_Monitoring_ImportWcfEvents_AppFabricMonitoringStoreDb. Both jobs are scheduled to run every 10 seconds. This job has never failed. This is what I see when viewing the Job Agent History Log:
Date 6/3/2013 5:06:30 AM
Log Job History (Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb)
Step ID 1
Server 1049AS_SQL\SQL2008
Job Name Microsoft_ApplicationServer_Monitoring_ImportWfEvents_AppFabricMonitoringStoreDb
Step Name ASImportWfEvents
Duration 00:00:01
Sql Severity 17
Sql Message ID 701
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: AS_MonitoringDbJobsAdmin. There is insufficient system memory in resource pool 'internal' to run this query. [SQLSTATE 42000] (Error 701). The step failed.
The Windows Event Log shows no entries around this time the System log, and only these SQL events in the Application log around this time.
Configuration details:
Server: Microsoft Windows NT 6.1 (7601), Windows Server 2008 R2 Standard SP1
Installed RAM: 4.00 GB
This is a VMware VM.
Microsoft SQL Server Standard Edition (64-bit)
10.50.1600.1
SQL_Latin1_General_CP1_CI_AS
Min Memory: 0
Max Memory: 2000 MB
This instance is on the same server as a SQL Server 2005 instance (Min Memory:0, Max Memory: 2000 MB). The 2005 instance was quiet at the time of the error in the 2008 R2 instance. Neither IIS nor any other significant services is running on this server.
This 2008 R2 instance is running SSRS and contains the databases for an AppFabric instance that is running on a different server. The only databases in this instance are the two SSRS databases and the two AppFabric databases, all of which are in simple mode.
The AppFabricMonitoringStoreDb.mdf (E:) is 1.5 GB and its log (F:) is 470 MB. tempdb.mdf (C:) is 250 MB and templog (C:) is 25 MB. All are set to allow unlimited growth. All drives have at least 5 GB free.
I had a similar problem last weekend, when the Max Memory for the 2008 R2 instance was set to 1500 MB. I increased it to 2000 MB as an experiment, but that doesn't seem to have helped. Given that the VM is only allocated 4 GB, the two SQL instances can't each
take 2 GB and leave the OS with nothing, so maybe I just need to allocate more RAM to this VM, but I have 4 other VMs exactly like it (same pair of SQL instances, same jobs) that haven't had any such memory issues and they are more heavily used than this one.
I would appreciate any ideas as to how to track this down and fix the source of this issue.
Thanks,
Mark
Working with Filestream
We've been using filestream storage for an app we've written in C#.net. I have some questions:
1. It looks like C# code retrieves filestream data from SQL then uses Windows IO to actually retrieve the file. Is this the most secure? We tried turning off Filestream for file I/O access so the only way you could get the data was through SQL but this produced an error.
2. We changed the login we use for accessing SQL Server to use SQL authentication only. Once we did that we lost the ability to access filestream data via C# - I assume because we no longer running with a domain account that had permissions on the folder.
3. We found a white paper from MS that suggested SQL Server logins cannot be used to access Filestream data. That seems to suggest the choice to enable filestream for file I/O access shouldn't be optional.
We are trying to produce an application that is as secure as it can be while being easy to manage by users with little or no SQL experience. We may need HIPPA like ability to restrict data access. We don't want anyone with the ability to browse folders to open up the files we've saved in filestream. At the end of the day, maybe filestream isn't the best choice for our storage...
sql server latches
Hi,
what is the sql server latches,
what purpose sql server latches are using can you any one give me clear clarification...
Unspecified error occurred on SQL Server during Index Maintenance
"Msg 0, Sev 0, State 1: Unspecified error occurred on SQL Server. Connection may have been terminated by the server. [SQLSTATE HY000]"
This error captured in after enabling the logging of the job to a txt file. Just before the error the UPDATE STATISTICS statement is executed. However after the error ALTER INDEX statement has also executed and then job failed. Nothing in SQL Error logs or Windows Event log at that time.
Below is the SQL and OS version.
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) Jun 28 2012 08:36:30 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
how to make inquiries, searching, into the SQL
I am looking for a manual to following the instruction in which i can learn to make inquiries, searching. specially the frecuent usefull commands.
thanks
Mssql 2008 attach on the network
Hi ı want to attach mdf/ldf file an anohter pc in the network. But sql say "failed with the operating system error 5(access is denied.)" the files are shared. How can ı do it? I use this code
GOCREATEDATABASE[X]ON( FILENAME = N'\\NetworkPath\Share\X.mdf'),( FILENAME = N'\\NetworkPath\Share\X_log.ldf')FOR ATTACH
GO
Please Help me