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

Error chain starting with write failure (error 655) during a DBCC CHECKDB caused the instance to restart with error 3449

$
0
0

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]



Invalid object name for user-Defined table type parameter to stored procedure

$
0
0

I have a stored procedure defined with a single parameter whose type is a user-defined data type. On occasion when a call to this stored procedure is made I get an error "Invalid object name @ids". On a particular day I will this error only for a single stored procedure. We don't make any changes to the stored proc, or the C# code, but the next day everything works fine. I have attempted to pass different types of invalid data to the SP, like passing a null, or a table with the wrong data type for the columns, no data, etc. Using SSMS I have attempted to call this SP with different types of data for the parameters but nothing have done seems to generate this error.

My network people assur me that nothing with user permissions is being modified overnight. The SQL admins have checked the sql and system logs and there are no other errors being thrown.

In the SQL Profiler, I see 3 events, RPC:Starting, then SP:Starting, the RPC:Completed with a 1-Error in the error column.
I am tracing sp, rpc and sql statements.

The call to the stored proc is made by calling sp_procedure_params_rowset to get a list of parameters then building the stored procedure call. This is well tested code and always works as expected so I don't think how the stored proc call is built is what is causing this issue.

Any idea what could cause this?

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[pc_ccs_check_ids]
	@ids as dbo.single_id_clustered readonly
AS
BEGIN
SET NOCOUNT ON
SELECT det.id, ch.[level]
FROM @ids det	
INNER JOIN change ch
    on det.id = ch.id
END
GO

Thank you for any help you can provide.

You could be September's TechNet Guru! Turbo charge your CV with awards and interviews! Get noticed!

$
0
0

TechNet Wiki is partnering with... YOU!

Give us some juicy technical content and we might big you up!

It really is that simple!

 

Show us your forum solutions or drop us some nifty snippets and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

 

If you spend any amount of time crafting an awesome answer to a forum question, or just learnt something new, then why not get the most back for your efforts, by posting it to TechNet Wiki.

 

1) Please copy over any solutions and revelations to TechNet Wiki.

2) Add a link to it on THIS WIKI PAGE, so we know you've contributed

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

 

If you win, we will sing your praises, similar to the weekly contributor awards, however once "on our radar" and making your mark, you will probably be interviewed for your greatness, and eventually even invited into other TechNet/MSDN circles!

 

Either way, winning this award in your favoured technology can only be very good for your career! ;)

 

Feel free to ask any questions below.

 

Thanks in advance!
Pete Laker


#PEJL Got a good solution? If you invest your time in coding an elegant/novel or large answer on these MSDN forums, why not copy it over to our belovedTechNet Wiki, for future generations to benefit from!

Consistency Error, tried with DBCC checktable ('Table name'REPARI_ALLOW_DAT_LOSS)

$
0
0

Consistency Error, tried with  DBCC checktable ('Table name', REPARI_ALLOW_DAT_LOSS) not able repair this error

 Problem remains same .

       

The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.DMS_OPEN_VALUE' and the index name 'pk_open_val'. The duplicate key value is (10269, 1, 112291).
The statement has been terminated.
DBCC results for 'DMS_OPEN_VALUE'.
Repair: The Nonclustered index successfully rebuilt for the object "dbo.DMS_OPEN_VALUE, _dta_index_DMS_OPEN_VALUE_6_174623665__K1_K5_K6_K2_K7_11" in database "adv_tvs".
Repair: The Nonclustered index successfully rebuilt for the object "dbo.DMS_OPEN_VALUE, _dta_index_DMS_OPEN_VALUE_6_174623665__K6_K5_K7_K2_K1_K3_4_8_9_10" in database "adv_tvs".
Msg 8945, Level 16, State 1, Line 1
Table error: Object ID 174623665, index ID 1 will be rebuilt.
Could not repair this error.

Thanks in advance

Regards,

Manu

 


MANU

Windows user via group membership and sysadmin role for currently connected user

$
0
0

hello,

I am trying to get a list of currently connected user who has sysadmin role. For the Windows login who doesn't have their logins created on the server but are part of Windows group, there seem to be no way to find out whether they are sysadmin or not. I was hoping to join dm_exec_session to syslogins or sys.server_principals view but since the Individual login doesn't exist on the server it comes back with empty row. Does anyone know how to resolve this problem.

I am using SQL 2008 r2.

Thanks for your input.

Kush


how to make .bak up file of a database in SQL server 2008 R2 ?

$
0
0

Greetings,

I want to know what is the procedure to take .bak file of a database of sql server 2008 R2 and also how to restore that file , without running any sql query.

SQL 2008 R2 to SQL Server 2008 degrade passible

$
0
0
Can I install SQL 2008 on SQL 2008 R2 server as   I need 2008 only.  There is no data in the system

SQL Server 2012 Database Restore Checks

$
0
0

Hi,

I have just restored a SQL Server 2012 Database.

It's the first time I have done so.

I can select data from the tables which suggests it's been successful.

The final output message is

'RESTORE DATABASE successfully processed 189291654 pages in 10114.619 seconds (146.208 MB/sec).'

Are there any other checks I need to do to prove the restore is complete and has no issues?

Thanks


store procedure read issue...

$
0
0

Hi team,

we have one login, that login having only database read permission but  unable to run the sp_helptext query , sp_helptext is also one of  read permission

when ever run sp_helptext getting error :this is invalid for this operation. 


How to schedule job to run on the 6th business day

$
0
0

Good Morning ,

I have a job that is scheduled to run once a month. Its a .bat file that used the OS (CmdExec) to execute the file, which in turns executes the Package. Now i want to run it on the 6th business day of each month instead, is there a way in SSMS or any other advice is appreciated.

Thanks

When to do Index Maintence

$
0
0

Hi, how i monitor/manage/control when is index need to be created for reporting stored procedure before end user complained 'time out' ?

PS: The amount of data is increasing everyday.

How to find the effective recovery model of a database ?

$
0
0

Hi,

When a database is in full recovery model, but it hasn't a full backup, it works as a simple recovery model.

So, the question : Is there a query to identify these cases  ? Identify the effective database recovery model, instead the configured database recovery model ?

Thank you !

Dennes


Dennes - Se resolveu, classifique a mensagem, por favor - [http://www.bufaloinfo.com.br] NOVO DVD Segurança no ASP.NET : http://www.bufaloinfo.com.br/LearingSeriesSegurancaASPNET2.asp

SQL Server 2008R2 apply Service Pack2

$
0
0

Hi,

How I can apply service pack without backup databases on my instance ?

Please Help me.

Continue backup on error

$
0
0

Gurus,

I know I should not have to continue back up on error. But there is the option to continue backing up even if an error is encountered.

Can you give me instances where I may use continue on error option?

thanks,


ebro

A network-related or instance-specific error occurred while establishing a connection to SQL Server" for the projets who execute the query sql

$
0
0

One of my friend using the sap based application. he is trying to connect the sql database server from sap application and he is trying to connect the sql server remotely from sap client which is on another server.

connection is established but after few requests we are getting 

ERROR***

A network-related or instance-specific error occurred while establishing a connection to SQL Server" for the projects who execute the query sql

even he is trying to connect from remote server(sap client) through ODBC The SQL Server Native Client...

we are able to connect sql server but after certain clicks on test data source failed.

i had increased session time out =0 on sql connections settings


Differential Backups Failing

$
0
0

The differential maintenance plan is failing with this error message  "Cannot perform a differential backup for database "Search_Service_Application_CrawlStoreDB_e9b6abf77def428095e4156c66fb4e06", because a current database backup does not exist. Perform a full database backup by reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

This is happing on a SQL Server 2012 Server Build 11.0.3128. I have verified we have a full backup. The maintenance plan is set to run every 6 hours but only fails during the 8:00 PM run. The current set up is this:

Full Backup on Weekly on Saturday at 9:00 PM

Differential Backup Daily every 6 hours starting at 2:00 AM ending at 11:59 PM

Transaction Log Backup once daily at 3:00 AM I don't know why it is set up this way as I did not set this.

One last note: This is a SharePoint database.

Any advice would be greatly appreciated - Thank You.

question regarding index properties for an index

$
0
0

Hi,

per the topic.  This is a SQL server 2012 Sp1 with CU4 I was working on optimizing a query and was looking at the index property for a table, in the fragmentation page, I see 0 for everything.  This table is part of a partition but I find this hard to believe as there are 11m rows in there.  See screenshot. 

I have tried pretty much everything I can think off to get those numbers up.  Rebuild the index w/ Full scan, update the stats, drop the index and recreate it, ran dbcc checkdb against the database, dbcc check against the table, tried to get the information via the dmv w/ Limited option (results never came back).

The last thing I did was rebuilt the table w/o the partition and put the same index on and I'm able to see the data in the fragmentation page of the index properties.  

I was wondering if anyone experienced this before and has a solution to it?

Thanks,


Get Table Data Output into a text file

$
0
0

Hi Experts,

I have below code. Which is taking data from 2 tables and archiving it to some archive database. After archived. Its deleting data from the production table for the specified data range... I want to take the count of archived data for both the tables into a text file e.g If table 1 has 100 rows and table 2 has 200 rows to archive it can put into text file that 

"Total 100 has been moved from T1"

"Total 200 has been moved from T2"

IF no rows satisfied the condition than "No data found fro transfer"

Any Help...


USE ADB
GO
SET NOCOUNT ON
DECLARE @ConditionDate DateTime;
SET @ConditionDate = DATEADD(mm,-12, CURRENT_TIMESTAMP)

BEGIN TRAN

-- Move Data To Archive Table

    INSERT INTO BDB.dbo.T1
        SELECT *
        FROM ADB.dbo.T1
    WHERE EDate < @ConditionDate
   
-- Delete Data From Original Table

    DELETE T1
    WHERE EDate < @ConditionDate

    IF @@ERROR <> 0
    BEGIN
        ROLLBACK TRAN
        RAISERROR ('Error occured while moving data' , 16, 1)
     END

-- Move Data To Archive Table
    INSERT INTO BDB.dbo.T2
        SELECT *
        FROM ADB.dbo.T2
    WHERE EDate < @ConditionDate
   
-- Delete Data From Original Table

    DELETE T2
    WHERE EDate < @ConditionDate

    IF @@ERROR <> 0
    BEGIN
        ROLLBACK TRAN
        RAISERROR ('Error occured while moving data' , 16, 1)
     END

  IF @@TRANCOUNT > 0
    BEGIN
        COMMIT TRAN 
    END

Schedule a job to run on specific day

$
0
0

Hi all,

I want to schedule a job in SQL agent to run only after 7 days starting from the 28th of every month.

Thanks in advance.


Logic Reads ... counter makes no sense?

$
0
0

How it is possible that selecting less data causes more logical reads?

SET STATISTICS IO ON
go

SELECT [id]
      ,[filler1]
  FROM [Test1].[dbo].[Tab1]
  Where id = 1

Table 'Tab1'. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

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

SELECT [id]
  FROM [Test1].[dbo].[Tab1]
  Where id = 1

Table 'Tab1'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

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

Test setup looks as follows:

CREATE TABLE dbo.Tab1
(
id INT NOT NULL,
filler1 CHAR(36) NOT NULL,
filler2 CHAR(216) NOT NULL
);

CREATE NONCLUSTERED INDEX [NonClusteredIndex-20130905-002756] ON [dbo].[Tab1]
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

INSERT INTO dbo.Tab1
(id, filler1, filler2)
VALUES
(1, 'x', 'x');

using SQL Server 2008 R2

Viewing all 15264 articles
Browse latest View live


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