SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
Backup & Recovery Check List
                                                                         Alejandro Vargas
                                                                     Oracle Support Israel.




User Managed Recovery Scenarios And Configuration
  1. Complete Closed Database Recovery. System tablespace is missing
  2. Complete Open Database Recovery. Non system tablespace is missing
  3. Complete Open Database Recovery (when the database is initially closed). Non
     system tablespace is missing
  4. Recovery of a Missing Datafile that has no backups.
  5. Restore and Recovery of a Datafile to a different location.
  6. Control File Recovery
  7. Incomplete Recovery, Until Time/Sequence/Cancel

Rman Recovery Scenarios And Configuration
  1. Complete Closed Database Recovery. System tablespace is missing
  2. Complete Open Database Recovery. Non system tablespace is missing
  3. Complete Open Database Recovery (when the database is initially closed). Non
     system tablespace is missing
  4. Recovery of a Datafile that has no backups.
  5. Restore and Recovery of a Datafile to a different location.
  6. Control File Recovery
  7. Incomplete Recovery, Until Time/Sequence/Cancel




User Managed Recovery Scenarios
    User managed recovery scenarios do require that the database is in archive log
    mode, and that backups of all datafiles and control files are
    made with the tablespaces set to begin backup, if the database is open while the
    copy is made. At the end of the copy of each tablespace
    it is necessaire to take it out of backup mode. Alternatively complete backups can
    be made with the database shutdown. Online redologs can
    be optionally backed up.

    Files to be copied:

      select name from v$datafile;
select member from v$logfile; # optional
      select name from v$controlfile;


    go up




Complete Closed Database Recovery. System tablespace is missing

    If the system tablespace is missing or corrupted the database cannot be started up
    so a complete closed database recovery must be performed.
    Pre requisites: A closed or open database backup and archived logs.

       1. Use OS commands to restore the missing or corrupted system datafile to its
          original location, ie:
          cp -p /user/backup/uman/system01.dbf
          /user/oradata/u01/dbtst/system01.dbf
       2. startup mount;
       3. recover datafile 1;
       4. alter database open;



    go up



Complete Open Database Recovery. Non system tablespace is missing


    If a non system tablespace is missing or corrupted while the database is open,
    recovery can be performed while the database remain open.
    Pre requisites: A closed or open database backup and archived logs.

       1. Use OS commands to restore the missing or corrupted datafile to its original
          location, ie:
          cp -p /user/backup/uman/user01.dbf /user/oradata/u01/dbtst/user01.dbf
       2. alter tablespace <tablespace_name> offline immediate;
       3. recover tablespace <tablespace_name>;
       4. alter tablespace <tablespace_name> online;



    go up
Complete Open Database Recovery (when the database is initially closed).
Non system tablespace is missing

       If a non system tablespace is missing or corrupted and the database crashed,
       recovery can be performed after the database is open.
       Pre requisites: A closed or open database backup and archived logs.

  1.     startup; (you will get ora-1157 ora-1110 and the name of the missing datafile, the
       database will remain mounted)
  2.     Use OS commands to restore the missing or corrupted datafile to its original
       location, ie:
       cp -p /user/backup/uman/user01.dbf /user/oradata/u01/dbtst/user01.dbf
  3.     alter database datafile3 offline; (tablespace cannot be used because the database
       is not open)
  4.     alter database open;
  5.     recover datafile 3;
  6.     alter tablespace <tablespace_name> online;


       go up



Recovery of a Missing Datafile that has no backups (database is open).


       If a non system datafile that was not backed up since the last backup is missing,
       recovery can be performed if all archived logs since the creation
       of the missing datafile exist.
       Pre requisites: All relevant archived logs.

  1.    alter tablespace <tablespace_name> offline immediate;
  2.    alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf';
  3.    recover tablespace <tablespace_name>;
  4.    alter tablespace <tablespace_name> online;

       If the create datafile command needs to be executed to place the datafile on a
       location different than the original use:

               alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf' as
               '/user/oradata/u02/dbtst/newdata01.dbf'
go up



Restore and Recovery of a Datafile to a different location.


       If a non system datafile is missing and its original location not available, restore
       can be made to a different location and recovery performed.
       Pre requisites: All relevant archived logs.

  1.     Use OS commands to restore the missing or corrupted datafile to the new
       location, ie:
       cp -p /user/backup/uman/user01.dbf /user/oradata/u02/dbtst/user01.dbf
  2.     alter tablespace <tablespace_name> offline immediate;
  3.     alter tablespace <tablespace_name> rename datafile
       '/user/oradata/u01/dbtst/user01.dbf' to '/user/oradata/u02/dbtst/user01.dbf';
  4.     recover tablespace <tablespace_name>;
  5.     alter tablespace <tablespace_name> online;


       go up



Control File Recovery


       Always multiplex your controlfiles. Controlfiles are missing, database crash.
       Pre requisites: A backup of your controlfile and all relevant archived logs.

  1.    startup; (you get ora-205, missing controlfile, instance start but database is not
       mounted)
  2.    Use OS commands to restore the missing controlfile to its original location:
       cp -p /user/backup/uman/control01.dbf /user/oradata/u01/dbtst/control01.dbf
       cp -p /user/backup/uman/control02.dbf /user/oradata/u01/dbtst/control02.dbf
  3.    alter database mount;
  4.    recover automatic database using backup controlfile;
  5.    alter database open resetlogs;
  6.    make a new complete backup, as the database is open in a new incarnation and
       previous archived log are not relevant.


       go up
Incomplete Recovery, Until Time/Sequence/Cancel


      Incomplete recovery may be necessaire when an archived log is missing, so
      recovery can only be made until the previous sequence,
      or when an important object was dropped, and recovery needs to be made until
      before the object was dropped.
      Pre requisites: A closed or open database backup and archived logs, the time or
      sequence that the 'until' recovery needs to be performed.


 1.    If the database is open, shutdown abort
 2.    Use OS commands to restore all datafiles to its original locations:
      cp -p /user/backup/uman/u01/*.dbf /user/oradata/u01/dbtst/
      cp -p /user/backup/uman/u02/*.dbf /user/oradata/u01/dbtst/
      cp -p /user/backup/uman/u03/*.dbf /user/oradata/u01/dbtst/
      cp -p /user/backup/uman/u04/*.dbf /user/oradata/u01/dbtst/
      etc...
 3.    startup mount;
 4.    recover automatic database until time '2004-03-31:14:40:45';
 5.    alter database open resetlogs;
 6.    make a new complete backup, as the database is open in a new incarnation and
      previous archived log are not relevant.

      Alternatively you may use instead of until time, until sequence or until cancel:

              recover automatic database until sequence 120 thread 1; OR
              recover database until cancel;


      go up




Rman Recovery Scenarios
      Rman recovery scenarios require that the database is in archive log mode, and that
      backups of datafiles, control files and archived
      redolog files are made using Rman. Incremental Rman backups may be used also.
      Rman can be used with the repository installed on the archivelog, or with a
      recovery catalog that may be installed in the same or
      other database.
      Configuration and operation recommendations:
Set the parameter controlfile autobackup to ON to have with each backup a
            controlfile backup also:
                     configure controlfile autobackup on;
            Set the parameter retention policy to the recovery window you want to have,
            ie redundancy 2 will keep the last two backups
            available, after executing delete obsolete commands:
                     configure retention policy to redundancy 2;
            Execute your full backups with the option 'plus archivelogs' to include your
            archivelogs with every backup:
                     backup database plus archivelog;
            Perform daily maintenance routines to maintain on your backup directory
            the number of backups you need only:
                     crosscheck backup;
                     crosscheck archivelog all;
                     delete noprompt obsolete backup;

    To work with Rman and a database based catalog follow these steps:

       1. sqlplus /
       2. create tablespace repcat;
       3. create user rcuser identified by rcuser default tablespace repcat temporary
          tablespace temp;
       4. grant connect, resource, recovery_catalog_owner to rcuser
       5. exit
       6. rman catalog rcuser/rcuser         # connect to rman catalog as the rcuser
       7. create catalog                    # create the catalog
       8. connect target /                  #

    go up

Complete Closed Database Recovery. System tablespace is missing

    In this case complete recovery is performed, only the system tablespace is missing,
    so the database can be opened without reseting
    the redologs.

       1.    rman target /
       2.    startup mount;
       3.    restore database;
       4.    recover database;
       5.    alter database open;


    go up
Complete Open Database Recovery. Non system tablespace is missing,
database is up

           1.   rman target /
           2.   sql 'alter tablespace <tablespace_name> offline immediate';
           3.   restore datafile 3;
           4.   recover datafile 3;
           5.   sql 'alter tablespace <tablespace_name> online';


        go up




Complete Open Database Recovery (when the database is initially closed).
Non system tablespace is missing


        A user datafile is reported missing when tryin to startup the database. The datafile
        can be turned offline and the database started up. Restore and
        recovery are performed using Rman. After recovery is performed the datafile can
        be turned online again.

  1.     sqlplus /nolog
  2.     connect / as sysdba
  3.     startup mount
  4.     alter database datafile '<datafile_name>' offline;
  5.     alter database open;
  6.     exit;
  7.     rman target /
  8.     restore datafile '<datafile_name>';
  9.     recover datafile '<datafile_name>';
  10.    sql 'alter tablespace <tablespace_name> online';


        go up



Recovery of a Datafile that has no backups (database is up).


        If a non system datafile that was not backed up since the last backup is missing,
        recovery can be performed if all archived logs since the creation
        of the missing datafile exist. Since the database is up you can check the tablespace
name and put it offline. The option offline immediate is used
       to avoid that the update of the datafile header.
       Pre requisites: All relevant archived logs.

  1.    sqlplus '/ as sysdba'
  2.    alter tablespace <tablespace_name> offline immediate;
  3.    alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf;
  4.    exit
  5.    rman target /
  6.    recover tablespace <tablespace_name>;
  7.    sql 'alter tablespace <tablespace_name> online';

       If the create datafile command needs to be executed to place the datafile on a
       location different than the original use:

               alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf' as
               '/user/oradata/u02/dbtst/newdata01.dbf'


       go up


Restore and Recovery of a Datafile to a different location. Database is up.


       If a non system datafile is missing and its original location not available, restore
       can be made to a different location and recovery performed.
       Pre requisites: All relevant archived logs, complete cold or hot backup.

  1.     Use OS commands to restore the missing or corrupted datafile to the new
       location, ie:
       cp -p /user/backup/uman/user01.dbf /user/oradata/u02/dbtst/user01.dbf
  2.     alter tablespace <tablespace_name> offline immediate;
  3.     alter tablespace <tablespace_name> rename datafile
       '/user/oradata/u01/dbtst/user01.dbf' to '/user/oradata/u02/dbtst/user01.dbf';
  4.     rman target /
  5.     recover tablespace <tablespace_name>;
  6.     sql 'alter tablespace <tablespace_name> online';


       go up



Control File Recovery
Always multiplex your controlfiles. If you loose only one controlfile you can
      replace it with the one you have in place, and startup the
      Database. If both controlfiles are missing, the database will crash.
      Pre requisites: A backup of your controlfile and all relevant archived logs. When
      using Rman alway set configuration parameter
      autobackup of controlfile to ON. You will need the dbid to restore the controlfile,
      get it from the name of the backed up controlfile.
      It is the number following the 'c-' at the start of the name.

 1.    rman target /
 2.    set dbid <dbid#>
 3.    startup nomount;
 4.    restore controlfile from autobackup;
 5.    alter database mount;
 6.    recover database;
 7.    alter database open resetlogs;
 8.    make a new complete backup, as the database is open in a new incarnation and
      previous archived log are not relevant.


      go up




Incomplete Recovery, Until Time/Sequence/Cancel


      Incomplete recovery may be necessaire when the database crash and needs to be
      recovered, and in the recovery process you find that
      an archived log is missing. In this case recovery can only be made until the
      sequence before the one that is missing.
      Another scenario for incomplete recovery occurs when an important object was
      dropped or incorrect data was committed on it.
      In this case recovery needs to be performed until before the object was dropped.
      Pre requisites: A full closed or open database backup and archived logs, the time or
      sequence that the 'until' recovery needs to be performed.


 1.    If the database is open, shutdown it to perform full restore.
 2.    rman target 
 3.    startup mount;
 4.    restore database;
 5.    recover database until sequence 8 thread 1; # you must pass the thread, if a
      single instance will always be 1.
6.    alter database open resetlogs;
7.    make a new complete backup, as the database is open in a new incarnation and
     previous archived log are not relevant.

     Alternatively you may use instead of until sequence, until time, ie: '2004-12-
     28:01:01:10'.


     go up

Más contenido relacionado

La actualidad más candente

Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Recvivaankumar
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Buvivaankumar
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12cuzzal basak
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rmanvivaankumar
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installationvivaankumar
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queriesvivaankumar
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.subhani shaik
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureOrazer Technologies
 

La actualidad más candente (19)

Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
 
Les 09 Tspitr
Les 09 TspitrLes 09 Tspitr
Les 09 Tspitr
 
Les 01 Arch
Les 01 ArchLes 01 Arch
Les 01 Arch
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
Xpp b tspitr
Xpp b tspitrXpp b tspitr
Xpp b tspitr
 
Les 10 Tune Rman
Les 10 Tune RmanLes 10 Tune Rman
Les 10 Tune Rman
 
Les 03 Catalog
Les 03 CatalogLes 03 Catalog
Les 03 Catalog
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
 
Rac questions
Rac questionsRac questions
Rac questions
 
Less17 Util
Less17  UtilLess17  Util
Less17 Util
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queries
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
 
Les 08 Dupe Db
Les 08 Dupe DbLes 08 Dupe Db
Les 08 Dupe Db
 
Les 20 dup_db
Les 20 dup_dbLes 20 dup_db
Les 20 dup_db
 
Les 08 tune_rman
Les 08 tune_rmanLes 08 tune_rman
Les 08 tune_rman
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
 

Similar a Backup andrecoverychecklist

Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklistمسلم islam
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recoveryArun Sharma
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)than sare
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsRoo Wall
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
8 i rman_love_it
8 i rman_love_it8 i rman_love_it
8 i rman_love_itAnil Pandey
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
ControlfilemanagementVinay Thota
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.subhani shaik
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recoveryYogiji Creations
 
- List the steps to multiplex your control files in OracleSolutionCont.docx
- List the steps to multiplex your control files in OracleSolutionCont.docx- List the steps to multiplex your control files in OracleSolutionCont.docx
- List the steps to multiplex your control files in OracleSolutionCont.docxrtodd22
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLAshnik Pte Ltd
 
Startupandshutdown
StartupandshutdownStartupandshutdown
StartupandshutdownVinay Thota
 

Similar a Backup andrecoverychecklist (20)

Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
8 i rman_love_it
8 i rman_love_it8 i rman_love_it
8 i rman_love_it
 
Backup&recovery
Backup&recoveryBackup&recovery
Backup&recovery
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Oracle backup
Oracle backupOracle backup
Oracle backup
 
- List the steps to multiplex your control files in OracleSolutionCont.docx
- List the steps to multiplex your control files in OracleSolutionCont.docx- List the steps to multiplex your control files in OracleSolutionCont.docx
- List the steps to multiplex your control files in OracleSolutionCont.docx
 
Les 12 fl_db
Les 12 fl_dbLes 12 fl_db
Les 12 fl_db
 
Backup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQLBackup-Recovery in PostgreSQL
Backup-Recovery in PostgreSQL
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
 
4714649_2.ppt
4714649_2.ppt4714649_2.ppt
4714649_2.ppt
 

Último

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 

Último (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 

Backup andrecoverychecklist

  • 1. Backup & Recovery Check List Alejandro Vargas Oracle Support Israel. User Managed Recovery Scenarios And Configuration 1. Complete Closed Database Recovery. System tablespace is missing 2. Complete Open Database Recovery. Non system tablespace is missing 3. Complete Open Database Recovery (when the database is initially closed). Non system tablespace is missing 4. Recovery of a Missing Datafile that has no backups. 5. Restore and Recovery of a Datafile to a different location. 6. Control File Recovery 7. Incomplete Recovery, Until Time/Sequence/Cancel Rman Recovery Scenarios And Configuration 1. Complete Closed Database Recovery. System tablespace is missing 2. Complete Open Database Recovery. Non system tablespace is missing 3. Complete Open Database Recovery (when the database is initially closed). Non system tablespace is missing 4. Recovery of a Datafile that has no backups. 5. Restore and Recovery of a Datafile to a different location. 6. Control File Recovery 7. Incomplete Recovery, Until Time/Sequence/Cancel User Managed Recovery Scenarios User managed recovery scenarios do require that the database is in archive log mode, and that backups of all datafiles and control files are made with the tablespaces set to begin backup, if the database is open while the copy is made. At the end of the copy of each tablespace it is necessaire to take it out of backup mode. Alternatively complete backups can be made with the database shutdown. Online redologs can be optionally backed up. Files to be copied: select name from v$datafile;
  • 2. select member from v$logfile; # optional select name from v$controlfile; go up Complete Closed Database Recovery. System tablespace is missing If the system tablespace is missing or corrupted the database cannot be started up so a complete closed database recovery must be performed. Pre requisites: A closed or open database backup and archived logs. 1. Use OS commands to restore the missing or corrupted system datafile to its original location, ie: cp -p /user/backup/uman/system01.dbf /user/oradata/u01/dbtst/system01.dbf 2. startup mount; 3. recover datafile 1; 4. alter database open; go up Complete Open Database Recovery. Non system tablespace is missing If a non system tablespace is missing or corrupted while the database is open, recovery can be performed while the database remain open. Pre requisites: A closed or open database backup and archived logs. 1. Use OS commands to restore the missing or corrupted datafile to its original location, ie: cp -p /user/backup/uman/user01.dbf /user/oradata/u01/dbtst/user01.dbf 2. alter tablespace <tablespace_name> offline immediate; 3. recover tablespace <tablespace_name>; 4. alter tablespace <tablespace_name> online; go up
  • 3. Complete Open Database Recovery (when the database is initially closed). Non system tablespace is missing If a non system tablespace is missing or corrupted and the database crashed, recovery can be performed after the database is open. Pre requisites: A closed or open database backup and archived logs. 1. startup; (you will get ora-1157 ora-1110 and the name of the missing datafile, the database will remain mounted) 2. Use OS commands to restore the missing or corrupted datafile to its original location, ie: cp -p /user/backup/uman/user01.dbf /user/oradata/u01/dbtst/user01.dbf 3. alter database datafile3 offline; (tablespace cannot be used because the database is not open) 4. alter database open; 5. recover datafile 3; 6. alter tablespace <tablespace_name> online; go up Recovery of a Missing Datafile that has no backups (database is open). If a non system datafile that was not backed up since the last backup is missing, recovery can be performed if all archived logs since the creation of the missing datafile exist. Pre requisites: All relevant archived logs. 1. alter tablespace <tablespace_name> offline immediate; 2. alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf'; 3. recover tablespace <tablespace_name>; 4. alter tablespace <tablespace_name> online; If the create datafile command needs to be executed to place the datafile on a location different than the original use: alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf' as '/user/oradata/u02/dbtst/newdata01.dbf'
  • 4. go up Restore and Recovery of a Datafile to a different location. If a non system datafile is missing and its original location not available, restore can be made to a different location and recovery performed. Pre requisites: All relevant archived logs. 1. Use OS commands to restore the missing or corrupted datafile to the new location, ie: cp -p /user/backup/uman/user01.dbf /user/oradata/u02/dbtst/user01.dbf 2. alter tablespace <tablespace_name> offline immediate; 3. alter tablespace <tablespace_name> rename datafile '/user/oradata/u01/dbtst/user01.dbf' to '/user/oradata/u02/dbtst/user01.dbf'; 4. recover tablespace <tablespace_name>; 5. alter tablespace <tablespace_name> online; go up Control File Recovery Always multiplex your controlfiles. Controlfiles are missing, database crash. Pre requisites: A backup of your controlfile and all relevant archived logs. 1. startup; (you get ora-205, missing controlfile, instance start but database is not mounted) 2. Use OS commands to restore the missing controlfile to its original location: cp -p /user/backup/uman/control01.dbf /user/oradata/u01/dbtst/control01.dbf cp -p /user/backup/uman/control02.dbf /user/oradata/u01/dbtst/control02.dbf 3. alter database mount; 4. recover automatic database using backup controlfile; 5. alter database open resetlogs; 6. make a new complete backup, as the database is open in a new incarnation and previous archived log are not relevant. go up
  • 5. Incomplete Recovery, Until Time/Sequence/Cancel Incomplete recovery may be necessaire when an archived log is missing, so recovery can only be made until the previous sequence, or when an important object was dropped, and recovery needs to be made until before the object was dropped. Pre requisites: A closed or open database backup and archived logs, the time or sequence that the 'until' recovery needs to be performed. 1. If the database is open, shutdown abort 2. Use OS commands to restore all datafiles to its original locations: cp -p /user/backup/uman/u01/*.dbf /user/oradata/u01/dbtst/ cp -p /user/backup/uman/u02/*.dbf /user/oradata/u01/dbtst/ cp -p /user/backup/uman/u03/*.dbf /user/oradata/u01/dbtst/ cp -p /user/backup/uman/u04/*.dbf /user/oradata/u01/dbtst/ etc... 3. startup mount; 4. recover automatic database until time '2004-03-31:14:40:45'; 5. alter database open resetlogs; 6. make a new complete backup, as the database is open in a new incarnation and previous archived log are not relevant. Alternatively you may use instead of until time, until sequence or until cancel: recover automatic database until sequence 120 thread 1; OR recover database until cancel; go up Rman Recovery Scenarios Rman recovery scenarios require that the database is in archive log mode, and that backups of datafiles, control files and archived redolog files are made using Rman. Incremental Rman backups may be used also. Rman can be used with the repository installed on the archivelog, or with a recovery catalog that may be installed in the same or other database. Configuration and operation recommendations:
  • 6. Set the parameter controlfile autobackup to ON to have with each backup a controlfile backup also: configure controlfile autobackup on; Set the parameter retention policy to the recovery window you want to have, ie redundancy 2 will keep the last two backups available, after executing delete obsolete commands: configure retention policy to redundancy 2; Execute your full backups with the option 'plus archivelogs' to include your archivelogs with every backup: backup database plus archivelog; Perform daily maintenance routines to maintain on your backup directory the number of backups you need only: crosscheck backup; crosscheck archivelog all; delete noprompt obsolete backup; To work with Rman and a database based catalog follow these steps: 1. sqlplus / 2. create tablespace repcat; 3. create user rcuser identified by rcuser default tablespace repcat temporary tablespace temp; 4. grant connect, resource, recovery_catalog_owner to rcuser 5. exit 6. rman catalog rcuser/rcuser # connect to rman catalog as the rcuser 7. create catalog # create the catalog 8. connect target / # go up Complete Closed Database Recovery. System tablespace is missing In this case complete recovery is performed, only the system tablespace is missing, so the database can be opened without reseting the redologs. 1. rman target / 2. startup mount; 3. restore database; 4. recover database; 5. alter database open; go up
  • 7. Complete Open Database Recovery. Non system tablespace is missing, database is up 1. rman target / 2. sql 'alter tablespace <tablespace_name> offline immediate'; 3. restore datafile 3; 4. recover datafile 3; 5. sql 'alter tablespace <tablespace_name> online'; go up Complete Open Database Recovery (when the database is initially closed). Non system tablespace is missing A user datafile is reported missing when tryin to startup the database. The datafile can be turned offline and the database started up. Restore and recovery are performed using Rman. After recovery is performed the datafile can be turned online again. 1. sqlplus /nolog 2. connect / as sysdba 3. startup mount 4. alter database datafile '<datafile_name>' offline; 5. alter database open; 6. exit; 7. rman target / 8. restore datafile '<datafile_name>'; 9. recover datafile '<datafile_name>'; 10. sql 'alter tablespace <tablespace_name> online'; go up Recovery of a Datafile that has no backups (database is up). If a non system datafile that was not backed up since the last backup is missing, recovery can be performed if all archived logs since the creation of the missing datafile exist. Since the database is up you can check the tablespace
  • 8. name and put it offline. The option offline immediate is used to avoid that the update of the datafile header. Pre requisites: All relevant archived logs. 1. sqlplus '/ as sysdba' 2. alter tablespace <tablespace_name> offline immediate; 3. alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf; 4. exit 5. rman target / 6. recover tablespace <tablespace_name>; 7. sql 'alter tablespace <tablespace_name> online'; If the create datafile command needs to be executed to place the datafile on a location different than the original use: alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf' as '/user/oradata/u02/dbtst/newdata01.dbf' go up Restore and Recovery of a Datafile to a different location. Database is up. If a non system datafile is missing and its original location not available, restore can be made to a different location and recovery performed. Pre requisites: All relevant archived logs, complete cold or hot backup. 1. Use OS commands to restore the missing or corrupted datafile to the new location, ie: cp -p /user/backup/uman/user01.dbf /user/oradata/u02/dbtst/user01.dbf 2. alter tablespace <tablespace_name> offline immediate; 3. alter tablespace <tablespace_name> rename datafile '/user/oradata/u01/dbtst/user01.dbf' to '/user/oradata/u02/dbtst/user01.dbf'; 4. rman target / 5. recover tablespace <tablespace_name>; 6. sql 'alter tablespace <tablespace_name> online'; go up Control File Recovery
  • 9. Always multiplex your controlfiles. If you loose only one controlfile you can replace it with the one you have in place, and startup the Database. If both controlfiles are missing, the database will crash. Pre requisites: A backup of your controlfile and all relevant archived logs. When using Rman alway set configuration parameter autobackup of controlfile to ON. You will need the dbid to restore the controlfile, get it from the name of the backed up controlfile. It is the number following the 'c-' at the start of the name. 1. rman target / 2. set dbid <dbid#> 3. startup nomount; 4. restore controlfile from autobackup; 5. alter database mount; 6. recover database; 7. alter database open resetlogs; 8. make a new complete backup, as the database is open in a new incarnation and previous archived log are not relevant. go up Incomplete Recovery, Until Time/Sequence/Cancel Incomplete recovery may be necessaire when the database crash and needs to be recovered, and in the recovery process you find that an archived log is missing. In this case recovery can only be made until the sequence before the one that is missing. Another scenario for incomplete recovery occurs when an important object was dropped or incorrect data was committed on it. In this case recovery needs to be performed until before the object was dropped. Pre requisites: A full closed or open database backup and archived logs, the time or sequence that the 'until' recovery needs to be performed. 1. If the database is open, shutdown it to perform full restore. 2. rman target 3. startup mount; 4. restore database; 5. recover database until sequence 8 thread 1; # you must pass the thread, if a single instance will always be 1.
  • 10. 6. alter database open resetlogs; 7. make a new complete backup, as the database is open in a new incarnation and previous archived log are not relevant. Alternatively you may use instead of until sequence, until time, ie: '2004-12- 28:01:01:10'. go up