Date post: | 15-Jan-2016 |
Category: |
Documents |
View: | 222 times |
Download: | 0 times |
Harvard University
Oracle Database Administration
Session 3
Installation
Harvard University
Announcements The TA sessions will be held at 53 Church St.,
Room 202 The first TA session starts tonight 7:35PM, after
class. Online TA session Thursday nights 7:30PM to
9:30PM Web site
http://www.courses.harvard.edu/ext/22750
Harvard University
PMON SMON
DBW0 LGWR
Library CacheDictionary
Cache
ARCH
DatafilesRedo Log Files Archived Redo
Log Files
Data BlockBuffers Redo Log BuffersShared Pool
1
23 4
Harvard University
Oracle InstanceMemory structures
DatabaseDatafiles, Control files, etc
PMON SMON DBW0 LGWR
Harvard University
The OFA Standard
/oracle($O racle_base)
/app
/u01
/(other applications)
/app
/u02
/($S ID)
/oradata
/u03
/($S ID)
/oradata
/u04 /u05
/
Harvard University
Oracle Directory Structure
bdum p udum p pfile cdum p arch create
<SID_NAM E>
adm in
netw ork dbs bin
$ORACLE_HOME
product
/u01/app/oracle ($ORACLE_BASE)
Harvard University
Files
Datafiles contain the actual data stored in a database The Parameter file contain the initialization
parameters used to create the memory area it will use, to manage the database
Control files map the physical files of the database to the logical tablespaces and online redo logs. It helps ensure the database remains consistent
Harvard University
Files Redo files contain enough information to allow Oracle
to reconstruct or back out a transaction, if the database should shutdown before these changes have been written to the disk
INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations generate redo
Alert and Trace files contain information on the health of the database and provides warnings when problems occur
Harvard University
Files
Backup files contain copies of the database files and can be used to recover the database.
The standard convention for file extensions or endings to file names are
– data files .dbf– control files .ctl– redo log files .dbf (some use .rdo)– parameter file .ora
Harvard University
Datafiles and Tablespaces
Harvard University
Oracle’s “Logical” World
A Tablespace is a logical division of a database. Each tablespace is made up of one or more datafiles. A datafile belongs to one tablespace
Harvard University
Oracle’s “Logical” World
A tablespace can belong to only one database
There must be at least two tablespaces SYSTEM and SYSAUX to create a database
Other include USERS, UNDO, TOOLS, etc.
Harvard University
Undo segments
Undo segments hold the before image of the data in a transaction
As a program begins to change the data in the database, Oracle changes the physical blocks that contain that information.
Before changing the data block buffers in the SGA or writing to disk, Oracle takes a copy of this data in an undo segment
Harvard University
Tablespace Examples
– System holds all objects owned by the sys user– SYSAUX is an auxiliary tablespace to the SYSTEM
tablespace– Rollback (RBS) (undo) is used to store the
rollback segments– Temp (Temporary) is used for sort functions.
Harvard University
Tablespace Examples
– Users is the default space for user accounts– Tools should be the default space for the system
user, after database creation.– Data holds the ‘real’ application data– Index holds the index data for the application
Harvard University
System Requirements
Memory minimum of 1024M required for Oracle11g installation
/usr/sbin/prtconf | grep “Memory size” Disk space of approx 3.3GB needed for the
Oracle11g Enterprise Edition 400MB swap minimum /usr/sbin/swap –l 400MB free space in the /tmp directory df -k /tmp
Harvard University
Operating System Requirements
O/S Solaris 9 or 10 uname -r O/S kernel patch set version for the specific
O/S version /bin/isainfo -kv
Harvard University
Operating System Requirements
We need a native window manager or some xterm emulation software. Character mode installs are not supported in 9i or 10g
The Oracle Universal Installer (OUI) is java based
Harvard University
Operating System Requirements
The Java Runtime Environment (JRE) is shipped with Oracle10g and 11g
To determine your operating system information, use the following commands
– uname –a for system information– showrev –p for patch levels
Harvard University
Root Level Setup
Configure the Kernal Create the mount points
– /u01– /u02– /u0??
Create the dba group Create the Oracle user
Harvard University
Kernel Parameters
These are the kernel parameters for Oracle11g
All are found in the /etc/system file For Solaris you can also use /etc/project Shared Memory is a region that can be
shared between different processes– shmmax 4GB (max) (4294967295)– shmmni 100
Harvard University
Kernel Parameters SHMMAX - kernel parameter controlling maximum
size of one shared memory segment SEMMNI - kernel parameter controls the maximum
number of semaphore sets. Semaphores in Unix are allocated in sets of 1 to SEMMSL.
SEMMSL - kernel parameter controls the maximum number of semaphores in a semaphore set.
SEMMNS - kernel parameter controls the maximum number of semaphores in the system
Harvard University
Kernel Parameters
What is a Semaphore– http://en.wikipedia.org/wiki/Semaphore_(program
ming)– http://searchenterpriselinux.techtarget.com/sDefi
nition/0,,sid39_gci212959,00.html
Semaphores– semmni 100– semmsl 256– semmns 256
Harvard University
Kernel Parameters
ipcs: The ipcs utility provides information about active inter-process communication facilities
– man ipcs
ipcrm: Can be used to remove a message queue, semaphore set, or shared memory ID
– man ipcrm
Harvard University
Oracle Requirements
Oracle 11g cannot be installed into an older oracle_home, that contains Oracle Software earlier than 11g
Harvard University
Unix Account
The DBA Unix group The Oracle Unix account
– Set umask to 022, sets the file creation mask– Set the DISPLAY variable DISPLAY=ora256.dce.harvard.edu:0.0 (Another example DISPLAY=128.103.81.222:0.0)
export DISPLAY
Harvard University
Unix Account
ORACLE_BASE is the directory at the top of the Oracle Software and administrative file structure. The OFA-recommended value is {mount_point}/app/oracle
ORACLE_HOME is the directory that contains the Oracle software for a given release. $ORACLE_BASE/product/release_version is the OFA standard
Harvard University
Unix Account
NLS_LANG is required if creating a database using a character set different than US7ASCII (the default)
ORA_NLS10 is required if creating a database with a storage character set other than US7ASCII.
Harvard University
Unix Account
To update the current session – . ./.profile for Bourne or Korn
To get the disk space available use the following
– df –k | cat
To describe the environment and list the variables
– env
Harvard University
Example Profile
# Local .profile # Set Environment set -a
– EDITOR=vi– TERM=vt100
– # Set Oracle Environment
– ORACLE_BASE=/export/home/oracle– ORACLE_HOME=$ORACLE_BASE/product/10.0.1test– TNS_ADMIN=$ORACLE_HOME/network/admin– ORACLE_TERM=vt100– LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH:– TMPDIR=/tmp
– # Set Path Search Directories– PATH=$ORACLE_HOME/bin:$PATH:
set +a
umask 022
Harvard University
Installation
Mount the CD– This usually mounts automatically to
/cdrom/oracle10g
If not, login as root – su root – mkdir cdrom– Manually mount the CD
mount –r –F hsfs device_name /cdrom
Harvard University
Installation
For 11g when codeset downloaded from Oracle website and expanded
– 11g/database– solaris.sparc64_11gR1_database.zip 2GB
Harvard University
Installation
Start the OUI as the Oracle user Go to the CD-ROM mount point
– cd /cdrom/oracle10g
Start the OUI – ./runInstaller &
Harvard University
Inventory
Orainventory is a repository of all installed Oracle products
Make it Oracle Home specific /var/opt/oracle for Sun Solaris
– oraInst.loc
/etc for HPUX, AIX
Harvard University
Inventory
#Oracle Installer Location File Location inst_group=dba #inventory_loc=/u01/app/oracle/oraInventory inventory_loc=/u01/app/oracle/product/oraInventory
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Harvard University
Notes
Assignment 1 TA Session Use the Blog to work together