Book Image

Oracle Database 12c Backup and Recovery Survival Guide

Book Image

Oracle Database 12c Backup and Recovery Survival Guide

Overview of this book

The three main responsibilities of a successful DBA are to ensure the availability, recoverability, and performance of any database. To ensure the recoverability of any database, a DBA needs to have a strong backup and recovery skills set. Every DBA is always looking for a reference book that will help them to solve any possible backup and recovery situation that they can come across in their professional life. Oracle Database 12c Backup and Recovery Survival Guide has the unique advantage to be a reference to all Oracle backup and recovery options available, making it essential for any DBA in the world. If you are new to Oracle Database, this book will introduce you to the fantastic world of backup and recovery that is vital to your success. If you are an experienced DBA, this book will become a reference guide and will also help you to learn some possible new skills, or give you some new ideas you were never aware about. It will also help you to easily find the solution to some of the most well known problems you could find during your career as a DBA. This book contains useful screenshots, scripts, and examples that you will find more than useful. Most of the books currently available in the market concentrate only on the RMAN utility to backup and recovery. This book will be an exception to the rule and will become a must-have reference, allowing you to design a real and complete backup and recovery strategy. It covers the most important topics on Oracle database such as backup strategies, Nologging operations, new features in 12c, user managed backups and recoveries, RMAN (including reporting, catalog management, troubleshooting, and performance tuning), advanced data pump, Oracle Enterprise Manager 12c and SQL Developer. "Oracle Database 12c Backup and Recovery Survival Guide" contains everything a DBA needs to know to keep data safe and recoverable, using real-life scenarios.
Table of Contents (22 chapters)
Oracle Database 12c Backup and Recovery Survival Guide
Credits
About the Author
Acknowledgement
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring RMAN


Now is the time to configure our RMAN environment to allow us to run all RMAN scenarios.

Creating the target DB RMAN backup account

Have a look at the following command:

SQL> CREATE USER backup_admin IDENTIFIED BY bckpwd DEFAULT TABLESPACE users;

SQL> GRANT sysbackup TO backup_admin;

$ rman target=backup_admin/bckpwd@pdborcl

Configure RMAN using the configure command

Have a look at the following command:

RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUSET;
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAL '/data/pdborcl/backups /bck_orcl_%U';
RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 200m MAXOPENFILES 8 RATE 150m;
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/pdborcl/backups/controlfile/ctl_orcl_%F';
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;

Backup database

Have a look at the following command:

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

Checking and deleting obsolete backups

Have a look at the following command:

RMAN> REPORT OBSOLETE;
RMAN> DELETE OBSOLETE;

Creating RMAN catalog user

Have a look at the following command:

SQL> CREATE TABLESPACE catalog_tbs DATAFILE '/data/pdborcl /catalog_01_tbs.dbf' SIZE 100m;
SQL> CREATE USER catalog_bck IDENTIFIED BY rmancatalog DEFAULT TABLESPACE catalog_tbs QUOTA UNLIMITED ON catalog_tbs;
SQL> GRANT connect, resource, recovery_catalog_owner TO catalog_bck;

Creating recovery catalog

Have a look at the following command:

$ rman target / catalog=catalog_bck/rmancatalog@pdborcl

RMAN> CREATE CATALOG tablespace catalog_tbs;

Register your DB in the recovery catalog

Have a look at the following command:

$ rman target=backup_admin/bckpwd catalog=catalog_bck/rmancatalog@pdborcl
RMAN> REGISTER DATABASE;
RMAN> REPORT SCHEMA;

Creating a virtual private catalog

Have a look at the following command:

SQL> CREATE USER fmunoz IDENTIFIED BY alvarez DEFAULT TABLESPACE catalog_tbs;
SQL> GRANT recovery_catalog_owner TO fmunoz;

$ rman catalog=catalog_bck/rmancatalog@pdborcl
RMAN> GRANT CATALOG FOR DATABASE pdborcl TO fmunoz;
RMAN> GRANT REGISTER DATABASE TO fmunoz;

rman catalog=fmunoz/alvarez@pdborcl

RMAN> CREATE VIRTUAL CATALOG;

Enabling Block Change tracking

Have a look at the following command:

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
SQL> SELECT status FROM v$block_change_tracking;