How to Delete Maintenance Plan in SQL 2005
Step 1:
DELETE FROM MSDB..SYSMAINTPLAN_PLANS
Step 2:
DELETE FROM SYSMAINTPLAN_LOG
Step 3:
DELETE FROM SYSMAINTPLAN_SUBPLANS
Step 4:
DELETE FROM SYSMAINTPLAN_PLANS
Step 1:
DELETE FROM MSDB..SYSMAINTPLAN_PLANS
Step 2:
DELETE FROM SYSMAINTPLAN_LOG
Step 3:
DELETE FROM SYSMAINTPLAN_SUBPLANS
Step 4:
DELETE FROM SYSMAINTPLAN_PLANS
–====================================================
–= BACKUP database accross four files
–====================================================
declare @filedate nvarchar(100)
declare @disk1 nvarchar(100)
declare @disk2 nvarchar(100)
declare @disk3 nvarchar(100)
declare @disk4 nvarchar(100)
declare @dbname nvarchar(100)
declare @backupname nvarchar(100)
declare @backupfolder nvarchar(100)
set @dbname = ‘DBA’
set @backupfolder = ‘F:\SQLBackup\’ + @dbname + ‘\’
select @filedate = replace(replace(replace(replace(convert(nvarchar,getdate(),121),’-’,’_’),’ ‘,’_’),’:’,”),’.’,’_’)
select @backupname = @dbname + ‘_backup’ + @filedate
print @filedate
print @backupname
–select @filedate
select @disk1 = @backupfolder + @dbname + ‘_backup_File1_’ + [...]
http://sqlblogcasts.com/blogs/tonyrogerson/archive/2007/03/10/how-to-create-a-corrupt-database-using-bulk-insert-update-and-bcp-sql-server-as-a-hex-editor.aspx
http://www.spiceworks.com/free-sql-server-monitoring-tool/
You have to run this query through the DAC as it’s accessing undocumented, hidden system tables.
How to: Use the Dedicated Administrator Connection with SQL Server Management Studio
Microsoft SQL Server provides a dedicated administrator connection (DAC). The DAC allows an administrator to access a running instance of SQL Server Database Engine to troubleshoot problems on [...]
SQL Server provides a special diagnostic connection for administrators when standard connections to the server are not possible. This diagnostic connection allows an administrator to access SQL Server to execute diagnostic queries and troubleshoot problems even when SQL Server is not responding to standard connection requests.
By default, the connection is only allowed from a client [...]
From Command prompt:
Start an instance of SQL Server or the SQL Server Agent service from a command prompt by typing:
net start mssqlserver or sqlservr, or net start SQLServerAgent or by running SQLSERVR.EXE. If you are referring to a named instance of SQL Server, you must specify mssql$instancename or SQLAgent$instancename.
TRANSACTION ISOLATION LEVEL
READ UNCOMMITTED
- can read rows that have been modified by other transactions but not yet committed
- do not issue shared locks to prevent other transactions from modifying data read by the current transaction.
READ COMMITTED
- cannot read data that has been modified but not committed by other transactions. This prevents dirty reads.
- phantom data [...]
SQL Server 2005 Database Engine Performance Counters
SQLServer:Access Methods
SQLServer:Buffer Manager
SQLServer:Buffer Node
SQLServer:Buffer Partition
AU cleanup batches/sec
AWE lookup maps/sec
Database pages
Free list empty/sec
AU cleanups/sec
AWE stolen maps/sec
Foreign pages
Free list requests/sec
By-reference [...]
EXEC msdb.dbo.sp_send_dbmail
@recipients = ‘me@myemail.com’,
@query = ’sp_configure ”max server memory”
GO
sp_configure ”min server memory”
GO
select left(counter_name,50),cntr_value from sys.dm_os_performance_counters
where counter_name in (”Target Server Memory (KB)”,”Total Server Memory (KB)”)
and object_name = ”SQLServer:Memory Manager”’,
@subject = ‘DEMO - MEMORY UPGRADE’,
@attach_query_result_as_file = 1 ;