INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Data Loading Copyright System Managers LLC 2003 all rights reserved.
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Dear Friends, I m Kartik Mali from gujarat. I prepared this presentation for who want to use oracle loader utility. I m giving here step by step knowledge.
ITEC474 Control File Maintenance
DBA 101 Bootcamp New DBA Series Backup 101 April 12, 20111Paper #352.
Harvard University Oracle Database Administration Session 10 Database Backups.
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
RMAN Restore and Recovery
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
Harvard University Oracle Database Administration Session 11 Database Recovery.
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
Configuring Recovery Manager
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
Backup & Recovery with RMAN
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
The Oracle Recovery Manager (RMAN)
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
Oracle backup and recovery strategy
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
Backup & Recovery Concepts for Oracle Database
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
5 Copyright © 2008, Oracle. All rights reserved. Using RMAN to Create Backups.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Backup and Recovery Protects From Data Loss. Backup and Recovery Protects From Data Loss Provides for Media Recovery.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
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.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
Chapter 8Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 8 Complete Recovery with Recovery Manager.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
Database Administration 3.Using Administration Tools.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
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.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
RMAN Maintenance.
Backup and Recovery.
Recovery Catalog Creation and Maintenance
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
Duplicating a Database
RAC Backup and Recovery Lab
Performing Database Recovery
Chapter 5 The Redo Log Files.
Presentation transcript:

INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all rights reserved.

DATA LOADING Use the EXPORT/IMPORT utilities to move bulk data from one Oracle database into another Oracle database. Logical backup – Saves the data and the DDL used to create the database objects Migration Tool Online documentation - C:\> exp{imp} help=y Data can also be loaded using SQL*PLUS “INSERT” commands or the Oracle utility SQL*LOADER.

DATA LOADING Types Of Exports. Full Export –EXP system/manager file = exp.dat full = y log = exp.log User Level Export –EXP system/manager file = exp.dat owner = scott log = exp.log Table Level Export –EXP scott/tiger file = exp.dat TABLES=(emp,dept) log = exp.log

DATA LOADING Types Of Imports. Full Import –IMP system/manager file = exp.dat full = y log = imp.log commit = y User Level Import –IMP system/manager file = exp.dat fromuser=scott touser=scott log = imp.log commit = y Table Level Import –IMP scott/tiger file = exp.dat TABLES=(emp.dept) log = imp.log commit = y

DATA LOADING cont. SQL*LOADER - Oracle utility used to load external file data into Oracle database tables Used when large amounts of data must be loaded. Loads data contained in a data file into one or more tables Requires a SQL*LOADER control file Copyright System Managers LLC 2003 all rights reserved.

DATA LOADING cont. SQL*LOADER Syntax: C:\> sqlldr scott/tiger control=my_control_file.ctl log=my_load.log Data File Contents – file name = ubs.dat 930|1058|Edward S.Eng|ibm 931|2157|John Ford|hp 932|1457|Melanie Goldman|msft 933|1657|Jane Williams|dell Copyright System Managers LLC 2003 all rights reserved.

DATA LOADING cont. SQL*LOADER Control File – Tells the loader how to how to interpret the data file: LOAD DATA INFILE 'ubs.dat' BADFILE 'ubs2.bad' DISCARDFILE 'ubs2.dsc' APPEND INTO TABLE ubs.table_customer FIELDS TERMINATED BY '|'OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS (CUST_NO, SITE_NO, CUST_NAME,SITE_ ABBREV)

DATA LOADING cont. SQL*LOADER Control File – Tells the loader how to load the data: INFILE – File containing the data to be loaded BADFILE – Records that are rejected go into this file DISCARDFILE – Records that do not meet a loading criteria Data can be appended onto existing data, inserted or replaced - APPEND/INSERT/REPLACE

DATABASE BACKUP Used if the database needs to be recovered due to a hardware or end user created failure. Types of database backups include: Logical Backup – Uses IMPort/EXPort. Often used to recover dropped tables. Saves the data. Physical Backup – Used to recover the database from hardware failures. Saves the databases data files. Either COLD or HOT. Copyright System Managers LLC 2003 all rights reserved.

DATABASE MODES Database is running in ARCHIVELOG mode When the active log file becomes filled a log switch is signaled LGWR process switches to writing to the next log file The ARCH process saves the active log file to offline storage Copyright System Managers LLC 2003 all rights reserved.

DATABASE BACKUP Cold physical backup - Backup that is taken when the database is shutdown. Save data files, log files and control files. How to find the location of the files: SQL > select member from v$logfile; SQL > select file_name from sys.dba_data_files; SQL > select name from v$control_files;

DATABASE BACKUP cont. Hot backup - Backup taken while the database is up (end users can also access the database during the backup). Requires that the database be run in ARCHIVELOG mode – Check v$database Redo log files are moved to offline storage when they fill up. Redo log files are moved to offline storage by the ARCH process.

DATABASE BACKUP DBA needs to monitor the offline storage to make sure that it does not fill up. Save “archived log files” using OS copy command. Delete archived log files from the archive directory. Copyright System Managers LLC 2003 all rights reserved.

DATABASE BACKUP Save tablespace data files using “ALTER TABLESPACE BEGIN/END BACKUP” AND OS copy command. Save database control file by using the ‘ALTER DATABASE BACKUP CONTROLFILE “ command. Copyright System Managers LLC 2003 all rights reserved.

DATABASE BACKUP Save The data files: SQL > alter tablespace system begin backup; SQL > HOST copy c:\oracle\system01.dbf C:backup SQL > alter tablespace system end backup; SQL > alter database backup controlfile to ‘c:\backup\control_backup.ctl'; SQL > alter system switch logfile; SQL > quit Save ARCHIVELOG files Copyright System Managers LLC 2003 all rights reserved.

DATABASE RECOVERY Recovery using a cold backup. Restore data files, log files and the control files to their original location. Startup the database. System is recovered to the last cold backup. Copyright System Managers LLC 2003 all rights reserved.

DATABASE RECOVERY cont. Recovery using a hot backup. Recovers the database to the point in time of failure. Requires access to both online and offline log files. After issuing either RECOVER DATABASE, RECOVER TABLESPACE or RECOVER DATAFILE the Oracle recovery management will prompt for the locations of the archivelog files. Copyright System Managers LLC 2003 all rights reserved.

DATABASE RECOVERY cont. Oracle recovery process uses the contents of the control file to determine which ARCHIVELOG files are required for the recovery The SMON process will: –Perform roll forward recovery using the data in the log files. –Perform rollback recovery by applying the data from the rollback segments to UNDO uncommitted changes

DATABASE BACKUP Recovery Manager (RMAN) is an Oracle utility introduced in Oracle8 RMAN types of physical database backups: –Block level backup and recovery –Hot and cold backups –Full and incremental backups Optional recovery catalog

DATABASE BACKUP – Recovery Manager

DATABASE BACKUP RMAN can be used with or without a recovery catalog. If no recovery catalog is used then all information required for recovery is obtained from the databases control files. Connecting to RMAN with a recovery catalog: rman target sys/manager123 rcvcat Connecting to RMAN without a recovery catalog: rman target sys/manager123 nocatalog Copyright System Managers LLC 2003 all rights reserved.

DATABASE BACKUP RMAN Backup Script: run { allocate channel dev1 type disk; backup incremental level 0 tag = 'full backup' database include current controlfile format = 'c:\rbackup\db_t%t_s%s_p%p'; sql "alter system switch logfile"; backup format = 'c:\rbackup\ar_t%t_s%s_p%p' archivelog all; release channel dev1; } exit Copyright System Managers LLC 2003 all rights reserved.

DATABASE RECOVERY RMAN Recovery Script: run { allocate channel dev1 type disk; alter database mount; restore database; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; } exit Copyright System Managers LLC 2003 all rights reserved.

DATABASE BACKUP/RECOVERY To run an RMAN script from the command prompt: c:\> rman target sys/not4u cmdfile c:\scripts\backup\hot_rman_bkup_lvl0.rcv msglog c:\rbackup\current_rman_lvl0.log nocatalog TARGET – Use the current setting for ORACLE_SID as the database to be backed up. CMDFILE – RMAN script that is used to backup the database MSGLOG – File where messages that are written during the time of backup are written NOCATALOG – Tells RMAN that this backup is being performed without a recovery catalog