DBA 101 Bootcamp

25
DBA 101 Bootcamp New DBA Series Backup 101 April 12, 2011 1 Paper #352

description

DBA 101 Bootcamp . New DBA Series Backup 101. Definitions. Archivelogmode Noarchivelogmode Shutdown normal Shutdown immediate Shutdown transactional Shutdown abort. Definitions cont’d . Consistent Inconsistent Control Files Data Files Redo Logs Archive Logs. Definitions cont’d. - PowerPoint PPT Presentation

Transcript of DBA 101 Bootcamp

Page 1: DBA 101 Bootcamp

DBA 101 Bootcamp

New DBA SeriesBackup 101

April 12, 2011 1Paper #352

Page 2: DBA 101 Bootcamp

Definitions

• Archivelogmode• Noarchivelogmode• Shutdown normal• Shutdown immediate • Shutdown transactional• Shutdown abort

April 12, 2011 2Paper #352

Page 3: DBA 101 Bootcamp

Definitions cont’d

• Consistent • Inconsistent• Control Files• Data Files• Redo Logs• Archive Logs

April 12, 2011 3Paper #352

Page 4: DBA 101 Bootcamp

Definitions cont’d

• Physical Backup• Logical Backup• RMAN client• Target database• Recovery catalog database• Recovery catalog schema

April 12, 2011 4Paper #352

Page 5: DBA 101 Bootcamp

Definitions cont’d

• User Managed Backups• Hot Backup• Cold Backup• Flash/Fast recovery area

April 12, 2011 5Paper #352

Page 6: DBA 101 Bootcamp

User Managed Backups (Physical)

• YOU manage the:– Who– What – Where– When– Why– How

April 12, 2011 6Paper #352

Page 7: DBA 101 Bootcamp

User Managed Backups cont’d

• Cold (consistent noarchivelogmode) backup– (g)v$datafile– (g)v$controlfile– Shutdown (any mode EXCEPT ABORT)– Copy datafiles and 1 copy of controlfile to

“other” location.

April 12, 2011 7Paper #352

Page 8: DBA 101 Bootcamp

User Managed Backups cont’d

• Cold (consistent archivelogmode) backup– Same as consistent noarchivelogmode AND– (g)v$archived_log– That’s it for COLD backups, any questions

before we move on?

April 12, 2011 8Paper #352

Page 9: DBA 101 Bootcamp

User Managed Backups cont’d• Hot (inconsistent) backup

– Implies archivelogmode– Same as cold consistent archivelogmode– Put tablespaces in backup mode– Copy datafile– Take tablespaces out of backup mode– Switch logfile– Backup controlfile to trace

April 12, 2011 9Paper #352

Page 10: DBA 101 Bootcamp

User Managed Backups cont’d

• Questions to ponder:– We never backed up redo logs, why?– Why was methodology different for control file

backup?– Why did we only backup 1 copy of the control

file?

April 12, 2011 10Paper #352

Page 11: DBA 101 Bootcamp

User Managed Backups Logical

• Export (old exp command, shouldn’t be used anymore)

• Data Pump– Whole presentation in itself.– Look at today at 11:45 for a datapump

presentation.

April 12, 2011 11Paper #352

Page 12: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups

• What is RMAN?• How do you access it?

– Command line– OEM

• What is a repository and do I need one?

April 12, 2011 12Paper #352

Page 13: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Connecting– connect catalog userid/password@______– connect target / or

userid/password@_______

April 12, 2011 13Paper #352

Page 14: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Types of backups– Full– Incremental– Archivelog– Control File – Tablespace– Data File

April 12, 2011 14Paper #352

Page 15: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Full– Backup database [plus archivelog];

• Incremental– Backup incremental level 0 database;– Backup incremental level 1 database;

April 12, 2011 15Paper #352

Page 16: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Archivelog– Backup archivelog all [delete input];

• Controlfile– Backup current controlfile;

April 12, 2011 16Paper #352

Page 17: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Tablespace– Backup tablespace tsname;

• Datafile– Backup datafile number;– Backup datafile “full path”;

April 12, 2011 17Paper #352

Page 18: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Reporting– List backup– Delete backup

April 12, 2011 18Paper #352

Page 19: DBA 101 Bootcamp

Recovery Manager (RMAN) Backups cont’d

• Questions to ponder:– Why do a controlfile backup AFTER the

database backup?– Why can’t I do a backup of my noarchivelog

mode database while its running?– Repository or no repository?

April 12, 2011 19Paper #352

Page 20: DBA 101 Bootcamp

Pros/Cons• User Managed:

– Pros: • You control all of it, control freaks, is this you?• It’s easy to just copy a file from a backup place to its

original place– Cons:

• You control all of it.• You have to maintain repository of when things were

backed up last, etc.

April 12, 2011 20Paper #352

Page 21: DBA 101 Bootcamp

Pros/Cons cont’d

• RMAN managed:– Pros:

• Oracle manages it all, you barely have to think about it

• What has been backed up is kept for you automatically.

April 12, 2011 21Paper #352

Page 22: DBA 101 Bootcamp

Pros/Cons cont’d

• RMAN managed:– Cons:

• You control freaks might not like Oracle “taking over it all”

• Not just being able to cp a file from a backup location to the original location, you have to get RMAN involved.

April 12, 2011 22Paper #352

Page 23: DBA 101 Bootcamp

Take home thought

• Backups are important but are useless if they can't be recovered, so test your recovery plan.

April 12, 2011 23Paper #352

Page 24: DBA 101 Bootcamp

Demo

• Do you have a playground?• If not, why not? You need one• We’ll look at

– User managed backup, both hot and cold– Recovery Manager(RMAN) backups full,

incremental, tablespace, datafile, archivelog and control file.

April 12, 2011 24Paper #352

Page 25: DBA 101 Bootcamp

Contact Info

• Joe Testa– Cell: 614-774-3595– Email:

[email protected][email protected][email protected]

– Facebook: joseph.s.testa– Twitter: n8xct

April 12, 2011 25Paper #352