Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 April SQL Server: DBCC PAGE and DBCC IND to find a Data Page information

SQL Server: DBCC PAGE and DBCC IND to find a Data Page information

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In the previous series of the articles, I shared internal structure of the Data File and Data Page of the SQL Server.

In this article, I am going to share small practical demonstration on how to find Data Page information of a particular table of the SQL Server.

First, Create a table with sample data:

1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE TABLE dbo.tbl_TestDataPage
(
DataPageID INT PRIMARY KEY
,Name VARCHAR(30)
)
GO
 
INSERT dbo.tbl_TestDataPage
VALUES
(1,'Anvesh'),(2,'Neevan')
,(3,'Martin'),(4,'Jeeny')
,(5,'Maria'),(6,'Roy')
GO

Execute DBCC IND to check allocated pages of a Table:
You should put your Database_Name. -1 means display all type of pages.

1
DBCC IND('Database_Name', 'tbl_TestDataPage', -1)

The Result:
PageFID is a file number and PagePID is a page number. You can use these numbers for further tracing.

SQL Server Data Page Information

Execute DBCC PAGE to find more information about the allocated page:

Syntax:

1
2
3
4
5
6
7
DBCC PAGE ( {'database_name' or DB_ID}, file_number, page_number [, printopt={0|1|2|3} ])
 
Print option:
0 - print the page header
1 - page header plus per-row hex dumps and slot array
2 - page header plus whole page hex dump
3 - detailed per-row interpretation

1
2
3
4
DBCC TRACEON(3604) -- This trace flag enable result in table format.
GO
DBCC PAGE('database_name',1,274,3)
GO

The Result:

SQL Server Page Header Information

Apr 15, 2016Anvesh Patel
SQL Server: What happened, when Row Overflow and Data Exceeding 8KB?SQL Server: Understanding the role of Extent
Comments: 2
  1. anubha agrawal
    February 11, 2018 at 9:07 am

    Hey,
    I make one store procedure which returns 1 lakh records in 1 sec while executing in sql server itself,
    but when i am calling same store procedure by front end it will take a lot of time.
    please help me?

    • Anvesh Patel
      Anvesh Patel
      February 12, 2018 at 5:26 pm

      which model type, are you using on the front end.

Anvesh Patel
Anvesh Patel

Database Engineer

April 15, 2016 SQL ServerAnvesh Patel, database, database research and development, DBCC IND, DBCC PAGE, dbrnd, row page header, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....