Oracle Database Installation Guide
Oracle Database Installation Guide
Thefollowingaresomeoftheproducts,tools,andutilitiesyoucanuseinachievingyourgoalsas adatabaseadministrator: Oracle Universal Installer (OUI) [Link] launchtheDatabaseConfigurationAssistanttoinstalladatabase. Database Configuration Assistant (DBCA) TheDatabaseConfigurationAssistantcreatesadatabasefromtemplatesthataresuppliedby Oracle,[Link],thus savingthetimeandeffortofgeneratingandcustomizingadatabasefromscratch. Database Upgrade Assistant ThisDatabaseUpgradeAssistantguidesyouthroughtheupgradeofyourexistingdatabasetoa newOraclerelease. Oracle Net Manager NetManagerguidesyouthroughyourOracleNetnetworkconfiguration. Oracle Enterprise Manager TheprimarytoolformanagingyourdatabaseisOracleEnterpriseManager,awebbased [Link],createdorupgradedadatabase,and configuredthenetwork,[Link] addition,OracleEnterpriseManageralsoprovidesaninterfaceforperformanceadvisorsandfor OracleutilitiessuchasSQL*LoaderandRecoveryManager.
Checking Prerequisites
Beforeinstallingthesoftware,theinstallerperformsanumberofautomatedprerequisitechecks toensurethatyourmachinefulfillsthebasichardwareandsoftwarerequirementsforanOracle [Link],anerrormessageis [Link] operationsystemyouarerunning,butsomeexamplesofprerequisitesinclude: Aminimumof512MBofmemoryisavailable. Sufficientpagingspaceisavailable. Appropriateoperatingsystemservicepacksorpatchesareinstalled. Anappropriatefilesystemformatisbeingused. TheinstallerautomaticallysetsanyoperatingsystemenvironmentvariablesthattheOracle databaseserverrequiresforitsoperation.
WhenyouinstallOracleDatabaseduringbasicandadvancedinstallations,youmakethe followingchoices. Whatdatabaseproductdoyouwanttoinstall? Youcaninstalloneofthefollowing: Enterprise EditionOracle'sfullfeatureddatabaseproductprovidingdatamanagement [Link],highsecurityonline transactionprocessing(OLTP)anddatawarehousingenvironments. Standard EditionThisinstallationtypeissuitableforworkgroupordepartmentlevel applications,[Link] relationaldatabasemanagementservicesandoptions.
Best Practice:
TheGlobalDatabaseNameisthefullnameofthedatabasethatuniquelydistinguishesitfrom [Link] database_name.database_domain,[Link] sales [Link] [Link] domainmakeuptheGlobalDatabaseName. Duringbasicinstallation,[Link] examplesinthedatabasedocumentationarebasedonthesampleschemas.. YouwillalsobepromptedtoenteryourdatabaseschemapasswordfortheSYS andSYSTEM accounts,whichenableyoutomanageandadministerthedatabase.
Whatkindofstoragemechanismdoyouwantyourdatabasetouse? Adatabaseincludesseveralfilesthatstoretheuserdata,databasemetadata,aswellas [Link],youdecidewhatkindof [Link]: File SystemThisdefaultoptioncreatesdatabasefilesthataremanagedbyyouroperating system'[Link]. OracleDatabasecancreateandmanagetheactualfiles. Ifyouarenotcertainofwhichoptiontouse,choosethedefaultselectionofFileSystem. Automatic Storage ManagementThisfunctionalityenablesyoutodefineapoolof storage(calledadiskgroup)inwhichOracleautomaticallymanagesdatabasefileplacementand [Link],thisoptionsimplifiesdatabase [Link] automatically.
WhatareyourDatabaseManagementOptions? [Link] modeenablesyoutomanagemultipletargets,suchasdatabasesandapplicationservers,froma [Link] instance. [Link] suchagentisfound,thenthisoptionisdisabled. Ifyouaresettingupasingledatabaseforthefirsttime,itisrecommendedthatyoudeploy EnterpriseManagerlocally,[Link] migrateyourdeploymentmodetocentralmanagement. Attheendoftheinterview,asummarywindowdisplaystheoptionsthatyouhavechosen,the requirementsforspacebasedonthoseoptions,[Link] havechosentoinstalladatabase,thenthisstepisperformedimmediatelyafterthesoftware installationiscomplete.
Basic [Link] [Link] databasebasedontheinformationyouprovide. ForBasicinstallation,youspecifythefollowing: Oracle Home LocationEnterthedirectoryinwhichtoinstalltheOracleDatabase10g [Link] Database10g. Installation TypeSelecteitherEnterprise Edition,Standard Edition,or Personal Edition (Windows Only).Referto"BasicInstallationChoices"onpage22. UNIX DBA Group (LinuxandUnixonly)SpecifytheDBAgroupforyouroperating system. Create Starter Database [Link] [Link] Global Database Name andDatabase Password fortheSYS,SYSTEM,SYSMAN,and DBSNMP [Link]"BasicInstallation Choices". TostarttheBasicInstallation,[Link]. Advanced [Link],use thismethodtoinstallOracleRealApplicationClusters,toupgradeadatabase,toconfigure AutomaticStorageManagement,[Link] [Link]
DBCA to Create and Configure a Database 2-6 Oracle Database 2 Day DBA
advancedchoices,see"AdvancedInstallationChoices"[Link] Database Installation Guide foryourplatform. [Link]"CheckingPrerequisites" [Link], warning,[Link] [Link],youmustresolvethem manually. Afterverifyingthatyoursystemmeetstheminimumrequirementsforinstallingandconfiguring thechosenproducts,clickNext. [Link] and Unix [Link] machine,thenthefollowingoccurs: [Link] [Link] [Link] patchestoorupgradinganexistinginstallation,[Link] thisareaisdifferentfromtheOraclehome,[Link] tocontinue. [Link],space [Link] [Link] Installwindowappearsshowinginstallationprogress. [Link],theConfiguration Assistants [Link] [Link] database,thentheDatabaseConfigurationAssistantstartsautomaticallyinaseparatewindow. Attheendofdatabasecreation,youarepromptedtounlockuseraccountstomaketheaccounts [Link] andSYSTEM accountsarealreadyunlocked,clickOK tobypass passwordmanagement. [Link] and Unix [Link] Configuration scripts [Link] promptedtoopenanewterminalwindow,[Link] scripts,returntothiswindowandclickOk. [Link] displaysseveralimportantURLs,[Link] thisURLinyourbrowserandloginastheSYS userwiththeassociatedpassword,andconnect [Link]. SeeChapter3,"GettingStartedwithOracleEnterpriseManager". [Link],youcanexittheInstaller.
Starting DBCA
TolaunchDBCA: [Link] Oraclesoftwareandcreateandrunthedatabase. [Link],clicktheStart buttonandthenselect Programs,Oracle - home_name,Configuration and Migration Tools,andthen Database Configuration Assistant. TolaunchtheDBCAonUNIX,orasanothermethodonaWindowsoperatingsystem,enterthe followingcommandatasystemprompt:
dbca
OntheDBCAOperationswindow,selectCreate a Database tobeginawizardthatenables [Link],youareaskedforyourinputonthe following: DatabaseTemplates DatabaseIdentification ManagementOptions DatabaseCredentials StorageOptions DatabaseFileLocations RecoveryConfiguration DatabaseContent InitializationParameters DatabaseStorage CreationOptions [Link] thedefaultparameters,youcanclickFinish [Link] windowinwhichyoumustclickOK [Link] DBCA to Create
and Configure a Database 2-8 Oracle Database 2 Day DBA
Database Templates
[Link],Oracle [Link] Warehouse,General Purpose, andTransaction Processing databases. [Link] Details toseethe [Link] [Link],selectthedefaultGeneral Purpose template. Formorecomplexenvironments,youcanselecttheCustom Database [Link] resultsinamoreextensiveinterview,whichmeansthatitwilltakelongertocreateyourdatabase becauseadatabasecreationscriptmustberun. Formoreinformationaboutusingdatabasetemplates,see"ManagingTemplateswithDBCA"on page212.
Database Identification
Management Options
UsethiswindowtosetupyourdatabasesoitcanbemanagedwithOracleEnterpriseManager, whichprovidesWebbasedmanagementtoolsforindividualdatabases,aswellascentral managementtoolsformanagingyourentireOracleenvironment. CheckConfigure the Database with Enterprise Manager to use Enterprise Manager. Selectoneofthefollowingoptions: IftheOracleManagementAgenthasbeeninstalledonyourhostcomputer,thenyouhavethe optionofselectingcentralmanagementbyselectingUse Grid Control for Database [Link],youmustalsoindicatewhich managementservicetouseinthedropdownmenu. SelectUse Database Control for Database Management tomanageyourdatabase [Link],youcanadditionallycheckEnable Email Notifications forOracletoemailyoualertsregardingpotentialproblems,andcheckEnable Daily Backup. ClickHelp formoreinformationabouttheseoptions.
Database Credentials
Inthiswindow,youspecifythepasswordsfortheadministrativeaccountssuchasSYS and [Link]: SelectUse the Same Password for All Accounts andenterthepasswordtousethe samepasswordforallaccounts. SelectUse Different Passwords andspecifypasswordsindividually.
Storage Options
Recovery Configuration
Whenyoucreateanewdatabase,itisimportanttoconfigurethedatabasesoyoucanrecover [Link]: ChooseSpecify Flash Recovery Area tospecifyabackupandrecoveryareaandspecify [Link] revieworaddadditionallocations,clickFile Location Variables atthebottomofthe window. CheckEnable Archiving toenablearchivingofdatabaseredologs,whichcanbeusedto [Link] EnterpriseManagerorrunningthedatabaseinARCHIVELOG [Link] archivemodesettingsorchangethembyselectingEdit Archive Mode Parameters. OraclerecommendsyouselectEnable [Link] [Link] optionnow,[Link]"ConfiguringYourDatabaseforBasic BackupandRecovery"onpage94.
Database Content
IntheSample Schemas tab,checkSample Schemas toincludetheSampleSchemas (EXAMPLE)[Link] [Link] [Link]. IntheCustom Scripts tab,youcanspecifyoneormoreSQLscriptstorunafteryourdatabase [Link],suchasloadingcustom [Link],checkRun the following scripts;otherwiseacceptthedefault No scripts to [Link] DBCA to Create and
Configure a Database 2-10 Oracle Database 2 Day DBA
Initialization Parameters
Thelinksonthiswindowprovideaccesstowindowsthatenableyouchangedefaultinitialization [Link]: Memory Sizing CharacterSets ConnectionMode Memory Usethiswindowtosettheinitializationparametersthatcontrolhowthedatabasemanagesits [Link]: Typicalrequireslittleconfiguration,andallocatesmemoryasapercentageoftotaloverall [Link],selectTypical [Link] Show Memory Distribution toseehowmuchmemorytheAssistantassignstotheSystem GlobalArea(SGA)andtheProgramGlobalArea(PGA).TolearnmoreaboutPGAandSGA, referto"ManagingMemoryParameters"inChapter5,"ManagingtheOracleInstance". Customrequiresmoreconfiguration,butgivesyoumorecontroloverhowthedatabaseuses [Link] directlyspecifymemorysizesfortheSGAandPGAandtheirsubstructures,suchastheshared poolandbuffercache. Selectoneofthefollowingoptions: SelectAutomatic toallocatespecificamountsofmemorytoSGAandPGA. SelectManual andenterspecificvaluesforeachSGAcomponenttocustomizehowtheSGA memoryisdistributedamongtheSGAmemorysubstructures. TocustomizehowtheSGAmemoryisdistributedamongtheSGAmemorysubstructures,select Manual [Link] memoryareas,clickHelp. Sizing Inthistab,youspecifythesmallestblocksizeandthemaximumnumberofoperatingsystem userprocessesthatcansimultaneouslyconnecttothedatabase. IntheBlock Size list,[Link] [Link] [Link],thisfieldisnotenabledsincethedatabasewillbe [Link],youcanchange blocksize.Selectingablocksizeotherthanthedefault8KBvaluerequiresadvancedknowledge andshouldonlybedonewhenabsolutelyrequired. IntheProcesses field,specifythemaximumnumberofprocessesthatcansimultaneously [Link] [Link] shouldallowforallbackgroundprocesses,suchaslocksandparallelexecutionprocesses. CharacterSets [Link] encodingschemesusedtodisplaycharactersonyourcomputerUsing DBCA to Create and
Configure a Database Installing Oracle and Building the Database 2-11
[Link]. ForDatabase Character Set,selectfromoneofthefollowingoptions: Use the DefaultSelectthisoptionifyouneedtosupportonlythelanguagecurrentlyused bytheoperatingsystemforallyourdatabaseusersandyourdatabaseapplications. Use Unicode (AL32UTF8)Selectthisoptionifyouneedtosupportmultiplelanguagesfor yourdatabaseusersandyourdatabaseapplications. Choose from the list of character setsSelectthisoptionifyouwanttheOracle Databasetouseacharactersetotherthanthedefaultcharactersetusedbytheoperatingsystem. IntheNational Character Set list,[Link] charactersetisanalternativecharactersetthatenablesyoutostoreUnicodecharactersina [Link] nationalcharactersetisthatprogramminginthenationalcharactersetmightbeeasier. IntheDefault Language list,[Link] defaultlanguagedetermineshowthedatabasesupportslocalesensitiveinformationsuchasday andmonthabbreviations,defaultsortingsequenceforcharacterdata,andwritingdirection(left orright). IntheDefault Date Format list,[Link] formatdeterminestheconventionfordisplayingthehour,day,month,[Link] theUnitedKingdom,thedateformatisDDMMYYYY. ConnectionMode [Link] modes: SelectDedicated Server Mode toallowadedicatedserverprocessforeachuserprocess. Selectthisoptionwhenthenumberoftotalclientsisexpectedtobesmall,orwhendatabase clientswillmakepersistent,longrunningrequeststothedatabase. SelectShared Server Mode toallowseveralclientconnectionstoshareadatabaseallocated [Link] isalsousefulwhendatabasememoryislimitedandforbetterperformancebecauseyoucanhave [Link] youchoosesharedservermode,thenyoumustalsoindicatethenumberofserverprocessesyou [Link], clickHelp.
Database Storage
Creation Options
Create DatabaseChecktocreateyourdatabaseatthistime. Save as a Database TemplateChecktosavethedatabasedefinitionasatemplateto useatanothertime. Generate Database Creation ScriptsChecktogenerateaSQLdatabasecreation scriptthatyoucanrunatalatertime.
Types of Templates
Table 21 DBCA Template Types Type File Include Database Structure Extensi Datafile on s? .dbc Seed Yes Thistypeoftemplatecontainsboththestructureandthephysical datafilesofanexisting(seed)[Link] template,databasecreationisfasterbecausethephysicalfilesand [Link] asacopyoftheseeddatabase,ratherthanhavingtobebuilt. Youcanchangeonlythefollowing: Nameofthedatabase Destinationofthedatafiles Numberofcontrolfiles Numberofredologgroups Initializationparameters Otherchangescanbemadeafterdatabasecreationusingcustomscripts thatcanbeinvokedbyDBCA,commandlineSQLstatements,orthe OracleEnterpriseManager. Thedatafilesandonlineredologsfortheseeddatabasearestoredina [Link] [Link] [Link] [Link] file. Nonseed .dbt No [Link] [Link] templatesaremoreflexiblethantheirseedcounterpartsbecauseall datafilesandonlineredologsarecreatedtoyourspecification(not copied),andnames,sizes,andotherattributescanbechangedas required.
Table 21 DBCA Template Types Type File Include Database Structure Extensi Datafile on s?
Seed
.dbc
Yes
Nonseed
.dbt
No
This type of template contains both the structure and the physical datafiles of an existing (seed) database. When you select a seed template, database creation is faster because the physical files and schema of the database have already been created. Your database starts as a copy of the seed database, rather than having to be built. You can change only the following: Name of the database Destination of the datafiles Number of control files Number of redo log groups Initialization parameters Other changes can be made after database creation using custom scripts that can be invoked by DBCA, commandline SQL statements, or the Oracle Enterprise Manager. The datafiles and online redo logs for the seed database are stored in a compressed format in another file with a .dfj extension. The corresponding .dfj files location is stored in the .dbc file. This type of template is used to create a new database from scratch. It contains the characteristics of the database to be created. Non-seed templates are more flexible than their seed counterparts because all datafiles and online redo logs are created to your specification (not copied), and names, sizes, and other attributes can be changed as required.
TheDatabaseUpgradeAssistantautomaticallyperformsthefollowingtasks: Modifiesorcreatesnewrequiredtablespaces Invokestheappropriateupgradescripts Archivesredologs Disablesarchivingduringtheupgradephase Whiletheupgradeisrunning,[Link] DBUAwritesdetailedtraceandlogfilesandproducesacompleteHTMLreportforlater [Link],theDBUAautomaticallylocksnewuseraccountsintheupgraded [Link](initializationparameterand listenerfiles)inthenewOraclehome.
TheDatabaseUpgradeAssistantsupportsthefollowingversionsoftheOracleDatabasefor upgradingtoOracleDatabase10g: Oracledatabaseversion8.0.6(singleinstancedatabasesonly) Oracle8i Release8.1.7(singleinstanceandRealApplicationClustersdatabases) Oracle9i Release1(9.0.1)(singleinstanceandRealApplicationClustersdatabases) Oracle9i Release9.2.0(singleinstanceandRealApplicationClusterdatabases) Ifyourdatabaseversionisnotinthislist,youneedtoupgradefirsttotheclosestreleaseaslisted. Youcanthenupgradethedatabasetothecurrentrelease.
Note:
Ifyoustoptheupgrade,butdonotrestorethedatabase,thenyou shouldnotrestarttheDBUAuntilyoustartuptheexisting databaseinUPGRADE [Link] backtotheoriginalserverunlessyourestoreyourdatabase. Ifyourestoreyourdatabasemanually(notusingtheDBUA),then removethefollowingfilebeforestartingtheDBUA: $10.2OracleHome/cfgtoollogs/dbua/logs/Welcome_<SID>.t [Link] runoperation.
TolaunchtheDBUAontheWindowsoperatingsystemchoosethefollowingmenuoption:
Start > Programs > Oracle - HOME_NAME > Configuration and Migration Tools > Database Upgrade Assistant
TolaunchtheDBUAonaUNIXorLinuxoperatingsystem,enterthefollowingatacommand prompt:
dbua
Thiscommandistypicallyfoundinyour$ORACLE_HOME/bin directory.
Toviewthestatusofthedbconsole process:
./emctl status dbconsole
InWindows,inadditiontousingthecommandline,youcanstartthedbconsole processasa service. Tostartdbconsole asaservice: [Link],ControlPanel,AdministrativeTools,[Link]. [Link] serviceislistedas OracleDBConsoleORACLE_SID,whereORACLE_SID [Link] listedintheStatuscolumn,[Link] appears. [Link],ensurethattheStartupTypeiseitherManualorAutomaticandnot [Link],[Link]. YoucanalsousetheServicespagetostoptheprocess.
[Link]
initiallycouldbeSYS [Link] databaseinstallation. EnterpriseManagerdisplaystheDatabaseHomepage(Figure34). Thepropertypagesacrossthetopofthepageenableyoutoaccessperformance,administration, [Link] isdiscussedinotherchaptersofthisbook. ThevarioussectionsoftheDatabaseHomepageandrelatedlinksprovideinformationaboutthe [Link],theAlerts,Related Alerts,and Diagnostic Summary sectionswarnyouoferrorsandperformanceproblemsthatare [Link] abouttheproblemarea,[Link] discussedinChapter10,"MonitoringandTuningtheDatabase".
Figure 34 Database Home Page
user. [Link] atthetopoftheDatabaseHomepage. [Link] intheleftnavigationbar. Ifyouneedtocreateanewadministrator,youmustfirstcreatetheuserandthenassign [Link],see"Administering DatabaseUsers"onpage78 [Link] tocreateanewEnterpriseManageruserbyassigningthemanagement privilegestoanexistingdatabaseuser. [Link] popupwindow. [Link]. [Link] databaseuserisnowincludedinthelistofmanagementusersontheSetupAdministratorspage. AlltheusersshownonthispagecanlogintotheDatabaseControlandperformdatabase managementtasks.
AclientisanyapplicationthatneedstoconnecttotheOracledatabasetosendorretrievedata. AnOracleclientapplicationcanresideonanymachineprovidedithasOracleclientsoftware installed. [Link] responsibleforestablishingandmaintainingtheconnectionbetweentheclientapplicationand theserver,aswellasexchangingmessagesbetweenthem,usingindustrystandardprotocols. For the client application and a database to communicate, the client application must specify location details for the database it wants to connect to and the database must provide some sort of identification, or address.
Connection Requests
Local Naming
Thelocalnamingmethodstoresconnectdescriptors,identifiedbytheirnetservicename,ina local(ontheclient)[Link] locatedinthe ORACLE_HOME/network/admin directory.
Directory Naming
ThedirectorynamingmethodstoresconnectidentifiersinacentralizedLDAPcompliant directoryservertoaccessadatabaseservice.
TheeasyconnectnamingmethodenablesclientstoconnecttoanOracledatabaseserverbyusing aTCP/IPconnectstringconsistingofahostnameandoptionalportandservicename:
CONNECT username/password@host[:port][/service_name]
Forexample:
CONNECT hr/hr@my-server:1521/mydb
Theeasyconnectnamingmethodrequiresnoconfiguration.
External Naming
Instancemanagementinvolvesconfiguringparametersthataffectthebasicoperationofthe [Link] serverreadstheseparametersatdatabasestartupandmonitorsthemwhilethedatabaseis [Link],[Link] aretwotypesofparameterfiles,andwhetherthesedynamicchangesarepersistentacross databaseshutdownandstartupdependsuponthetypeofparameterfileyouareusing. Serverparameterfile This,thepreferredformofinitializationparameterfile,iscontainedinabinaryfilethatcanbe [Link] not [Link] machinethatOracleisrunningon,andispersistentacrossshutdownandstartup. Textinitializationparameterfile Thistypeofinitializationparameterfilecanbereadbythedatabaseserver,butitisnotwrittento [Link],youcansetinitializationparameterswithatexteditorforthemtobe persistentacrossshutdownandstartup.
Description Thedatabasewriterwritesmodifiedblocksfromthedatabase buffercachetothefilesondisk.Oracleallowsamaximumof20 databasewriterprocesses. [Link] entriesaregeneratedintheredologbufferoftheSGAandthelog writerprocesswritestheredologentriessequentiallyintoan onlineredologfile. Atspecifictimes,allmodifieddatabasebuffersintheSGAare writtentothedatafilesbyadatabasewriterprocess(DBWn).This [Link] forsignallingDBWn atcheckpointsandupdatingallofthe datafilesandcontrolfilesofthedatabasetoindicatethemost recentcheckpoint. Thesystemmonitorperformscrashrecoverywhenafailed instancestartsupagain. Theprocessmonitorperformsprocessrecoverywhenauser [Link] resourcesthatthefailedprocesswasusing. Whenthedatabaseisrunninginarchivelogmode,oneormore archiverprocessescopytheredologfilestoarchivalstoragewhen [Link], seeChapter9,"PerformingBackupandRecovery".
Checkpoint
Checkpoint
Atspecifictimes,allmodifieddatabasebuffersintheSGAare writtentothedatafilesbyadatabasewriterprocess(DBWn).This [Link] forsignallingDBWn atcheckpointsandupdatingallofthe datafilesandcontrolfilesofthedatabasetoindicatethemost recentcheckpoint. Thesystemmonitorperformscrashrecoverywhenafailed instancestartsupagain. Theprocessmonitorperformsprocessrecoverywhenauser [Link] resourcesthatthefailedprocesswasusing. Whenthedatabaseisrunninginarchivelogmode,oneormore archiverprocessescopytheredologfilestoarchivalstoragewhen [Link], seeChapter9,"PerformingBackupandRecovery".
Control Files
[Link] [Link],Oracle [Link],thecontrolfileshouldhave [Link],threecopiesofthecontrolfileare automaticallycreated. Ifanycontrolfilefails,[Link] controlfilecopyintact,however,youcanshutdownyourdatabaseandrecreatethefailed controlfilefromoneoftheothercontrolfiles,[Link] deletethefailedcontrolfilefromtheCONTROL_FILES initializationparameterandrestartyour [Link],dependingupon circumstances.
[Link] [Link],which arealsocalledredorecords. [Link] modifieddatafrombeingpermanentlywrittentothedatafiles,thenthechangescanbeobtained fromtheredolog,[Link], Oracleallowsamultiplexedredologsothattwoormoreidenticalcopiesoftheonlineredolog canbemaintainedondifferentdisks. Yourdatabase'[Link] [Link] isdefinedbyanumber,suchasgroup1. Thedatabaselogwriterprocesswritesredorecordsfromthememorybuffertoaredologgroup [Link].
Thelogwriterperformsthisactioninacircularfashionsothattheoldestgroupisoverwrittenby themostrecentredorecords.
Tablespaces
[Link] [Link] tempfiles. Therearevarioustypesoftablespaces,includingthefollowing: Undotablespace Adatabaserunninginautomaticundomanagementmodetransparentlycreatesandmanages [Link] forundodatakeptinthattablespace. Permanenttablespaces Thesetablespacesareusedtostorepermanentobjectsanddata. Temporarytablespaces Temporarytablespacesimprovetheconcurrenceofmultiplesortoperations,reducetheir overhead,[Link] [Link](extentallocationand deallocation)islocallymanaged.
Datafiles
[Link] tothesefilesinanOracleproprietaryformatthatcannotbereadbyprogramsotherthanthe [Link] tablespaces. Datafilescanbebrokendownintothefollowingcomponents: Segmentsandextents [Link],tablesarestoredindata segments,whereasindexesarestoredinindexsegments. [Link] ofaspecifiedsizeforasegment,butifthatextentfills,thenmoreextentscanbeallocated. Datablock Datablocks,alsocalleddatabaseblocks,arethesmallestunitofI/[Link] [Link] DBAatdatabasecreationordefaultedbyOracle. Afterthedatabasehasbeencreated,itisnotpossibletochangethedefaultblocksizewithoutre [Link],itispossibletocreatetablespacewithablocksizedifferent [Link] nonstandardblocksize,seeOracle Database Administrator's Guide.
Creating Indexes
Oracleautomaticallycreatestheindexesnecessarytosupportdataintegritydefinedwith [Link],youmight wanttoaddanindextothecolumnsyoudefineinachildtablewhenaddingaforeignkey [Link],youshouldexaminetheperformanceofyour [Link]. Afterindexcreation,Oracleautomaticallysynchronizestheindexwithanysubsequentinserts, updates,ordeletestothebasetable. IndexesaregenerallyofvaluetoqueriesandtoSQLstatementsthatneedtooperateonasingle, [Link] byincreasingtheprocessingoverheadforstatementsthatadd,modify,[Link] cases,astatementcouldusetwoormoreindexesandtheoptimizerpicksjustoneofthem. Unlessotherstatementscantakeadvantageoftheunusedindexes,theyarenotprovidingany [Link],youmightfindyourselfdeletingindexesifyoucreatetoomany.
Index Types
Astandard,Btreeindexcontainsanentryforeachvalueintheindexkeyalongwithanaddress [Link] indexinanOracledatabase. [Link] [Link], however,abitmapindexrequiresmoreoverheadduringrowoperationsonthetableandshould beusedprimarilyfordatawarehouseenvironmentsasdescribedintheOracle Database Data Warehousing Guide. AscendingandDescending Thedefaultsearchthroughanindexisfromlowesttohighestvalue,wherecharacterdatais sortedbyASCIIvalues,numericdatafromsmallesttolargestnumber,anddatefromtheearliest [Link]. Youcancauseindexsearchestoreversethesearchorderbycreatingtherelatedindexwiththe descendingoption. ColumnandFunctional Typically,anindexentryisbasedonthevalueorvaluesfoundinthetable'scolumnorcolumns. [Link],youcancreateafunctionbasedindexinwhichtheindexed [Link],tofindcharacterdatathatcanbeinmixedcase, youcoulduseafunctionbasedindextolookforthevaluesasiftheywereallinuppercase characters. SingleColumnandConcatenated Youcancreateanindexonjustonecolumn,whichiscalledasinglecolumnindex,oronmultiple columns,[Link] columnsarelikelytobeincludedintheWHERE clauseoffrequentlyexecutedSQLstatements. Forconcatenatedindexes,youshoulddefinethecolumnsusedintheindexcarefullysothatthe columnwiththefewestduplicatevaluesisnamedfirst,thecolumnwithnextfewestduplicate valuesissecond,[Link] Indexes 8-16 Oracle
Database 2 Day DBA
Managing Views
[Link] [Link],butinsteadderivetheirdatafrom [Link]. Liketables,viewscanbequeried,updated,insertedinto,anddeletedfrom,withsome [Link] provideanadditionallevelofsecuritybyrestrictingaccesstoapredeterminedsetofrowsand [Link]. ManyimportantviewsareintheSYS [Link] theychangeonlywhenachangeismadetothedatadictionary,forexample,whenanewtableis createdorauserisgrantednewprivileges. Manydatadictionarytableshavethreecorrespondingviews: ADBA_ viewdisplaysallrelevantinformationintheentiredatabase.DBA_ viewsareintended onlyforadministrators. AnALL_ viewdisplaysalltheinformationaccessibletothecurrentuser,includinginformation fromthecurrentuser'sschemaaswellasinformationfromobjectsinotherschemas,ifthe currentuserhasaccesstothoseobjectsthroughprivilegesorroles. AUSER_ [Link] privilegesarerequiredtoquerytheseviews. ThecolumnsoftheALL_,DBA_,andUSER_ viewscorrespondingtoasingledatadictionary tableareusuallynearlyidentical. [Link] namesofdynamicperformanceviews,availableonlytoadministrators,startwiththecharacters V$ andareoftenreferredtoastheV$ views. CompletedescriptionsoftheviewsintheSYS schemaarecontainedintheOracle Database Reference.
[Link] redologthathavenotalreadybeenappliedtothedatafilesatthetimeofthebackup. Tomakeaconsistentbackup,yourdatabasemusthavebeenshutdownnormallyandcannotbe [Link],allcommittedchanges intheredologarewrittentothedatafiles,sothedatafilesareinatransactionconsistentstate. Thisprocessisknownasanofflinebackupbecausetheentiredatabaseisofflinefortheduration ofthebackup. Incontrasttoaconsistentbackup,[Link] aninconsistentbackup,theonlineredologscontainchangesthathavenotyetbeenappliedtothe [Link] ARCHIVELOG [Link] mustbearchivedandbackedupalongwiththedatafilestopreservethesechanges.
[Link] datafilesrestoredfromaninconsistentbackupiscalledmediarecovery.
Media Recovery
Ifyourestorethearchivedredologsandthedatafilesfrombackups,thenyoumustperform [Link] logsnotalreadyreflectedinthedatafilesareappliedtothedatafiles,bringingthemtoa transactionconsistentstatebeforethedatabaseisopened. Mediarecoveryrequiresacontrolfile,datafiles(typicallyrestoredfrombackup),andonlineand [Link] recoveryismostoftenusedtorecoverfromamediafailure,suchasthelossofafileordisk,ora usererror,suchasthedeletionofthecontentsofatable. Therearetwoformsofmediarecovery:[Link] completerecovery,datafilesarerestoredfrombackup;allchangesfromthearchivedandonline [Link] andcanbeopenedwithnolossofcommittedchanges. Inpointintimerecovery,youreturnyourdatabasetoitscontentsatatargettimeofyour [Link] completesetofarchivedredologfilesfromthetimeofthatbackupthroughthetargettime. Duringrecovery,eachchangebetweenthebackuptimeandthetargettimeisappliedtothe datafiles. Pointintimerecoverycanreturnyourwholedatabasetoitsstateatanytimebetweenthetimeof [Link] [Link] youdonotrecoverthecompletesetofchangestoyourdatabase. EnterpriseManagerprovidesaconvenientinterfacetobothcompleteandpointintimerecovery [Link],[Link] timerecoveryisdiscussedatmorelengthinOracle Database Backup and Recovery Basics.
Planning Space Usage and Location for the Flash Recovery Area
Retention Policy and the Flash Recovery Area Space management in the flash recovery area is governed by a backup retention policy. A retention policy determines when files are obsolete, meaning that they are no longer neededtomeetyourdatarecoveryobjectives.
Retentionpoliciescanbebasedonredundancyofbackupsoronarecoverywindow. Underaredundancybasedpolicy,theflashrecoveryareaconsidersabackupofafileobsolete onlywhentheRMANrepositoryhasrecordsofaspecifiednumberofmorerecentbackupsof [Link],[Link] [Link], theMondaynightbackupbecomesredundantbecausetheTuesdayandWednesdaybackupsare available. Underarecoverywindowbasedpolicy,[Link] becomeobsoleteonlywhentheyarenolongerneededforsuccessfulcompleterecoveryorpoint [Link],assumethat [Link] agomustberetained,alongwithafullsetofarchivedredologsgeneratedsincethatbackup.
Youmusthavethepropercredentialstoperformsomeoftheconfigurationtasksforbackupand recovery,[Link] required: TheOracleuseryouusewhenyoulogintoEnterpriseManager Thehostoperatingsystemuserwhosecredentialsyouprovidewhenperformingbackupand recoverytasks ToperformorscheduleRMANtasks,youmusteitherlogintoEnterpriseManagerasauserwith SYSDBA privileges,orprovidehostoperatingsystemcredentialsforauserwhoisamemberof theDBA [Link] RMANcommandlineclient. Fortasksrequiringhostoperatingsystemcredentials,aHostCredentialsformappearsatthe bottomofthepageusedtoperformthetask(seeFigure91).EnterpriseManagerusesthe credentialswhenitinvokesRMANtoperformjobsyourequestedorscheduled.
[Link] thistaskatdatabasecreationtime,however,thenyoucancreateaflashrecoveryareaforyour databasenow. Toconfigureaflashrecoveryarea: [Link],[Link] thepermissionsforthisdirectoryallowOracletocreatefileshere. [Link],clickMaintenance. TheMaintenancepropertypageappears. [Link]/Recoverysection,selectRecovery Settings. TheRecoverySettingspageappears. [Link],enterthepathtotheflashrecoveryarealocation(thepathtothe directoryondiskyoucreatedinstep1),[Link] Apply changes to SPFILE only boxisnotchecked,thenclickApply tosaveyoursettings. Itisimportanttomonitorspaceusageintheflashrecoveryareatoensurethatitislargeenough [Link] [Link] Flash Recovery Area tonavigatetotheRecoverySettingspage,whichcontainsaFlashRecovery AreaUsagegraphshowinghowmuchspaceisallocatedtoeachtypeoffileandhowmuchspace isfree.
Performing Offline Database Backups Whenperforminganofflinebackup,thedatabaseinstanceshutsdown,thenrestartsandentersa MOUNTED [Link] background,[Link] openaffectsthepagesyouseefromEnterpriseManagerwhiletheofflinebackupruns. Afteryousubmitthebackupjob,astatuspageshouldappearindicatingthatthejobhasbeen [Link] downandmountedaspartoftheofflinebackup,andthatyoumustwaitforthebackupto complete. Whenthedatabaseisshutdownandrestarted,theEnterpriseManagerapplicationmustalso [Link],itcannot respondtoattemptstorefreshthepage. AfterEnterpriseManagerrestartsbutthedatabaseisnotopen,EnterpriseManagerreportsthatit [Link] ofthedatabaselistenerandtheinstance(unmountedormounted)asthedatabaseperformsthe [Link] orPerform Recovery.