4 Copyright © 2007, Oracle. All rights reserved. Managing the Oracle Instance.

Slides:



Advertisements
Similar presentations
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Advertisements

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.
3 Managing an Oracle Instance. Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance.
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.
5 Copyright © Oracle Corporation, All rights reserved. Using Data Dictionary and Dynamic Performance Views Cui Zhou Oracle Certified Professional.
5 Copyright © Oracle Corporation, All rights reserved. Using Data Dictionary and Dynamic Performance Views.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
1 - Oracle Server Architecture Overview
Managing Schema Objects
Harvard University Oracle Database Administration Session 2 System Level.
Managing an Oracle Instance
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
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.
Managing database instance
Using RMAN to Perform Recovery
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 Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
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
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
5 Copyright © 2004, Oracle. All rights reserved. Controlling the Database.
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.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
IT Database Administration SECTION 01. Starting Up and Shutting Down the Database Database Administration Facilities – A number of tools are available.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
3 Copyright © 2005, Oracle. All rights reserved. Creating an Oracle Database.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
1 Copyright © 2006, Oracle. All rights reserved. Introduction.
6 Copyright © 2006, Oracle. All rights reserved. Monitoring Grid Control.
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
Oracle 10g Administration Database Control and Storage Structures Copyright ©2006 Custom Training Institute.
 Database Administration Oracle Database Instance Management Starting Up and Shutting Down أ. ندى الغامدي, أ. ندى الطوالة.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Initialization Parameters
Using Data Dictionary and Dynamic Performance Views
Is 221: Database Administration
Oracle Database Architecture
Oracle Database Architecture
Performing Database Recovery
Oracle Database Architecture
Presentation transcript:

4 Copyright © 2007, Oracle. All rights reserved. Managing the Oracle Instance

Copyright © 2007, Oracle. All rights reserved Objectives After completing this lesson, you should be able to: Start and stop the Oracle database and components Use Oracle Enterprise Manager Access a database with SQL*Plus Modify database initialization parameters Describe the stages of database startup Describe database shutdown options View the alert log Access dynamic performance views

Copyright © 2007, Oracle. All rights reserved Management Framework Oracle Database 11g management framework components: Database instance Listener Management interface: –Database Control –Management agent (when using Grid Control) Listener Database Control Management agent Management interface or

Copyright © 2007, Oracle. All rights reserved Starting and Stopping Database Control $ emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved. Starting Oracle Enterprise Manager 11g Database Control started Logs are generated in directory /u01/app/oracle/product/11.1.0/db_1/ edrsr17p1.us.oracle_orcl/sysman/log $ emctl stop dbconsole Oracle Enterprise Manager 11g Database Control Release Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved. Stopping Oracle Enterprise Manager 11g Database Control Stopped.

Copyright © 2007, Oracle. All rights reserved Oracle Enterprise Manager

Copyright © 2007, Oracle. All rights reserved Accessing Oracle Enterprise Manager

Copyright © 2007, Oracle. All rights reserved Database Home Page Property pages

Copyright © 2007, Oracle. All rights reserved Other Oracle Tools SQL*Plus provides an additional interface to your database so that you can: Perform database management operations Execute SQL commands to query, insert, update, and delete data in your database SQL Developer: Is a graphical user interface for accessing your instance of Oracle Database Supports development in both SQL and PL/SQL Is available in the default installation of Oracle Database Components >SQL*Plus Init Params DB Startup DB Shutdown Alert Log Perf Views

Copyright © 2007, Oracle. All rights reserved Using SQL*Plus SQL*Plus is: A command-line tool Used interactively or in batch mode $ sqlplus hr/hr SQL*Plus: Release Beta on Wed May 30 21:41: Copyright (c) 1982, 2006, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release Beta With the Partitioning, OLAP and Data Mining options SQL> select last_name from employees; LAST_NAME Abel Ande Atkinson …

Copyright © 2007, Oracle. All rights reserved Calling SQL*Plus from a Shell Script $./batch_sqlplus.sh SQL*Plus: Release Beta on Wed May 30 21:41: Copyright (c) 1982, 2006, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release Beta With the Partitioning, OLAP and Data Mining options SQL> COUNT(*) SQL> 107 rows updated. SQL> Commit complete. SQL> Disconnected from Oracle Database 11g Enterprise Edition Release Beta With the Partitioning, OLAP and Data Mining options oracle]$ # Name of this file: batch_sqlplus.sh # Count employees and give raise. sqlplus hr/hr <<EOF select count(*) from employees; update employees set salary = salary*1.10; commit; quit EOF exit Output

Copyright © 2007, Oracle. All rights reserved Calling a SQL Script from SQL*Plus $ sqlplus SQL*Plus: Release Beta on Wed May 30 21:41: Copyright (c) 1982, 2006, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release Beta With the Partitioning, OLAP and Data Mining options DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID IT Disconnected from Oracle Database 11g Enterprise Edition Release Beta With the Partitioning, OLAP and Data Mining options select * from departments where location_id = 1400; quit script.sql Output

Copyright © 2007, Oracle. All rights reserved spfileorcl.ora Initialization Parameter Files Components SQL*Plus >Init Params DB Startup DB Shutdown Alert Log Perf Views

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Simplified Initialization Parameters DB_CACHE_SIZE DB_FILE_MULTIBLOCK _READ_COUNT SHARED_POOL_SIZE … Advanced CONTROL_FILES DB_BLOCK_SIZE PROCESSES UNDO_MANAGEMENT … Basic

Copyright © 2007, Oracle. All rights reserved Initialization Parameters: Examples ParameterSpecifies CONTROL_FILES One or more control file names DB_FILES Maximum number of database files PROCESSES Maximum number of OS user processes that can simultaneously connect DB_BLOCK_SIZE Standard database block size used by all tablespaces DB_CACHE_SIZE Size of the standard block buffer cache

Copyright © 2007, Oracle. All rights reserved Initialization Parameters: Examples ParameterSpecifies SGA_TARGET Total size of all SGA components MEMORY_TARGET Oracle systemwide usable memory SGA Database buffer cache Redo log buffer Java pool Streams pool Shared pool Large pool Shared SQL area Library cache Data dictionary cache Other I/O buffer Response queue Request queue Free memory

Copyright © 2007, Oracle. All rights reserved

Copyright © 2007, Oracle. All rights reserved Initialization Parameters: Examples ParameterSpecifies PGA_AGGREGATE_TARGET Amount of PGA memory allocated to all server processes SHARED_POOL_SIZE Size of shared pool (in bytes) UNDO_MANAGEMENT Undo space management mode to be used

Copyright © 2007, Oracle. All rights reserved Using SQL*Plus to View Parameters SQL> SELECT name, value FROM V$PARAMETER; NAME VALUE lock_name_space 2 processes 150 sessions 170 timed_statistics TRUE timed_os_statistics 0 … SQL>SHOW PARAMETER SHARED_POOL_SIZE NAME TYPE VALUE shared_pool_size big integer 0 SQL> show parameter para NAME TYPE VALUE fast_start_parallel_rollback string LOW parallel_adaptive_multi_user boolean TRUE parallel_automatic_tuning boolean FALSE parallel_execution_message_size integer 2148 parallel_instance_group string …

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Changing Initialization Parameter Values Static parameters: –Can be changed only in the parameter file –Require restarting the instance before taking effect Dynamic parameters: –Can be changed while database is online –Can be altered at: — Session level — System level –Are valid for duration of session or based on SCOPE setting –Are changed by using ALTER SESSION and ALTER SYSTEM commands

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Changing Parameter Values: Examples SQL> ALTER SESSION SET NLS_DATE_FORMAT ='mon dd yyyy'; Session altered. SQL> SELECT SYSDATE FROM dual; SYSDATE jun SQL> ALTER SYSTEM SET SEC_MAX_FAILED_LOGIN_ATTEMPTS=2 COMMENT='Reduce from 10 for tighter security.' SCOPE=SPFILE; System altered.

Copyright © 2007, Oracle. All rights reserved Database Startup and Shutdown or Components SQL*Plus Init Params >DB Startup DB Shutdown Alert Log Perf Views

Copyright © 2007, Oracle. All rights reserved Starting Up an Oracle Database Instance

Copyright © 2007, Oracle. All rights reserved Starting Up an Oracle Database Instance: NOMOUNT OPEN MOUNT NOMOUNT SHUTDOWN Instance started STARTUP

Copyright © 2007, Oracle. All rights reserved Starting Up an Oracle Database Instance: MOUNT OPEN MOUNT NOMOUNT SHUTDOWN Control file opened for this instance Instance started STARTUP

Copyright © 2007, Oracle. All rights reserved Starting Up an Oracle Database Instance: OPEN OPEN MOUNT NOMOUNT SHUTDOWN All files opened as described by the control file for this instance Control file opened for this instance Instance started STARTUP

Copyright © 2007, Oracle. All rights reserved Startup Options: Examples SQL> startup SQL> alter database mount; SQL> alter database open; SQL> startup nomount

Copyright © 2007, Oracle. All rights reserved Shutting Down an Oracle Database Instance Components SQL*Plus Init Params DB Startup >DB Shutdown Alert Log Perf Views

Copyright © 2007, Oracle. All rights reserved Shutdown Modes A No T No Yes I No Yes Shutdown Mode Allows new connections Waits until current sessions end Waits until current transactions end Forces a checkpoint and closes files N No Yes Shutdown modes: A = ABORT I = IMMEDIATE T = TRANSACTIONAL N = NORMAL

Copyright © 2007, Oracle. All rights reserved Shutdown Options During: SHUTDOWN NORMAL or SHUTDOWN TRANSACTIONAL or SHUTDOWN IMMEDIATE Consistent database (clean database) On the way down: Uncommitted changes rolled back, for IMMEDIATE Database buffer cache written to data files Resources released On the way up: No instance recovery

Copyright © 2007, Oracle. All rights reserved Shutdown Options: Examples SQL> shutdown SQL> shutdown immediate SQL> shutdown abort SQL> shutdown transactional

Copyright © 2007, Oracle. All rights reserved Shutdown Options During: SHUTDOWN ABORT or Instance failure or STARTUP FORCE Inconsistent database (dirty database) On the way down: Modified buffers not written to data files Uncommitted changes not rolled back On the way up: Online redo log files used to reapply changes Undo segments used to roll back uncommitted changes Resources released

Copyright © 2007, Oracle. All rights reserved Using SQL*Plus to Start Up and Shut Down oracle]$ sqlplus dba1/oracle as sysdba SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area bytes Fixed Size bytes Variable Size bytes Database Buffers bytes Redo Buffers bytes Database mounted. Database opened. SQL>

Copyright © 2007, Oracle. All rights reserved Blackout Administration

Copyright © 2007, Oracle. All rights reserved

Copyright © 2007, Oracle. All rights reserved Viewing the Alert Log Database Home page > Related Links region > Alert Log Content Components SQL*Plus Init Params DB Startup DB Shutdown >Alert Log Perf Views

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Viewing the Alert History

Copyright © 2007, Oracle. All rights reserved Using Trace Files Each server and background process can write to an associated trace file. Error information is written to the corresponding trace file. Automatic diagnostic repository (ADR) –Is a systemwide central tracing and logging repository –Stores database diagnostic data such as: — Traces — Alert log — Health monitor reports

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Dynamic Performance Views Provide access to information about changing states of the instance memory structures Session data Wait events Memory allocations Running SQL UNDO usage Open cursors Redo log usage …and so on Oracle instance Components SQL*Plus Init Params DB Startup DB Shutdown Alert Log >Perf Views

Copyright © 2007, Oracle. All rights reserved Dynamic Performance Views: Usage Examples SQL> SELECT sql_text, executions FROM v$sql WHERE cpu_time > ; SQL> SELECT * FROM v$session WHERE machine = 'EDRSR9P1' and logon_time > SYSDATE - 1; SQL> SELECT sid, ctime FROM v$lock WHERE block > 0; a b c

Copyright © 2007, Oracle. All rights reserved Dynamic Performance Views: Considerations These views are owned by the SYS user. Different views are available at different times: –The instance has been started. –The database is mounted. –The database is open. You can query V$FIXED_TABLE to see all the view names. These views are often referred to as “v-dollar views.” Read consistency is not guaranteed on these views because the data is dynamic.

Copyright © 2007, Oracle. All rights reserved Data Dictionary: Overview SELECT * FROM dictionary; Tables Indexes Views Users Schemas Procedures …and so on Schema Constraints Indexes Views Sequences Temp Tables >Data Dict

Copyright © 2007, Oracle. All rights reserved Data Dictionary Views ALL_ views DBA_ views N/A Subset of Is usually the same as ALL_ except for the missing OWNER column (Some views have abbreviated names as PUBLIC synonyms.) Everything that the user owns Everyone USER_ Includes user’s own objects Everything that the user has privileges to see Everyone ALL_ May have additional columns meant for DBA use only EverythingDBA DBA_ NotesContentsWho Can Query

Copyright © 2007, Oracle. All rights reserved Notes Only

Copyright © 2007, Oracle. All rights reserved Data Dictionary: Usage Examples SELECT USERNAME, ACCOUNT_STATUS FROM dba_users WHERE ACCOUNT_STATUS = 'OPEN'; SELECT table_name, tablespace_name FROM user_tables; SELECT sequence_name, min_value, max_value, increment_by FROM all_sequences WHERE sequence_owner IN ('MDSYS','XDB'); a b c DESCRIBE dba_indexes; d

Copyright © 2007, Oracle. All rights reserved Summary In this lesson, you should have learned how to: Start and stop the Oracle database and components Use Enterprise Manager and describe its high-level functionality Access a database with SQL*Plus Modify database initialization parameters Describe the stages of database startup Describe database shutdown options View the alert log Access dynamic performance views

Copyright © 2007, Oracle. All rights reserved Practice 4 Overview: Managing the Oracle Instance This practice covers the following topics: Navigating in Enterprise Manager Viewing and modifying initialization parameters Stopping and starting the database instance Viewing the alert log Connecting to the database by using SQL*Plus

Copyright © 2007, Oracle. All rights reserved