Unix Shell Scripting For DBAs

Download Unix Shell Scripting For DBAs

Post on 08-Apr-2018




0 download

Embed Size (px)


<ul><li><p>8/7/2019 Unix Shell Scripting For DBAs</p><p> 1/5</p><p>Pacific computer training institute903 Pavilion Court Suite I, McDonough, GA 30253</p><p>Tel: 1-877-405-4554</p><p>Unix Shell Scripting For DBAs</p><p>Part A: The Korn Shell Programming Fundamentals</p><p>1.Introduction2.UNIX SHELLS</p><p> Bourne She ll C a nd TC She ll Korn Shell Bash She ll</p><p>3.The Environm ent The / etc / p rofile File The .profile File The ENV File The set o options The promp ts The primary prompts The sec ond ary Prom pt The Sea rch Path The d ot c omma nd</p><p>4.The Comm and Line The Exit Sta tus Multiple Comm and s and c om ma nd grouping Cond itiona l execution of com ma nds Comm and s in the Background Co mm and-Line Histo ry</p><p>5.Aliases Listing Aliases Creating Aliases Deleting Aliases</p><p>6.Job Control</p><p> 1</p></li><li><p>8/7/2019 Unix Shell Scripting For DBAs</p><p> 2/5</p><p> Listing Jobs Stopping current Job Running jobs in background Running jobs in foreground Waiting for Job s Killing Job s</p><p>7.Metacharacters8.Filename Sub stitution</p><p> The Asterisk The Question Mark The Squa red Brac kets Escaping metal Characters Tilde and Hyphen Expansion New KSH Metal Characters</p><p>9.Variables Loc al Variab les Setting a nd Referenc ing Loc al Va riab les The Sc op e of Loc al Va riab les Sett ing Rea d -Only Va riab les Environment Variables Setting Environment Spec ial Environm ent Va riab les Listing Set Variab les Unsett ing Va riab les Printing the Values of Va riab les Esc ap e Seq uenc es Variab le Expressions Variab le Expa nsion Variab le Attribute s : The type set Comm and Positiona l Param eters Othe r Spe c ia l Variab les</p><p>10.Quoting The Bac kslash The single Q uotes The Double Q uotes</p><p>11.Comm and Substitution12.Standa rd I/O a nd redirec tion</p><p> Red irec tion and t he Child Shell</p><p> 2</p></li><li><p>8/7/2019 Unix Shell Scripting For DBAs</p><p> 3/5</p><p>13.Pipes The Here Doc ume nt a nd Red irec ting Input</p><p>14.Timing Com ma nds The time Com ma nd The TMOUT va riab le The sleep Comm and</p><p>Part B: The Korn Shell Prog ramming</p><p>15.Introduction The steps in c rea ting a she ll sc rip t The First Line(shb ang ) Comments Executa b le sta tem ents and Korn Shell Constructs Nam ing a nd Storing Sc ripts Using a sc ript a s an a rgum ent to ksh</p><p>16.Rea d ing user input Rea d ing a nd File Desc rip to rs Rea d ing throug h Files</p><p>17.Arithmetic Operation The intege r type Listing Inte gers Arithmetic O pe rato rs and the let c omm and</p><p>18.</p><p>Positioning Param eters and c om ma nd line a rgum ents</p><p> The set Positiona l Pa rameters19.Cond itional Co nstruc ts and Flow Control</p><p> Testing Exit Sta tus and the $? Variab le The test c om ma nd File Testing with Binary Op era to rs Expression Testing w ith Logica l Op era to rs File Testing with Flags The if Com ma nd Using the Korn Test Korn Test w ith num bers The let c om ma nd and testing num be rs The if/e lse c om ma nd The exit c om ma nd The null Com ma nd</p><p> 3</p></li><li><p>8/7/2019 Unix Shell Scripting For DBAs</p><p> 4/5</p><p> The c ase c omm and The c ase c omma nd a nd the here d oc ument</p><p>20.The Loo ping Co mm and The for com ma nd The $* and $@ Variab le and wo rd lists The w hile Com ma nd The until Comm and The select c omm and and Menus The loo p ing c ont rol structures</p><p> The shift Com ma nd The b rea k Comm and the continue Comm and</p><p> Nesting Loops and Loop Control I/ O redirec tion a nd Loop s The exec Com ma nd a nd Loop s The IFS and Loops</p><p>21.Functions Defining Func tions Listing and Unsetting Functions Loc a l Va riab les and Return Value Exported Func tions Function op tions and the type set c om ma nd</p><p>22.Trapping Signals Pseudo or Fake Signa ls Resetting Signa ls Ignoring Signals Listing Traps Traps and Func tions</p><p>23.Debugging Korn Shell Scripts -n deb ug op tion -x de bug o ption -v deb ug op tion</p><p>24.Parsing Co mm and Line Arguments Proc essing Co mm and Line Op tions with g etopts</p><p>25.Spec ial Utilities c ut utility sed utility awk utility</p><p> 4</p></li><li><p>8/7/2019 Unix Shell Scripting For DBAs</p><p> 5/5</p><p> tr utility</p><p>Part C: Orac le Database administration and Shell Sc ripts</p><p>1.The Shell wrapper2.Logging on to SQL*PLUS3.</p><p>Executing SQL commands within shell scripts</p><p>4.Ca lling a SQL sc rip t from she ll sc rip t5.Informing t he DBA: Send ing em ails and pa ge s6.Sched uling sc ripts with c ron jobs7.Com mon Data ba se autom ation tasks</p><p> Automating ba ckups Che c king Orac le log files for errors Che c king d isk spac e utiliza tion Automa ting da tab ase startups and shutdow ns Autom at ing sta rtup and shutdow n o f listene r and othe r utilities Automa ting d ata ba se m onitoring</p><p>Rec ommended Books:</p><p>1.Anatole Olczak: The Korn She ll (Unix and Linux Program Ma nua l)(ISBN ISBN-10: 0201675234 , ISBN-13: 978-0201675238)</p><p>2.Jon Emmons and Dona ld K. Burleson: Orac le She ll Sc rip ting , Linux and UnixProgram ming for O rac le(ISBN 0977671550)</p><p>Contac t Information:</p><p>Pac ific Systems, Inc .</p><p>903 Pavilion Co urt Suite I</p><p>Mc Donoug h, GA 30253</p><p>1-877-405-4554</p><p> 5</p>http://shopping.yahoo.com/search/all;_ylt=AqZkPdDBsOTDipg.y5DL74wCyNsA;_ylu=X3oDMTBkdDZ1ZHBvBHNlYwNwcm9kdGl0bGU-?p=Donald+K.+Burleson&amp;mid=1http://shopping.yahoo.com/search/all;_ylt=AqZkPdDBsOTDipg.y5DL74wCyNsA;_ylu=X3oDMTBkdDZ1ZHBvBHNlYwNwcm9kdGl0bGU-?p=Donald+K.+Burleson&amp;mid=1</li></ul>