108 questions
0
votes
0
answers
31
views
SQL Agent step with cursor not excuting for all databases [duplicate]
I have a SQL Agent job with a step that uses a cursor to run a DBCC CHECKDB for all databases. However, it randomly stops before it runs for all databases. The job succeeds, and I see no errors in ...
1
vote
2
answers
3k
views
A database snapshot cannot be created because it failed to start. The storage usage for the managed instance cannot exceed (1048576) MBs
ERROR ImageI have Azure Managed Instance databases. In which I have a database "ABC" whose size is 568 GB. When I run DBCC Check on my database it throws below error :
Msg 1823, Level 16, ...
0
votes
0
answers
2k
views
Attempt to fetch logical page (6:948264) in database 7 failed. It belongs to allocation unit 72057596882452480 not to 72057595956822016
When running the update query an error occurred (mentioned in the subject line) in the MSSQL server. After run DBCC CHECKDB ('db_name', REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS, NO_INFOMSGS and DBCC ...
0
votes
0
answers
240
views
DBCC CLONEDATABASE exception 12605 : Failed to create snapshot database
I'm executing the following instruction :
DBCC CLONEDATABASE(mydb_prod, mydb_clone)
And here is the exception I get :
Database cloning for 'mydb_prod' has started with target as
'mydb_clone'. Msg ...
0
votes
2
answers
2k
views
If DBCC printed error messages, contact your system administrator: operand type clash on index rebuild
Question: I'm using SQL Server 2016 and have a table with encrypted columns using Always Encrypt. I had to make some changes to the table. So, I had to drop and re-add the table. The table has one ...
0
votes
0
answers
70
views
Are there any .NET API to read SQL Server data pages?
I'm writing a C# program and it needs to read SQL Server data pages. Right now what I'm doing is using SQL Server's DBCC PAGE command to get this information and then parse the result. When the page ...
0
votes
2
answers
266
views
DBCC CHECKDB did not return a result set in Java ( MS SQL )
Here is my Function:
private static void checkDatabase(String dbName, String password) {
try{
Connection con=DriverManager.getConnection(
"jdbc:sqlserver://localhost;...
0
votes
1
answer
277
views
Capture content from Messages Tab SSMS
I am running the following query to shrink logfile of a database.
DBCC shrinkfile('Sample_log',0)
My concern is that, even if shrinking fails, query will run without any error. Only a message will ...
1
vote
0
answers
2k
views
Attempt to fetch logical page in database 5 failed
When I run a select query, I get the error:
Msg 605, Level 21, State 3, Line 1
Attempt to fetch logical page (1:XXXXXXX) in database 5 failed. It belongs to allocation unit XXXXXXXXXXX not to ...
2
votes
4
answers
3k
views
Is there a way to run sys.dm_db_log_space_usage for all databases?
I'm looking to create a monitoring tool to track changes in transaction log usage on a production server we maintain.
Previously, I used DBCC SQLPERF(LOGSPACE);, which provided a list of all ...
0
votes
1
answer
1k
views
Can't Run DBCC CHECKDB on master DB - Azure Files
Storing SQL Server database files on new Azure Files share. Cannot run full / comprehensive CHECKDB against these databases - I think this has something to do with user account not having permissions ...
1
vote
1
answer
734
views
Will DBCC SHRINKFILE kill the active transaction?
I have created a job that loads several GBs of data from source DB to my destination DB on daily basis. in the beginning this job was running fine without any issues.
For the past 2 weeks the job is ...
0
votes
1
answer
240
views
DBCC command to reseed identity of table inside Execute SQL Task in SSIS
I have a situation in which a fact table is loaded every day.
There are two SSIS packages that load this table.
1) Package1_FullLoad.dtsx - runs every Sunday, with a full refresh
2) ...
0
votes
1
answer
1k
views
DBCC SHRINKFILE with emptyfile generating filegroup is full errors
I have been using DBCC SHRINKFILE with EMPTYFILE to move data from one secondary data files data to another. There is currently four files in the filegroup and there is over 1TB free of space between ...
1
vote
1
answer
2k
views
Is it possible to delete a single execution plan from cache on Azure SQL DB?
Conclusion
You can not. Microsoft explicitly states: "you cannot manually remove an execution plan from the cache" in this article called 'Understanding the Procedure Cache on SQL Azure'.
Original ...
0
votes
1
answer
392
views
DBCC CheckDb-any ways to detect errors vb.net?
I am using the below code to check if my database has any issues/requires troubleshooting:
Dim cmd As New SqlCommand("DBCC CHECKDB (offpoDb) WITH TABLERESULTS", con)
Dim reader As SqlDataReader = cmd....
5
votes
4
answers
29k
views
DBCC CHECKIDENT(myTable, RESEED,1) reseeding from 2
In SQL Server 2012, the following query is seeding the identity column myTable_id from 2 instead of 1. Why? myTable_id is also PK.
DELETE FROM myTable;
GO
SELECT * FROM myTable --0 rows are returned ...
2
votes
1
answer
97
views
Sql Server page structure. What is Fdata length?
I am trying to understand the structure of the Sql Server data pages. This is the screenshot from the Pro SQL Server Internals by Dmitri Korotkevitch
I've created 3 tables:
1 INT Column
2 INT Columns
...
0
votes
0
answers
173
views
Identity seed is mixed between 0 and 1 when reseeding all tables in database
**UPDATE (5/18/2017) **
I discovered the problem isn't as big as I thought it would be. This ONLY occurs after a schema has been deployed, and the migration errors out during the initial phase. The ...
1
vote
1
answer
864
views
Why do dbcc checkdb on system databases and sp_executesql on a user database cause a deadlock?
I have a daily job running a dbcc checkdb statement without additional parameters on each of the system databases. This job runs during off-peak hours and usually takes 5 seconds or less to run.
The ...
4
votes
1
answer
3k
views
SQL Server logging failed queries
I'm trying to implement a system-wide logging, which would log all failed Stored Procedure executions in our dabatase and I'm looking at Extended Events.
I've done some research and it seems quite ...
2
votes
2
answers
698
views
Does reset primary keys with DBCC CHECKIDENT safe for rows with bigger Id
I have a table with primary integer key value and its auto increment one by one , the values inside were going fine until 116, suddenly after a moment it continues from 10085 value ..
I don't know ...
2
votes
2
answers
2k
views
DBCC Command Not Working Inside Procedure
I have below query. Logically, the procedure usp_mytran should RESEED the Identity to 1 for table dbo.Sales. But the last query is returning different values for Max_ID_Value and Current_Seed_Value. ...
0
votes
0
answers
976
views
DBCC CheckDB require how much size of the Tempdb
An automatic job running to do the DBCC CheckDB for all of our database on SQL Server 2008 R2.
we have 22 DBs, and 1 of the db has about 160GB, I relocate a hard drive around 70 GB for the tempdb ...
1
vote
1
answer
1k
views
When do we specify fill factor for DBCC DBREINDEX?
I checked over google and found that if fill factor is 0 then it uses the 100% space on index page. Otherwise we need to specify the fill factor.
My questions to experts are:
Should we leave it ...