database administration judy riniker and greg girard from the ksu information systems office

38
Database Database Administration Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Upload: august-wilkins

Post on 25-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database AdministrationDatabase Administration

Judy Riniker and Greg Girard from the KSU

Information Systems Office

Page 2: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

TopicsTopics

KSU Information System Office, KSU Information System Office, Database AdministrationDatabase Administration

Oracle Database ArchitectureOracle Database Architecture

Database AdministrationDatabase Administration

Short Demo of OEMShort Demo of OEM

Page 3: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Database Administration StaffDatabase Administration Staff

• CA IDMS Database Administrators (2)CA IDMS Database Administrators (2)

– Student data 7 GbStudent data 7 Gb

– Student financial and loan data 9 GbStudent financial and loan data 9 Gb

– Total 17 Gb of Production DataTotal 17 Gb of Production Data

– Test and developmentTest and development

– OS/390 OS/390

Page 4: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– Human ResourcesHuman Resources

• Production Production 23 Gb23 Gb

• Stress Test Stress Test 23 Gb23 Gb

• DevelopmentDevelopment 2.1 Gb2.1 Gb

• TrainingTraining 1.7 Gb1.7 Gb

• DeliveredDelivered 1.2 Gb1.2 Gb

• UpgradeUpgrade 436 Mb436 Mb

Page 5: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– FacilitiesFacilities

• FinancialsFinancials– Production Production 6.8 Gb6.8 Gb– Test Test 6.9 Gb6.9 Gb– DevelopmentDevelopment 4.2 Gb4.2 Gb

• Facilities Management SystemFacilities Management System– ProductionProduction 2.1 Gb2.1 Gb– TestTest 2.1 Gb2.1 Gb– DevelopmentDevelopment 2.1 Mb2.1 Mb

Page 6: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– Student Related SystemsStudent Related Systems

• KATS Interface KATS Interface 220 Mb220 Mb

• DARS DARS – ProductionProduction 3.6 Gb3.6 Gb– TestTest 3.6 Gb3.6 Gb

– HelpdeskHelpdesk 685 Mb685 Mb

– Department Department 4.4 Gb4.4 Gb

Page 7: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– TelecommunicationsTelecommunications

• Production BillingProduction Billing 13.4 Gb13.4 Gb

• Production BillingProduction Billing 1.7 Gb 1.7 Gb

• Production Call loadingProduction Call loading 4.5 Gb 4.5 Gb

• Production Directory Production Directory 1.0 Gb 1.0 Gb

• Test DirectoryTest Directory 1.0 Gb 1.0 Gb

Page 8: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– Division of Continuing Education Division of Continuing Education

• Production Production 1.1 Gb1.1 Gb

• TestTest 847 Mb847 Mb

• DevelopmentDevelopment 1.7 Gb1.7 Gb

• DevelopmentDevelopment 807 Mb807 Mb

• DesignDesign 820 Mb 820 Mb

Page 9: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

KSU Information Systems KSU Information Systems OfficeOffice

Oracle Database Administrators (5)Oracle Database Administrators (5)– Application/Database Utilities & Application/Database Utilities &

ToolsTools• OEM OEM 590 Mb590 Mb

• Internet DirectoryInternet Directory 500 Mb500 Mb

• Version ControlVersion Control 285 Mb285 Mb

• ISO DevelopmentISO Development 1.6 Gb1.6 Gb

• Video ServerVideo Server 2 Gb Raw2 Gb Raw

Page 10: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Tables, Indexes, ViewsTables, Indexes, Views• Peoplesoft 7.5 HRMS (HR)Peoplesoft 7.5 HRMS (HR)

– TablesTables 40994099– Indexes Indexes 59475947– ViewsViews 29222922

• Oracle Financials (Facilities Accounting)Oracle Financials (Facilities Accounting)– TablesTables 23442344– IndexesIndexes 50195019– ViewsViews 28112811

• FAMIS (Facilities Work Management) FAMIS (Facilities Work Management) – TablesTables 333333– IndexesIndexes 202202– ViewsViews 31 31

Page 11: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Server HardwareServer Hardware

• Sun Microsystems: E4500, E1000, E450, Sun Microsystems: E4500, E1000, E450, Sparc10Sparc10

• Storage: RAID 10 - Striped and mirroredStorage: RAID 10 - Striped and mirrored

• CPUs range from 50 MHz Sparc to 248 CPUs range from 50 MHz Sparc to 248 MHz UltraSparcMHz UltraSparc

• RAM 192 Mb to 3G.RAM 192 Mb to 3G.

• CNS does the Unix System CNS does the Unix System AdministrationAdministration

Page 12: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Oracle Database InstanceOracle Database Instance

• Architecture Architecture – Memory AreasMemory Areas

– ProcessesProcesses

– Physical FilesPhysical Files

Page 13: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Oracle Database OverviewOracle Database Overview

Data filesParameter Control Redo Log

Archive Database

RedoLogBuffer

DataBufferCache

Library Cache

Data Dict. Cache

Shared Pool SGAInstance

SMON DBW0 PMON CKPT ARCHLGWR

UserProcess

ServerProcess

PGA

MemoryProcessesPhysical Files

Page 14: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

• Memory area used to store database Memory area used to store database information that is shared by information that is shared by database processesdatabase processes– Data Block Buffer CacheData Block Buffer Cache

• holds data blocks that are read from holds data blocks that are read from data segments in the database such as data segments in the database such as tables and indexestables and indexes

• Size is set by DB_BLOCK_BUFFERS in the Size is set by DB_BLOCK_BUFFERS in the parameter file; but should typically be 1-parameter file; but should typically be 1-2% of the total size of the database.2% of the total size of the database.

• LRU Least Recently Used AlgorithmLRU Least Recently Used Algorithm

SGA Area : System Global

Page 15: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

– Shared SQL PoolShared SQL Pool • During the parse phase of a SQL query, During the parse phase of a SQL query,

the database server process uses this the database server process uses this area to compile the SQL statementarea to compile the SQL statement

• Stores the data dictionary cache and the Stores the data dictionary cache and the library cachelibrary cache

• Size is set by SHARED_POOL_SIZE in the Size is set by SHARED_POOL_SIZE in the parameter file.parameter file.

SGA: System Global Area

Page 16: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:• Shared SQL Pool Shared SQL Pool

– Data dictionary CacheData dictionary Cache• Information about database objects is Information about database objects is

stored in the data dictionary tables such stored in the data dictionary tables such as user account data, table descriptions, as user account data, table descriptions, privileges, datafile names, etc.privileges, datafile names, etc.

• When the information is needed by the When the information is needed by the database, the data dictionary tables are database, the data dictionary tables are read and the data returned is stored in read and the data returned is stored in the SGA in the dictionary cachethe SGA in the dictionary cache

• If too small, database will have to If too small, database will have to repeatedly query the data dictionary repeatedly query the data dictionary tables for information. tables for information.

• LRU Least Recently Used AlgorithmLRU Least Recently Used Algorithm

Page 17: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:• Shared SQL Pool Shared SQL Pool

– Library CacheLibrary Cache• Stores the most recently used SQL Stores the most recently used SQL

statements statements – Text of the SQL StatementText of the SQL Statement– Parse Tree : Compiled version of the Parse Tree : Compiled version of the

statementstatement– Execution Plan: Steps take when executing Execution Plan: Steps take when executing

the statementthe statement

• If a SQL statement is reexecuted and a If a SQL statement is reexecuted and a shared SQL area already contains the shared SQL area already contains the execution plan for the statement, the execution plan for the statement, the server process does not need to parse server process does not need to parse the statement. the statement.

Page 18: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

– Redo Log BufferRedo Log Buffer • Describe the changes that are made to Describe the changes that are made to

the databasethe database

• ““Re-do” entries are written in the on-line Re-do” entries are written in the on-line log files so they can be used in roll log files so they can be used in roll forward operations during database forward operations during database recoveriesrecoveries

• The entries are first stored in the SGA The entries are first stored in the SGA area in the Redo Log Buffer and then are area in the Redo Log Buffer and then are periodically written to the physical files.periodically written to the physical files.

• Size is set by LOG_BUFFER in the Size is set by LOG_BUFFER in the parameter file.parameter file.

SGA: System Global Area

Page 19: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

– Large PoolLarge Pool • Optional areaOptional area

• Can be dedicated to supporting large Can be dedicated to supporting large SQL statementsSQL statements

• Size is set by LARGE_POOL_SIZE in the Size is set by LARGE_POOL_SIZE in the parameter file.parameter file.

• Can also use parameter Can also use parameter SHARED_POOL_RESERVED_SIZE instead SHARED_POOL_RESERVED_SIZE instead of large pool.of large pool.

SGA: System Global Area

Page 20: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

– Java PoolJava Pool • Services the parsing requirements for Services the parsing requirements for

Java commandsJava commands

• Size is set by JAVA_POOL_SIZE in the Size is set by JAVA_POOL_SIZE in the parameter file.parameter file.

SGA: System Global Area

Page 21: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Memory Areas:Memory Areas:

– Memory that is used by a single Oracle Memory that is used by a single Oracle user processuser process

– PGA is not sharable PGA is not sharable

– Contains:Contains:• Sort areaSort area

• Session informationSession information

• Cursor state (stage in processing current Cursor state (stage in processing current SQL statements)SQL statements)

PGA: Program Global Area

Page 22: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Oracle Database OverviewOracle Database Overview

Data filesParameter Control Redo Log

Archive Database

RedoLogBuffer

DataBufferCache

Library Cache

Data Dict. Cache

Shared Pool SGAInstance

SMON DBW0 PMON CKPT ARCHLGWR

UserProcess

ServerProcess

PGA

MemoryProcessesPhysical Files

Page 23: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

ProcessesProcesses• SMON - System MonitorSMON - System Monitor

– Checks for consistency of the databaseChecks for consistency of the database

– If necessary, initiates recovery of the If necessary, initiates recovery of the database when the database is opendatabase when the database is open

– Coalesces contiguous free extents into Coalesces contiguous free extents into larger free extents.larger free extents.

Page 24: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

ProcessesProcesses• PMON - Process MonitorPMON - Process Monitor

– Cleans up failed user processesCleans up failed user processes• If an update fails, PMON releases the row If an update fails, PMON releases the row

lockslocks

• DBWR - Database WriterDBWR - Database Writer– Manages the contents of the data block Manages the contents of the data block

buffer cache and the dictionary cachebuffer cache and the dictionary cache

– Performs batch writes of changed blocks Performs batch writes of changed blocks from the SGA area to the data files from the SGA area to the data files

Page 25: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

ProcessesProcesses• LGWR - Log WriterLGWR - Log Writer

– Manages the writing of the contents of the Manages the writing of the contents of the redo log buffer to the online redo log filesredo log buffer to the online redo log files

• CKPT - CheckpointsCKPT - Checkpoints– Updates database status information in Updates database status information in

the control filesthe control files

– Checkpoints cause DBWR to write all of Checkpoints cause DBWR to write all of the blocks that have been modified since the blocks that have been modified since the last checkpoint to the data files.the last checkpoint to the data files.

Page 26: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

ProcessesProcesses• ARCH - ArchiveARCH - Archive

– After the first redo log is filled, the After the first redo log is filled, the second redo log will go into use, then second redo log will go into use, then the third,…then back to the firstthe third,…then back to the first

– ARCH will make copy of the each redo ARCH will make copy of the each redo log before is overwrittenlog before is overwritten

– Serves in recovering a databaseServes in recovering a database

Page 27: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Oracle Database OverviewOracle Database Overview

Data filesParameter Control Redo Log

Archive Database

RedoLogBuffer

DataBufferCache

Library Cache

Data Dict. Cache

Shared Pool SGAInstance

SMON DBW0 PMON CKPT ARCHLGWR

UserProcess

ServerProcess

PGA

MemoryProcessesPhysical Files

Page 28: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Physical FilesPhysical Files• Database filesDatabase files

– Control FilesControl Files (control1.ctl)(control1.ctl)• Records information about all the files in Records information about all the files in

a databasea database

• Serves to maintain consistency and aid Serves to maintain consistency and aid in recoveryin recovery

– Redo Logs (redo_1a.log)Redo Logs (redo_1a.log)• Log of all transactionsLog of all transactions

• Used in recovering in event of a Used in recovering in event of a database crashdatabase crash

• 3 or more3 or more

Page 29: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Physical FilesPhysical Files• Database filesDatabase files

– Data filesData files• Database objects are stored in Database objects are stored in

tablespaces. Tablespace is a logical tablespaces. Tablespace is a logical division of the database.division of the database.

– System Tablespace (system.dbf file) System Tablespace (system.dbf file) » Data dictionaryData dictionary

– Temporary Tablespace (temp.dbf file)Temporary Tablespace (temp.dbf file)» dynamically created objects that store data dynamically created objects that store data

during large sorting operationsduring large sorting operations– Rollback Tablespace (rbs.dbf file)Rollback Tablespace (rbs.dbf file)

» Maintain both statement-level and Maintain both statement-level and transaction-level read consistency with in the transaction-level read consistency with in the databasedatabase

– Data Tablespace (hrlarge.dbf file)Data Tablespace (hrlarge.dbf file)» User and application tables,objectsUser and application tables,objects

Page 30: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Physical FilesPhysical Files• Database filesDatabase files

– Data filesData files• Each tablespace is made of 1 or more Each tablespace is made of 1 or more

data filesdata files

• Creating a new tablespace requires Creating a new tablespace requires creating a new data filecreating a new data file

– Alert Log (alert.log)Alert Log (alert.log)• Records commands and command results Records commands and command results

of major events in the life of a databaseof major events in the life of a database– Tablespace creationsTablespace creations– Log switchingLog switching– Startup and shutdownsStartup and shutdowns– Problems (internal errors)Problems (internal errors)

Page 31: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Basic Database Basic Database • One or more data filesOne or more data files

• One or more control filesOne or more control files

• Two or more online redo logsTwo or more online redo logs

– InternallyInternally• Users/SchemasUsers/Schemas

• Rollback segmentsRollback segments

• User TablespacesUser Tablespaces

• Data dictionary tablesData dictionary tables

• User objectsUser objects

Page 32: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Basic Database Basic Database – ServerServer

• SGA SGA

• SMONSMON

• PMONPMON

• DBWRDBWR

• LGWRLGWR

• CKPTCKPT

• ARCHARCH

• Users PGAUsers PGA

Page 33: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database Administration Database Administration

• Because an Oracle database system can be quite large and have many users, someone or some group of people must manage this system. The database administrator (DBA) is this manager. Every database requires at least one person to perform administrative duties.

Page 34: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database Administration Database Administration

• Installing and upgrading the Oracle server and application tools

• Allocating system storage and planning future storage requirements for the database system

• Creating primary database storage structures (tablespaces) after application developers have designed an application

Page 35: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database Administration Database Administration

• Creating primary objects (tables, views, indexes) once application developers have designed an application

• Modifying the database structure, as necessary, from information given by application developers

• Enrolling users and maintaining system security

Page 36: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database Administration Database Administration

• Ensuring compliance with database vendor license agreement

• Controlling and monitoring user access to the database

• Monitoring and optimizing the performance of the database

• Planning for backup and recovery of database information

Page 37: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

Database Administration Database Administration • Maintaining archived data on tape

• Backing up and restoring the database – Logical - Database records

• Export/Import

– Physical - redo logs, data and control files• Offline (Cold)

• Online (Hot)

• Contacting database vendor for technical support

Page 38: Database Administration Judy Riniker and Greg Girard from the KSU Information Systems Office

ToolsTools

• OEMOEM

• ScriptsScripts

• Oracle Support SiteOracle Support Site

Demo of

OEM