James' SQL Footprint
Monitor Deadlock in SQL 2012
Extended Events can replace SQL Profiler, and it is more powerful with less performance…
0 comments, 2,473 reads
Posted in James' SQL Footprint on 12 August 2012
Backup Master Database
Does Master database support full recovery mode?
As I remembered, by default, Master database is in "Simple" recovery mode. I never try to put it into Full recovery mode because master database is not updated frequently, and it is very small.…
0 comments, 1,205 reads
Posted in James' SQL Footprint on 7 July 2012
New in SQL 2012 (1)
1. Indirect Checkpoint
Prior to SQL Server 2012, SQL Server Database Engine Support 3 type of checkpoints: Automatic, manual and internal. Now there is a new checkpoint type added : Indirect Checkpoint.
Not…
0 comments, 620 reads
Posted in James' SQL Footprint on 1 July 2012
Several useful T-SQL Function
The following sample is from BOL:
-------------------------------------
USE AdventureWorks2008R2;
GO
SELECT SalesOrderID, ProductID, OrderQty
,SUM(OrderQty) OVER(PARTITION BY SalesOrderID) AS 'Total'
,AVG(OrderQty) OVER(PARTITION BY SalesOrderID) AS 'Avg'
,COUNT(OrderQty) OVER(PARTITION BY SalesOrderID) AS 'Count'
,MIN(OrderQty) OVER(PARTITION BY SalesOrderID) AS 'Min'
0 comments, 642 reads
Posted in James' SQL Footprint on 30 June 2012
Rebuild index with "Alter Index Rebuild" or "DBCC DBREINDEX"
First, in BOL, for "DBCC DBREINDEX" , it mentions
This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify…
1 comments, 4,094 reads
Posted in James' SQL Footprint on 23 June 2012
Shrink transaction log file
0 comments, 765 reads
Posted in James' SQL Footprint on 17 June 2012
Max Server Memory
http://blogs.msdn.com/b/sqlsakthi/archive/2012/05/19/cool-now-we-have-a-calculator-for-finding-out-a-max-server-memory-value.aspx
you can try the tool from http://blogs.msdn.com/b/sqlsakthi/p/max-server-memory-calculator.aspx
Then Jonathan Kehayias made a post to clarify why the calculator doesn't work
http://www.sqlskills.com/blogs/jonathan/2012/05/default.aspx
Jonathan has another great post relative the max server memory…
0 comments, 1,601 reads
Posted in James' SQL Footprint on 2 June 2012
Setup windows firewall for SQL Server
1 comments, 991 reads
Posted in James' SQL Footprint on 1 June 2012
Backup duration statistics
SELECT
DBNAME,
backup_type,
MAX(sizeMB) as MaxBackupFileSizeMB,
Max(duration) as MaxDurationSEC,
MAX(speedMBSEC) as MaxSpeedMBperSEC,
MIN(sizeMB) as…
0 comments, 317 reads
Posted in James' SQL Footprint on 25 May 2012
Ad hoc query optimization in SQL Server
For instance:
--clear plan cache first
DBCC FREEPROCCACHE
--run…
2 comments, 2,236 reads
Posted in James' SQL Footprint on 15 May 2012
Use Powershell script to verify backup files
1. RESTORE HEADERONLY
Returns a result set containing all the backup header information for all backup sets on a particular backup device.
2. RESTORE FILELISTONLY
Returns a result set containing a list of…
0 comments, 3,359 reads
Posted in James' SQL Footprint on 12 May 2012
Backup database in CMS
1. run query on CMS to find out which server the database is on
2. then connect to the server and run backup query.
If you backup…
0 comments, 296 reads
Posted in James' SQL Footprint on 9 May 2012
Generate restore script automatically by backup history table
For instance, if you backup the database as the sequence below
| ID | backup_start_date | backup_type |
| 1 | 2012-04-30 18:28:43.000 | Full |
| 2 | 2012-04-30… |
2 comments, 1,252 reads
Posted in James' SQL Footprint on 30 April 2012
Setup database mirroring and log shipping together
here is a great article about how to setup the database mirroring and log shipping together.
http://technet.microsoft.com/en-us/library/ms187016.aspx
In our system, we setup data mirroring with high-safety…
0 comments, 2,116 reads
Posted in James' SQL Footprint on 21 April 2012
script system object in resource database
0 comments, 274 reads
Posted in James' SQL Footprint on 19 April 2012
Log shipping setup problem
there are 2 monitor tables after logshipping setup
1. log_shipping_monitor_primary
This table has entries for all primary database on primary server and monitor server
2. log_shipping_monitor_secondary
This table has entries…
0 comments, 439 reads
Posted in James' SQL Footprint on 18 April 2012
Why I can not connect sql server ???
1. Enable TCP protocol
I tried to login sql server by SSMS with Server Name "MachineName\InstanceName", and select the Network protocol "TCP/IP"
but got error message below
My…
0 comments, 2,327 reads
Posted in James' SQL Footprint on 10 April 2012
Why shrink sql server data file failed?
2 comments, 663 reads
Posted in James' SQL Footprint on 7 April 2012
Clean SQL Server Cache
SQL Server memory cache just like…
0 comments, 2,571 reads
Posted in James' SQL Footprint on 6 April 2012
SQL Server 2012 license
1. There is no Datacenter Edition anymore, it is merged into Enterpise Edition. Furthermore, Workgroup and Small business Editions are also being retired.
Currently there are only…
0 comments, 814 reads
Posted in James' SQL Footprint on 5 April 2012



Subscribe to this blog