3 Managing an Oracle Instance. Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance.

Slides:



Advertisements
Similar presentations
The Architecture of Oracle
Advertisements

Introduction to Oracle
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2007 all rights.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Managing an Oracle Instance
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Oracle Database Instance Management Oracle 10g. Ebtisam Alabdulqader Outline Management Framework. Managing Oracle instance through the Enterprise Manager.
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
Oracle9i Database Administrator: Implementation and Administration
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
Managing the Oracle RDBMS Today you will look at the basics, including: –Setting up Enterprise Manager –Using Enterprise Manager –Using Server Manager.
Oracle Database Workshop 1 Presented to IBRI CAS 27-Nov-2011 By Abdullah Alkalbani.
Chapter 3 Installing and Managing Oracle. The Oracle Universal Installer (1/4) To install Oracle9i, you use the Oracle Universal Installer (OUI), a GUI-based.
CHAPTER 2 Implementing a Database. Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Basic Oracle Architecture
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright  Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
By Lecturer / Aisha Dawood 1.  Dedicated and Shared Server Processes  Configuring Oracle Database for Shared Server  Oracle Database Background Processes.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
Database Administration 3.Using Administration Tools.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
Week 2 Lecture 1 Creating an Oracle Instance. Learning Objectives  Learn the steps for creating a database  Understand the prerequisites for creating.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
5 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
 Database Administration Oracle Database Instance Management Starting Up and Shutting Down أ. ندى الغامدي, أ. ندى الطوالة.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Managing an Oracle Instance
Oracle8/8i Database Administration
Maintaining Online Redo Log Files
Is 221: Database Administration
Oracle9i Database Administrator: Implementation and Administration
Recovering from Noncritical Losses
Oracle Architectural Components
Performing Database Recovery
Chapter 5 The Redo Log Files.
Presentation transcript:

3 Managing an Oracle Instance

Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance and opening the database Closing a database and shutting down the instance Getting and setting parameter values Managing sessions Monitoring ALERT and trace files Setting up operating system and password file authentication Creating the parameter file Starting up an instance and opening the database Closing a database and shutting down the instance Getting and setting parameter values Managing sessions Monitoring ALERT and trace files

User process Server process PGA Password file ALERT file Parameter file Overview Control files Data files Redo log files Instance SGA Shared pool

Database Administrator Users Automatically created Automatically created Granted the DBA role Granted the DBA role The two database administrator users SYS and SYSTEM are:

User SYS and SYSTEM SYS Password: change_on_install Owner of the database data dictionary SYS Password: change_on_install Owner of the database data dictionary SYSTEM Password: manager Owner of additional internal tables used by Oracle tools

Remote database administration Local database administration YesYes NoNo Do you have a secure connection? Do you want to use OS authentication? Use OS authentication Use a password file Authentication Methods

Operating System Authentication Set up the user to be authenticated by the operating system. Set REMOTE_LOGIN_PASSWORDFILE (in init.ora) to NONE. Use the following commands to connect to a database: Set up the user to be authenticated by the operating system. Set REMOTE_LOGIN_PASSWORDFILE (in init.ora) to NONE. Use the following commands to connect to a database: CONNECT / AS SYSDBA CONNECT / AS SYSOPER

Using Password File Authentication Create the password file using the password utility: Set REMOTE_LOGIN_PASSWORDFILE (init.ora) to EXCLUSIVE or SHARED Use the following command to connect to a database: Create the password file using the password utility: Set REMOTE_LOGIN_PASSWORDFILE (init.ora) to EXCLUSIVE or SHARED Use the following command to connect to a database: $orapwd file=$ORACLE_HOME/dbs/orapwU15\ password=admin entries=5 $orapwd file=$ORACLE_HOME/dbs/orapwU15\ password=admin entries=5 CONNECT INTERNAL/ADMIN

Changing the Internal Password Use the password utility on NT and UNIX to delete and create the password file. or Use the ORADIM80 utility on NT to delete and create a new password file. Use the password utility on NT and UNIX to delete and create the password file. or Use the ORADIM80 utility on NT to delete and create a new password file.

Uses of Parameters init.orainit.ora Size the SGASize the SGA Set database and instance defaultsSet database and instance defaults Set user or process limitsSet user or process limits Define various physical attributes (e.g., database block size)Define various physical attributes (e.g., database block size) Specify control files, datafiles, redo log files, etc.Specify control files, datafiles, redo log files, etc.

The Initialization Parameter File SVRMGR> CONNECT / AS SYSDBA SVRMGR> STARTUP PFILE=/DISK1/initU15.ora SVRMGR> CONNECT / AS SYSDBA SVRMGR> STARTUP PFILE=/DISK1/initU15.ora initU15.ora Instance SGA Shared pool Library cache Redo log buffer PMONDBWR SMON LGWRCKPTARCH Database buffer cache Data dictionary cache

Parameter File Example # Initialization Parameter File: initU15.ora db_name = U15 control_files = (/DISK1/control01.con, /DISK2/control02.con) db_block_size = 8192 db_block_buffers = 2000 shared_pool_size = log_buffer = 64K processes = 50 db_files = 100 log_files = 10 max_dump_file_size = background_dump_dest = (/home/disk3/user15/BDUMP) user_dump_dest = (/home/disk3/user15/UDUMP) core_dump_dest = (/home/disk3/user15/CDUMP) rollback_segments = (r01,r02,r03,r04,r05,r06,r07,r08)... # Initialization Parameter File: initU15.ora db_name = U15 control_files = (/DISK1/control01.con, /DISK2/control02.con) db_block_size = 8192 db_block_buffers = 2000 shared_pool_size = log_buffer = 64K processes = 50 db_files = 100 log_files = 10 max_dump_file_size = background_dump_dest = (/home/disk3/user15/BDUMP) user_dump_dest = (/home/disk3/user15/UDUMP) core_dump_dest = (/home/disk3/user15/CDUMP) rollback_segments = (r01,r02,r03,r04,r05,r06,r07,r08)...

OPEN MOUNT NOMOUNT SHUTDOWN All files opened as described by the control file for this instance. Control file opened for this instance. Instance started. SHUTDOWN STARTUP Startup and Shutdown in Stages

Startup and Shutdown (cont.) Starting an instance includes: Reading the parameter file Reading the parameter file Allocating the SGA Allocating the SGA Starting the background processes Starting the background processes Opening the ALERT and trace files Opening the ALERT and trace files

STARTUP Command STARTUP PFILE=/DISK1/initU15.ora Start up the instance, and open the database. STARTUP [FORCE][RESTRICT][PFILE = filename] [OPEN [RECOVER][database] | MOUNT | NOMOUNT]

STARTUP Command OPEN: enables users to access the database MOUNT: mounts the database for certain activities but does not allow user access to db NOMOUNT: creates SGA + bg processes; no access to database FORCE: aborts the running instance before performing a normal startup RESTRICT: restricted access RECOVER: begins media recovery

ALTER DATABASE Command Change state of the database from NOMOUNT to MOUNTChange state of the database from NOMOUNT to MOUNT ALTER DATABASE database MOUNT ALTER DATABASE database MOUNT Open the database as a read-only databaseOpen the database as a read-only database ALTER DATABASE database OPEN READ ONLYALTER DATABASE database OPEN READ ONLY

Opening a Database in Read- Only Mode Any database can be opened as a read-only databaseAny database can be opened as a read-only database A read-only database can be used to:A read-only database can be used to: Execute queriesExecute queries Execute disk sortsExecute disk sorts Take datafiles offline and onlineTake datafiles offline and online Perform recovery of offline data filesPerform recovery of offline data files

Shutdown mode: A AbortI Immediate T TransactionalN Normal Shutdown Options TXXOOTXXOO IXXXOIXXXO AXXXXAXXXX Shutdown Mode Allow new connections Wait until current sessions end Wait until current transactions end Force a checkpoint and close files NXOOONXOOO YES NO

Shutdown Time Immediate Transactional Time Normal Abort 2

Oracle Memory and Background Processes : Connecting to a Shared Server Red lines trace the path between the client and the instance

Oracle Memory and Background Processes : Connecting to a Dedicated Server Red lines trace the path between the client and the instance

Oracle Memory : PGA & SGA The PGA has private areas for each application The SGA is allocated when the instance starts up

Oracle Memory : SGA Components The shared pool stores parsed SQL commands for possible reuse The buffer cache stores data blocks read from the datafiles

Oracle Memory : SGA Components The cursor pool is optional and provides extra memory for program cursors The redo log buffer stores all changes to data before the changes are written to the datafiles The large pool is optional and adds more memory for better response time

Background Processes : PMON & SMON PMON (Process Monitor) cleans up remaining resources after the server and user processes end SMON (System Monitor) handles recovery if needed, cleans up old temporary tables, and restores space

Background Processes : DBWn & CKPT DBWn (Database Writer) writes modified buffers to the datafiles CKPT (Checkpoint Process) signals the DBWn process and assigns SCN

Background Processes : ARCn & LGWR ARCn (Archiver) copies redo log files to archive log files LGWR (Log Writer) writes redo log buffers to the redo log files

Background Processes : RECO & LMS RECO (Recoverer Process) fixes errors if changes across distributed databases fail LMS (Lock Manager Service) handles updates that affect data in multiple clustered databases

Dynamic Performance Views Maintained by the Oracle Server and continuously updated Contain data on disk and memory structures Contain data that is useful for performance tuning Have public synonyms with the prefix V$ Maintained by the Oracle Server and continuously updated Contain data on disk and memory structures Contain data that is useful for performance tuning Have public synonyms with the prefix V$

OPEN MOUNT NOMOUNT Data dictionary Accessing Dynamic Performance Views Dynamic performance views reading data from disk Dynamicperformance views reading from memory SHUTDOWN

Example V$PARAMETER V$SGA V$OPTION V$PROCESS V$SESSION V$VERSION V$INSTANCE Control file SGA V$THREAD V$CONTROLFILE V$DATABASE V$DATAFILE V$DATAFILE_HEADER V$LOGFILE

Displaying Current Parameter Values Use the Server Manager command: SHOW PARAMETER control Query the dynamic performance view V$PARAMETER: SELECT name FROM v$parameter WHERE name LIKE ‘%control%’; SELECT name FROM v$parameter WHERE name LIKE ‘%control%’;

Dynamic Initialization Parameters ALTER SESSION SET SQL_TRACE=true; Some initialization parameters can be modified while an instance is running. ALTER SYSTEM SET TIMED_STATISTICS=true; ALTER SYSTEM SET SORT_AREA_SIZE= DEFERRED;

Enable and Disable Restricted Session Use the STARTUP command to restrict access to a database: STARTUP RESTRICT Use the ALTER SYSTEM command to place an instance in restricted mode: ALTER SYSTEM ENABLE RESTRICTED SESSION;

Terminating Sessions SELECT sid, serial# FROM v$session WHERE username=‘SCOTT’; 1. Identify which session to terminate with the dynamic performance view V$SESSION: 2. Execute the ALTER SYSTEM command: ALTER SYSTEM KILL SESSION ‘7,15’;

Trace Files Trace files can be written by server and background processes. Oracle dumps information about errors in trace files. The ALERT file consists of a chronological log of messages and errors. Server process tracing can be enabled or disabled by: – An ALTER SESSION command – The parameter SQL_TRACE Trace files can be written by server and background processes. Oracle dumps information about errors in trace files. The ALERT file consists of a chronological log of messages and errors. Server process tracing can be enabled or disabled by: – An ALTER SESSION command – The parameter SQL_TRACE

Controlling the Trace File User process Server process USER_DUMP_DESTBACKGROUND_DUMP_DEST ALERT file Instance SGA Shared pool

Guidelines Check the ALERT file periodically to: Detect internal errors (ORA-600) and block corruption errors Monitor database operations View the nondefault initialization parameter Check the ALERT file periodically to: Detect internal errors (ORA-600) and block corruption errors Monitor database operations View the nondefault initialization parameter

Summary Creating the parameter file Starting up and shutting down an instance Understanding the use of dynamic performance views Manage sessions Describing the use of trace files Creating the parameter file Starting up and shutting down an instance Understanding the use of dynamic performance views Manage sessions Describing the use of trace files