30
1 SQL SERVER DBA – TOPIC WISE FAQs SQL SERVER 1) What is SQL Server ? Micr osoft SQL Ser ver 200 5 is a dat aba se platform for lar ge-s cal e onl ine transact io n pr oces si ng (OL TP ! data "are#o$ si ng ! an d e-commerce applications% it is also a b$siness intelligence platform for data integration! anal&sis! and reporting sol$tions' 2) What is t he V ersios A vai!a"!e i S QL Server? SQL Server "as developed b& Microsoft in 1)* and t#e versions are +'0! +'5! *'0! )'0(2000! '0(2005! 10(200)' #) What is th e Di $ere%e "et&ee SQL Server 2''' a( 2''?  SQL Server*2''' SQL Server*2''  T -SQL T -SQL as "ell as ,L .nterprise manager SSMS Q$er& /nal&er Q$er& editor TS SSS 3o eporting T ools SSS 3o .4ception #andling in TS .4ception #andling in SSS ,an create $p to 1+ nstances ,an create $p to 50 instances 3o e4ception #andling in TS' .4ception #andlin g in SSS' sa6 blan7 pass"ord' .nforce pass"ord polic&' 3o database mirroring atabase mirroring' Ob8ect oriented programming ,ommon lang$age r$ntime +) What are the E(itios av ai!a"!e ,or S QL Server 2 ''?  T#ere are + si4 editio ns available in SQL Server 2005 a .nt erprise .di ti on b Standard .di tio n ceveloper edition d 9or7 gr o$p edition e Mobile edition f .4press edition ) What are the T oo!s are avai!a"!e i SQL Server 2''' a( 2''? S! 2''' 2'' 1 .nterprise manager : Q$er& /nal&er Management St$dio 2 3et"or7 ,lient ;tilities ,on<g$ration manager = SQL Pro<ler Pro<ler > Service manager S$rface area con<g$ration 5 eporting Services ,on<g$ration + atabase T $ning /dvisor * ,ommand Prompt ;tilities

DBA Iq Faq-praveen

Embed Size (px)

Citation preview

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 1/30

1

SQL SERVER DBA – TOPIC WISE FAQs

SQL SERVER1) What is SQL Server?

Microsoft SQL Server 2005 is a database platform for large-scale onlinetransaction processing (OLTP ! data "are#o$sing! and e-commerceapplications% it is also a b$siness intelligence platform for data integration!anal&sis! and reporting sol$tions'

2) What is the Versio s Avai!a"!e i SQL Server?SQL Server "as developed b& Microsoft in 1 )* and t#e versions are +'0! +'5!*'0! )'0(2000 ! '0(2005 ! 10(200) '

#) What is the Di$ere %e "et&ee SQL Server 2''' a (2'' ?

SQL Server*2''' SQL Server*2'' T-SQL T-SQL as "ell as ,L.nterprise manager SSMSQ$er& /nal& er Q$er& editor

TS SS S3o eporting Tools SS S3o .4ception #andling in TS .4ception #andling in SS S,an create $p to 1+ nstances ,an create $p to 50 instances3o e4ception #andling in TS' .4ception #andling in SS S'

sa6 blan7 pass"ord' .nforce pass"ord polic&'3o database mirroring atabase mirroring'

Ob8ect oriented programming,ommon lang$age r$ntime

+) What are the E(itio s avai!a"!e ,or SQL Server 2'' ? T#ere are + si4 editions available in SQL Server 2005a .nterprise .ditionb Standard .ditionc eveloper editiond 9or7gro$p editione Mobile edition

f .4press edition

) What are the Too!s are avai!a"!e i SQL Server 2''' a ( 2'' ?S! 2''' 2''1 .nterprise manager : Q$er&

/nal& erManagement St$dio

2 3et"or7 ,lient ;tilities ,on<g$ration manager= SQL Pro<ler Pro<ler> Service manager S$rface area con<g$ration5 eporting Services

,on<g$ration+ atabase T$ning /dvisor* ,ommand Prompt ;tilities

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 2/30

2

-) What are Servi%es avai!a"!e i SQL Server? T#ere are t#ree services available in SQL Server 2005'a SQL server servi%e ?- t is responsible for r$nning atabases! S&stem

Stored Proced$res! S&stem nde4es! ;ser Login information and Pass"ordsb SQL server a.e t servi%e ?- t is responsible for r$nning @obs! /lerts!

3otif&ing t#e operatorsc Distri"/te( Tra sa%tio Coor(i ator ?- t is responsible for moving data

among instances (One A to anot#er A

0) o& a 3 &a3s to r/ servi%es?Services are r$n b& 5 "a&s t#e& are1) /t tas7 pane B ig#t clic7 on server and clic7 start C stop2) Management St$dio B ig#t clic7 on Server and clic7 start C stop C restart3) S$rface /rea ,on<g$ration4) ,ommand Prompt B Net start/stop mssqlserver 5) SQL Server con<g$ration manager B ig#t clic7 on server and clic7 start C

stop C restart'

4) What is Wi (o&s A/the ti%atio ?9#en 9indo"s a$t#entication is $sed to connect SQL Server! Microsoft9indo"s is completel& responsible for a$t#enticating t#e client b& identif&ingits "indo"s $ser acco$nt'

5) What is SQL Server A/the ti%atio ?

9#en SQL Server a$t#entication is $sed! SQL Server a$t#enticates t#e clientb& comparing $ser name and pass"ord "it# $ser names and pass"ordsmaintained "it#in SQL Server'

1') What is the (i$ere %e "et&ee Wi (o&s A/the ti%atio a (SQL Server a/the ti%atio ?1 9indo"s a$t#entication is #ig#l& sec$re t#an SQL Server a$t#entication

"#& beca$se "e need not provide an& login details' So t#e c#ance of tracing login details from code b& t#e $na$t#ori ed persons "ill be less'9indo"s a$t#entication $ses t#e defa$lt "indo"s login credentials'

2 9indo"s a$t#entication "ill $ses t#e credentials of t#e c$rrentl& logged$ser to login in to t#e SQL Server database' Do$r application need not tos$ppl& t#e $ser name and pass"ord'

= Eor SQL Server a$t#entication "e #ave to s$ppl& t#e SQL database $sername and pass"ord' T#at "ill be $sed to get t#e privileges and rig#t of t#e $ser'

11) What is AWE? o& %o 6./re D3 a i% 7e or3 A!!o%atio ?Fenerall& SQL Server reserves onl& a small portion of memor&' Sometimesreserved memor& is not s$Gcient to SQL server and reH$ired additionalmemor&' AWE is /se( to s/88ort ver3 !ar.e a o/ ts o, 8h3si%a!

e or39 Whe AWE is e a"!e( the o8erati . s3ste (3 a i%a!!3a!!o%ates e or3 to SQL Server "ase( o the Min server memory

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 3/30

=

a ( max server memory setti .s9 :1) Wi 9 Server 2''# SE s/88orts/t8o +;B :2) EE /8to #2;B9 :#) DC /8to -+;B)To Co 6./re AWE<* Ri.ht %!i%= o i sta %e > Pro8erties > 7e or3 >E a"!e AWE > Set 7i a ( 7a e or3 et%9@ote ?- /9. is not needed and cannot be con<g$red on +>-bit operatings&stems'

12) What is Li =e( Server? o& to %o e%t Li =e( server? o& to test!i =e( Server?

One server connected "it# anot#er server to e4ec$te H$eries against OL. Adata so$rces on remote servers'OLEDB Provi(er ?- /n OLE DB provider is a LL t#at manages and interacts"it# a speci<c data so$rces s$c# as SQL Server *'0! /ccess! .4cel! O A,!Oracle! A2! Local <le s&stem! .4c#ange Server etc' SQL 3ative ,lient(P OF ? SQL3,L is t#e oGcial OL. A provider for SQL Server'

To %o e%t !i =e( server /si . OLE DB 8rovi(er ?-spIaddlin7edserver JserverK6servername6! Jsrvprod$ctK6SQLServerCOracle6Tests the %o e%tio to a !i =e( server ?-spItestlin7edserver servernameB

1#) What is 8/r8ose o, Re.istere( Servers?egistering a server to store t#e server connection information for f$t$re

connections'

1+) What (o 3o/ ea "3 Co!!atio ?

,ollation is basicall& t#e sort order' T#ere are t#ree t&pes of sort orders(1 ictionar& case sensitive ! (2 ictionar& case insensitive! (= Ainar&

1 ) What are the Proto%o!s /se( i @et&or=i .? What is theDe,a/!t Port / "er o, TCP IP?

T#e protocols $sed in net"or7ing are T,PC P! 3/M. P PP.S! /! SN/ .M.MO D' T#e defa$lt port no of T,PC P is 1>=='

1-) What is the S3 ta /se( ,or 6 ( the SQL Server versio ?1 Select JJversion2 ,lic7 on Server B S$mmar& eports B Server as#board B con<g$ration

details B See prod$ct version'

10) What is "!o%=i .? o& to i(e ti,3 a ( reso!ve the "!o%=i .s?Aloc7ing #appens "#en one $ser #olds an e4cl$sive loc7 on an ob8ect and asecond $ser reH$ires an e4cl$sive loc7 on t#e same ob8ect' T#is forces t#esecond $ser to "ait! bloc7 on t#e <rst'Deter i e B!o%=i . sessio s ?- /ctivit& Monitor! spI"#o2! spIloc7!s&s's&sprocess! s&s'dmIe4ecIreH$ests! s&s'dmIosI"aitingItas7sReso!ve B!o%=i . Sessio ?- (1 ig#t clic7 on session and ill in /ctivit&

Monitor (2 Kill Session_id14) What is Dea(!o%=?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 4/30

>

/ deadloc7 occ$rs "#en $sers tr& to place e4cl$sive loc7s on eac# ot#er6sob8ects'E ?- ;ser1 places an e4cl$sive loc7 on Table1 and t#en tries to place ane4cl$sive loc7 on Table2' ;ser2 alread& #as an e4cl$sive loc7 on table2! and;ser2 tries to p$t an e4cl$sive loc7 on Table1' T#is condition ca$ses endlessloop of "aiting for t#e loc7s to be released' T#e atabase engine pic7s one of t#e victim ($sers and 7ills t#eirH$er& and send a error message to $sers Do$ are t#e victim of a deadloc7and tr& again later 'Dea(!o%= I ,or atio Too!s1 Tra%e F!a.s ?- A,, T /,.O3 (120> : A,, T /,.O3 (1222 ' 9#en

t#ese trace Rags is enabling! t#e deadloc7 information capt$red b& t#eSQL Server error log'

2 Dea(!o%= .ra8h eve t i SQL Pro6!er ?- SQL Server Pro<ler grap#icall&representation of tas7s and reso$rces involved in a deadloc7'

(Loc7? eadloc7 and Loc7? eadloc7 c#ain events in t#e Loc7s events= S3ste Vie& ?- 9e can <nd t#e bloc7ing sessions b& "riting t#e follo"ingH$er&Sele t session_id! stat"s! #lo $in%_session_id &rom s's(dm_e e _req"ests*+ere #lo $in%_session_id , -

Reso!vi . Dea(!o%= ?- /fter <nd t#e session ca$sing t#e problem "e can$se LL command'B LL processIid

15) What are the T38es o, Lo%=s? E 8!ai ea%h? T#ere are * loc7s t&pes are available in SQL Server 2005'

a Share( Lo%= ?- S#ared (S loc7s allo" conc$rrent transactions to read(S.L.,T a reso$rce $nder pessimistic conc$rrenc& control'

b 8(ate Lo%=< - ;sed on reso$rces t#at can be $pdated' Prevents acommon form of deadloc7 t#at occ$rs "#en m$ltiple sessions are reading!loc7ing! and potentiall& $pdating reso$rces later'

c E %!/sive Lo%=< - .4cl$sive ( loc7s prevent access to a reso$rce b&conc$rrent transactions

d I te t Lo%=< - ;sed to establis# a loc7 #ierarc#&' T#e t&pes of intent loc7sare? intent s#ared ( S ! intent e4cl$sive ( ! and s#ared "it# intente4cl$sive (S '

e S%he a< - ;sed "#en an operation dependent on t#e sc#ema of a table ise4ec$ting'

f B/!= 8(ate ?- ;sed "#en b$l7 cop&ing data into a table and t#eTABLOC #int is speci<ed

g e3*Ra .e ?- Protects t#e range of ro"s read b& a H$er& "#en $sing t#eseriali able transaction isolation level

2') What are the Co 8o e ts %a "e i sta!!e( &ith SQL Server2'' ?

9e can install t#e follo"ing components "it# Microsoft SQL Server 2005a SQL Server atabase .ngine

b /nal&sis Servicesc eporting Servicesd 3oti<cation Services

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 5/30

5

e ntegration Servicesf Management Toolsg oc$mentation and Samples

21) What are the SQL Server E(itio s o, SQL Server 2'' ?SQL Server 2005 is available in =2-bit and +>-bit editions'a SQL Server 2005 .nterprise .dition (=2-bit and +>-bitb SQL Server 2005 .val$ation .dition (=2-bit and +>-bitc SQL Server 2005 Standard .dition (=2-bit and +>-bitd SQL Server 2005 9or7gro$p .dition (=2-bit onl&e SQL Server 2005 eveloper .dition (=2-bit and +>-bitf SQL Server 2005 .4press .dition (=2-bit onl&

g SQL Server 2005 ,ompact .dition (=2-bit onl&# SQL Server 2005 $ntime .dition (=2-bit and +>-bit

22) What is the 8ro%ess o, I sta!!atio ?a Pre8are o/r Co 8/ter to I sta!! SQL Server 2'' <* To prepare &o$r

comp$ter for SQL Server 2005! revie" #ard"are and soft"arereH$irements! S&stem ,on<g$ration ,#ec7er reH$irements and bloc7ingiss$es! and sec$rit& considerations'

b I sta!! SQL Server 2'' <* To install SQL Server 2005! r$n Set$p $singt#e SQL Server 2005 nstallation 9i ard or install from t#e commandprompt' Do$ can also add components to an instance of SQL Server 2005!

or $pgrade to SQL Server 2005 from a previo$s SQL Server version'c Co 6./re o/r SQL Server 2'' I sta!!atio <* /fter Set$p completes

t#e installation of SQL Server 2005! &o$ can con<g$re SQL Server $singgrap#ical and command prompt $tilities

2#) What is the Virt/a! 7e or3? o& to assi. virt/a! e or3 ho& /%h s8a%e re /ire( ,or Virt/a! e or3?/ reserved dis7 space to maintain transactions "#enever Memor& ( /M isf$ll' irt$al memor& si e is at least = times of t#e p#&sical memor& installedin t#e comp$ter'To Set Virt/a! e or3 ?- ig#t clic7 on S&stem B Select S&stem PropertiesB /dvanced B Performance Settings B /dvanced B irt$al memor& B,#ange B Select director& B Provide min and ma4 val$es'

DATABASE1) What is Data"ase? What are the 6!es %reate( &hi!e %reati . a

Data"ase?/ atabase is a collection of meaningf$l and related data t#at are stored in ro"and col$mns format (Tables ' 9#ile creating a atabase in SQL Server t#ere aret"o data <les are created called master data <le ('mdf ! log data <le ('ldf and

"e can add one or more optional 3- imensional data <les ('ndf '2) E 8!ai a"o/t Data 6!es :9 (,G 9 (,G 9!(,) :Fi!e str/%t/re)?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 6/30

+

a Pri ar3 Data 6!e :9!(,) ?- Primar& data <les #olds $ser data and ob8ects'.ver& database #as one primar& data <le'

b Se%o (ar3 Data 6!e :9 (,) ?- Secondar& ata <le ('ndf is optional and #old$ser data and ob8ects t#at do not <t in t#e Primar& data <le' 9e can add 3 no'of Secondar& data <les for a A'

c Lo. Data 6!e :9!(,) ?- T'Log records all t#e transactions and databasemodi<cations made b& eac# transaction and it is $sed to recover t#edatabase' /t least one transaction log <le reH$ired for eac# A' Min' log <lesi e is 512 A'

#) o& store the (ata i SQL Server? What is Pa.e a ( Pa.e siHe? What isE te t a ( E te t siHe?

T#e f$ndamental $nit of data storage in SQL server is t#e . 0E ' T#e si e of t#epage is ) 7b' ,ollection of eig#t contig$o$s pages is 7no"n as an E EN ' T#esi e of an e4tent is +> 7b ()4) '

+) What is Fi!! ,a%tor? o& to assi. Fi!! ,a%tor?/ Eill factor is a reserved free space on eac# leaf level page "#ic# is $sed forf$t$re gro"t# of data or inde4 in a table and red$ces t#e page splits'Assi. Fi!! Fa%tor ?- ig#t ,lic7 on Server B Properties B atabase Settings B

efa$lt nde4 Eill Eactor B Provide t#e val$e

) Te!! e a"o/t S3ste Data"ase a ( ser Data"ases i 2''' a ( 2'' ?SQL Server 2''' ?- 1 Master 2 Model = MS A > Temp ASQL Server 2'' ?- 1 Master 2 Model = MS A > Temp A 5 eso$rce A

-) E 8!ai a"o/t S3ste Data"ases i SQL Server 2'' ?

T#ere are <ve s&stem databases available in SQL Server 2005'a 7aster Data"ase ?- ecords Server level ob8ects s$c# as Login /cco$nts! .nd

Points! Lin7ed Servers! S&stem ,on<g$ration settings! location of t#edatabase <les and initiali ation information for SQL server' SQL Server ,annotstarts if Master A is $navailable'

b 7o(e! Data"as e?- T#e Model A is $sed as a template for all databasescreated on instances of SQL Server' f "e create a ne" atabase t#e Model

A str$ct$re "ill be in#erited to ne" atabase'c 7SDB Data"ase ?- T#e msdb database is $sed b& SQL Server /gent for

sc#ed$ling alerts and 8obs and b& ot#er feat$res s$c# as Service Aro7er andatabase Mail' SQL Server a$tomaticall& maintain completed online bac7$p

and restore #istor& in MS A'd Te 8DB ?- Temp A is a global reso$rce A' t stores $ser ob8ects (global or

local temporar& tables! stored proced$res! table variables! or c$rsors !nternal ob8ects (intermediate res$lts for spools or sorting and versions

(online inde4 operations! M$ltiple /ctive es$lt Sets (M/ S ! and /ET.triggers ' 9e cannot bac7$p t#e Temp A beca$se "#en SQL Server Start (orStop t#e Temp A can be deleted permanentl& (or refres# Temp A'

e Reso/r%e Data"ase ?- T#e eso$rce database is a #idden (read-onl&database t#at contains all t#e s&stem ob8ects s$c# as s&s'ob8ects t#at areincl$ded "it# SQL Server 2005' T#e eso$rce database ma7es $pgrading

process easier and faster'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 7/30

*

0) I, 7o(e! a ( 7SDB Data"ase &i!! %rash &hat 3o/ &i!! (o? o& tore"/i!( 7aster Data"ase?

9e can re-create Model and MS A databases b& reb$ild t#e Masteratabase'

SQL Server 2''' :Re"/i!( 7asterDB) ?- Start B $n B rebuildm.exeSQL Server 2'' :Re"/i!( 7asterDB) ?- Start B $n B setup.exe

4) o& to ove 7o(e!G 7SDBG Te 8DB?a' ,#ec7 t#e Pat# of Temp A t#ro$g# spINelp A Temp Ab' /LT. /T/A/S. tempdb MO ED E L. (3/M. K tempdev! E L.3/M. K

.?Utempdb'mdf %c' Stop t#e Servicesd' Move t#e <les to desired locatione' estart t#e Servicesf' ,#ec7 t#e Pat# of Temp A t#ro$g# spINelp A Temp A

5) o& to ove 7aster Data"ase?a' ,#ec7 t#e Pat# of Master A t#ro$g# spINelp A Masterb' Stop t#e Servicesc' ,#ange t#e pat# at Start$p parameters

SQL Server ,on<g$ration manager B Services B ig#t clic7 on Service BProperties B /dvanced B /dd ne"Ipat# at Start$p parameters

d' Move t#e <les to desired locatione' estart t#e Servicesf' ,#ec7 t#e Pat# of Master A t#ro$g# spINelp A Master

1') What are the Data"ase States a ( e 8!ai the ? T#e main database states are online! oVine! restoring! recovering! reso$rcepending! s$spect and emergenc&'

11) What is Data"ase S a8shot? ;ive the S3 ta ?/ atabase snaps#ot is a read-onl& static vie" of t#e database' Snaps#ots m$stbe located on t#e same server' Snaps#ots doesn6t contain $n-committedtransactions at t#e time of snaps#ot "as ta7en' t is ver& $sef$l for reportH$eries' (T#is option is available in 2005 .. editionE ?- , ./T. /T/A/S. /dvent$re9or7sIdbss1)00 O3 ( 3/M. K/dvent$re9or7sI ata! E L.3/M. K ,?UProgram EilesUMicrosoft SQLServerUMSSQL'1UMSSQLU ataU /dvent$re9or7sIdataI1)00'ss /S S3/PSNOT OE/dvent$re9or7s%

12) What is Tra sa%tio ? What is Tra sa%tio :ACID) Pro8erties? Transaction is a set of Logical $nit of "or7 and it contains one or more databaseoperations' / valid transaction s#o$ld be met (/, /tomicit&! ,onsistenc&!

solation! $rabilit& properties'a Ato i%it3 ?- / transaction m$st be an atomic $nit of "or7! eit#er all of it data

modi<cation are performed (or none of t#em is performed'b Co siste %3 ?- 9#en completed a transaction m$st leave all data in

consistent state' n a relational database! all r$les m$st be applied totransactions modi<cations to maintain all data integrit&' /ll internal data

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 8/30

)

str$ct$res! s$c# as A-tree inde4es (or do$ble lin7ed lists m$st be correct atend of transaction'

c Iso!atio ?- Modi<cations made b& conc$rrent transactions m$st be isolatedfrom t#e modi<cations made b& t#e ot#er conseH$ent transactions' /transaction eit#er sees a data in t#e state it "as in before anot#er conc$rrenttransaction modi<ed it! (or sees t#e data after second transactioncompleted'

d D/ra"i!it3 ?- /fter a transaction #as completed! its eWects are permanentl& inplace in t#e s&stem' T#e modi<cation persists even in t#e event of a s&stemfail$re'

1#) What are Tra sa%tio Iso!atio !eve!s?/n solation level determines t#e degree of isolation of data bet"een conc$rrent

transactions' T#e defa$lt isolation level is ead committed'a ead $ncommittedb ead committedc epeatable readd Seriali able

1+) What is 8/r8ose o, LS@ / "ers?.ver& record in t#e transaction log is $niH$el& identi<ed b& a log seH$encen$mber (LS3 ' LS3s are $sed internall& d$ring a .STO . seH$ence to trac7 t#epoint in time to "#ic# data #as been restored'

1 ) E 8!ai a"o/t RAID a ( RAID !eve!s?/ stands for ed$ndant /rra& of ndependent is7s' / is a dis7 s&stem

t#at contains arra&s to provide greater performance! reliabilit&! storagecapacit&! and lo"er cost' T&picall& 0! 1! and 5 / levels are $sed in SQLServer'

1-) I, a Data"ase i Si .!e ser o(e? o& to %ha .e i to 7/!ti*/sero(e?

/lter database database nameB set m$ltiI$ser

10) 7i i a! 7o(e a ( Si .!e /ser o(e?Minimal mode? - Start -Br$n -B command prompt B SQLS. . '. . Xf Single $ser mode? - Start -Br$n -B command prompt B SQLS. . '. . Xm

14) Or8ha e( sers? o& to 6 ( Or8ha e( sers a ( Reso!ve the ?9#en a A is move! attac# : detac#! restoring to diWerent instance orcorresponding login is dropped! t#e $sers of t#e atabase becomes Orp#aned$sers and t#e& can6t access t#e database beca$se t#e database $sers are notmapped to S (Sec$rit& denti<er in t#e ne" instance'To (ete%t Or8ha e( /sers ?- sp_ +an%e_"sers_lo%in eportTo Reso!ve Or8ha e( sers<* sp_ +an%e_"sers_lo%in pdate_One !

d#_"ser ! lo%in_name15) What is Ro& siHe o, a Data"ase?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 9/30

o" si e of a database is )0+0 b&tes'

2') What is ea8 ta"!e?/ table "it#o$t a cl$stered inde4 is called as #eap table'

21) What is Che%= 8oi t?,#ec7 Point is a operations t#at s&nc#roni es t#e p#&sical data "it# t#e c$rrentstate of t#e b$Wer cac#e b& "riting o$t all modi<ed data pages in b$Wer cac#eto dis7'

22) o& a 3 &a3s 3o/ %a ove the (ata or (ata"ases "et&eeservers a ( (ata"ases?SS S! TS! /ttac# : etac#! A$l7 cop& program! A$l7 nsert : mport and .4port

"i ard

2#) S3 ta ,or 6 ( o/t the Data"ase ID?Select dbIid ( dbIname6

2+) S3 ta ,or 6 ( o/t Lo.i s? C/rre t ser?To 6 ( o/t !o.i s ? - select Y from s&s's&sloginsTo 6 ( o/t %/rre t /ser ?- Select c$rrentI$ser

2 ) Is it 8ossi"!e to ta=e Ba%=/8s a ( Restores o, S3ste Data"ases?

Re%over3 7o(e!s

1) What is Re%over3 7o(e!? Be e6ts o, Re%over3 7o(e!s?/ recover& model is a atabase propert& t#at control t#e basic be#avior of t#e bac7$p and restore operations for a A ' ecover& models are designedto control transaction log maintenance'

2) E 8!ai F/!!G B/!=*Lo..e( Si 8!e Re%over3 7o(e!s?a F/!!<* 9it# E$ll ecover& Model "e can recover t#e data $p to t#e min$te

of cras#! beca$se it records ever& operation in t#e transaction log'a B/!=*Lo..e(<* 9it# A$l7-Logged recover& model "e can recover most of

t#e data! b$t "e "ill lost b$l7-operations beca$se t#ose are not recordedin to t#e log' 9e can set t#is option 8$st before performing a b$l7 insertoperation to speed $p t#e b$l7 insert'

b Si 8!e< - 9it# Simple ecover& Model "e can recover t#e data onl& $p tot#e last bac7$p! beca$se not#ing is recorded in t#e transactional log' /n&c#anges made to database after t#e last bac7$p "as performed "ill be lostbeca$se t#e& are not recorded in t#e transaction log' Fenerall& it is $sef$lfor test and development databases or data "are#o$ses! b$t it is notappropriate c#oice for Prod$ction atabase'

#) Whi%h DBs %a &e /se Si 8!e Re%over3 7o(e!?Simple ecover& Model is $sef$l for evelopment! Test databases! ata

"are#o$ses or not often c#anged atabases'+) I Whi%h Re%over3 7o(e!s Poi t*i *ti e re%over3 is 8ossi"!e?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 10/30

10

Point-in-Time ecover& is Possible onl& in E$ll and A$l7-Logged ecover&Models' A$t in A$l7-Logged ecover& model Point-in-time recover& is ma& orma& not possible'

) I S3ste DBs &hat are the (e,a/!t Re%over3 7o(e!s /se(?Master - SimpleModel - E$llMS A - Simple

Temp A - Simple

-) Wh3 i Si 8!e Re%over3 o(e! &e %a t ta=e T9Lo. "a%=/8s?n Simple ecover& Model t#e Transaction Logs are tr$ncated'

0) Ca &e ta=e Di$9 "a%=/8 i Si 8!e re%over3 7o(e!?

9e can ta7e iWerential bac7$p in Simple recover& model beca$se it belongsto 'mdf

Ba%=/8s1) What is Ba%=/8s? T38es o, "a%=/8s?

6 op' o& data t+at is "sed to restore and re over t+e data a&ter a s'stem&ail"re7( T#ere are fo$r t&pes of Aac7$ps available (1 E$ll Aac7$p (2

iWerential Aac7$p (= Transaction Log Aac7$p (> Eile CEile Fro$p Aac7$p

2) What is se o, Ba%=/8s?Aac7$ps is Safe F$ard to atabases beca$se ata ma& can loss d$e to man&

fail$res s$c# as Media Eail$res! ;ser errors! Nard"are Eail$res and 3at$ralisasters etc' 9it# good bac7$ps! "e can recover database from fail$res'

#) What is F/!!G Di$G T9Lo. Ba=/8s? E 8!ai Ea%h?a F/!! Ba%=/8<* 8"ll #a $"p ! bac7s $p t#e entire atabase incl$ding

Transaction Log' 9it# f$ll Aac7$p Point-in-time recover& is possiblebeca$se it contains 'mdf and 'ldf' t oWers complete protection againstmedia fail$res'

b Di$ere tia! Ba%=/8<* iWerential bac7$p records onl& t#e data t#at #asc#ange or modi<ed e4tents since t#e last f$ll bac7$p'

c T9Lo. Ba%=/8<* Transaction Log t#at records all transactions since lasttransaction log bac7$p or diWerential bac7$p' t can be $sed for recovert#e data to t#e point of fail$re (or speci<c point-in-time

d Fi!e Fi!e ;ro/8 "a%=/8<* Eile and Eile gro$p bac7$ps are a speciali edform of A bac7$p' n "#ic# onl& certain individ$al <le (or <le gro$psfrom a A are bac7$p'

+) Ca &e ta=e Di$9 "a%=/8s &itho/t F/!! "a%=/8s?3o! it is not possible'

) What are the S3 ta es ,or Ba%=/8s?

a) F/!! Ba%=/8 ? - Ba $"p data#ase d#name to dis$ 9 6pat+7 #) Di$9 Ba%=/8 ? - Ba $"p data#ase d#name to dis$ 9 6pat+7 *it+di:erential

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 11/30

11

) T9Lo. Ba%=/8 ?- Ba $"p lo% d#name to dis$ 9 6pat+7

-) E 8!ai a"o/t Tai! o, Lo.? ;ive the s3 ta ? T#e tail-log bac7$p is t#e last bac7$p t#at #ave not been bac7ed $p earlier!to recover t#e database to t#e point of a fail$re' (/ bac7$p ta7en t#at #avenot been bac7ed $p 8$st before restoring a database 'S3 ta <* 1 A/, ;P LOF databaseIname TO bac7$pIdeviceB 9 TN3O .,O . D 2 A/, ;P LOF databaseIname TO bac7$pIdeviceB Z9 TN [ ,O3T 3;.I/ET. I . O \ 3OIT ;3,/T. ]

0) Ba%=/8s strate.3?Fenerall& Aac7$ps are done b& client reH$irement' A$t Most of t#ecompanies are follo"ing t#is strateg&'1 F/!! Ba%=/8 ?- .ver& Sat$rda& evening +'00 PM

2 Di$ere tia! Ba%=/8 ?- .ver& a& evening +'00 PM= Tra sa%tio a! Lo. Ba%=/8 ?- .ver& one #o$r

Restore1) What is Restore? What are the re%over3 states? E 8!ai Ea%h?

estore means recover t#e data from bac7$ps' T#ere are t#ree recover&states for estore' (1 9it# ecover& (2 9it# 3o- ecover& (= Standb&'a With Re%over3 ?- 9it# ecover&! atabase "ill comes to Online and get

read& to $sing atabase' Fenerall& "#ile restoring recent (last T'Log "ecan c#oose "it# recover& option'

b With @o*Re%over3 ?- 9it# 3o- ecover& atabases "ill comes to OVineand "e can6t access A' Fenerall& e4cept recent log "e can c#oose 9it#3o- ecover& option'

c Sta ("3<* 9it# Standb&! atabases "ill comes to OVine and $sers can#ave read onl& access' Fenerall& e4cept recent log "e can c#oose Standb&option for ead onl& access'

2) What are the %o o s%e arios to Restori . the Data?1 To restore t#e lost and corr$pted data after a s&stem fail$re2 To restore a database onto a development s&stem for $ser b& application

developers "#ile developing and testing ne" code'= To restore a database onto a test s&stem to load test applications and

database feat$res'> To restore a database on separate server as a read-onl& database to

perform H$eries for reports'

#) I &hi%h e(itio O *!i e restoratio is 8ossi"!e?On-line restoration is possible onl& in .nterprise edition'

+) What are the S3 ta es ,or Restore?a With Re%over3 ?- estore database dbname from dis7 K Pat# "it#

recover&

b With @o*Re%over3 ?- estore database dbname from dis7 K Pat# "it#no recover&c Sta ("3 ?- estore database dbname from dis7 K Pat# "it# no standb&

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 12/30

12

) What is Poi t*i *ti e restore a ( /se o, that?Point-in-time restore is $sed to restore t#e atabase to a partic$lar time 8$stbefore a fail$re #as occ$rred or before corr$pt data'

-) E 8!ai a"o/t STOPAT %!a/se?STOP/T cla$se is $sed to restore a data base at point of time'

0) Restore Strate.3?1' Eirst restore recent last f$ll bac7$p2' T#en restore last iW' bac7$p=' T#en restore all Transaction Log bac7$ps'

Lo.shi88i .1) What is Lo. shi88i . a ( 8/r8ose o, Lo. shi88i .? To ac#ieve #ig# availabilit& and #ig# protection! Log s#ipping copiestransactions from a primar& server6 to one or more secondar& servers6' n Logs#ipping! T'Log bac7$ps are sent to one or more secondar& servers and t#enrestored to t#e destination servers individ$all&' f t#e Primar& databasebecomes $navailable! an& of t#e secondar& database can bro$g#t into onlineman$all&' T#e Secondar& server acts as a Aac7$p server and provides read-onl&H$er& processing to red$ce t#e load on t#e Primar& server' (Eor H$er&processing! secondar& servers s#o$ld be con<g$re in stand-b& mode '

2) What is Pri ar3 ServerG Se%o (ar3 Server 7o itor Server?a Pri ar3 Server ? - Primar& Server is a Prod$ction server "#ic# #olds t#e

original cop& of t#e database' Log s#ipping con<g$ration and administrating"ill be done from Primar& Server'

b Se%o (ar3 Server ? - Secondar& servers #old t#e standb& cop& of t#edatabase' 9e m$st initiali e t#e A on a secondar& server b& restoring abac7$p from t#e Primar& server $sing eit#er 3O .,O . D option or t#eST/3 AD option' A& $sing ST/3 AD option ;sers can #ave read-onl& accessto it'

c 7o itor Server ? - /n optional Server is called as Monitor Server t#atrecords #istor& and stat$s of bac7$p! cop& and restore operations and raisesalerts if an& operations fail' T#e Monitor Sever s#o$ld be on separate serverto avoid losing critical information' Single Monitor Server monitors m$ltipleLog s#ipping con<g$rations'

#) What are the Jo"s r/ i . ,or Lo. shi88i . a ( e 8!ai the ?Log s#ipping #aving fo$r operations "#ic# are #andled b& SQL Server /gent @ob'a Ba%=/8 Jo" ? - Aac7$p 8ob is created on Primar& Server instance and it

performs bac7$p operation' t logs #istor& on t#e local server and monitorsevers and deletes old bac7$p <les and #istor& information'

b Co83 Jo" ? - ,op& @ob is created on Secondar& server instance and it performs

copies t#e bac7$p <les from primar& sever to secondar& server' t logs #istor&on t#e secondar& server and monitor server'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 13/30

1=

c Restore Jo" ? - estore @ob is created on t#e Secondar& server instance and itperforms restore operation' t logs #istor& on t#e local server and monitorsever and deletes old <les and #istor& information'

d A!ert Jo"< * f a Monitor Server is $sed! t#e /lert @obs is created on t#eMonitor server instance and it raises /lerts if an& operations #ave notcompleted s$ccessf$ll&'

+) Re /ire e ts ,or Lo. shi88i .?a SQL Server 2005 Standard .dition! 9or7gro$p .dition! or .nterprise .dition

m$st be installed on all server instances involved in log s#ipping'b /ll servers s#o$ld #ave t#e same case sensitivit& settings'c T#e databases m$st $se t#e f$ll recover& model or b$l7-logged recover&

model'

) o& to %o 6./re Lo. shi88i .?

a' ,#oose Primar& Server! Secondar& Servers! and optional Monitor server'b' ,reate a Eile s#are to 7eep Transaction log bac7$ps (Aest to place on aseparate comp$ter

c' ,reate a folder for eac# Secondar& server into "#ic# transaction log bac7$pcopies'

d' ,#oose Aac7$p Sc#ed$le for Primar& atabasee' ,#oose ,op& and estore Sc#ed$les for Secondar& atabasef' ,#oose /lert @ob sc#ed$le for Monitor Server if con<g$red

-) What are 8er issio s re /ire( ,or Lo. shi88i .?9e m$st #ave sysadmin on eac# server instance to con<g$re Log s#ipping'

0) I Lo.shi88i . &hi%h Re%over3 7o(e!s %a &e /se(?9e can $se eit#er f$ll or b$l7 logged recover& model for log s#ipping'

4) Where 3o/ o itori . Lo. shi88i . a ( ho&?9e can monitoring t#e Log s#ipping in t#e follo"ing "a&s'a 7o itor server : istor3 Ta"!es) ?- Monitor Server trac7s all statistics! stat$s

and errors t#at co$ld be #appen d$ring Log s#ipping'1 Lo.Kshi88i .K o itorK8ri ar3 ?- Stores primar& server stat$s2 Lo.Kshi88i .K o itorKse%o (ar3 ?- Stores secondar& servers stat$s= Lo.Kshi88i .K o itorKhistor3K(etai!< - ,ontains #istor& details for

logs#ipping agents'> Lo.Kshi88i .K o itorKerrorK(etai! ?- Stores error details for log s#ipping

8obs'5 Lo.Kshi88i .K o itorKa!ert ?- Stores /lert @ob

b S3ste Store( Pro%e(/res :7SDB) ?- S&stem Stored proced$res gives t#e#istor& information abo$t t#e speci<ed server t#at are con<g$red in Logs#ipping'1 spI#elpIlogIs#ippingImonitor ( $n at Monitor Server2 spI#elpIlogIs#ippingImonitorIprimar& JPrimar&I atabase K A3ame6

( $n at MS= spI#elpIlogIs#ippingImonitorIsecondar& J Secondar&I atabase KA3ame6 ( $n at MS

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 14/30

1>

> spI#elpIlogIs#ippingIalertI8ob ( $n at Mon Server5 spI#elpIlogIs#ippingIprimar&Idatabase J atabase K A3ame6 ( $n at

Primar& Server+ spI#elpIlogIs#ippingIsecondar&Idatabase J atabase K A3ame6 ( $n

at Sec Serverc Tra sa%tio Lo. shi88i . Stat/s re8ort :S/ ar3 Re8orts) ?- T#is

report s#o"s t#e stat$s of log s#ipping con<g$rations for "#ic# t#is serverinstance is a primar&! secondar& or monitor'

d SQL Server /gent @ob Nistor&e ,#ec7ing t#e SQL Server Log

5) o& Se%o (ar3 Server &i!! "ro/.ht i to O !i eG i, the Pri ar3 Server"e%o es avai!a"!e?

f t#e Primar& Server "ill become $n-available! do t#e follo"ing steps'a Ta7e t#e Tail of Log from Primar& server

b estore Tail of log into all Secondar& atabasec emove Log-s#ipping con<g$ration from Primar& Serverd Select an& one of Secondar& server and bring into online "it# /lter atabase

A3ame set Onlinee ig#t clic7 on Primar& atabase and Fenerate script for ;sers and Logins'f T#en move t#e script to Secondar& server to create ;sers and Loginsg e-con<g$re log s#ipping from 3e" Server (Secondar& server

1') What are errors o%%/rre( i Lo. shi88i .? T#ere are t"o errors are occ$rred d$ring Log s#ipping1 1++2' ?- T#is error occ$rs "#en t#e Aac7$p 8ob fails

2 1++21 ?- T#is error occ$rs "#en t#e estoring 8ob fails

7irrori .1) What is Data"ase 7irrori .? What are the "e e6ts o, that?

atabase mirroring is a met#od of increasing database availabilit& ! "#ic#s$pports a$tomatic failover "it# no loss of data'Be e6ts ?-# ncreases data protectioni ncreases availabilit& of a database

8 mproves t#e availabilit& of t#e prod$ction database d$ring $pgrades

2) What are the 8rere /isites ,or Data"ase 7irrori .?a Aot# Servers are reH$ires same edition eit#er Standard .dition or

.nterprise .dition'b f 9itness server con<g$red! t#e server s#o$ld be installed Standard

.dition! .nterprise .dition! 9or7gro$p .dition! or .4press .dition'c /ll Servers s#o$ld $se t#e same master code page and collation'd Mirror Server #as same database name and $se onl& 9it# 3o ecover&

option'e Mirroring $ses t#e f$ll recover& model' (Simple and b$l7-logged not

s$pportedf /ll logins for connecting Principal atabase s#o$ld be reside on Mirrordatabase

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 15/30

15

#) What are the Restri%tio s ,or Data"ase 7irrori .?a Ma4im$m 10 databases per instance can s$pport on a =2-bit s&stem'b atabase mirroring is not s$pported "it# eit#er cross-database

transactions or distrib$ted transactions'

+) E 8!ai a"o/t Pri %i8a!G 7irror a ( Wit ess Servers?1 Pri %i8a! Server ?- One Server serves t#e database to client is called

Principal server and it #aving original data' ,an #ave onl& one PrincipalServer and it #as to be on a separate server'

2 7irror Server ?- Ot#er server instance acts as a #ot or "arm standb&server is called Mirror server and it #aving cop& of database'

= Wit ess Server ?- T#e "itness server is an optional server and it controlsa$tomatic failover to t#e mirror if t#e principal becomes $navailable' Tos$pport a$tomatic failover! a database mirroring session m$st be

con<g$red in #ig#-availabilit&') I &hi%h O8eratio s are r/ i . the O8erati . 7o(es?

As3 %hro o/s ?- ;nder as&nc#rono$s operation! t#e Principal server doesnot "ait for a response from t#e mirror server after sending t#e log b$Wer'S3 %hro o/s ?- ;nder s&nc#rono$s operation! t#e Principal server sends t#elog b$Wer to t#e mirror server! and t#en "aits for a response from t#e mirrorserver'

-) What are the O8erati . 7o(es a ( e 8!ai the ?

a' i.h Avai!a"i!it3 ?- Nig#-availabilit& mode! r$ns s&nc#rono$sl&' eH$iresa 9itness Server instance' T#e Principal server sends t#e log b$Wer to t#emirror server! and t#en "aits for a response from t#e mirror server'

b' i.h Prote%tio ?- Nig#-protection mode! r$ns s&nc#rono$sl&' /l"a&scommit c#anges at bot# t#e Principal and Mirror'

c' i.h Per,or a %e ?- Nig#-performance mode! r$ns as&nc#rono$sl& andt#e transaction safet& set to oW' T#e Principal server does not "ait for aresponse from t#e mirror server after sending t#e log b$Wer' T#e principalserver r$nning nice and fast! b$t co$ld lose data on t#e mirror server'

0) What is the (e,a/!t o, Port / "ers o, Pri %i8a! a ( 7irror servers?o& to 6 ( the Port / "ers?

T#e defa$lt port n$mbers of principal and mirror servers are 5022 and 502='To Fi ( Port @/ "er ?- SELE; name! port 8 O< s's(t p_endpoints

4) What is E ( Poi t? o& / %reate e ( 8oi t?/n endpoint is a net"or7 protocol "#ic# is $sed to comm$nicate over t#enet"or7'Creatio o, a e ( 8oi t ?

,reate endpoint endpoint nameB StateKstartedCstoppedCdisabled as tcp (listener portK5022C502= for databaseImirroring

(roleKpartnerC"itness5) Whi%h Tra%e a. is /se( i 7irrori .?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 16/30

1+

Trace Rags are $sed to temporaril& set speci<c server c#aracteristics or tos"itc# oWCon a partic$lar be#avior' 1>00 Trace Rag is $sed in mirroring'To set tra%e a. ,or Data"ase irrori . ?- ,on<g$ration Manager B

ig#t clic7 on server instance B Properties B /dvanced tab B Start$pparameters B -t1>00 (add

1') I &hi%h Re%over3 o(e! &e %a /se i 7irrori .?n mirroring t#e principal and mirror databases are $sed onl& f$ll recover&

model

11) What is Ro!e*s&it%hi .?nter c#anging of roles li7e principal and mirror are called role s"itc#ing'

12) What is the S3 ta to sto8 the Data"ase 7irrori .?/lter database database nameB set partner oW

1#) o& to %o 6./re 7irrori .?a ,#oose Principal Server! Mirror Server! and optional 9itness server'b T#e principal and mirror server instances m$st be r$nning t#e same

edition eit#er Standard .dition or .nterprise .ditionc T#e 9itness server instance can r$n on SQL Server Standard .dition!

.nterprise .dition! 9or7gro$p .dition! or .4press .ditiond Mirror database reH$ires restoring a recent bac7$p and one or more T'log

bac7$ps of t#e principal database ("it# 3orecover&

1+) o& to o itori . 7irrori .? T#ere are si4 met#ods are available for monitoring t#e atabase Mirroringa SQL Server 7a a.e e t St/(io ?- / green arro" on t#e mirror server is

indicates r$nning "ell' / red arro" indicates problems t#at need toinvestigate'

b SQL Server Lo. ?- t provides information of Mirroring establis#ment andstat$s' f an& errors occ$rs it "ill be logged to SQL Server log and 9indo"sevent log'

c Per,or a %e 7o itor ?- t can provides real-time information abo$tatabase mirroring' 9e can $se performance co$nters to get stat$s of t#e

database mirroring s$c# as A&tes receivedCsec! A&tes sentCsec! Transactiondela& etc'

d Pro6!er ?- Pro<ler man& events are providing t#e stat$s of t#e atabasemirroring

e Data"ase 7irrori . 7o itor ?- atabase Mirroring Monitor is a F; toolt#at s#o"s $pdate stat$s and to con<g$re "arning t#res#olds'To o8e D7 7o itor ?- ig#t clic7 on Principal atabase B Tas7s B SelectLa$nc# atabase Mirroring Monitor'

f S3ste Store( Pro%e(/res< -2' spIdbmmonitoraddmonitoring

=' spIdbmmonitorc#angemonitoring>' spIdbmmonitor#elpmonitoring5' spIdbmmonitordropmonitoring

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 17/30

1*

1 ) What is ar(e i .?/s H$ic7l& as possible! t#e log b$Wer is "ritten to t#e transaction log on dis7!a process called #ardening'

1-) What is Lo. "/$er/ log b$Wer is a special location in memor& ( /M ' SQL Server stores t#ec#anges in t#e database6s log b$Wer'10) o& to Set a Wit ess Server to Data"ase 7irrori .?

SS7S ?- ig#t ,lic7 on Principal atabase B Tas7s B Mirror B ,lic7 on,on<g$re Sec$rit& B Provide t#e .nd point for 9itness server B ,lic7 o T*SQL ?- /LT. /T/A/S. /dvent$re9or7s S.T 9 T3.SS K

T,P?CCprasad'local?502> ( o t#is from t#e Principal Server

14) o& to Re ove a Wit ess Server ,ro Data"ase 7irrori .?

SS7S ?- ig#t ,lic7 on Principal atabase B Tas7s B Mirror B emove T,Paddress from t#e 9itness B ,lic7 o T*SQL ?- /LT. /T/A/S. /dvent$re9or7s S.T 9 T3.SS OEE

15) o& to Set/8 F/!!3 Q/a!i6e( @a es ,or Data"ase 7irrori .?I9 FQD@ ErrorOne or more of t#e server net"or7 addresses lac7s a f$ll& H$ali<ed domainname (EQ 3 ' Specif& t#e EQ 3 for eac# server! and clic7 Start Mirroringagain'

T#e s&nta4 for a f$ll&-H$ali<ed T,P address is?

T,P?CC comp$terInameB' domainIsegmentBZ' domainIsegmentB^? portB

II9 RECTIF I@; F LL Q ALIF ED @A7ES1 To Vie& E (8oi ts<* S.L.,T Y E OM s&s'databaseImirroringIendpoints%2 Re ove e isti . a!! E (8oi ts ,ro Pri %i8a!G 7irror a ( Wit ess

servers <* OP .3 PO 3T Z.3 PO 3TI3/M.^#) A((i . M!o%a!M as the 8ri ar3 D@S s/N as ,o!!o&s<*

a ig#t-clic7 73 Co 8/ter ! and t#en clic7 Pro8erties ' T#e S&stemProperties dialog bo4 "ill appear'

b ,lic7 t#e Co 8/ter @a e tab'c ,lic7 Cha .e ' T#e Co 8/ter @a e Cha .es dialog bo4 "ill appear'd ,lic7 7ore ' T#e D@S S/N a ( @etBIOS Co 8/ter @a e dialog

bo4 "ill appear'e .nter t#e appropriate 3S s$G4 for t#e domain'f Select t#e Cha .e 8ri ar3 D@S s/N &he (o ai e "ershi8

%ha .es c#ec7 bo4'g ,lic7 O to save t#e c#anges! and t#en clic7 O to e4it t#e Co 8/ter

@a e Cha .es dialog bo4'# ,lic7 O to close t#e S3ste Pro8erties dialog bo4! and t#en restart

t#e comp$ter for t#e c#ange to ta7e eWect'> econ<g$re t#e atabase mirroring eit#er F; or T-SQL

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 18/30

1)

2') What are the Data"ase 7irrori . states?1) S @C RO@I I@;<*

T#e contents of t#e mirror database are lagging be#ind t#e contents of t#e principal database' T#e principal server is sending log records to t#emirror server! "#ic# is appl&ing t#e c#anges to t#e mirror database to rollit for"ard'

/t t#e start of a database mirroring session! t#e database is in t#eSD3,N O3 _ 3F state' T#e principal server is serving t#e database! andt#e mirror is tr&ing to catc# $p'

2) S @C RO@I ED ?-9#en t#e mirror server becomes s$Gcientl& ca$g#t $p to t#e principal

server! t#e mirroring state c#anges to SD3,N O3 _. ' T#e databaseremains in t#is state as long as t#e principal server contin$es to sendc#anges to t#e mirror server and t#e mirror server contin$es to appl&c#anges to t#e mirror database'

f transaction safet& is set to E;LL! a$tomatic failover and man$alfailover are bot# s$pported in t#e SD3,N O3 _. state! t#ere is no dataloss after a failover'

f transaction safet& is oW! some data loss is al"a&s possible! even int#e SD3,N O3 _. state'

#) S SPE@DED<* T#e mirror cop& of t#e database is not available' T#e principal

database is r$nning "it#o$t sending an& logs to t#e mirror server! a

condition 7no"n as r"nnin% e posed ' T#is is t#e state after a failover' / session can also become S;SP.3 . as a res$lt of redo errors or if t#e administrator pa$ses t#e session S;SP.3 . is a persistent state t#at s$rvives partner s#$tdo"ns andstart$ps'

+) PE@DI@;KFAILOVER<* T#is state is fo$nd onl& on t#e principal server after a failover #asbeg$n! b$t t#e server #as not transitioned into t#e mirror role' 9#en t#e failover is initiated! t#e principal database goes into t#eP.3 3FIE/ LO . state! H$ic7l& terminates an& $ser connections! andta7es over t#e mirror role soon t#ereafter'

) DISCO@@ECTED<* T#e partner #as lost comm$nication "it# t#e ot#er partner

Re8!i%atio1) What is Re8!i%atio ?

eplication is t#e process of cop&ing and distrib$ting data bet"een databasesto diWerent servers t#ro$g#o$t t#e enterprise '

eplication is a set of tec#nologies for cop&ing and distrib$ting data anddatabase ob8ects from one database to anot#er and t#en s&nc#roni ing bet"een

databases to maintain consistenc&'2) What are the /ses o, Re8!i%atio ?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 19/30

1

a Server to Server Re8!i%atio ?-1' mproving scalabilit& and availabilit&2' ata "are#o$sing and reporting=' ntegrating data from m$ltiple sites>' ntegrating #eterogeneo$s data5' OVoading batc# processing

b Server to C!ie t Re8!i%atio ?-1' .4c#anging data "it# mobile $sers2' etail point of sale (POS applications=' ntegrating data from m$ltiple sites

#) T38es o, Re8!i%atio a ( e 8!ai ea%h?a S a8shot re8!i%atio ?- Snaps+ot repli ation ta7es a pict$re or a snaps#ot of

t#e database and propagated to t#e s$bscribers' t red$ces t#e over#ead ont#e P$blis#ers and S$bscribers beca$se it does not monitor data $pdates'

Snaps#ot replication is ver& $sef$l! "#en t#e so$rce data is c#angesoccasionall& ( eporting 'b Tra sa%tio a! re8!i%atio ?- Transactional eplication starts "it# a snaps#ot

of t#e p$blis#er database' 9it# Transactional eplication! an& c#anges madeto t#e articles are capt$red from t#e transactional log and propagated to t#edistrib$tors contin$o$sl& and a$tomaticall&' ;sing Transactional eplication "ecan 7eep t#e p$blis#er and s$bscriber in almost e4actl& t#e same state'

c 7er.e re8!i%atio ?- Merge eplication starts "it# a snaps#ot of t#e p$blis#erdatabase' S$bseH$ent data c#anges and sc#ema modi<cations made at t#eP$blis#er and S$bscribers are trac7ed "it# triggers' T#e S$bscribers&nc#roni es "it# t#e P$blis#er "#en connected to t#e net"or7 and

e4c#anges all ro"s t#at #ave c#anged bet"een t#e P$blis#er and S$bscribersince t#e last time s&nc#roni ation occ$rred'

+) E 8!ai a"o/t P/"!isherG S/"s%ri"er a ( Distri"/ter?a P/"!isher ?- T#e P$blis#er is a database t#at ma7es data available for

replication' T#e P$blis#er can #ave one or more p$blications'b Distri"/tor<* T#e distri#"tor is t#e intermediar& bet"een t#e p$blis#er and

s$bscriber' t receives p$blis#ed transactions or snaps#ots and t#en stores andfor"ards t#ese p$blications to t#e s$bscribers'

c S/"s%ri"ers<* S$bscribers are database servers t#at store t#e replicateddata and receive $pdates' / s$bscriber can receive data from m$ltiplep$blis#ers' Aased on t#e replication t&pe! t#e S$bscriber can also pass datac#anges bac7 to t#e P$blis#er or rep$blis# t#e data to ot#er S$bscribers'

) E 8!ai a"o/t Arti%!eG P/"!i%atio G S/"s%ri8tio ?a Arti%!e ?- /n rti le is t#e data! transactions! or stored proced$res t#at are

stored "it#in a p$blication' T#is is t#e act$al information t#at is going to bereplicated'

b P/"!i%atio ?- T#e p"#li ation is t#e storage container for diWerent articles' /s$bscriber can s$bscribe to an individ$al article or an entire p$blication'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 20/30

20

c S/"s%ri8tio ?-S$bscription is a reH$est b& t#e s$bscriber to receive t#ep$blication'

-) Whi%h re%over3 o(e!s are /se( ,or Re8!i%atio ?E$ll and A$l7-logged ecover& models

0) o& to o itor the Re8!i%atio ?a Re8!i%atio 7o itor ?- eplication Monitor is a F; tool provides detailed

information on t#e stat$s and performance of p$blications and s$bscriptions'A& $sing replication monitor "e can <nd o$t (1 "#ic# s$bscriptions are slo"(2 9#& is an agent not r$nning (= Time ta7en to transaction commit (> 9#&merge replication is slo" (5 No" far be#ind s$bscription etc'To !a/ %h Re8!i%atio 7o itor ?- ,onnect nstance B ig#t ,lic7 on

eplication folder B Select la$nc# eplication monitor

b 7a a.e e t St/(io ?- A& $sing management St$dio "e can see ie"Snaps#ot /gent Stat$s! ie" Log eader /gent Stat$s! ie" S&nc#roni ationStat$s etc'Thro/.h SS7S ?- ,onnect nstance B ig#t ,lic7 on P$blication B Select t#eoption

c S3ste 7o itor ?- Provides information on t#e performance of vario$sprocesses of eplication'

A.e t Per,or a %eo" e%t Co/ ter

/ll agents eplication/gents $nning

Snaps#ot/gent

eplicationSnaps#ot

Snaps#ot? elivered,mdsCsec

Snaps#ot/gent

eplicationSnaps#ot

Snaps#ot? elivered TransCsec

Log eader/gent

eplicationLogreader

Logreader? elivered,mdsCsec

Log eader/gent

eplicationLogreader

Logreader? elivered TransCsec

Log eader/gent

eplicationLogreader

Logreader? eliver&Latenc&

istrib$tion/gent eplication ist' ist? elivered ,mdsCsecistrib$tion

/gent eplication ist' ist? elivered TransCsec

istrib$tion/gent eplication ist' ist? eliver& Latenc&

Merge /gent eplication Merge ,onRictsCsec

Merge /gent eplication Merge o"nloaded,#angesCsec

Merge /gent eplication Merge ;ploaded ,#angesCsec

4) What are the A.e ts avai!a"!e ,or Re8!i%atio a ( e 8!ai ea%h?SQL Server /gent #osts and sc#ed$les t#e agents $sed in replication and alsocontrols and monitors operations o$tside of replication'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 21/30

21

b S a8shot A.e t ?-T#e Snaps#ot /gent is t&picall& $sed for all t&pes of replication' t is responsible for cop&ing t#e sc#ema and data from t#ep$blis#er to t#e s$bscribers! stores t#e snaps#ot <les! and recordsinformation abo$t s&nc#roni ation in t#e distrib$tion database' T#e Snaps#ot/gent r$ns at t#e istrib$tor'

c Lo. Rea(er A.e t ?- T#e Log eader /gent is $sed for transactionalreplication' t moves information from t#e transaction log on t#e p$blis#er tot#e distrib$tion database'

d Distri"/tio A.e t ?- T#e istrib$tion /gent is $sed for snaps#ot replicationand transactional replication' t is responsible for moving t#e storedtransactions from t#e distrib$tor to t#e s$bscribers'

e 7er.e A.e t ?- T#e Merge /gent is $sed for merge replication' t isresponsible for converging records from m$ltiple sites and t#en redistrib$tingt#e converged records bac7 to t#e s$bscribers'

f Q/e/e Rea(er A.e t ?- T#e Q$e$e eader /gent is $sed for transactional

replication "it# t#e H$e$ed $pdating option' t r$ns on t#e istrib$tor and isresponsible for reading messages from t#e H$e$e on t#e s$bscribers andappl&ing t#em to t#e appropriate p$blication'

5) What are the A.e ts /se( ,or Tra sa%tio a! Re8!i%atio ?a Snaps#ot /gentb Log eader /gentc istrib$tion /gent

1') What are the A.e ts /se( ,or 7er.e Re8!i%atio ?a Snaps#ot /gent

b Merge /gent

11) What is the Pro%ess o, Tra sa%tio a! Re8!i%atio ? T#ree /gents are doing t#e Process for Transactional eplication

7A@A;E7E@T

1) What is 7ai te a %e P!a ?Maintenance plans create a "or7Ro" for database optimi ation! and ma7e freefrom inconsistencies'

2 9#at t#e tas7s in Maintenance Plans`

= SQL Server Logs`

+) Data"ase 7ai!?atabase Mail is an enterprise sol$tion for sending e-mail messages from t#e

Microsoft SQL Server 2005 atabase .ngine' ;sing atabase Mail! &o$r databaseapplications can send e-mail messages to $sers' T#e messages can contain

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 22/30

22

H$er& res$lts! and can also incl$de <les from an& reso$rce on &o$r net"or7'atabase Mail is designed for reliabilit&! scalabilit&! sec$rit&! and s$pportabilit&'

5 E$ll Te4t Searc#`

PERFOR7A@CE T @I@;1) Whi%h Too!s are /se( ,or Per,or a %e T/ i .?

T#ere are man& tools are $sed for Performance t$ninga Wi (o&s too!s ,or o itori . a88!i%atio s ?- Performance monitor!

Performance ,o$nters and Logs! Tas7 manager! 3et"or7 managerb SQL Server too!s ,or o itori . %o 8o e ts ?- SQL trace! SQL

Pro<ler! M s! S&stem Stored proced$res! Frap#ical s#o" plan! /ctivit&Monitor! A,,! A$ilt-in E$nctions! Trace Rags

2) o& to i(e ti,3 !o .est r/ i . /eries? T#ere are t"o "a&s to identif& slo" r$nning H$eries1 Pro<ler (A& $sing d$ration of t#e H$er&2 s&s'dmIe4ecIH$er&Istats and s&s'dmIe4ecIreH$ests M s= A,, OP.3T /3

#) Reaso s ,or S!o& R/ i . Q/er3? T#ere are a n$mber of common reasons for slo"-r$nning H$eriesa Lac7 of $sef$l inde4es! Lac7 of $sef$l data striping ( / 'b Aloc7ings! Table scans! Lac7 of $sef$l partitioning

c Missing or o$t of date statistics ($pdate statisticsd Slo" net"or7 comm$nication'e ns$Gcient memor& available for SQL Server'f ns$Gcient dis7 space'g .4cess recompilations of Stored Proced$res# Proced$res and Triggers "it#o$t S.T 3O,O;3T On

+) o& to a a!3He /er3 8er,or a %e?9e can anal& e H$er& performance in t#ree "a&s1 T*SQL ?- S.T SNO9PL/3I/LL O3COEE! S.T SNO9PL/3IT. T O3COEE2 SS7S ?- .stimated .4ec$tion Plan : /ct$al .4ec$tion plan= Pro6!er ?- To displa& te4t and ML e4ec$tion plans! see ispla&ing

.4ec$tion Plans b& ;sing SQL Server Pro<ler .vent ,lasses

) o& to i %rease Q/er3 8er,or a %e?9e can improve H$er& performance in t#e follo"ing "a&s1 /dd inde4es if reH$ired2 $n ;pdate statistics for o$t of date statistics= esolving Aloc7ing iss$es> /dd space to A <les or Temp A! if t#at are not #aving eno$g# space

5 ed$ce t#e too m$c# normali ation+ ;sing Temporar& tables instead of ,$rsors* SPs and Triggers are "it# Set 3O,O;3T On

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 23/30

2=

) ;nnecessaril& complicated 8oins

-) E 8!ai a"o/t Pro6!er? What are the ses o, Pro6!er?SQL Pro<ler can capt$re SQL Server events from t#e server to anal& e ortro$bles#oot performance problems s$c# as Einding Slo"-r$nning H$eriesand Monitoring performance etc' Pro<ler is $sef$l for maintaining sec$rit&!tro$bles#ooting! monitoring and optimi ation'

ses o, SQL Pro6!er<*a Eind t#e "orst-performing H$eries'b dentif& t#e ca$se of a deadloc7'c Monitor stored proced$re performanced /$dit SQL Server activit&'e Monitoring T-SQL activit& per $ser'f ,ollect a representative sample of events for stress testing'g ,ollect a sample of events for t$ning t#e p#&sical database design b&

$sing atabase .ngine T$ning /dvisor'0) What are the Eve ts is %a8t/re( SQL Pro6!er?

9e can capt$re t#e events s$c# asa T-SQL Statements! Stored Proced$resb ,$rsors! Loc7s (deadloc7sc atabases ob8ects and a$to gro"t# of si e of data : log <lesd .rrors : "arnings (s&nta4 errorse Performance (s#o" planf Table Scansg Sec$rit& a$dits (failed logins! pass"ord c#anges

# Monitor server control! memor& c#anges (,P;! eads! 9ritesi Sessions! Transactions! T$ning

4) E 8!ai a"o/t Data"ase T/ i . A(visor? What is Wor=!oa(?atabase T$ning /dvisor can anal& e t#e performance eWects of "or7loads

r$n against one or more atabases or a SQL Pro<ler trace (t#e& ma& contain T-SQL batc# or remote proced$re call ' /fter anal& ing! it recommends toadd! remove or modif& p#&sical design str$ct$res s$c# as cl$stered and non-cl$stered inde4es! inde4ed vie"s and partitioning'Wor=!oa( ?- / "or7load is a set of Transact-SQL statements t#at e4ec$tesagainst databases &o$ "ant to t$ne

5) What is D3 a i% 7a a.e e t Vie&s?M s ret$rn server state information t#at "e can $se to monitor t#e #ealt#

of a server instance! diagnose problems! and t$ne performance' T#ere aret"o t&pes of M s?a Server*s%o8e( D7Vs<* eH$ire t#e .9 S. . ST/T. permission on

t#e server'

b Data"ase*s%o8e( D7Vs<* eH$ire t#e .9 /T/A/S. ST/T.permission on t#e database'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 24/30

2>

1') What is DAC? o& to %o e%t DAC?/, is stands for edicated /dministrator ,onnection' T#is diagnostic

connection allo"s an administrator to access r$nning instance totro$bles#oot problems or e4ec$te diagnostic H$eries on t#e server - even"#en SQL Server is not responding to standard connection reH$ests' T#isconnection $ses 1>=> port and can connect onl& one connection perinstance'To %o e%t DAC ?-1) SQLC7D ?- *Sa( i < =instan e_name,2) ; I ?- SSMS Q$er& .ditor b& connecting to ADMIN < instan e_name,

11) E 8!ai a"o/t Data"ase Co so!e Co a (s :DBCC)?A,, ,ommands are $sed to c#ec7 t#e consistenc& of t#e atabases oratabase Ob8ects' 9#ile e4ec$ting A,, commands t#e A engine creates a

database snaps#ot and t#en r$ns t#e c#ec7s against t#is snaps#ot' /fter t#e

A,, command is completed! t#is snaps#ot is dropped'12) What is Store( Pro%/re? What are the t38es o, store( Pro%e(/res

avai!a"!e i SQL server a ( e 8!ai ea%h?/ stored proced$re is a precompiled e4ec$table ob8ect t#at contains oneor more Transact-SQL statements'

a ser De6 e( Store( Pro%e(/re ?- Stored proced$res are mod$les orro$tines t#at encaps$late code for re$se' / stored proced$re can ta7einp$t parameters! ret$rn tab$lar or scalar res$lts and messages to t#eclient

b S3ste Store( Pro%e(/re ?- S&stem stored proced$res are $sed to

perform man& administrative and informational activities'c E te (e( store( 8ro%e(/re ?- .4tended stored proced$res are $sed to

create o"n e4ternal ro$tines in a programming lang$age s$c# as ,'.4tended stored proced$res are LLs t#at an instance of Microsoft SQLServer can d&namicall& load and r$n'

1#) What is A%tivit3 7o itor a ( /se o, that? What are the 8er issio sre /ire( to /se A%tivit3 7o itor?/ctivit& Monitor is $sed to get information abo$t $sers connections to t#e

atabase .ngine and t#e loc7s t#at t#e& #old' /ctivit& Monitor is $sed totro$bles#ooting database loc7ing iss$es! and to terminate a deadloc7ed or$nresponsive process'To /se a%tivit3 o itor ?- VIEW SERVER STATE permission on Serverand SELECT permission to t#e s3s8ro%esses : s3s!o%=s tables in t#emaster database'To i!! a Pro%ess ?- s3sa( i and 8ro%essa( i database roles andpermission are reH$ired to ILL a process'

1+) What is E e%/tio P!a a ( e 8!ai it?

.4ec$tion Plan grap#icall& displa&s t#e data retrieval met#ods c#osen b&

SQL Server' t represents t#e e4ec$tion cost of speci<c statements andH$eries in SQL Server' T#is grap#ical approac# is ver& $sef$l for$nderstanding t#e performance of t#e H$er&'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 25/30

25

21) What is Tra%e a.? ;ive so e Tra%e a.s? Trace Rags are $sed to temporaril& set speci<c server c#aracteristics or tos"itc# oWCon a partic$lar be#avior' T#ere are t"o t&pes of trace Rags?session and global' Session trace Rags are active for a connection and arevisible onl& to t#at connection' Flobal trace Rags are set at t#e server leveland are visible to ever& connection on t#e server' Some Rags can onl& beenabled as global! and some can be enabled at eit#er global or sessionscope'(1 2+0 (2 120> (= 1211 (> 1222 (5 122> (+ 252) (* =205 () =+25 (>+1+ (10 *)0+ (11 1>00To set o o$ Tra%e a. ?- (1 A,, T /,.O3 (2 A,, T /,.OEETo E a"!e Tra%e a. .!o"a!!3 ?- A,, T /,.O3 "it# t#e -1 arg$ment(.4?- A,, T /,.O3 252)! -1*T start/8 o8tio ?- ndicates t#at an instance of SQL Server s#o$ld be

started "it# a speci<ed trace Rag ( tra e> in eWect'To Deter i e tra%e F!a.s are %/rre t!3 a%tive ?- A,, T /,.ST/T;S

1 ) What are the %o o ,ai!/res o%%/r i SQL Server 2'' ? T#ere are t#ree common fail$res occ$r in SQL Server 2005'1 atabase Eail$res2 P#&sical Server Eail$res= SQL Server Service fail$res

1-) What are the %a/ses o, Data"ase Fai!/res? T#ere are t#ree common iss$es "ill ca$ses atabase fail$res' Log Eile vie"er

is ver& $sef$l to diagnose t#ese problems t#at "ill occ$r in SQL Server 2005'1 Data"ase has r/ o/t o, Dis= s8a%e ?-a f a atabase is online! and r$nning o$t of dis7 space t#e data cannot

be inserted into t#e database'b f t#e atabase d$ring recover&! and t#e data <le becomes f$ll t#e

atabase engine mar7s t#e atabase as eso$rce Pending '2 T9 Lo. is ,/!! ?-

a f t#e atabase is Online! and t#e T'Log becomes f$ll t#e atabase.ngine iss$es 002 error and it is in read-onl& state and "ill not allo"$pdates'

b f t#e atabase d$ring recover&! and t#e T'Log becomes f$ll t#eatabase engine mar7s t#e atabase as eso$rce Pending '

= Te 8DB has r/ o/t o, Dis= s8a%e ?- Temp A stores ;ser ob8ects!nternal Ob8ects and ersion stores' f t#e Temp A database r$ns o$t of

space! it ca$ses signi<cant problems for SQL Server 2005' T#e errors are"ritten to SQL Server log and t#ese errors (1101! 1105! = 5 ! = +*!= 5)! = ++ indicates Temp A #as ins$Gcient space'

10) o& to / (ersta ( Data"ase E .i e Errors?f an& error occ$rs! t#e server "rites error messages to logs ( atabase mail!

SQL /gent! SQL Server : 9indo"s 3T ' T#ese logs #aving .rror n$mber!

.rror message! Severit&! State! Proced$re name! Line n$mber' 9e can eas&to $nderstand errors b& vie"ing Log <le vie"er'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 26/30

2+

14) What is Severit3 !eve! i Eve t !o.? At &hat severit3 !eve!s are&ritte to the SQL Server !o.?

T#e Severit& level tells #o" bad t#e error is' /bove 1 Severit& level errorsare "ritten to t#e SQL Server log'

15) What is State Attri"/te o, a error essa.e i Eve t !o.? T#e state attrib$tes provides details of "#at ca$sed t#e error'

2') What are the Ca/ses o, Ph3si%a! Server Fai!/res? T#ere are <ve common iss$es "ill ca$ses P#&sical Server fail$res'1 is7 fail$res2 Memor& fail$res= Processor fail$res> 3et"or7 card fail$res5 / fail$res

21) I, Lo. 6!e is ,/!! &hat 3o/ &i!! (o?f t#e T'Log <le is f$ll t#e atabase iss$es 002 error and it is in ead-onl&

state and "ill not allo" $pdates' T#e follo"ing tas7s "ill responding T'Log <le1 Aac7ing $p t#e log2 /dding one or more log <les= Moving t#e Log to anot#er dis7> ncreasing log <le si e or enabling a$to gro"t#5 Teminating long-r$nning transactins'

22) I, Data 6!e is ,/!! &hat 3o/ &i!! (o?f t#e primar& data <le is f$ll "e can add secondar& data <les'

A((i . a 6!e to (ata"ase< * ig#t clic7 on database B Properties B Eiles Bclic7 add B give t#e val$es for logical name! <le t&pe! <le gro$p! initial si e!a$to gro"t#! pat# and <le name '

2#) I, a Data"ase is / (er S/s8e%t o(e? What 3o/ &i!! (o?s8Kresetstat/s ?- esets t#e stat$s of a s$spect database ( sp_resetstat"s? dvent"re*or$s@

2+) I, the server has %o 8!ete!3 ,ai!e(G a ( ho& to a!! the "a%=/8srestore( o to a e& server?a A$ild t#e 9indo"s server and restore t#e domain logins to s$pport

9indo"s a$t#entication'b nstall SQL Server and an& service-pac7 $pgrades'c P$t SQL Server in single-$ser mode and restore t#e master database'd estore t#e msdb database'e f t#e model database "as modi<ed! restore it'f estore t#e $ser databases'

2 ) f a Server performance is slo"` No" &o$ can tro$bles s#oot aproblem`

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 27/30

2*

2-) f a atabase Performance is slo"` No" can &o$ do Performance T$ning`

20) 9#at are t#e Performance ss$es` .4plain t#em`

7ISCELLA@EO S

1) What are the Di$ere %es "et&ee De!ete Tr/ %ate?De!ete<* elete command removes t#e ro"s in a table and records intransaction log "#ic# ma7es it slo"' ollbac7 is possible'Tr/ %ate< - Tr$ncate command removes all t#e ro"s in a table! b$t it "on6t"rite log "#ic# ma7es it faster' ollbac7 is not possible'

2) What is a I (e ? T38es o, I (e es? o& a 3 %!/stere( i (e esa ( o *%!/stere( i (e es %reate( o a ta"!e?Fenerall& SQL Server e4amines (table scan ever& ro" in t#e table to satisf&

t#e H$er& res$lts' nde4 is a p#&sical str$ct$re containing pointers to t#edata "#ic# is $sed for retrieving data more H$ic7l& and improves t#e H$er&performance 'C!/stere( I (e ?- Onl& one ,l$stered inde4 can create on a Table' 9#en "ecreate a cl$stered inde4 on a table! all t#e ro"s in t#e table are stored in t#eorder of t#e cl$stered inde4 7e&'@o *%!/stere( i (e ?- 2> 3on-,l$stered inde4es can create on a Table'3on-cl$stered inde4es are stored as A-Tree str$ct$res "it# t#e leaf levelnodes #aving t#e inde4 7e& and it6s ro" locator'

#) o& %a &e re"/i!( a I (e ?

A& $sing A,, A . 3 .

+) What s the (i$ere %e "et&ee a 8ri ar3 =e3 a ( a / i /e =e3?Aot# primar& 7e& and $niH$e 7e& enforces $niH$eness of t#e col$mn on"#ic# t#e& are de<ned'

S!

Pri ar3 e3 i /e e3

1 Primar& 7e& creates a cl$steredinde4

;niH$e 7e& creates a non-cl$stered inde4

2 Primar& e& doesn6t allo" 3$lls ;niH$e 7e& allo"s one 3$llonl&

) What is Store( Pro%e(/re?/ stored proced$re is a pre-compiled SQL statements t#at are stored in Severdatabase to performing a tas7' / single proced$re can be $sed over t#enet"or7 b& several clients $sing diWerent inp$t data' /nd "#en t#eproced$re is modi<ed! all clients a$tomaticall& get t#e ne" version'

A(va ta.es ?-1 Stored proced$re can red$ce net"or7 traGc beca$se H$eries e4ec$ted asa batc#'

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 28/30

2)

2 mproving t#e performance beca$se t#e SPs are pre-compiled'= Stored proced$res provide better sec$rit& to &o$r data> .asil& modif& t#e SPs "#en b$siness r$les c#ange'

-) What is ser De6 e( F/ %tio ? T38es o, DFs?;ser- e<ned E$nctions t#at allo" &o$ to de<ne &o$r o"n T-SQL f$nctionst#at can accept ero or more parameters and ret$rn a single scalar dataval$e or a table data t&pe' T#ere are t#ree t&pes of ; Es are available in SQLServer 2005'a S%a!ar Va!/e( DFs ?- / scalar-val$ed ; E accepts parameters and

ret$rns a single scalar data t&pes (Te4t! nte4t! image 'b Ta"!e Va!/e( DFs ?- / table-val$ed ; E is a f$nction t#at accepts

parameters and ret$rns t#e res$lts in t#e form of a table'

0) What are the (i$ere %es "et&ee Store( Pro%e(/re a ( ser

De6 e( F/ %tio ?S!

ser De6 e( F/ %tio s Store( Pro%e(/res

1 E$nctions are compiled ande4ec$ted at r$n time'

Stored proced$res arestored in parsed andcompiled format in t#edatabase'

2 E$nctions cannot aWect t#e stateof t#e database "#ic# means "ecannot performinsert!delete!$pdate and createoperations on t#e database'

Stored Proced$res canaWect t#e state of t#edatabase b& $sing insert!delete! $pdate and createoperations'

= E$nctions are basicall& $sed tocomp$te val$es' 9e passes someparameters to f$nctions as inp$tand t#en it performs someoperations on t#e parameter andret$rn o$tp$t'

Stored proced$res arebasicall& $sed to processt#e tas7'

> E$nction can not c#ange server

environment and o$r operatings&stem environment'

Stored proced$res can

c#ange server environmentand o$r operating s&stemenvironment

5 E$nctions can not be invo7ed fromSQL Statements' .4ec$te' S.L.,T

operating s&stem can beinvo7ed from SQLStatements' .4ec$te'S.L.,T

+ E$nctions can r$n an e4ec$table<le from SQL S.L.,T or an actionH$er&'

operating s&stem $se.4ec$te or .4ec to r$n

4) What is a Tri..er? What are the tri..er o(e!s are avai!a"!e i SQLServer 2'' ?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 29/30

2

/ trigger is a set of T-SQL Statements stored permanentl& in t#e atabaseand a$tomaticall& <red "#en an event occ$rs' T#e& are $sed to impose $serde<ned restrictions or b$siness r$les and also provides #ig# sec$rit& on

atabaseC tables' T#ere are t"o t&pes of trigger models are available in SQL Server 2005D7L Tri..ers ?- ML triggers created on ML statements li7e nsert! ;pdateand elete of atabase ob8ectsDDL Tri..ers ?- L triggers created on L statements li7e ,reate! /lterand rop of A ob8ects or A'

5) T38es o, Tri..ers? T#ere are t"o t&pes of triggers-) A,ter Tri..ers ?- /fter Triggers "ill <res after t#e data is inserted into

t#e table' T#e t&pical $se for an /fter trigger is to log t#e action to an/$dit or logging table

0) Be,ore Tri..ers ?- Aefore triggers "ill <re before t#e data is insertedinto t#e table'@ote ?- ML triggers <res before or after iss$e! L triggers <res after t#eiss$e'

1') What is a Vie& a ( a(va ta.es o, Vie&s?/ vie" is a pre-de<ned SQL Statements t#at t#e A engine e4ec$tes andretrieves d&namicall&' / standard vie" acts as a virt$al table based on t#eres$lt set of a select statement' T#e <elds in a vie" are <elds from one ormore real tables or anot#er vie"s'A(va ta.es ?-

1 To restrict t#e $sers to speci<c ro"s : col$mns and #ide t#e col$mns "it#sensitive data

2 ;ser friendl& names can be provided instead of base table col$mn names= EreH$entl& $sed comple4 @oins! Q$eries and ;nions can be coded once as a

ie" and ie" can be referenced for simplicit& and consistenc& of coding'> /ggregate information s$c# as S$ms! ,o$nts! /vg and so on can be

calc$lated in a vie" to simplif& coding "#en t#ose aggregation information"ill be referenced m$ltiple times'

5 ie"s can be $sed for ata sec$rit&! allo"ing $sers access certain data"it#o$t granted permissions to directl& access t#e base tables'

11) T38es o, Vie&s? E 8!ai a"o/t I (e e( Vie&? T#ere are t"o t&pes of ie"s 1 Standard ie" 2 nde4ed ie"s'/n inde4ed ie" (materiali ed vie" is li7e a standard vie"! and it #as a$niH$e cl$stered inde4 created on it' t stored p#&sicall& 8$st li7e a table'A(va ta.e ?- nde4ed vie"s "or7s best for H$eries t#at aggregates man&ro"s or #ave 8oins t#at ca$se response time of t#e standard vie" to be slo"'

12) What is the (i$ere %e "et&ee a Lo%a! a ( a ;!o"a! te 8orar3

ta"!e?

8/20/2019 DBA Iq Faq-praveen

http://slidepdf.com/reader/full/dba-iq-faq-praveen 30/30

=0

Lo%a! te 8orar3 ta"!e ?- t e4ists onl& for t#e d$ration of a connection or! if de<ned inside a compo$nd statement! for t#e d$ration of t#e compo$ndstatement';!o"a! te 8orar3 ta"!e ?- remains in t#e database permanentl&! b$t t#ero"s e4ist onl& "it#in a given connection' 9#en connection is closed! t#edata in t#e global temporar& table disappears' No"ever! t#e table de<nitionremains "it# t#e database for access "#en database is opened ne4t time'

1#) What is PRI7AR E ?/ P M/ D .D constraint is a $niH$e identi<er for a ro" "it#in a databasetable' .ver& table s#o$ld #ave a primar& 7e& constraint to $niH$el& identif&eac# ro" and onl& one primar& 7e& constraint can be created for eac# table'

T#e primar& 7e& constraints are $sed to enforce entit& integrit&'

1+) What is @IQ E E %o strai t?

/ ;3 Q;. constraint enforces t#e $niH$eness of t#e val$es in a set of col$mns! so no d$plicate val$es are entered' T#e $niH$e 7e& constraints are$sed to enforce entit& integrit& as t#e primar& 7e& constraints'

1 ) What is FOREI;@ E ?/ EO . F3 .D constraint prevents an& actions t#at "o$ld destro& lin7sbet"een tables "it# t#e corresponding data val$es' / foreign 7e& in onetable points to a primar& 7e& in anot#er table' Eoreign 7e&s prevent actionst#at "o$ld leave ro"s "it# foreign 7e& val$es "#en t#ere are no primar&7e&s "it# t#at val$e' T#e foreign 7e& constraints are $sed to enforcereferential integrit&'

1-) What is C EC Co strai t?/ ,N., constraint is $sed to limit t#e val$es t#at can be placed in acol$mn' T#e c#ec7 constraints are $sed to enforce domain integrit&'

10) What is @OT @ LL Co strai t?/ 3OT 3;LL constraint enforces t#at t#e col$mn "ill not accept n$ll val$es'

T#e not n$ll constraints are $sed to enforce domain integrit&! as t#e c#ec7constraints'