You are on page 1of 5

N O T E - 1

SQL FUNDAMENTAL
UPGRADE

HIGH AVAILANILITY
PERFORMANCE TUNING
BACKUP AND DR

o T-SQL (FUNCTION, CURSOR, VIEW , SP)


o ISOLATION LABEL, INDEX, STATISTICS, QUERY OPTIMIZER, DATA TIRE,
DMV, DBCC, LOCK -DEADLOCK, PERFMON, DATA COLLECTOR,
o SECURITY [ ENCRIPTION, TRIGER, STORE PROCEDURE, AD]
o INSTALATION, RAID

SSRS (SSIS )
Which command using Query Analyzer will give you the version of SQL server and
operating system?

SELECT SERVERPROPERTY ('productversion'), SERVERPROPERTY


('productlevel'), SERVERPROPERTY ('edition').

UPGRADE
o The resulting upgraded instance has the same name as the original.
o Resource DLLs are responsible for carrying out most operations on cluster
resources.
o A dynamic-link library (DLL) is a module that contains functions and data that
can be used by another module (application or DLL).
o Applications continue to connect to the same instance name
DMV / FUNCTION
o Q- Which DMV give me query plan or I will use old method to find query plan?
o Below DMVs can be used to provide query plan related information :-
o sys.dm_exec_query_stats
o sys.dm_exec_sql_text
o sys.dm_exec_query_plan
o 30) Which DMVs are useful to gather information about database mirroring :-
o sys.dm_db_mirroring_connections
o sys.dm_db_mirroring_auto_page_repair
o SQL_VARIANT (extend property )
o
o 31) What are the most important DMVs\DMFs from a DBA perspective.
o Execution Related
o sys.dm_exec_connections
o sys.dm_exec_sessions
o sys.dm_exec_requests
o sys.dm_exec_cached_plans
o sys.dm_exec_query_plans
o sys.dm_exec_sql_text
o sys.dm_exec_query_stats
o Index Related
o sys.dm_db_index_physical_stats
o sys.dm_db_index_usage_stats
o SQL Server Operating System
o sys.dm_os_performance_counters
o sys.dm_os_schedulers
o sys.dm_os_nodes
o sys.dm_os_waiting_tasks
o sys.dm_os_wait_stats
o I/O Related
o sys.dm_io_virtual_file_stats
o DBCC DROPCLEALBUFFERS (to remove data from memory)
o DBCC FREEPROCCACHE (to remove the the query plans from the memory)
o SP_INDEXES_ROWSET ; 2 (all indexes for the data base )
o SELECT TABLE_NAME FROM INFORMATION_SCHEMA .TABLES (LIST ALL
TABLES IN A DATABASE )
o SELECT * FROM INFORMATION_ SCHEMA COLUMNS (list all column in a table )
o Select * from information_schema . table_constraints (list all the table constraints in a
database)
o DBCC CHECKIDENT (rebuild an identity column )

o Alternate keys
o The difference between a primary key and any other unique key is that SQL server
automatically use the primary key definition integrity constructs.
o Defining a primary key on a table helps to relate that table to other tables.
o SP_LOCK (detect blocked)
o DBCC DROPCLEANBUFFER (To remove the data from the memory)
o DBCC FREEPOCCACHE (to remove the query from the memory)
o SELECT rows
FROM sysindexes
WHERE id = OBJECT_ID (table name)
AND indid < 2
o SET NOCOUNT ON (poorly performing query having procedures and triggers without
the SET NOCOUNT ON )
o SET SHOWPLAN_ALL ON (troubleshoot poorly performing query )
o SET SHOWPLAN_TEXT ON ,,
o SET STATISTICS IO ON ,,
o Substring function
o Only the system administrator can issue RAISEERROR with a severity level 19 through
25.
o COMMIT TRANSACTION
o SET IMPLICIT_TRANSACTIONS ON (not for permanent save )
o SET IMPLICIT_TRANSACTIONS OF (to
o You cannot use DROP TABLE statement on system table
o SET NO EXEC ON (check syntax without executing it )
o Create a default constraint (value of unknown) remember this will work only if social
security does not have unique constraint.
o Uniqueidentifier datatype
o GUID (globally unique identification numbers, A GUID is a binary number.
o DBCC PINTABLE (does not cause the table to be read into memory )
o Q how you can get a list of all the table constrains in a database ?
A SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
o All indexes for the database
SP_INDEXES_ROWSET ; 2
o DBCC CHECKDB , DBCC CHECKALLOCK, DBCC CHECKTABLE
o Check the level of fragmentation on a table
DBCC SHOWCONTIG
o SQL server profile profiler use SQL server profiler with a trace to observe lock conflicts
o Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN
KEY
o The primary key also impacts the physical storage of the data
o DBCC INDEXDEFRAG
o DBCC REINDEX
o DBCC SHOWCONTIG (check the the level of fragmentation )
o Use a specific index by using index hints
SELECT fname, lname
From emps (INDEX (idx_fname, idx_lname ) )
o The MSDB database is the database with the backup and restore system tables.
o .TRC (extension for trace file)
o ERD entity relationship diagram
o DTA database engine tuning advisor
o STG security technical implementation guide
o GPO group policy organization
o SA GOD- guardian of data )
o DHCP dynamic host control protocol
o VLDB very large database

You might also like