|
Utilizando os principais comandos do DBCC
|
Blogger |
O que você gostaria de ver nesta página? Envie sua sugestão.
Utilizando os principais comandos do DBCCDBCC CACHESTATS displays information about the objects currently in the buffer cache, such as hit rates, compiled objects and plans, etc. Example: DBCC CACHESTATS Sample Results (abbreviated): Object Name Hit Ratio Proc 0.86420054765378507 Here's what some of the key statistics from this command mean:
[7.0, 2000] Updated 9-1-2005 ***** DBCC DROPCLEANBUFFERS: Use this command to remove all the data from SQL Server's data cache (buffer) between performance tests to ensure fair testing. Keep in mind that this command only removes clean buffers, not dirty buffers. Because of this, before running the DBCC DROPCLEANBUFFERS command, you may first want to run the CHECKPOINT command first. Running CHECKPOINT will write all dirty buffers to disk. And then when you run DBCC DROPCLEANBUFFERS, you can be assured that all data buffers are cleaned out, not just the clean ones. Example: DBCC DROPCLEANBUFFERS [7.0, 2000, 2005] Updated 9-1-2005 ***** DBCC ERRORLOG: If you rarely restart the mssqlserver service, you may find that your server log gets very large and takes a long time to load and view. You can truncate (essentially create a new log) the Current Server log by running DBCC ERRORLOG. You might want to consider scheduling a regular job that runs this command once a week to automatically truncate the server log. As a rule, I do this for all of my SQL Servers on a weekly basis. Also, you can accomplish the same thing using this stored procedure: sp_cycle_errorlog. Example: DBCC ERRORLOG [7.0, 2000, 2005] Updated 9-1-2005 ***** DBCC FLUSHPROCINDB: Used to clear out the stored procedure cache for a specific database on a SQL Server, not the entire SQL Server. The database ID number to be affected must be entered as part of the command. You may want to use this command before testing to ensure that previous stored procedure plans won't negatively affect testing results. Example: DECLARE @intDBID INTEGER SET @intDBID = (SELECT dbid FROM master.dbo.sysdatabases WHERE name = 'database_name') [7.0, 2000, 2005] Updated 9-1-2005 ***** DBCC INDEXDEFRAG: In SQL Server 2000, Microsoft introduced DBCC INDEXDEFRAG to help reduce logical disk fragmentation. When this command runs, it reduces fragmentation and does not lock tables, allowing users to access the table when the defragmentation process is running. Unfortunately, this command doesn't do a great job of logical defragmentation. The only way to truly reduce logical fragmentation is to rebuild your table's indexes. While this will remove all fragmentation, unfortunately it will lock the table, preventing users from accessing it during this process. This means that you will need to find a time when this will not present a problem to your users. Of course, if you are unable to find a time to reindex your indexes, then running DBCC INDEXDEFRAG is better than doing nothing. Example: DBCC INDEXDEFRAG (Database_Name, Table_Name, Index_Name)
|
importar no delicious Domínio Grátis! Hospedagem de Páginas Grátis Backup Online Grátis HK-450 Metal Upgrade Belt CP V2 EK1H-E014D BELT CP KIT Blogs: %%backlinks%% Poker RegrasPokercores htmlwebdesign poker de graça importar no delicious Aeromodelismo Helicopter |