|
|
-
|
|
This script runs across all DB2 servers every morning and creates a report. It’s a quick way of getting DB2 health status, in my inbox. I open the report in my Blackberry , while travelling into work.
It doesn’t replace Monitoring, which deals with thresholds being met .
The script runs as par......
|
|
-
|
|
Connecting from Windows to Linux is possible with plink.exe
Plink is part of the PuTTY toolkit. Plink is the command line interface to the PuTTY backend.
One of the interesting methods to apply is connecting to DB2 on Linux. In the example below the plink command is : a connection made to Linu......
|
|
-
|
|
sys.dm_os_performance_counters have enough information to measure SQL Server database free space. Broken down into data file and log file used space
The purpose of sys.dm_os_performance_counters is to return a row per performance counter.
The script below returns a row per database on an SQL Ser......
|
|
-
|
|
After a restore on a database – I saw a (resticted user ) next to a database.
Solved the problem by:
ALTER DATABASE mydatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE mydatabase SET MULTI_USER
GO
Republished from http://www.sqlserver-dba.com.......
|
|
-
|
|
Despite best efforts to size a tempdb, on occasions the tempdb expands to a size as big as the drive. Because the drive is full the tempdb can no longer expand. This triggers a situation in a monitoring framework. A quick solution is required, to shrink down the tempdb. Following are 2 different met......
|
|
-
|
|
If you want to view the objects within the cache use the query below. This will give you an insight into how optimizer and storage engine reached the plan.
SELECT [qpc].[refcounts]
, [qpc].[usecounts]
, [qpc].[objtype]
, [st].[dbid]
, [stx].[objectid]
, [stx].[text]
, [qpl].[query_plan]
F......
|
|
-
|
|
Quite often, this question appears on forums or on various jobs."Is there any way that I can tell when a stored procedure was last executed or who executed it? Is there any execution history that I can look at?"
The following query will assist in telling you what time a stored procedure was last ex......
|
|
-
|
|
Sometimes you just need a quick method to update all statistics of every table. The script below will apply a FULL SCAN, so I wouldn't recommend that you use this as regular maintenancce task . There are other command options for sp_MSforeachtable
exec sp_MSforeachtable
@command1 = 'print ''Proc......
|
|
-
|
|
This is an undocumented stored procedure. It's found in the master db and accepts the following input parameters.It returns one (or greater ) rows for every table. Each table has it's own resultset.
I find it useful for managing a process such as a sql server rapid tuning for an emergency performan......
|
|
-
|
|
Useful script that returns all user tables in a database: sizes and percentages of totals
############START#################
------------------SCRIPT ----------START-------------------------
-- Create the temp table for further querying
CREATE TABLE #temp(
tbl_id int IDENTITY (1, 1),
tbl_nam......
|
|