SlideShare ist ein Scribd-Unternehmen logo
1 von 49
DBCC
         documented and
    undocumented, useful or un-
             useful
Dubi Lebel


D.B.A. = Don’t bother Asking

Dubi Or Not To Be

Dubi.Lebel@gmail.com
Introduction




Nice to meet you…..
documented and undocumented
• Documented
 • support
  • Books Online
  • Microsoft Knowledgebase
  • Whitepapers



• Undocumented
 • unsupported & risky
  •   Blog
  •    internet
  •    user group presentations
  •   do not expect me (or Microsoft) to help you with any issue
      caused by running any unsupported piece of code on your SQL
      Server!
Undocumented DBCC Commands
http://sqlgeek.pl/Download/Scripts/20091230_DBCC_Script.txt

DBCC HELP('help')
---------------------------------------------
dbcc help
(
   { 'dbcc_statement' | @dbcc_statement_var | '?' }
)
   [ WITH NO_INFOMSGS ]

DBCC execution completed. If DBCC printed error
messages, contact your system administrator.
DBCC HELP
DBCC HELP('?')
---------------------------
Checkalloc                      checkcatalog
Checkconstraints                checkdb
Checkfilegroup                  checkident
Checktable                      cleantable
Dbreindex                       dropcleanbuffers
Free                            freeproccache
Freesessioncache                freesystemcache
Help                            indexdefrag
Inputbuffer                     opentran
Outputbuffer                    pintable
Proccache                       show_statistics
Showcontig                      shrinkdatabase
Shrinkfile                      sqlperf
Traceoff                        traceon
Tracestatus                     unpintable
Updateusage                     useroptions

DBCC execution completed. If DBCC printed error messages, contact your system
administrator.
DBCC HELP('CHECKTABLE')
DBCC HELP('CHECKTABLE')
------------------------
dbcc CHECKTABLE
(
   { 'table_name' | 'view_name' }
   [ , NOINDEX
   | index_id
   | { REPAIR_ALLOW_DATA_LOSS
   | REPAIR_FAST
   | REPAIR_REBUILD
   }]
)
   [ WITH
       {
          [ ALL_ERRORMSGS ]
          [ , [ NO_INFOMSGS ] ]
          [ , [ TABLOCK ] ]
          [ , [ ESTIMATEONLY ] ]
          [ , [ PHYSICAL_ONLY ] ]
          [ , [ EXTENDED_LOGICAL_CHECKS ] ]
       }
   ]

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/0d6cb620-eb58-4745-8587-4133a1b16994.htm
Trace Flags
• Trace flags are used to temporarily set specific server
  characteristics or to switch off a particular behavior. For
  example, if trace flag 3205 is set when an instance of SQL Server
  starts, hardware compression for tape drivers is disabled. Trace
  flags are frequently used to diagnose performance issues or to
  debug stored procedures or complex computer systems.




BOL:
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/b971b540-1ac2-
435b-b191-24399eb88265.htm
Trace Flags vs. DBCC
Trace Flags:
• Trace Flags are numbers
• Toggle on/off to change in SQL Server‟s behavior
• Trace Flags toggle by DBCC (DBCC TRACEON / TRACEOFF)
• Result is change in SQL Server‟s behavior
• Could be just to enable a hotfix (multi HF in the same build)



DBCCs
• DBCCs are text command
• Result is a report as messages uotput
DBCC TRACEON
• --switching on trace flag 3205. This flag is switched on only for
  the current connection
• DBCC TRACEON (3205);
• GO

• --switches on trace flag 3205 globally
• DBCC TRACEON (3205, -1);
• GO

• --switches on trace flags 3205, and 260 globally
• DBCC TRACEON (3205, 260, -1);
• GO
DBCC TRACEOFF
• --disables trace flag 3205
• DBCC TRACEOFF (3205);
• GO

• --disables trace flag 3205 globally
• DBCC TRACEOFF (3205, -1);
• GO

• --sdisables trace flags 3205 and 260 globally.

• DBCC TRACEOFF (3205, 260, -1);
• GO
DBCC TRACESTATUS
• Status - Indicates whether the trace flag is set ON of OFF, either
  globally or for the session.
  1 = ON / 0 = OFF
• Global - Indicates whether the trace flag is set globally.
  1 = True / 0 = False
• Session - Indicates whether the trace flag is set for the session
  1 = True / 0 = False
DBCC TRACESTATUS
--displays the status of all trace flags that are currently enabled
globally.
DBCC TRACESTATUS(-1);
GO

--displays the status of trace flags 2528 and 3205.
DBCC TRACESTATUS (2528, 3205);
GO

--displays whether trace flag 3205 is enabled globally.
DBCC TRACESTATUS (3205, -1);
GO

--lists all the trace flags that are enabled for the current session.
DBCC TRACESTATUS();
GO
Startup parameters

• http://msdn.microsoft.com/en-us/library/ms345416.aspx How to:
  Configure Server Startup Options (SQL Server Configuration
  Manager)
•




On a cluster, changes must be made on the active server while SQL Server is
online, and will take effect when the Database Engine is restarted. The registry
update of the startup options on the other node will occur upon the next
failover.
TF Using RegEdit
• Regedit
•
TF Using startup parameters
Check the Errorlog
And if the IT is not your friend?
• sp_procoption - Sets stored procedure for autoexecution. A
  stored procedure that is set to autoexecution runs every time an
  instance of SQL Server is started.

CREATE PROC TraceOnAtBoot
AS
DBCC TRACEON (1234,-1);
DBCC TRACEON (5678,-1);
GO

• EXEC sp_procoption „TraceOnAtBoot‟, 'autostart', 'TRUE'
Note

•Trace flag behavior may not
 be supported in future
 releases of SQL Server

• BOL & http://msdn.microsoft.com/en-us/library/ms188396.aspx
My Application
•   8,640,000 up to 60,480,000 rows in single table
•   500-3,000 new rows per secund
•   Each row around 120K (20 MetaData + 100K image)
•   From 300 TB through 1 PB up to 4 PB



• http://support.microsoft.com/kb/920093
  Tuning options for SQL Server 2005 and SQL Server 2008 when
  running in high performance workloads
652: Disable page pre-fetching scans
• SQL Server no longer brings database pages into the buffer pool
  before these database pages are consumed by the scans.
• Queries that benefit from the page pre-fetching feature exhibit
  low performance.
TF _DEMO 01
TF 652
661: Disable the ghost record removal process

• A ghost record is the result of a delete
  operation.
  After deleting the deleted record is kept as a
  ghost record.
  Later, the deleted record is purged by the
  ghost record removal process.
834: Use Microsoft Windows large-page
allocations for the buffer pool (SQL 2005)
• Page memory size may be from 2 MB to 16 MB.
• Trace flag 834 causes SQL Server to use Microsoft
  Windows large-page allocations for the memory that is
  allocated for the buffer pool.
• applies only to 64-bit versions of SQL Server.
• May prevent the server from starting if memory is
  fragmented and if large pages cannot be allocated.
  Therefore, trace flag 834 is best suited for servers that
  are dedicated to SQL Server.
• Automatically in SQL 2008
836: Use the max server memory option for the
buffer pool

• Causes SQL Server to size the buffer pool at
  startup based on the value of the max server
  memory option instead of based on the total
  physical memory.

• Trace flag 836 applies only to 32-bit versions
  of SQL Server that have the AWE allocation
  enabled. You can turn on trace flag 836 only at
  startup.
TF in this doc (is it really help me?)
 • Trace flag 652: Disable page pre-fetching scans
 • Trace flag 661: Disable the ghost record removal process
 • Trace flag 834: Use Microsoft Windows large-page allocations for the
   buffer pool
 • Trace flag 836: Use the max server memory option for the buffer pool
 • Trace flag 2301: Enable advanced decision support optimizations
 • Trace flags that disable various ring buffers
  • Trace flag 8011: Disable the ring buffer for Resource Monitor
  • Trace flag 8012: Disable the ring buffer for schedulers
  • Trace flag 8018: Disable the exception ring bufferTrace flag 8019: Disable
    stack collection for the exception ring buffer
 • Trace flag 8020: Disable working set monitoring
 • Trace flag 8744: Disable pre-fetching for ranges
Still need to
• How to Load Lots of Data?
• Avoid Lock Escalation
• Partitions Tables
  • Auto Grow Equally in all Data file
 • Deadlocks
• TempDB
• BackUP
• Query processor
How to Load Lots of Data?
• http://msdn.microsoft.com/en-
  us/library/dd425070(v=sql.100).aspx The Data
  Loading Performance Guide (Thomas Kejser, Peter
  Carlin and Stuart Ozer )

• SQL Server 2008 introduces trace flag 610, which
  controls minimally logged inserts into indexed tables

• http://blogs.msdn.com/b/sqlserverstorageengine/archi
  ve/2008/10/24/new-update-on-minimal-logging-for-sql-
  server-2008.aspx MSDN Blogs > SQL Server Storage
  Engine > New update on minimal logging for SQL
  Server 2008
1211: Avoid Lock Escalation
• Lock escalation to table level may occur as the number of row-
  level exclusive (X) locks rises above a threshold. If this
  happens, concurrency will drop to single threaded inserts. It is
  possible to prevent this escalation from happening; the technique
  depends on the SQL Server version:
• For SQL Server 2005, lock escalation generally
  occurs at 5000 locked allocated. There are
  exceptions. See this
  • Setting a BATCHSIZE to a number lower than this will disable
    escalation
  • Alternatively, you can use trace flag 1211 to completely
    disable lock escalation on the server.
• For SQL Server 2008, it is also possible to completely
  disable lock escalation on a table level.
1224: Avoid Lock Escalation
• Similar to trace flag 1211 with one key
  difference. It enables lock escalation when
  lock manager acquires 40% of the statically
  allocated memory or (40%) non-AWE(32-
  bit)/regular(64-bit) dynamically allocated
  memory
• If this memory cannot be allocated due to
  other components taking up more
  memory, the lock escalation can be triggered
  earlier.
• If both trace flags (1211 and 1224) are set at
  the same time, the trace flag 1211 takes
  precedence.
1117: Auto Grow Equally in all Data file
• From Performance aspect all data file should be in
  same size.
• Otherwise, SQL Server will utilize the data file which
  is largest in size, assume you have auto growth option
  enabled then obviously that file will grow and SQL
  Server will keep on using the data file which is largest
  in size.
• TF 1117 Attempt to grow all files in one filegroup
  and not just the one next in the autogrowth chain .
•

 Read more: http://sql-
 articles.com/articles/general/day-6trace-flag-1117-
 auto-grow-equally-in-all-data-file/#ixzz1lRHA9AZ7
TF _DEMO 02
TF 1117
1204, 1205, 1222: Deadlock
• Scope: global only
• TF1204 Returns the resources and types of locks
  participating in a deadlock and also the current
  command affected
• TF1205 (undocumented) startup parameter collects
  information every time that the deadlock algorithm
  checks for a deadlock, not when a deadlock is
  encountered, was documented in SQL Server 7.0
  BOL, but is not documented in SQL Server 2008.
• TF 1222 formats deadlock information, first by
  processes and then by resources. It is possible to
  enable 1204 and 12222 trace flags to obtain two
  representations of the same deadlock event.
1204 Note
• In SQL Server 2000, a simple DBCC TRACEON (1204) is
  enough to enable deadlock reporting to the error log.
• In SQL Server 2008, you must enable the flag globally because
  the session-level flag is not visible to the deadlock monitor
  thread.
TF _DEMO 03
TF 1204, 1205, 1222
1118: TempDB
• “Nothing Is Not More Permanent Than The
  Temporary” - Wonder TempDB , Dubi Lebel ISUG
  Nov 09
• Slide 38, KB 328551 , TF 1118 reduce the allocation
  resource contention for tempdb that is experiencing
  heavy usage.
• directs SQL Server to allocate full extents to each
  tempdb objects (instead of mixed extents)
• http://technet.microsoft.com/en-us/library/cc966545.aspx ,
3226: prevents successful back
operations from being logged
• By default, every successful backup operation adds
  an entry in the SQL Server error log and in the system
  event log.
• If you create very frequent log backups, these success
  messages accumulate quickly, resulting in huge error
  logs in which finding other messages is problematic.
3014: More information on Backup

• undocumented
• returns more information to the ERRORLOG about
  BACKUP.
3004: More More information on Backup

• undocumented
• returns more information to the ERRORLOG about
  BACKUP include Creation the backup file or
  Padding to the backup file.
All about backup
•“It's just simple being in simplicity or
 It's not folly to be in full”
 ISUG Dubi Lebel ISUG May 12
TF _DEMO 04
Backup/Restore TF
4199 : Query processor
• KB 974006
• added in Cumulative Update 6 for SQL Server 2005 Service
  Pack 3 (SP3), Cumulative Update package 7 for SQL Server
  2008, Cumulative Update 7 for SQL Server 2008 Service Pack
  1 (SP1), and SQL Server 2008 R2.
• Because of the policy change to put query processor fixes under
  a trace flag, even if you are running with the latest hotfix or
  cumulative update installed, you are not necessarily running SQL
  Server with all the latest query processor fixes enabled.
• TF 4199 enable all the fixes that were previously made for the
  query processor under many trace flags. In addition, all future
  query processor fixes will be controlled by using this trace flag.
3502: Prints a message to the log at
the start and end of each checkpoint.
TF _DEMO 05
TF 3502
More, I/o subsystem:
 • SQL Server 2000 I/O Basics (2005) http://technet.microsoft.com/en-
   au/library/cc966500.aspx
 • SQL Server I/O Basics, Chapter 2 http://technet.microsoft.com/en-
   au/library/cc917726.aspx
more
• Trace flag 2528 disables parallel checking of objects during
  DBCC CHECKDB, DBCC CHECKFILEGROUP and DBCC
  CHECKTABL
More Important UDTF
• 8602 Ignore index hints that are spe-cified in query/​procedure.
• 8722 Dis-able all other types of hints. This includes the OPTION
  clause.
• 8755 Dis-able any lock-ing hints like READONLY. By set-ting
  this, you allow SQL Server to dynam-ic-ally select the best
  lock-ing hint for the query.
Questions ?




Dubi Lebel

D.B.A. = Don‟t bother Asking

Dubi Or Not To Be

Dubi.Lebel@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Guatemala User Group
 
GLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesGLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesBiju Thomas
 
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
 
Mini Session - Using GDB for Profiling
Mini Session - Using GDB for ProfilingMini Session - Using GDB for Profiling
Mini Session - Using GDB for ProfilingEnkitec
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyFranck Pachot
 
DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified Pini Dibask
 
Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)Pini Dibask
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configurationsuresh gandhi
 
Oracle 12.2 sharding learning more
Oracle 12.2 sharding learning moreOracle 12.2 sharding learning more
Oracle 12.2 sharding learning moreLeyi (Kamus) Zhang
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features" Anar Godjaev
 
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, UnicodeOracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, UnicodeMarkus Flechtner
 
Sql injection with sqlmap
Sql injection with sqlmapSql injection with sqlmap
Sql injection with sqlmapHerman Duarte
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All EditionsFranck Pachot
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle TroubleshootingHector Martinez
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadmCloud
 
What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...Sveta Smirnova
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12cPini Dibask
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 

Was ist angesagt? (20)

Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination
 
GLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New FeaturesGLOC 2014 NEOOUG - Oracle Database 12c New Features
GLOC 2014 NEOOUG - Oracle Database 12c New Features
 
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
 
Mini Session - Using GDB for Profiling
Mini Session - Using GDB for ProfilingMini Session - Using GDB for Profiling
Mini Session - Using GDB for Profiling
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easy
 
DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified DOAG - Oracle Database Locking Mechanism Demystified
DOAG - Oracle Database Locking Mechanism Demystified
 
Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configuration
 
Oracle 12.2 sharding learning more
Oracle 12.2 sharding learning moreOracle 12.2 sharding learning more
Oracle 12.2 sharding learning more
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
 
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, UnicodeOracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
 
Sql injection with sqlmap
Sql injection with sqlmapSql injection with sqlmap
Sql injection with sqlmap
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle Troubleshooting
 
10053 otw
10053 otw10053 otw
10053 otw
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
 
What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12c
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 

Ähnlich wie DBCC - Dubi Lebel

Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database DeploymentsMike Willbanks
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2Alex Zaballa
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2Alex Zaballa
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under controlMarcin Przepiórowski
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1DB2 LUW V11.1 CERTIFICATION TRAINING PART #1
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1sunildupakuntla
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuningOutsourceAX
 
Oracle 12 c new-features
Oracle 12 c new-featuresOracle 12 c new-features
Oracle 12 c new-featuresNavneet Upneja
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierKellyn Pot'Vin-Gorman
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Continuent
 
Oracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesOracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesTanel Poder
 
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...Mark Broadbent
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsAlex Zaballa
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012Eduardo Castro
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersIke Ellis
 

Ähnlich wie DBCC - Dubi Lebel (20)

Handling Database Deployments
Handling Database DeploymentsHandling Database Deployments
Handling Database Deployments
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2
 
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know - Part 2
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Alwayson in sqlserver2017
Alwayson in sqlserver2017Alwayson in sqlserver2017
Alwayson in sqlserver2017
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1DB2 LUW V11.1 CERTIFICATION TRAINING PART #1
DB2 LUW V11.1 CERTIFICATION TRAINING PART #1
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuning
 
Oracle 12 c new-features
Oracle 12 c new-featuresOracle 12 c new-features
Oracle 12 c new-features
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next Frontier
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
 
Oracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known FeaturesOracle Exadata Performance: Latest Improvements and Less Known Features
Oracle Exadata Performance: Latest Improvements and Less Known Features
 
SQL Server Clustering Part1
SQL Server Clustering Part1SQL Server Clustering Part1
SQL Server Clustering Part1
 
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...
SharePoint is from Mars, SQL Server is from Venus (SQL Server for SharePoint ...
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developers
 

Mehr von sqlserver.co.il

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013sqlserver.co.il
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cachesqlserver.co.il
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013sqlserver.co.il
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserversqlserver.co.il
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012sqlserver.co.il
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum versionsqlserver.co.il
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3sqlserver.co.il
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2sqlserver.co.il
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Eventssqlserver.co.il
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoresqlserver.co.il
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACsqlserver.co.il
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatialsqlserver.co.il
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkelsqlserver.co.il
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...sqlserver.co.il
 

Mehr von sqlserver.co.il (20)

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStore
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
 
מיכאל
מיכאלמיכאל
מיכאל
 
נועם
נועםנועם
נועם
 
עדי
עדיעדי
עדי
 
מיכאל
מיכאלמיכאל
מיכאל
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
 

Kürzlich hochgeladen

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Kürzlich hochgeladen (20)

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

DBCC - Dubi Lebel

  • 1. DBCC documented and undocumented, useful or un- useful Dubi Lebel D.B.A. = Don’t bother Asking Dubi Or Not To Be Dubi.Lebel@gmail.com
  • 3. documented and undocumented • Documented • support • Books Online • Microsoft Knowledgebase • Whitepapers • Undocumented • unsupported & risky • Blog • internet • user group presentations • do not expect me (or Microsoft) to help you with any issue caused by running any unsupported piece of code on your SQL Server!
  • 4. Undocumented DBCC Commands http://sqlgeek.pl/Download/Scripts/20091230_DBCC_Script.txt DBCC HELP('help') --------------------------------------------- dbcc help ( { 'dbcc_statement' | @dbcc_statement_var | '?' } ) [ WITH NO_INFOMSGS ] DBCC execution completed. If DBCC printed error messages, contact your system administrator.
  • 5. DBCC HELP DBCC HELP('?') --------------------------- Checkalloc checkcatalog Checkconstraints checkdb Checkfilegroup checkident Checktable cleantable Dbreindex dropcleanbuffers Free freeproccache Freesessioncache freesystemcache Help indexdefrag Inputbuffer opentran Outputbuffer pintable Proccache show_statistics Showcontig shrinkdatabase Shrinkfile sqlperf Traceoff traceon Tracestatus unpintable Updateusage useroptions DBCC execution completed. If DBCC printed error messages, contact your system administrator.
  • 6. DBCC HELP('CHECKTABLE') DBCC HELP('CHECKTABLE') ------------------------ dbcc CHECKTABLE ( { 'table_name' | 'view_name' } [ , NOINDEX | index_id | { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD }] ) [ WITH { [ ALL_ERRORMSGS ] [ , [ NO_INFOMSGS ] ] [ , [ TABLOCK ] ] [ , [ ESTIMATEONLY ] ] [ , [ PHYSICAL_ONLY ] ] [ , [ EXTENDED_LOGICAL_CHECKS ] ] } ] DBCC execution completed. If DBCC printed error messages, contact your system administrator.
  • 8. Trace Flags • Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. For example, if trace flag 3205 is set when an instance of SQL Server starts, hardware compression for tape drivers is disabled. Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems. BOL: ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/b971b540-1ac2- 435b-b191-24399eb88265.htm
  • 9. Trace Flags vs. DBCC Trace Flags: • Trace Flags are numbers • Toggle on/off to change in SQL Server‟s behavior • Trace Flags toggle by DBCC (DBCC TRACEON / TRACEOFF) • Result is change in SQL Server‟s behavior • Could be just to enable a hotfix (multi HF in the same build) DBCCs • DBCCs are text command • Result is a report as messages uotput
  • 10. DBCC TRACEON • --switching on trace flag 3205. This flag is switched on only for the current connection • DBCC TRACEON (3205); • GO • --switches on trace flag 3205 globally • DBCC TRACEON (3205, -1); • GO • --switches on trace flags 3205, and 260 globally • DBCC TRACEON (3205, 260, -1); • GO
  • 11. DBCC TRACEOFF • --disables trace flag 3205 • DBCC TRACEOFF (3205); • GO • --disables trace flag 3205 globally • DBCC TRACEOFF (3205, -1); • GO • --sdisables trace flags 3205 and 260 globally. • DBCC TRACEOFF (3205, 260, -1); • GO
  • 12. DBCC TRACESTATUS • Status - Indicates whether the trace flag is set ON of OFF, either globally or for the session. 1 = ON / 0 = OFF • Global - Indicates whether the trace flag is set globally. 1 = True / 0 = False • Session - Indicates whether the trace flag is set for the session 1 = True / 0 = False
  • 13. DBCC TRACESTATUS --displays the status of all trace flags that are currently enabled globally. DBCC TRACESTATUS(-1); GO --displays the status of trace flags 2528 and 3205. DBCC TRACESTATUS (2528, 3205); GO --displays whether trace flag 3205 is enabled globally. DBCC TRACESTATUS (3205, -1); GO --lists all the trace flags that are enabled for the current session. DBCC TRACESTATUS(); GO
  • 14. Startup parameters • http://msdn.microsoft.com/en-us/library/ms345416.aspx How to: Configure Server Startup Options (SQL Server Configuration Manager) • On a cluster, changes must be made on the active server while SQL Server is online, and will take effect when the Database Engine is restarted. The registry update of the startup options on the other node will occur upon the next failover.
  • 15. TF Using RegEdit • Regedit •
  • 16. TF Using startup parameters
  • 18. And if the IT is not your friend? • sp_procoption - Sets stored procedure for autoexecution. A stored procedure that is set to autoexecution runs every time an instance of SQL Server is started. CREATE PROC TraceOnAtBoot AS DBCC TRACEON (1234,-1); DBCC TRACEON (5678,-1); GO • EXEC sp_procoption „TraceOnAtBoot‟, 'autostart', 'TRUE'
  • 19. Note •Trace flag behavior may not be supported in future releases of SQL Server • BOL & http://msdn.microsoft.com/en-us/library/ms188396.aspx
  • 20. My Application • 8,640,000 up to 60,480,000 rows in single table • 500-3,000 new rows per secund • Each row around 120K (20 MetaData + 100K image) • From 300 TB through 1 PB up to 4 PB • http://support.microsoft.com/kb/920093 Tuning options for SQL Server 2005 and SQL Server 2008 when running in high performance workloads
  • 21. 652: Disable page pre-fetching scans • SQL Server no longer brings database pages into the buffer pool before these database pages are consumed by the scans. • Queries that benefit from the page pre-fetching feature exhibit low performance.
  • 23. 661: Disable the ghost record removal process • A ghost record is the result of a delete operation. After deleting the deleted record is kept as a ghost record. Later, the deleted record is purged by the ghost record removal process.
  • 24. 834: Use Microsoft Windows large-page allocations for the buffer pool (SQL 2005) • Page memory size may be from 2 MB to 16 MB. • Trace flag 834 causes SQL Server to use Microsoft Windows large-page allocations for the memory that is allocated for the buffer pool. • applies only to 64-bit versions of SQL Server. • May prevent the server from starting if memory is fragmented and if large pages cannot be allocated. Therefore, trace flag 834 is best suited for servers that are dedicated to SQL Server. • Automatically in SQL 2008
  • 25. 836: Use the max server memory option for the buffer pool • Causes SQL Server to size the buffer pool at startup based on the value of the max server memory option instead of based on the total physical memory. • Trace flag 836 applies only to 32-bit versions of SQL Server that have the AWE allocation enabled. You can turn on trace flag 836 only at startup.
  • 26.
  • 27. TF in this doc (is it really help me?) • Trace flag 652: Disable page pre-fetching scans • Trace flag 661: Disable the ghost record removal process • Trace flag 834: Use Microsoft Windows large-page allocations for the buffer pool • Trace flag 836: Use the max server memory option for the buffer pool • Trace flag 2301: Enable advanced decision support optimizations • Trace flags that disable various ring buffers • Trace flag 8011: Disable the ring buffer for Resource Monitor • Trace flag 8012: Disable the ring buffer for schedulers • Trace flag 8018: Disable the exception ring bufferTrace flag 8019: Disable stack collection for the exception ring buffer • Trace flag 8020: Disable working set monitoring • Trace flag 8744: Disable pre-fetching for ranges
  • 28. Still need to • How to Load Lots of Data? • Avoid Lock Escalation • Partitions Tables • Auto Grow Equally in all Data file • Deadlocks • TempDB • BackUP • Query processor
  • 29. How to Load Lots of Data? • http://msdn.microsoft.com/en- us/library/dd425070(v=sql.100).aspx The Data Loading Performance Guide (Thomas Kejser, Peter Carlin and Stuart Ozer ) • SQL Server 2008 introduces trace flag 610, which controls minimally logged inserts into indexed tables • http://blogs.msdn.com/b/sqlserverstorageengine/archi ve/2008/10/24/new-update-on-minimal-logging-for-sql- server-2008.aspx MSDN Blogs > SQL Server Storage Engine > New update on minimal logging for SQL Server 2008
  • 30. 1211: Avoid Lock Escalation • Lock escalation to table level may occur as the number of row- level exclusive (X) locks rises above a threshold. If this happens, concurrency will drop to single threaded inserts. It is possible to prevent this escalation from happening; the technique depends on the SQL Server version: • For SQL Server 2005, lock escalation generally occurs at 5000 locked allocated. There are exceptions. See this • Setting a BATCHSIZE to a number lower than this will disable escalation • Alternatively, you can use trace flag 1211 to completely disable lock escalation on the server. • For SQL Server 2008, it is also possible to completely disable lock escalation on a table level.
  • 31. 1224: Avoid Lock Escalation • Similar to trace flag 1211 with one key difference. It enables lock escalation when lock manager acquires 40% of the statically allocated memory or (40%) non-AWE(32- bit)/regular(64-bit) dynamically allocated memory • If this memory cannot be allocated due to other components taking up more memory, the lock escalation can be triggered earlier. • If both trace flags (1211 and 1224) are set at the same time, the trace flag 1211 takes precedence.
  • 32. 1117: Auto Grow Equally in all Data file • From Performance aspect all data file should be in same size. • Otherwise, SQL Server will utilize the data file which is largest in size, assume you have auto growth option enabled then obviously that file will grow and SQL Server will keep on using the data file which is largest in size. • TF 1117 Attempt to grow all files in one filegroup and not just the one next in the autogrowth chain . • Read more: http://sql- articles.com/articles/general/day-6trace-flag-1117- auto-grow-equally-in-all-data-file/#ixzz1lRHA9AZ7
  • 34. 1204, 1205, 1222: Deadlock • Scope: global only • TF1204 Returns the resources and types of locks participating in a deadlock and also the current command affected • TF1205 (undocumented) startup parameter collects information every time that the deadlock algorithm checks for a deadlock, not when a deadlock is encountered, was documented in SQL Server 7.0 BOL, but is not documented in SQL Server 2008. • TF 1222 formats deadlock information, first by processes and then by resources. It is possible to enable 1204 and 12222 trace flags to obtain two representations of the same deadlock event.
  • 35. 1204 Note • In SQL Server 2000, a simple DBCC TRACEON (1204) is enough to enable deadlock reporting to the error log. • In SQL Server 2008, you must enable the flag globally because the session-level flag is not visible to the deadlock monitor thread.
  • 36. TF _DEMO 03 TF 1204, 1205, 1222
  • 37. 1118: TempDB • “Nothing Is Not More Permanent Than The Temporary” - Wonder TempDB , Dubi Lebel ISUG Nov 09 • Slide 38, KB 328551 , TF 1118 reduce the allocation resource contention for tempdb that is experiencing heavy usage. • directs SQL Server to allocate full extents to each tempdb objects (instead of mixed extents) • http://technet.microsoft.com/en-us/library/cc966545.aspx ,
  • 38. 3226: prevents successful back operations from being logged • By default, every successful backup operation adds an entry in the SQL Server error log and in the system event log. • If you create very frequent log backups, these success messages accumulate quickly, resulting in huge error logs in which finding other messages is problematic.
  • 39. 3014: More information on Backup • undocumented • returns more information to the ERRORLOG about BACKUP.
  • 40. 3004: More More information on Backup • undocumented • returns more information to the ERRORLOG about BACKUP include Creation the backup file or Padding to the backup file.
  • 41. All about backup •“It's just simple being in simplicity or It's not folly to be in full” ISUG Dubi Lebel ISUG May 12
  • 43. 4199 : Query processor • KB 974006 • added in Cumulative Update 6 for SQL Server 2005 Service Pack 3 (SP3), Cumulative Update package 7 for SQL Server 2008, Cumulative Update 7 for SQL Server 2008 Service Pack 1 (SP1), and SQL Server 2008 R2. • Because of the policy change to put query processor fixes under a trace flag, even if you are running with the latest hotfix or cumulative update installed, you are not necessarily running SQL Server with all the latest query processor fixes enabled. • TF 4199 enable all the fixes that were previously made for the query processor under many trace flags. In addition, all future query processor fixes will be controlled by using this trace flag.
  • 44. 3502: Prints a message to the log at the start and end of each checkpoint.
  • 46. More, I/o subsystem: • SQL Server 2000 I/O Basics (2005) http://technet.microsoft.com/en- au/library/cc966500.aspx • SQL Server I/O Basics, Chapter 2 http://technet.microsoft.com/en- au/library/cc917726.aspx
  • 47. more • Trace flag 2528 disables parallel checking of objects during DBCC CHECKDB, DBCC CHECKFILEGROUP and DBCC CHECKTABL
  • 48. More Important UDTF • 8602 Ignore index hints that are spe-cified in query/​procedure. • 8722 Dis-able all other types of hints. This includes the OPTION clause. • 8755 Dis-able any lock-ing hints like READONLY. By set-ting this, you allow SQL Server to dynam-ic-ally select the best lock-ing hint for the query.
  • 49. Questions ? Dubi Lebel D.B.A. = Don‟t bother Asking Dubi Or Not To Be Dubi.Lebel@gmail.com

Hinweis der Redaktion

  1. "DBCC documented and undocumented, useful or un-useful"There are a lot of undocumented DBCC in SQL Server, some of them for developer debugging, other for testing small set are for Support engineers but... Many of them could be useful for DBAs and many of them are dangerous…in part 1- 'the introduction' we will try to answer: how to find those DBCCs? how to find minimal official documented? and how to use them?part 2-'when and what undocumented should I use' will deal with DBCC that can help us like the DBCC CORRUPT(dbname|dbid)
  2. --SET NOCOUNT ON--GO--IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[test]') AND type in (N'U'))--DROP TABLE [dbo].[test]--GO--CREATE TABLE [dbo].[test](-- [i] [int] NOT NULL,-- [j] [int] NOT NULL,-- [d] [datetime2](7) NULL,-- [FFU_FHR] [char](5000) DEFAULT 'some default st' NOT NULL--) ON [PRIMARY]--GO--CREATE CLUSTERED INDEX [cix_test] ON [dbo].[test] --(-- [i] ASC)--GO--DECLARE @i INT = 0--WHILE @i < 20000--BEGIN-- INSERT test(i, j, d) -- SELECT @i, -- CASE WHEN @i % 2 = 0 THEN @i ELSE 2000000 - @i END,-- SYSDATETIME()--END--GODBCC TRACESTATUS GOSET STATISTICS IO ONGOselect 'Starting', cast (SYSDATETIME() as time)GODBCC DROPCLEANBUFFERS; GO SELECT MAX(d) FROM test;GOselect 'Without TF ', cast (SYSDATETIME() as time)GODBCC TRACEON(-1, 652) DBCC DROPCLEANBUFFERS; GO SELECT MAX(d) FROM test;GODBCC TRACEOFF (-1, 652) GOselect 'with TF', cast (SYSDATETIME() as time)GO
  3. Set NoCount OnGO--DBCC TRACEON (1117,-1)--GO--Create database with 4 files keeping unequal size USE master GO IF EXISTS(SELECT 1 FROM sys.databases where name='1117') DROP DATABASE [1117] GO CREATE DATABASE [1117] ON PRIMARY( NAME = N'1117', FILENAME = N'C:\\MSSQL\\DATA\\1117.mdf', SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), -- first Data file 3 MB( NAME = N'1117_1', FILENAME = N'C:\\MSSQL\\DATA\\1117_1.ndf', SIZE = 1024KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), -- all other files only 1 MB( NAME = N'1117_2', FILENAME = N'C:\\MSSQL\\DATA\\1117_2.ndf', SIZE = 1024KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), ( NAME = N'1117_3', FILENAME = N'C:\\MSSQL\\DATA\\1117_3.ndf', SIZE = 1024KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON( NAME = N'1117_log', FILENAME = N'C:\\MSSQL\\DATA\\1117_log.ldf', SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO --script to get file size initially --SELECT name, (size*8)/1024 'Size in MB' FROM [1117].sys.database_filesSELECT file_id, name, [sizeInMb] = CONVERT(DECIMAL(12,2),ROUND(size/128.000,2)), [spaceUsedMb] = CONVERT(DECIMAL(12,2),ROUND(FILEPROPERTY(name,'SPACEUSED')/128.000,2)) FROM [1117].sys.database_filesWHERE (data_space_id = 1)---=-=-=-=-=-=-=-=-=-=-=--Now CREATE a table to populate the data USE [1117] GO CREATE TABLE Trash (name CHAR(8000)) GO INSERT Trash VALUES ('Trash for TF 1117') GO 700 --script to get file size after data insertion --SELECT name, (size*8)/1024 'Size in MB' FROM [1117].sys.database_filesSELECT file_id, name, [sizeInMb] = CONVERT(DECIMAL(12,2),ROUND(size/128.000,2)), [spaceUsedMb] = CONVERT(DECIMAL(12,2),ROUND(FILEPROPERTY(name,'SPACEUSED')/128.000,2)) FROM [1117].sys.database_filesWHERE (data_space_id = 1)GO ----INSERT Trash VALUES ('Trash for TF 1117') GO 200 SELECT file_id, name, [sizeInMb] = CONVERT(DECIMAL(12,2),ROUND(size/128.000,2)), [spaceUsedMb] = CONVERT(DECIMAL(12,2),ROUND(FILEPROPERTY(name,'SPACEUSED')/128.000,2)) FROM [1117].sys.database_filesWHERE (data_space_id = 1)--DBCC TRACEOFF (1117,-1)--GO
  4. Set NoCount OnGOdbcctracestatusGOUSE DBCC_DEMOGOUSE [DBCC_DEMO]GOIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DL_1]') AND type in (N'U'))DROP TABLE [dbo].[DL_1]GOCREATE TABLE [dbo].[DL_1]( [i] [int] NULL, [c] [char](10) NULL) ON [PRIMARY]GOIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DL_2]') AND type in (N'U'))DROP TABLE [dbo].[DL_2]GOCREATE TABLE [dbo].[DL_2]( [i] [int] NULL, [c] [char](10) NULL) ON [PRIMARY]GO--OPEN Secund TABinsert DL_1 values(1,'abc')GO------=-=-=-=-=-=-=Begin tranupdate DL_1 set c='efg'where i =1--UPADTE in Sec tabupdate DL_2 set c='Def'where i =2---rollback tranDBCC TRACEON(1204, 3605,-1)DBCC TRACEOff(1204,1205,1222, 3605,-1)DBCC TRACEON(1205, 3605,-1)DBCC TRACEON(1222, 3605,-1)exec sp_readerrorlog-----------------------------Set NoCount OnGOinsert DL_2 values(2,'abc')GO---Begin tranupdate DL_2 set c='efg'where i =2----update DL_1 set c='efg'where i =1----rollback tranEXEC sp_cycle_errorlog ; GODBCC TRACEON(1204, 3605,-1)DBCC TRACEOff(1204,1205, 3605,-1)DBCC TRACEON(1205, 3605,-1)DBCC TRACEON(1222, 3605,-1)exec sp_readerrorlog
  5. Set NoCount OnGOuse master;GODBCC TRACEON(3004,--3014,3604,3605,-1);GORESTORE DATABASE [AdventureWorks2008R2] FROM DISK = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL10_50.VULCAN\\MSSQL\\Backup\\AdventureWorks2008R2.bak' WITH FILE = 1, NOUNLOAD, STATS = 10GODBCC TRACEOFF(3004,3014,3604,3605,-1);--DBCC tracestatus()--sp_readerrorlogDBCC TRACEON(3004,3014,3604,3605,-1);create database ttt;EXEC sp_readerrorlog; drop database ttt;EXEC sp_readerrorlog;DBCC TRACEOFF(3004,3014,3604,3605,-1);
  6. Set NoCount OnGODBCC tracestatusDBCC traceon(3502,3604,3605,-1)CHECKPOINT exec sp_readerrorlogDBCC traceoff(3502,3604,3605,-1)