Database Administration 3.Using Administration Tools.

Slides:



Advertisements
Similar presentations
The Architecture of Oracle
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
3 Managing an Oracle Instance. Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance.
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.
5 Copyright © Oracle Corporation, All rights reserved. Using Data Dictionary and Dynamic Performance Views.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
1 - Oracle Server Architecture Overview
Backup The flip side of recovery. Types of Failures Transaction failure –Transaction must be aborted System failure –Hardware or software problem resulting.
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Database Backup and Recovery
INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all.
INTRODUCTION TO ORACLE
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
Oracle9i Database Administrator: Implementation and Administration
Redo Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Log File Waits  Redo is written to disk when  User commits  Log Buffer.
7 Maintaining Redo Log Files. 7-2 Objectives Explaining the use of online redo log files Obtaining log and archive information Controlling log switches.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Using RMAN to Perform Recovery
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Oracle Database Administration
Managing the Oracle RDBMS Today you will look at the basics, including: –Setting up Enterprise Manager –Using Enterprise Manager –Using Server Manager.
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.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
1Introduction Objectives 1-2 Course Objectives 1-3 Oracle Products 1-4 Relational Database Systems 1-5 How the Data Is Organized 1-6 Integrity Constraints.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
7202ICT – Database Administration
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
CHAPTER 5 Managing Control Files and Online Redo Logs.
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.
2 Using Administration Tools Objectives Using the Server Manager Line Mode Identifying administration applications supplied with the Oracle Enterprise.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
44 Creating a Database. 4-2 Objectives Preparing the operating system Preparing the parameter file Creating the database Preparing the operating system.
IT Database Administration SECTION 02. CREATING DATABASES Creating a Database: Overview 1. Plan the physical design and storage structures 2. Back.
Week 2 Lecture 1 Creating an Oracle Instance. Learning Objectives  Learn the steps for creating a database  Understand the prerequisites for creating.
Creating an Oracle Database. Considerations before creating a DB Planning for Database Creation –Select the standard database block size. –Use an undo.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and 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.
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.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Week 2 Lecture 2 Data Dictionary Views and Control Files.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
Oracle Database Architectural Components
Maintaining Online Redo Log Files
Using Data Dictionary and Dynamic Performance Views
Oracle9i Database Administrator: Implementation and Administration
Maintaining the Control File
Performing Database Recovery
Chapter 5 The Redo Log Files.
Database administration
Presentation transcript:

Database Administration 3.Using Administration Tools

Database Administration Using Administration Tools 1. Using the Server Manager Line Mode 2. Identified the application supplied with OEM 3.Using OEM component

Database Administration Using Administration Tools On UNIX svrmgrl svrmgrl svrmgrl command=“connect scott/tiger” On NT svrmgrl30 svrmgrl30

Database Administration Using Administration Tools On UNIX svrmgrl svrmgrl svrmgrl command=“connect scott/tiger” On NT svrmgrl svrmgrl

Database Administration Using Administration Tools On NT svrmgrl svrmgrl

Database Administration Using Administration Tools 1. Exit,remark, set,show,spool 2. Connect/disconnect,describe,execute show errors,show parameter,show sga 3. Connect … as sysdba/sysoper archive log,recover database,startup/shutdown set charwidth 20, spool crdb.log,show all,show spool

Database Administration Using Administration Tools OEM Architecture OEM Console Intelligent Agent OEM Repository

Database Administration Using Administration Tools Starting and using OEM - Create repository automatically by invoking OEM - define services auto/manual discovery - set up security using preferred - using OEM applications

Database Administration

4. Creating a database

Database Administration Creating a database 1. Preparing the operating system 2. Preparing the parameter file 3. Create the database

Database Administration Creating a database 1. Preparing the operating system 2. Preparing the parameter file 3. Create the database

Database Administration Creating a database. A privileged account by one of the following ways by OS or password file. Memory to start the instance. Sufficient disk space for planned database Multiplex the control,log file and balance Data files Optimal Flexible Architecture - OFA

Database Administration Creating a database Optimal Flexible Architecture - OFA - ORACLE_BASE ORACLE_HOME -The OFA directory structure for NT is not identical to that for UNIX because of naming conversion and lack of symbolic links - OFA copy and the directory information

Database Administration Creating a database On Unix - Created automatically during the installation - Created manually after install On NT - Created automatically using database assistant - Created manually after install

Database Administration Creating a database Manually create a database - decide the instance, database and character set - set the OS variables - prepare the parameter file - create a password file - start the instance - create the database - Run scripts to generate the data dictionary and further steps

Database Administration Creating a database OS Environment variables - ORACLE_HOME /u01/app/oracle/product/ ORACLE_SID - ORACLE_BASE /u01/app/oracle - ORA_NLS33 $ORACLE_HOME/ocommon/nls/admin/data - PATH $ORACLE_HOME/bin In Korn shell.profile $ORACLE_SID=U16; export ORACLE_SID In C shell source.cshrc $setenv ORACLE_SID U16

Database Administration Creating a database On NT - Set the variable ORACLE_SID C:\> set ORACLE_SID=U16 - Create the service and the password file with ORADIM Editing the Parameter file DB_NAME CONTROL_FILES DB_BLOCK_SIZE

Database Administration Creating a database 1. Connect as SYSDBA/INTERNAL 2. STARTUP NOMOUNT 3. Creating the database 4. Creating data dictionary view and standard packages Steps : 1. Syntax errors in the SQL scripts 2. Files that should be created already exist 3. OS errors such as permission or insufficient space errors Troubleshooting :

Database Administration Creating a database After creation of the database 1. Data file for system 2. Control and redo logs 3. SYS/change_on_install 4. SYSTEM/manager 5. system Rollback segment 6. Internal tables 7. System views

Database Administration 5.Data Dictionary and Standard Packages

Database Administration Data Dictionary Views and Standard Packages The data dictionary provides information about - Logical and physical structure - Names,definitions and space allocations of schema objects - Integrity constraints - Database user and privileges - Auditing Created by - Created with catalog.sql,catproc.sql script - base table created with sql.bsq scripts Data dictionary Views DBA_XXX, ALL_XXX,USER_XXX

Database Administration Data Dictionary Views and Standard Packages Dict dba_tables,dba_objects,dba_tab_columns,dba_constraints dba_users,dba_sys_privs,dba_roles dba_extents,dba_free_space,dba_segments dba_rollback_segs,dba_data_files,dba_tablespaces dba_audit_trail,dba_audit_objects,dba_audit_obj_opts

Database Administration Data Dictionary Views and Standard Packages Cat*.sql catalog and DD info. Dbms*.sql DB package specification prvt*.plb Wrapped database package code utl*.sql Views and tables for database utilities UNIX $ORACLE_HOME/rdbms/admin NT %ORACLE_HOME%/rdbms80/admin

Database Administration Data Dictionary Views and Standard Packages Oracle supplied Packages DBMS_LOB,DBMS_SESSION,DBMS_SPACE,DBMS_ROWID, DBMS_SHARED_POOL,DBMS_UTILITY DBMS_SHARED_POOL.KEEP (UNKEEP) DBMS_UTILITY.ANALIZE_SCHEMA DBMS_ROWID.ROWID_INFO Check the status about the stored objects

Database Administration 6. Maintaining The Control File

Database Administration Maintaining The Control File - The usage of the control file - Examining the contents of control file - Obtaining the control file information - Multiplexing the control file

Database Administration Maintaining The Control File Using of control file - binary file is necessary for the database start and operate successfully - for locate the data file and log files - must be available whenever the database mounted and opened - about the database consistency used during recovery

Database Administration The contents of the control file - Database name and sid - Names and location of log files - Names of the tablespace - The time stamp of database creation - Checkpoint information - Log history - Backup info for Recovery Manager Maintaining The Control File

Database Administration The size of the control file depend on - MAXLOGFILES - MAXLOGMEMBERS - MAXLOGHISTORY - MAXDATAFILES - MAXINSTANCES Maintaining The Control File

Database Administration Obtaining control file info - V$CONTROLFILE - NAME - V$PARAMETER - NAME ‘control_files’ - VALUE - V$CONTROLFILE_RECORD_SECTION - type - records_size - records_total - records_used Maintaining The Control File

Database Administration Multiplexing the control file to avoid a single point of database failure control_files=(/disk1/control1.con, /disk2/control2.con Steps : 1. Shutdown database 2. Make a copy of the cotrol file 3. Edit or Add the CONTROL_FILES parameters 4. Restart the database Backup the control file : alter database backup controlfile to name - Created at $ORACLE_HOME/database alter database backup controlfile to trace - Created at BACKGROUND_DUMP_DEST Maintaining The Control File

Database Administration 7. Maintaining Redo Log File

Database Administration - the usage of redo log files - obtain the log and archive information - controlling log switches and checkpoint - multiplexing and maintaining online redo log files - planning online redo log files - troubleshooting the redo log file problems Maintaining The LOG Files

Database Administration The usage of redo log files - minimize the loss of data in the database - used for the recovery - record all the changes made to the database Redo log groups and members Maintaining The LOG Files Disk1 Disk2 Group1 member Group2 member Group3 member

Database Administration Parameters for redo logs MAXLOGFILES (255) MAXLOGMEMBERS (CREATE DATABASE) LOG_FILES Redo log and LGWR LGWR process under the following case - when commit occurs - when redo log buffer pool become one third full - when LGWR time out occurs (every 3 seconds0 - before the DBWR write the modified blocks to the data files Maintaining The LOG Files

Database Administration Maintaining The LOG Files Log switch - switch form one log group to the other Checkpoint - all the database write to the datafile by DBWR - CKPT updates the headers of all data and controls files Checkpoint occurs in the following situations - every log switch - when database shutdown( not abort) - forced by LOG_CHECKPOINT_INTERVAL & LOG_CHECKPOINT_TIMEOUT - when manually requested by the DBA

Database Administration Maintaining The LOG Files NOARCHIVELOG mode - the log files are overwritten each time an redo logs filled or switch occur ARCHIVELOG mode - the ARCH archive the log to archive LOG - manually or automatically LOG_ARCHIVE_START=TRUE/FALSE ARCHIVE LOG LIST V$DATABASE V$LOG V$THREAD V$INSTANCE V$LOGFILE more information in BACKUP/RECOVERY course

Database Administration Maintaining The LOG Files Force log switch with the command ALTER SYSTEM SWITCH LOGFILE; Control the check point with - LOG_CHECKPOINT_INTERVAL set to high value > log file size, not to 0 - LOG_CHECKPOINT_TIMEOUT set to 0 disable the time based checkpoint

Database Administration Maintaining The LOG Files Add database Redo log file groups ALTER DATABASE ADD LOGFILE [group n] file name eg. ALTER DATABASE ADD LOGFILE ( ‘/disk3/log3a.rdo’, ‘/disk4/log3b.rdo’ ) size 1M; Add database Redo log file members ALTER DATABASE ADD LOGFILE member to GROUP eg. ALTER DATABASE ADD LOGFILE MEMBER ‘/disk4/log1b.rdo’ to GROUP1, ‘/disk4/log2b.rdo’ to GROUP2,;

Database Administration Maintaining The LOG Files Drop online Redo log groups ALTER DATABASE DROP LOGFILE GROUP 3; Drop online Redo log members ALTER DATABASE DROP LOGFILE member ‘/disk4/log2b.dbf’; Clear on line redo log files ALTER DATABASE CLEAR [ UNARCHIVED] LOGFILE ‘/disk3/log2a.rdo’; Notes : - an instance at least 2 groups of online log files - the active group can not be dropped - the not archived log group can not be dropped - when drop the log file the system file are not deleted

Database Administration Maintaining The LOG Files - Number Of online redo log files LGWR,ARCH and no of transactions - Locationof online Redo log files 1. Multiplex redo logs 2. Redo logs X archive logs (LGWR,ARCH) 3. Redo logs X data files (LGWR,DBWR) - Size of the redo logs minimum 50 k maximum depend on OS switch and checkpoint number and amount of redo entries space and recovery time

Database Administration Maintaining The LOG Files Possible LGWR Errors 1. one member is not available still work dropping and adding a new redo log member 2. All the members of next group are not available shutdown the instance if group not active dropping and recreating new group if active need media recovery from the loss of an online redo logs 3.All member of current group are not available shutdown the instance need media recovery from the loss of an online redo logs