870 likes | 990 Vues
Tutorial HK: Configuring Oracle on Linux For Peak Performance. Roger Schrag Database Specialists, Inc. www.dbspecialists.com LinuxWorld Conference & Expo August 10, 1999. Today’s Presentation. Introduction to Oracle technology Installing Oracle Managing your database
E N D
Tutorial HK:Configuring Oracle on Linux For Peak Performance Roger Schrag Database Specialists, Inc. www.dbspecialists.com LinuxWorld Conference & Expo August 10, 1999
Today’s Presentation • Introduction to Oracle technology • Installing Oracle • Managing your database • Optimizing your database • Where to get more information
About The Author • 10+ years experience with Oracle technology • Lots of Oracle DBA experience on Unix platforms • Mostly e-business and ERP systems • Presenter at Oracle user groups and conferences • Author of various white papers • Linux believer
Today’s Goals • Get a basic understanding of “How Oracle Works” • Learn the proper way to install Oracle • Gain access to accurate information
Oracle Quick Start • Learn basic Oracle concepts • Install Oracle software • Create a default database • Make the default database usable • Create application schema • Develop application • Big picture issues (backups, capacity planning…)
An Introduction to Oracle Technology • Platform independence • Database terminology • Important files • Oracle process architecture • Environment variables • Optimal flexible architecture • Interacting with a database
Platform Independence • Abstraction of platform-specific issues • Generic and platform-specific documentation • Oracle skills transfer well from one platform to another
Database Terminology • Key fundamentals • Learn them correctly • Many “Oracle-isms” Terminology
DBA • Stands for “database administrator” • Involved in logical design of a database • Performs the physical design and implementation • Assists developers with difficult database issues • Responsible for ensuring good performance, proper security, as well as backup and recovery strategies Terminology
Database • A collection of operating system files that make up one physical data store or node • Many different types of data, each with its own attributes, can be stored in one database Terminology
Database Name • Every Oracle database has a name • Eight characters or less • Default global domain name is “.WORLD” • Best to give each database a unique name and use one common domain Terminology
Instance • A set of operating system processes and shared memory structures which allow an application to access data in a database Terminology
Instance Name • Also known as SID (System Identifier) • Applications identify which instance they wish to access by name • The convention is to give an instance the same name as the database it accesses Terminology
SGA • Stands for System Global Area • A collection of shared memory structures created by an Oracle instance • Each process of the instance attaches itself to the SGA upon startup Terminology
Starting the Database • Opening a database so that applications may access it • Done by starting up an instance and mounting it to the database Terminology
Net8 or SQL*NET • Networking infrastructure that allows applications to access databases on remote servers • Was called SQL*Net before Oracle8 • Renamed to Net8 Terminology
Oracle internally uses a client/server architecture The application accessing Oracle is seen as the client, the Oracle server process is a server Client/Server Terminology
Username • Each user in an Oracle database has a unique name up to 30 characters in length • Separate usernames in the database do not need to map to separate real-life users Terminology
Schema • A separate namespace for database objects such as tables, indexes and stored procedures • Every database object resides in one schema • Each database user has one schema with the same name as their username • Username = schema Terminology
Data Dictionary • Repository of information indicating all of the users defined in the database and all of the objects they own • A set of database tables with names like user$ and tab$ Terminology
SYS and SYSTEM • SYS user owns all of the internal structures that make up the data dictionary for the database • SYS user has all privileges on the database • SYSTEM user has DBA privileges also Terminology
Control Files, Data Files, Redo Logs and Parameter Files • The physical files that make up an Oracle database Terminology
Tablespace • A named collection of one or more physical files used for storing database objects • Mask certain implementation details from application developers Terminology
Extent • One contiguous chunk of physical storage within a tablespace • Can range in size from 2 Kb to 2 Gb, but must be contiguous Terminology
Segment • A collection of extents that belong to one object • Physical storage used to hold the data for an object • Most hold the contents of a table or index, but there are other types of segments as well Terminology
Rollback Segment • Stores “undo” information for a transaction that is still in progress • Allows Oracle to back out the transaction if the application requests a rollback • Enables one session to update data while another is querying the same data Terminology
Temporary Segment • Holds a partial result set when too much data is involved to complete the operation in memory • Commonly used when sorting data for ordering, grouping, or building an index Terminology
Identifier • Most are limited to 30 bytes in length and are case-insensitive • Unless quoted, identifiers must start with a letter and may include letters, digits and certain special characters like _, $, and # Terminology
The Files That Control an Oracle Instance • Parameter file • Password file
The Files That Make Up a Database • Control files • Data files • Online redo logs • Archived redo logs
The Oracle Process Architecture • Database • Instance • Net8 • Applications
The Oracle Instance • Shared global area (SGA) • Daemon processes • Server processes
Making an Oracle Database Available 1. Start an instance 2. Mount the database 3. Open the database
Accessing a Local Database 1. Application forks an Oracle server process 2. Environment variable indicates which local database to access 3. setuid bit allows server process to attach to SGA, read data files 4. Application communicates with server process via IPC
Accessing a Remote Database 1. Net8 client resolves alias to hostname, port, and instance name (in the case of TCP/IP protocol; other protocols supported) 2. Net8 client sends a request to the Net8 listener on the database server 3. Net8 listener on database server forks an Oracle server process 4. Application communicates with server process using any supported protocol
Environment Variables • ORACLE_HOME • LD_LIBRARY_PATH • PATH • ORACLE_SID • TWO_TASK • NLS_LANG • ORA_NLS33 • ORACLE_BASE • DBA
$ORACLE_HOME • Location of Oracle software installation • For example: /u01/app/oracle/product/8.0.5 • Always required
$LD_LIBRARY_PATH • Location of Oracle shared libraries • Must include $ORACLE_HOME/lib • For example: /u01/app/oracle/product/8.0.5/lib • Always required
$PATH • Location of Oracle executables • Must include $ORACLE_HOME/bin • For example: /u01/app/oracle/product/8.0.5/bin • Always required
$ORACLE_SID • Name of local Oracle instance to access • For example: MYDB • Overridden if application specifies Net8 alias or if $TWO_TASK is set • Required if application does not specify Net8 alias and $TWO_TASK is not set
$TWO_TASK • Net8 alias for local or remote Oracle instance to access • For example: MYDB • Overridden if application specifies Net8 alias explicitly • Optional
$NLS_LANG • Language and character set of client application • Format is language_territory.CHARSETNAME • For example: american_america.US7ASCII • See platform-specific installation guide for a list of supported settings • Required when default character set is not being used
$ORA_NLS33 • Location of Oracle client NLS character set data • Typically $ORACLE_HOME/ocommon/nls/admin/data • For example: /u01/app/oracle/product/8.0.5/ocommon/nls/admin/data • Required when default character set is not being used
$ORACLE_BASE • Location of OFA directory structure • For example: /u01/app/oracle • An optional convenience
$DBA • Location of instance-related administrative files • For example: /u01/app/oracle/admin • An optional convenience
Optimal Flexible Architecture • A set of best practices for installing Oracle • Developed by Oracle Consulting and refined over the years • Observed reasonably well by the Oracle Installer • See platform-specific administrator’s reference for complete OFA specification
OFA Guidelines • Assigning and naming mount points • Directory hierarchies • Naming conventions for all files • Naming conventions for tablespaces • Policies for assigning segments to tablespaces
OFA Benefits • A standardized methodology • A good naming convention • Files organized in an easy-to-find manner • Support for multiple databases or Oracle releases on one server • Separation of Oracle software and database files • Ability to distribute I/O across many physical devices