Getting Started: DBA Basics (90 minutes)

130
1 Getting Started: DBA Basics (90 minutes) Congratulations! You're Our New Progress DBA! Now What? Tom Bascom, White Star Software Abstract: People often ask what tasks a newly minted OpenEdge DBA should be performing? What should my daily, weekly, monthly etc checklist have on it? What's good? What's BAD? Where do I even look to find out? What do I need to pay attention to? What can I ignore? What should I lose sleep over? When should I update my resume? Who can help me? In this session we will show you the way through the challenges that lie in front of you and help bring peace to your weekends and evenings!

Transcript of Getting Started: DBA Basics (90 minutes)

Page 1: Getting Started: DBA Basics (90 minutes)

1

GettingStarted:DBABasics(90minutes)Congratulations!You'reOurNewProgressDBA!NowWhat?TomBascom,WhiteStarSoftwareAbstract:PeopleoftenaskwhattasksanewlymintedOpenEdgeDBAshouldbeperforming?Whatshouldmydaily,weekly,monthlyetcchecklisthaveonit?What'sgood?What'sBAD?WheredoIevenlooktofindout?WhatdoIneedtopayattentionto?WhatcanIignore?WhatshouldIlosesleepover?WhenshouldIupdatemyresume?Whocanhelpme?Inthissessionwewillshowyouthewaythroughthechallengesthatlieinfrontofyouandhelpbringpeacetoyourweekendsandevenings!

Page 2: Getting Started: DBA Basics (90 minutes)

GettingStarted:DBABasicsCongratulations!You'reOurNewProgressDBA!NowWhat?

TomBascom,WhiteStarSoftware

[email protected]

Page 3: Getting Started: DBA Basics (90 minutes)

AFewWordsabouttheSpeaker

•  TomBascom:Progressuser&roamingDBAsince1987•  Partner:WhiteStarSoftware&DBAppraise,LLC

– ExpertconsultingservicesrelatedtoallaspectsofProgressandOpenEdge.– RemotedatabasemanagementserviceforOpenEdge.– Authorof:– Simplifyingthejobofmanagingandmonitoringtheworld’sbestbusinessapplications.

–  [email protected]

3

Page 4: Getting Started: DBA Basics (90 minutes)
Page 5: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?

5

Page 6: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?

6

Page 7: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?•  IsanyoneonaversionofProgressthatisasingledigitnumber…i.e.V9,V8,etc.

7

Page 8: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?•  IsanyoneonaversionofProgressthatisasingledigitnumber…i.e.V9,V8,etc.

•  WhoisonOpenEdge10?

8

Page 9: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?•  IsanyoneonaversionofProgressthatisasingledigitnumber…i.e.V9,V8,etc.

•  WhoisonOpenEdge10?•  Howabout11.x?

9

Page 10: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?•  IsanyoneonaversionofProgressthatisasingledigitnumber…i.e.V9,V8,etc.

•  WhoisonOpenEdge10?•  Howabout11.x?•  12?

10

Page 11: Getting Started: DBA Basics (90 minutes)

AudienceSurvey

•  HowmanydoatleastsomeProgressDBAwork?•  Howmanyhavebeendoingthatworkforlessthanayear?•  IsanyoneonaversionofProgressthatisasingledigitnumber…i.e.V9,V8,etc.

•  WhoisonOpenEdge10?•  Howabout11.x?•  12?•  Arethereanycodersintheroom?

11

Page 12: Getting Started: DBA Basics (90 minutes)

Now What?!?

Page 13: Getting Started: DBA Basics (90 minutes)

13

ResourcesToGetStartedWith

Page 14: Getting Started: DBA Basics (90 minutes)

OnlineDocumentation

14

https://community.progress.com/community_groups/openedge_general/w/openedgegeneral/1329.openedge-product-documentation-overview

Page 15: Getting Started: DBA Basics (90 minutes)

LocalDocumentation•  Windows“CHM”DocsStart->OpenEdge->Help->

15

TherearegoodMacappsforreadingCHMfiles:

Page 16: Getting Started: DBA Basics (90 minutes)

Knowledgebasehttp://knowledgebase.progress.com

Page 17: Getting Started: DBA Basics (90 minutes)

Knowledgebase

Page 18: Getting Started: DBA Basics (90 minutes)

PANS–DailyTechnicalBulletinsStep1:Exerciseyourknowledgebasesearchskills:

Page 19: Getting Started: DBA Basics (90 minutes)

ProgressCommunityhttp://community.progress.com

Page 20: Getting Started: DBA Basics (90 minutes)

ProgressTalkhttp://progresstalk.com

Page 21: Getting Started: DBA Basics (90 minutes)

StackOverflowhttps://stackoverflow.com/questions/tagged/progress-4gl%20or%20progress-db%20or%20openedge

Page 22: Getting Started: DBA Basics (90 minutes)

Slackhttps://join.slack.com/t/openedge/shared_invite/enQtMTgwODYyODI4MDM2LTg3MDFlMGVkODY2NTdiYjQ0ZDE4MzAwZTUxMDcxMWI0NzMwYTU5M2JjY2ZmMWRiZGIyNzZlNWViNzk3MDJiNDY

Or:https://goo.gl/oTwneQOr:https://tinyurl.com/slackOpenEdge

Page 23: Getting Started: DBA Basics (90 minutes)

PUGChallenge

Page 24: Getting Started: DBA Basics (90 minutes)

Don’tforget!

•  YourApplicationVendor– Documentation&recommendations– Mayhavetheirownforums– Knowledgebase– Userconferences– Andsoforth!

Page 25: Getting Started: DBA Basics (90 minutes)

25

SettingUpYourCommandLine

Environment

Page 26: Getting Started: DBA Basics (90 minutes)

PROENV

•  Providesacommandlineenvironmentthatisproperlyconfiguredtorunalladministrativecommands.– DLC&WRKDIRenvironmentvariableswillbeset.– PATHwillinclude$DLC/binandotherusefulbits.

•  IfyoudonotusePROENVthenyouneedtoensurethattheDLCvariableisexportedandthat$DLC/binisinyourPATH!

26

Page 27: Getting Started: DBA Basics (90 minutes)

PROENVonWindows

ProTip!IfyouarerunningonWindowsmakesuretoadjustthewidthandheightoftheproenvwindow!Thepre-oe11defaultis300linesby24columns–andthatdoesnotworkwellforanyone.Modernmonitorscaneasilysupport160columnsby64lineswithacomfortablefontsize.Andtherearemuchbettercoloroptionsthanwhiteonblack.

Page 28: Getting Started: DBA Basics (90 minutes)

28

StartingaDatabase

Page 29: Getting Started: DBA Basics (90 minutes)

StartingaDatabase

•  PROSERVE•  DBMAN•  Exploder

29

Page 30: Getting Started: DBA Basics (90 minutes)

PROSERVEPro•  CommandLine•  EasytoScript•  LotsofControl•  Repeatable•  Sequenceofactionsisguaranteed

Con•  MustProvideDetailslike“dbname”•  Dinosaurstigma?

30

$proservedbname–n500–spin3149–B1000000–L50000$probiwdbname$proaiwdbname$prowdogdbname$proapwdbname

Page 31: Getting Started: DBA Basics (90 minutes)

DBMANPro•  CommandLine•  Workswithconmgr.properties•  EasytoScript•  StartsPageWriters&Watchdog•  Runsasa“Service”onWindows(avoidsWindows“userlogoutclosesbackgroundwindows”issue).

Con•  Usesconmgr.properties•  AdminServermustberunning•  Orderofoperationsisnotcontrollable.

•  AdminServerusesJava

31

proenv>dbmandbName-start

Page 32: Getting Started: DBA Basics (90 minutes)

ExploderPro•  ExercisesHealthCareBenefits

Con•  GraphicalInterface•  RequiresAdminServer•  Requiresconmgr.properties•  Ugly•  Confusing•  Incomplete•  Unreliable(Java)•  Butifyoulikethatsortofthing…

32

Page 33: Getting Started: DBA Basics (90 minutes)

ExploderProTip

•  AlwaysmakesurethattheadminserverisrunningbeforedecidingthatExploder(ordbman)isn’tworkingproperly!

proenv>proadsv-queryOpenEdgeRelease10.2BasofMonDec1417:02:01EST2009AdminServerisalive.(8545)proenv>

Page 34: Getting Started: DBA Basics (90 minutes)

34

StoppingaDatabase

Page 35: Getting Started: DBA Basics (90 minutes)

StoppingaDatabase

•  PROSHUT•  DBMAN•  Exploder

35

$proshut-bysports2000Shutdownisexecuting.(1613)Shutdowncomplete.(1614)

Page 36: Getting Started: DBA Basics (90 minutes)

StoppingaDatabase

•  PROSHUT•  DBMAN•  Exploder

36

•  Deletethe.lkfile…•  Kill-9•  Rebootserver…•  Tripoverplug…

Page 37: Getting Started: DBA Basics (90 minutes)
Page 38: Getting Started: DBA Basics (90 minutes)

StoppingaDatabase

•  PROSHUT•  DBMAN•  Exploder

38

•  Deletethe.lkfile…•  Kill-9•  Rebootserver…•  Tripoverplug…

OnthebrightsideProgresscrashrecoveryworksvery,verywell–noneoftheabovewillcorruptanOpenEdgedatabase.(DoNOT,however,trythesetechniqueswithcertainotherbignamedatabases…)

Page 39: Getting Started: DBA Basics (90 minutes)

PROSHUTPro•  CommandLine•  EasytoScript•  LotsofControl•  Fast

Con•  What’saCommandLine?

39

$proshut–bydbname

Page 40: Getting Started: DBA Basics (90 minutes)

DBMANPro•  CommandLine•  Workswithconmgr.properties•  EasytoScript

Con•  CommandLine•  Usesconmgr.properties•  AdminServermustberunning

40

$dbmandbName-stop

Page 41: Getting Started: DBA Basics (90 minutes)

ExploderPro Con

•  GraphicalInterface•  RequiresAdminServer•  Requiresconmgr.properties•  Ugly,Confusing,Incomplete•  Unreliable•  Cannotcontrolsequence•  Easytoshutdownthewrongdb

41

Page 42: Getting Started: DBA Basics (90 minutes)

42

HowDoIMakeaBackup?

Page 43: Getting Started: DBA Basics (90 minutes)

HowDoIMakeaBackup?

•  PROBKUP–thepreferredmethodendorsedbyexperiencedProgressDBAseverywhere.

43

Page 44: Getting Started: DBA Basics (90 minutes)

HowDoIMakeaBackup?

•  PROBKUP–thepreferredmethodendorsedbyexperiencedProgressDBAseverywhere.

•  MethodsusedbyFutureJob-Seekers:– DiskMirroring– OSBackup– 3rdPartyTools– VMorSAN“snapshots”

44

Page 45: Getting Started: DBA Basics (90 minutes)

PROBKUP

•  Knowswhereallofthepartsofthedatabaseare(eventhepartsinmemoryorinunusualdisklocations).

•  Canbeexecutedwiththedatabaseonline.•  Canskipemptyspaceinthedb.•  Canbeusedtochange“physical”DBStructure(extentsize&location)

•  Canturnonafter-imagingonlineifyouforget!

45

$probkuponlinedbnamedbname.pbk-com

Page 46: Getting Started: DBA Basics (90 minutes)

“AllThePartsoftheDB”

46

#sports.st#b/bi/sports.b1#d"SchemaArea":6,32;1 /db/sports.d1d"InfoArea":7,32;1 /db/sports_7.d1d"Customer/OrderArea":8,32;8 /db/sports_8.d1d"PrimaryIndexArea":9,1;8 /db/sports_9.d1d"CustomerIndexArea":10,1;64 /db2/sports_10.d1d"OrderIndexArea":11,32;64 /db/sports_11.d1#a/ai/sports.a1a/ai/sports.a2a/ai/sports.a3a/ai/sports.a4

Page 47: Getting Started: DBA Basics (90 minutes)

OSBackup&3rdPartyTools

•  Thedatabasemustbeofflineorina“quiescentstate”.•  Youareresponsibleformakingcertainoftheabove.•  Youmustalsoensurethatallpartsofthedatabaseareincludedinthebackup.

47

Page 48: Getting Started: DBA Basics (90 minutes)

VMorSAN“Snapshots”•  Thesnapshotmustbeaconsistent,pointintimeimageoftheentiredatabase.

•  Thedatabasewillbeinacrashedstatewhenrecovered.•  Notallsnapshotproductsarecreatedequally!•  ProgresshastestedandcertifiedEMC’sSRDF.•  SomeusersreportsuccesswithVMWare’sVMotion(butbewareofpossibleperformanceissues).

•  OtherusersreportVMotionhorrorstories–CaveatEmptor!

48

Page 49: Getting Started: DBA Basics (90 minutes)

OtherStufftoBackup

•  $DLC/properties•  DBLogFiles•  Structure(.st)Files•  Parameter(.pf)Files•  $DLC/startup.pf•  repl.propertiesetc.•  $DLC/certs

49

Page 50: Getting Started: DBA Basics (90 minutes)

50

NoneofMySQLKnowledgeWorks

Page 51: Getting Started: DBA Basics (90 minutes)

51

Page 52: Getting Started: DBA Basics (90 minutes)

NoneofMySQLWorks!?!

•  ProgressisNOTSQL.•  Period.FullStop.EndofStory.•  ThinkingaboutProgresslikeSQLwillonlyleadtopainandagony.

52

Page 53: Getting Started: DBA Basics (90 minutes)

NoneofMySQLWorks!?!

•  ProgressisNOTSQL.•  Period.FullStop.EndofStory.•  ThinkingaboutProgresslikeSQLwillonlyleadtopainandagony.

•  SomeofuslikeitthiswayJ

53

Page 54: Getting Started: DBA Basics (90 minutes)

4glvsSQL•  Thereare2“languages”–4glandSQL-92thatshareacommon“storageengine”.

•  ThestorageengineiswhatDBAsmanage.•  VirtuallyallProgressapplicationsarewrittenwiththe4gl.•  SQLisusedalmostexclusivelyforexternalreportingordataextracts.

•  Thelanguagesarenotawareofeachother.– Triggersandstoredproceduresinonelanguagearenotknowntotriggersintheother!

54

Page 55: Getting Started: DBA Basics (90 minutes)

EmbeddedSQL-89–IsNOTSQL-92!!!•  The4GLlanguagehassomeveryoldandverylimitedSQL-89syntaxembeddedinit.

•  Thispermitstrivialad-hocquerieswithina4glsessionsuchas:selectcount(*)fromcustomer.

•  Thismakesagooddemo.

55

Page 56: Getting Started: DBA Basics (90 minutes)

SQL-89

AttemptingtousetheembeddedSQL-89inapplicationcodewillonlyleadtopain,

sufferingandagony.

Donotgothere.Youhavebeenwarned.

56

Page 57: Getting Started: DBA Basics (90 minutes)

ProgressisNOTSQL!Progressismuchbetterthanthat.•  The4GLlanguagedoesnotrespect“fieldwidth”–alldataisvariablewidth.

•  Afieldformatisjustadefaultsuggestionusedwhentheprogrammerprovidesnootherinputordisplayformat–itisnotaconstraint.

•  Forinstanceacharacterfielddefinedas“x(30)”mightbe“overstuffed”withastringoflength2,000.

•  Thisisnormalandverycommonpracticewithin4glapplications.Itisnotanerror.

57

Page 58: Getting Started: DBA Basics (90 minutes)

NewSQLWidthOptions!ADTandASUcanbeenabledforspecificLoginBrokers,Forexample:proserve<dbname>-S<port>-SQLTruncateTooLargeON-SQLWidthUpdateONServerTypebothproserve<dbname>-m3-S<port>-SQLTruncateTooLargeON-SQLWidthUpdateONServerTypeSQLWhendataistruncatedthereisamessageinthedatabaselogsimilarto:SQLSRV22:(-----)13authorizeddatatruncationaction(s)performed.IfADTorASUisnotneededmayalsobeenabledforindividualclientsessionsviaODBCorJDBC.Example:sqlexp-url"jdbc:datadirect:openedge://localhost:<port>;databasename=<databasename>;truncateTooLarge=output;"RefertoArticle000068442,HowtoenableAuthorizedDataTruncationinaJDBCorODBCconnection.ForinteractionbetweenADTandASURefertotheWhitepaper:AutonomousSchemaUpdateFunctionality:https://community.progress.com/community_groups/openedge_rdbms/f/18/t/19534

Page 59: Getting Started: DBA Basics (90 minutes)

SQL-92Interface

•  SQLEXP•  ODBC/JDBC•  DBTOOL•  UPDATESTATISTICS•  SQLDUMP

59

Page 60: Getting Started: DBA Basics (90 minutes)

SQLEXP

•  RunSQLscripts•  GRANTandREVOKEperms(savethescriptsbecausetheSQLpermissionsarenotincludedinadump&load!)

60

$DLC/bin/sqlexp-useruserName-passwordpassWord\-dbdbName-SservicePort\–infilescript.sql–outfilesqlexp.log

Page 61: Getting Started: DBA Basics (90 minutes)

ODBC/JDBC

61

Page 62: Getting Started: DBA Basics (90 minutes)

DBTOOL

62

$dbtoolsports DATABASETOOLSMENU ------------------------------------------- 1.SQLWidth&DateScanw/ReportOption 2.SQLWidthScanw/FixOption 3.RecordValidation 4.RecordVersionValidation 5.ReadorValidateDatabaseBlock(s) 6.RecordFixup 7.SchemaValidation 9.Enable/DisableFileLogging Q.Quit

Choice:

http://knowledgebase.progress.com/articles/Article/P24496

Page 63: Getting Started: DBA Basics (90 minutes)

UPDATESTATISTICS

63

/*genUpdateSQL.p**mprodbName–pgenUpdateSQL.p–param"updstats.sql"**sqlexp-useruser-passwordpassWord-dbdbName-Sport-infileupdstats.sql–outfileupdstats.log*/outputtovalue(session:parameter).foreach_fileno-lockwhere_hidden=no:putunformatted"UPDATETABLESTATISTICSANDINDEXSTATISTICSAND""ALLCOLUMNSTATISTICSFORPUB."'"'_file._file-name'"'";"skip"commitwork;"skip.end.outputclose.

Page 64: Getting Started: DBA Basics (90 minutes)

DumpingYourSQLConfiguration

Thursday:10:30–11:30BrusselsPaulKoufalis

Dump&Load:MorethanjustafewProutilCommands

Page 65: Getting Started: DBA Basics (90 minutes)

65

TheDBA’sBestFriend

After-Imaging

Page 66: Getting Started: DBA Basics (90 minutes)

After-Imaging

•  Roll-forwardrecovery.•  Ajournaloftransaction“notes”thatcanbereplayedagainstabaselinebackuptorestoreadatabasetothelastcompletedtransactionorapointintimeoraspecifictransactionnumber.

•  Thisisthesameconceptthatsomeotherdatabasesrefertoasthe“redolog”.

66

Page 67: Getting Started: DBA Basics (90 minutes)

WhydoIneedafter-imaging?

•  Protectionfrommedialoss--suchasbadtapes,acrasheddisk,adestroyeddatacenterorstolenservers…

Page 68: Getting Started: DBA Basics (90 minutes)

WhyelsedoIneedafter-imaging?

•  Protectionfromhumanerrors:

•  Humanerrorisatleastasbigariskashardwareproblems.

for each customer: delete customer. end.

$ cd /db $ rm *

for each order: delivered = yes. end.

$ vi dbname.db … :x

Page 69: Getting Started: DBA Basics (90 minutes)

After-ImagingBestPractices•  Enableafter-imagingonallupdateabledatabases.•  Placeafter-imageextentsonseparatedisksfromdataextents.•  Use8to16variableextentswith“largefiles”enabled(moreforOER).•  RunanAIW.•  Switchextentsasoftenasthebusinessneedsyouto.•  Usethesequencenumberwhennamingarchivedlogs.•  CopyarchivedlogstoanexternallocationASAP.•  Verifyyourprocessbycontinuouslyrollingforward.•  Monitorbothyour“empty”and“full”extents.•  Keepatleast30+daysofarchivedafter-imagelogs.•  Establishdedicatedbackupandrecoveryfilesystems.

Page 70: Getting Started: DBA Basics (90 minutes)

70

StartupParameters

Page 71: Getting Started: DBA Basics (90 minutes)

WheretoFindThem?

•  Onthecommandline.•  Inascript.•  In“.pf”files.•  In$DLC/properties/conmgr.propertiesL•  Verifybyexaminingthe“dbname.lg”file.

– Searchfor“(333)”andexaminethenext50-75lines…

71

Page 72: Getting Started: DBA Basics (90 minutes)

72

ImportantConfigurationOptions

Page 73: Getting Started: DBA Basics (90 minutes)

ImportantConfigurationOptions

•  Connections•  BIClusterSize•  BlockSizes•  StorageAreas•  RowsPerBlock

73

Page 74: Getting Started: DBA Basics (90 minutes)

Connections

•  -nisconnectionsNOTlicenses,-nshouldalwaysbelargerthanyourlicensecount!

•  -Mi/Ma/Mn/Mpb:networkbrokerconnectionparameters•  -m3/ServerType:SQLvs4GLserver•  -minport,-maxport:portrangeusedbyservers

Page 75: Getting Started: DBA Basics (90 minutes)

Connections•  -n:isNOTlicencecountsogiveyourselfagoodbuffer•  -Mi1–Ma5isagoodstartformostpeople•  -Mpb=maxconcurrentusers(4GLorSQL)/-Maplusafew•  -Mn=Sumof–Mpbplusagenerousfewextra•  -ServerType:segregate4GLandSQLconnectionsonseparate–m3brokers

•  Usenon-overlapping–minportand–maxportrangesforeachbroker

Page 76: Getting Started: DBA Basics (90 minutes)

BIClusterSize

•  TheDefaultvarieswithrelease,512KBiscurrent.•  For“Workgroup”Licensessmallerisbetter.

– More,butsmaller,delays.

•  For“Enterprise”Licensesbiggerisbetter.– Mayincreasecrashrecoverytimeabit.– Butreducestheriskofpainfuldelaysduringheavyprocessing.– 32768KBis“agoodstart”.

•  proutildbname–Ctruncatebi–bi32768

76

Page 77: Getting Started: DBA Basics (90 minutes)

BlockSizes•  DBBlock(MustDump&LoadtoChange)

–  4KBor8KB–  NOT1KBor2KB

•  BIBlock–  16KB–  proutildbname–Ctruncatebi–biblocksize16

•  AIBlock–  16KB–  rfutildbname–Caimagetruncate–ai16–  AImustbedisabledsodoit‘early’

77

Page 78: Getting Started: DBA Basics (90 minutes)

StorageAreas•  Type2storageareasarethefoundationforalladvancedfeaturesoftheOpenEdge

database.•  Type2areashaveclustersizesof8,64or512.•  DatablocksinType2areascontaindatafromjustonetable.•  UseMany(Type2)StorageAreas(andneveruseType1Areas).•  DoNOTassigntablestoareasbasedon“function”.•  Insteadgroupobjectsbycommon“technicalattributes”(RowsPerBlock,size,activity

level).•  PutLargeObjects(LOBs)inseparateAreas.•  DoNOTstoredata,indexesorLOBsinthe“SchemaArea”.

78

Page 79: Getting Started: DBA Basics (90 minutes)

Storage•  RAID5isEVIL!•  Soarethevariantsspawnedfromit:

–  RAID6–  RAIDDP(DoubleParityorDefinitelyPutrid)–  Etal–ParitybasedRAIDprovidesaParodyofPerformance(allRAIDotherthanRAID10isparitybased).

•  NAS<>SAN•  IfatallpossibleavoidNetApp•  SANsexisttomakelifeeasyforstorageadmins–theyarenottheretomakeyourdatabaserunfaster.

79

Page 80: Getting Started: DBA Basics (90 minutes)

Just2050slidestogo!

80

Page 81: Getting Started: DBA Basics (90 minutes)

81

WhereAretheLogFiles?

Page 82: Getting Started: DBA Basics (90 minutes)

Wherearethelogfiles?•  dbname.lg•  AdminServer:

$WRKDIR/admserv.log•  AppServers:

$WRKDIR/appsrv.broker.log$WRKDIR/appsrv.server.logLocationof$WRKDIRcanbefoundin$DLC/bin/proenv

•  OSLogs– /var/log,/usr/adm

82

Page 83: Getting Started: DBA Basics (90 minutes)

83

Monitoring

Page 84: Getting Started: DBA Basics (90 minutes)

Butfirst…

•  Alwaysset–tablerangesizeand–indexrangesizeondbstartup!

•  Towhatvalues?

Page 85: Getting Started: DBA Basics (90 minutes)

Butfirst…•  Alwaysset–tablerangesizeand–indexrangesizeondbstartup!•  Towhatvalues?

/*range.p--mprodbName-p./range.p*/definevariabletasintegerno-undolabel"tables".definevariableiasintegerno-undolabel"indexes".foreach_fileno-lockwhere_hidden=no:t=t+1.end.foreach_indexno-lock:i=i+1.end.displaytiwithside-labels.

Page 86: Getting Started: DBA Basics (90 minutes)

dbname.lg:WhattoIgnore

86

(452)Loginbyrooton/dev/pts/6.(453)Logoutbyrooton/dev/pts/6.(708)Useridisnowtom.(8873)Loginusernum2547,remoteSQLclient.(14658)Previousmessagesentonbehalfofuser2542,serverpid22516,brokerpid5778.(12699)DatabasexyzOptions:

Andafewsquillionmore“noise”messages… Msg Type Client Type | | Date Time Process-Id v v Usr# Msg# Message Text------------------------------------------------------------------------------------------------[2014/08/23@09:34:36.572-0400] P-336 T-1240798976 I ABL 5: (452) Login by tom on /dev/pts/1.[2014/10/24@13:07:54.129-0400] P-11073 T-1226471168 I ABL : (334) Single-user session end.

Page 87: Getting Started: DBA Basics (90 minutes)

dbname.lg:WhattoPayAttentionTo

87

(2248)Beginnormalshutdown(2249)BeginABNORMALshutdown(542)Servershutdownstartedbyrooton/dev/pts/6.(5292)SYSTEMERROR:Thebrokerisexitingunexpectedly,beginningAbnormalShutdown.(1384)Thedatabaseisbeingshutdown.(915)Locktableoverflow,increase-Lonserver(1081)Toomanyusersrequestedsemaphoreundo,increaseSEMMNU.(358) SYSTEMERROR:Toomanysubprocesses,cannotfork.Errno=12.

Note:notacomprehensivelistorerrorsbutyougettheidea

Page 88: Getting Started: DBA Basics (90 minutes)

dbname.lg:WhattoPanicOver!

88

(37)Yourdatabasewasdamaged.Dumpitsdataandreloadit.(43)Cannotfindoropenfile<filename>,errno=<number>.(1124)SYSTEMERROR:Wrongdbkeyinblock.Found5512,shouldbe1458inarea15.(886)Thedatabasewaslastused<date/time>.(887)Thebefore-imagefileexpected<date/time>.(888)Thosedatesdon'tmatch,soyouhavethewrongcopyofoneofthem.SYSTEMERROR:…

Note2:notallSYSTEMERRORsareworthgettingoutofbedfor

Page 89: Getting Started: DBA Basics (90 minutes)

dbname.lg:WhatNotToMiss

•  Thelackofthesemessagesmeansthatbackupsarenotexecuting.•  Orthatafter-imagingisnotfunctioning.

89

(1362)Fullbackupstarted.(1364)Fullbackupsuccessfullycompleted.(7129)Usr61setnametoAimagefull.(3778)Thisisafter-imagefilenumber270sincethelastAIMAGEBEGIN(3777)Switchedtoaiextent/ai/sports.a4.

Page 90: Getting Started: DBA Basics (90 minutes)

MonitoringTools&Services•  PROMON(free,included)•  ProTop(freeorpaid)

16:30–17:30Copenhagen;[WSS]ProTop:TheBestOEMonitoringDashboardintheGalaxy

•  RollyourownwithVirtualSystemTables•  OEManagement(“FathomManagement”)•  ProgressManagedDBAService•  DBAppraise(supportservicesadd-onforProTop)

90

Page 91: Getting Started: DBA Basics (90 minutes)

WhattoMonitor

•  IstheDBup?•  BackupAge•  Numberofconnections•  Oldestactivetransaction•  Commits/sec•  LogicalReads/sec•  After-image#offullextents•  Busyusers,tablesandindexes

•  Latchtimeouts•  Locksinuse•  Blockedusers•  IOresponse•  CPUperformance•  DiskSpace

91

Page 92: Getting Started: DBA Basics (90 minutes)

DatabasePerformanceTuningTalks

Wednesday10:00–11:00Amsterdam;[AdamBackman]Topnperformancetips

15:45–16:45Amsterdam;[DanForeman]Captain,WhereshouldIgo?WhatshouldIdo?

Thursday11:45–12:45Brussels;[AdamBackman]Buildyourownluck

13:45–14:45Brussels;[TomBascom]OpenEdgeDatabasePerformanceTuning16:30–17:30Copenhagen;[WSS]ProTop:TheBestOEMonitoringDashboardintheGalaxy

Friday

9:00–10:00Brussels;[DanForeman]promonforDummies&Geniuses

Page 93: Getting Started: DBA Basics (90 minutes)

93

It’sNot“Just”aDatabase

Page 94: Getting Started: DBA Basics (90 minutes)

It’sNot“Just”aDatabase

•  AnyAmountofTuningcanalwaysbedefeatedbylousycode.

94

Page 95: Getting Started: DBA Basics (90 minutes)

It’sNot“Just”aDatabase

•  AnyAmountofTuningcanalwaysbedefeatedbylousycode.

•  …andthereisaLOToflousycodeoutthereL

95

Page 96: Getting Started: DBA Basics (90 minutes)

PickYourBattles

Theperformanceenhancementpossiblewithagivenimprovementislimitedbythefractionofthe

executiontimethattheimprovedfeatureisused. --Amdahl’sLaw

Page 97: Getting Started: DBA Basics (90 minutes)

Inotherwords:

•  Tryingtoimprovesmallthingsthatnobodynoticesprobablyisn’ttheroadtofameandfortune.

•  Bigqueriesthatreturnlotsofdataandwhicharefrequentlyusedbylotsofuserswillbemuchmorenoticeable.

Page 98: Getting Started: DBA Basics (90 minutes)

Users!

•  Sometimesyouneedtoknowwhattheyaredoing:– UNIX: kill–USR1<pid>– Windows: %DLC%\bin\proGetStack<pid>

•  Mustowntheprocessorberoot/administrator•  Createsaprotrace.<PID>inworkingdirectory•  Theprotracecontainsa4glstacktrace!

98

Page 99: Getting Started: DBA Basics (90 minutes)

protrace.<PID>

99

PROGRESSstacktraceasofTueDec411:28:002012Commandlineargumentsare/progress/dlc/bin/_progres-pmls.p-pf/los_prod/develop.pf-T/dbtmpStartupparameters:-pf/progress/dlc/startup.pf,-T/dbtmp,-clientlog/los_logs/debug/client_f474458_20121204_112720_45302816.log...(snip)+++PARALLELTOOLSCONSORTIUMLIGHTWEIGHTCOREFILEFORMATversion1.0...(snip)**4GLStackTrace**-->obj/mnu/menu(/los_prod/obj/mnu/menu.r)atline416obj/src/startup(/los_prod/obj/src/startup.r)atline2042mls.p(/los_prod/mls.r)atline26**Persistentprocedures/Classes**HandleFileName001010/los_prod/obj/tools/proclib.r000000/los_prod/config.r(STATIC)001000/los_prod/obj/prt/genBarcode.r

Page 100: Getting Started: DBA Basics (90 minutes)

ApplicationCodePerformanceTuningTalksWednesday

14:00–17:30Prague;[PaulKoufalis,PeterJudge]Workshop:4GLCodePerformance-ProfilingandIndexing15:45–16:45Cologne;[Panel]DebuggingandTrouble-ShootingPanel

Thursday

10:30–11:30Noordwijk;[DanForeman]TEMP-TABLEMonitoring&PerfTuning13:45–14:45Manchester;[DanForeman]NeedleinaStackTrace

16:30–17:30Copenhagen;[WSS]ProTop:TheBestOEMonitoringDashboardintheGalaxy

Friday

9:00–10:00Brussels;[DanForeman]promonforDummies&Geniuses11:45–12:45Cologne;[PaulKoufalis,PeterJudge]Mastering4GLCodePerformance-Profiling&Indexing10:15–11:14Brussels;[TomBascom]EmbeddedApplicationPerformanceInstrumentation16:30–17:30Manchester;[TomBascom]4GLCodingWorstPractices

Page 101: Getting Started: DBA Basics (90 minutes)

101

AFewWordsAbout“killing”Users

Page 102: Getting Started: DBA Basics (90 minutes)

About“killing”Users…

•  IfyouareonUNIX:– “kill-9”isdangerous!Youwillcrashthedatabase!– “kill-9”doesnot“alwayswork”– “kill-1”(“hangup”)issafeandeffective

– proshutdbname–Cdisconnectusr#

102

Page 103: Getting Started: DBA Basics (90 minutes)

About“killing”Users…

•  IfyouareonWindows:– We’resorryL– TaskManager“endtask”isequivalenttokill-9.– Loggingoutcanterminateallofyourbackgroundwindows–including“scheduledtasks”.Whichwillactlikeakill-9.

103

Page 104: Getting Started: DBA Basics (90 minutes)

104

Checklists

Page 105: Getting Started: DBA Basics (90 minutes)

Mornings

105

Page 106: Getting Started: DBA Basics (90 minutes)

Mornings

•  Verifysuccessfulbackup•  Verifythatafter-imagingisenabledandproperlyswitchingextents•  Verifythatwarmspareisavailableanduptodate•  Verifythatmonitorsarerunningandthatalertsareflowing•  Verifysufficientfilesystemfreespace

Page 107: Getting Started: DBA Basics (90 minutes)

Mornings

•  Checkbifilesize•  Checkfixedextentfreespace•  Checkfreespaceinaiarchivefilesystem•  Checkfreespaceinbackupfilesystem•  Checkfor“runaway”processes•  Checkforovernightprocessesthatmaystillberunning(butshouldnotbe)

•  Checkforleftoverlongopentransactions

Page 108: Getting Started: DBA Basics (90 minutes)

Mornings

•  Reviewdblogfileforovernightmessages•  Ifyouareusingthealternatebufferpool--reviewB2,ensurethattherearefreeblocksandthatlru2isdisabled

•  Checkmonitoredmetricsfortrendsthatareapproachingactionablethresholds

•  ReadProgressPANSalerts

Page 109: Getting Started: DBA Basics (90 minutes)

Mornings

•  ReviewOSlogs•  ReviewOSfreememory•  Reviewsummaryofpreviousday’sCPUanddiskutilization•  CheckOSconfigurationforunwelcomechanges

Page 110: Getting Started: DBA Basics (90 minutes)

DuringtheDay

110

Page 111: Getting Started: DBA Basics (90 minutes)

DuringtheDay

•  AIswitching&warmspareapply•  Numberofusers/connections•  HighdiskIOrates,lowbufferhitratio•  Unusuallyactivetablesorindexes•  Unusuallogfilemessagesandalerts•  LockTableHWM,activelocks•  Timebetweencheckpoints•  OSbottlenecksandconstraints

Page 112: Getting Started: DBA Basics (90 minutes)

DuringtheDay•  LongopenTRX&BIfilegrowth

–  Findtheoldesttransaction(usuallyacodeproblem)•  Blockedusers/connections

–  REC=recordlocking,codingissue–  BK*,TX*etcindicatesystemresourceconstraints

•  Excessivelyactiveconnectionsor“rapidreaders”–  Whataretheydoing?–  Isitlegitimate?–  Isthereabetterway?

•  Usethe“clientstatementcache”or“proGetStack”toidentifyspecificcodecausingaproblem.–  Workwithdevelopmenttogetitfixed.

Page 113: Getting Started: DBA Basics (90 minutes)

Weekly

113

Page 114: Getting Started: DBA Basics (90 minutes)

Weekly

•  Rotate/Truncatethe.lgfile•  Cleanuptrashindbdirectories

–  protrace,leftoverscratchfiles,corefiles,etc– Don’tforget–T!

•  Refreshdbanalys•  Refresh“prostrctlist”•  RefreshDEV/TEST/QA/Trainingetc.

–  ThismayinvolverestoringaPRODbackupwhichwillverifythatbackupsaregood.

Page 115: Getting Started: DBA Basics (90 minutes)

Weekly

•  Afterrefreshingdbanalysreview:–  Indexutilization,identifyidxcompacttargets– Checkrowsperblocksettings– CheckRMchains– Fragmentation– Scatter

•  Scheduleappropriateremediationactivities

Page 116: Getting Started: DBA Basics (90 minutes)

Monthly

116

Page 117: Getting Started: DBA Basics (90 minutes)

Monthly

•  Outagesummary:plannedandunplanned•  CapacityPlanningReports:

– BasicCRUD&TRXtrends– OverallDBgrowth– User/Connectiontrends–  IOresponse– Projectdiskspaceneeds– Projectdiskthroughputneeds– Projectmemory&CPUutilization

Page 118: Getting Started: DBA Basics (90 minutes)

Quarterly

118

Page 119: Getting Started: DBA Basics (90 minutes)

Quarterly•  Reviewallstartupparametersandconfigoptions•  Reviewstorageareaconfiguration•  IfallowingSQL-92connections:

–  RundbtooltoadjustSQL-width–  Run“updatestatistics”fortheoptimizer

•  IfusingSSLetc–reviewcertificatevalidity&expiration•  ReviewOSconfiguration,kernelparamsetc.

–  TestIOthroughput:randomreads&synchronouswrites•  ReviewProgressreleaselevel•  Reviewmonitoredmetricsandalerts•  Reviewanynewbusinessgrowthplans

Page 120: Getting Started: DBA Basics (90 minutes)

Annually

120

Page 121: Getting Started: DBA Basics (90 minutes)

Annually

•  DRTest•  Licensereview&“true-up”•  ReviewHWlandscapeandpotentialupgrades•  Reviewbusinessgrowthplans&projections•  PUGChallenge/Exchange

121

Page 122: Getting Started: DBA Basics (90 minutes)

SpecialEvents

122

Page 123: Getting Started: DBA Basics (90 minutes)

Upgrades&ServicePacks

•  Shutdown•  Truncatethebi•  Backup•  InstalltheupgradeorSP(orchange$DLC)•  proutil–Cupdatevst•  proutil–Cupdateschema•  Restart

123

Page 124: Getting Started: DBA Basics (90 minutes)

Pre-ReleaseorUpgrade•  Reviewanyonlinechangesthatshouldbemadepermanent:-spin,-L,etc.•  Run“proutil–Cdescribe”andconfirmthatyouhavetheconfigoptionsthatyouneed(largefiles

etc).•  Reviewallstartupparameters&configoptions:

–  General:-n,-L,-B,-B2,-lruskips,-lru2skips,-spin,-M*(ifused)–  Schemarelated:-omsize,-*rangesize–  OtherConfig:bicluster&blocksize

•  Reviewstorageareas–areanynewareasneeded?(Perhapsatableshouldbesplitout?)•  Review.dfforproblems–i.e.RECIDfields,nostorageareaetc•  ReviewProgressservicepacks–shouldaSPbeapplied?

Page 125: Getting Started: DBA Basics (90 minutes)

Post-Release

•  Checkschemaareaforstrayobjects•  CheckthatnoRECIDfieldshavesnuckin•  Verifythattables,indexesandLOBsareallinproperstorageareas•  Verify–omsize,-*rangesizeetc.•  VerifyB2assignments

Page 126: Getting Started: DBA Basics (90 minutes)

Post-Outage(unplanned)

•  Rootcauseanalysis•  Remediationplan•  Lessonslearned

– Neworimprovedalerts– Additionalinstrumentation–  Improvedprocedures– Additionaltraining

126

Page 127: Getting Started: DBA Basics (90 minutes)

FreeTime

127

Page 128: Getting Started: DBA Basics (90 minutes)

Planning,Testing&Optimizing

•  Benchmarkingandstresstesting•  Alternativeconfigurations•  NewOpenEdgereleasesandfeatures•  Reducingrequireddowntime

Page 129: Getting Started: DBA Basics (90 minutes)

Questions?129

Page 130: Getting Started: DBA Basics (90 minutes)

ThankYou!

130