SQL
SQL
com/
http://blog.sqlauthority.com/
mssqltips.com
http://www.sqlserver-dba.com
Experience with database tuning using SQL Sentry , SCOM 2012
<type of output>
0: Return only the minimum of information for each operation -- the operation, its
context and the transaction ID. (Default)
1: As 0, but also retrieve any flags and the log record length.
2: As 1, but also retrieve the object name, index name, page ID and slot ID.
3: Full informational dump of each operation.
4: As 3 but includes a hex dump of the current transaction log row.
For index....
use database
exec sp_help tabalename
I'l like to get the DBs status on a Server. Means, I need to know what are the DBs
are being used,
what are not being & if any are in use, I need to know when it was used last time
and how frequently
its been used in the past several month.
Answered
select *
from fn_trace_gettable('c:\MyTraceFile.trc', default)
--------------------------------------------------------------------------------
Difference between Index Rebuild and Index Reorganize Explained View(s): 3754
What is difference between rebuild and reorganize the indexes in SQL Server 2005?
When should i go for rebuild the index and when should i go for reorganize the
index?
Answer 1)
--------------------------------------------------------------------------------
Index Rebuild: This process drops the existing Index and Recreates the index.
USE AdventureWorks;
GO
ALTER INDEX ALL ON Production.Product REBUILD
GO
Index Reorganize: This process physically reorganizes the leaf nodes of the index.
USE AdventureWorks;
GO
ALTER INDEX ALL ON Production.Product REORGANIZE
GO
You need to check the fragmentation (using DBCC showcontig) for indices to decide
what to go for rebuild or reorganize.
Recommendation: Index should be rebuild when index fragmentation is great than 40%.
Index should be reorganized when index fragmentation is between 10% to 40%. Index
rebuilding process uses more CPU and it locks the database resources.
Bhoomika_bhandari@dell.com
careers@bartronicsindia.com
careers@unissl.com.
itjobs@emerson.com
india@winshuttle.com
1. Check the email alerts to see if anything needs to be addressed. We use MOM to
monitor our environments, so MOM notifies us of issues.
2. Work on production tickets
3. Work on dev/test/perf/... tickets
4. Work on project tasks
5. Proactive administration (performance mostly)
6. Automating things when I can
...
USE [WSS_ApplicationUsage]
GO
ALTER DATABASE [WSS_ApplicationUsage] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(N'WSS_ApplicationUsage_log', 1)
ALTER DATABASE [WSS_ApplicationUsage] SET RECOVERY FULL WITH NO_WAIT
GO
If the database is online and begin to restore the database after backup BACKUP
LOG [database_name] TO [backup_device] WITH NORECOVERY
-- If the database is offline, and log file may be damaged BACKUP LOG
[database_name] TO [backup_device] WITH CONTINUE_AFTER_ERROR