Skip to main content

DB - Fast Recovery Area






Let's  distillate  a bit the Fast Recovery Area (FRA)





  •   Central location for backup data
    • Logs
    • Archive logs
    • Backups
    • Control file
  • Location (either)
    • ASM
    • filesystem
  • Allow RMAN Retention policies
  • Parameters ( location and size)
    • DB_RECOVERY_FILE_DEST
    • DB_RECOVERY_DEST_SIZE




FRA - Maintenance other notes





  • The maintenance is done automatically, and if is properly sized are not expected issues
  • Use the RMAN commands to remove backups and file copies that are not required.
  • If gets full - database stops




RMAN> REPORT OBSOLETE 
RMAN> DELETE OBSOLETE 




Get Info





SQL> show parameter DB_RECOVERY_FILE_DEST

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size big integer 3852M

SQL> col name form a30
SQL> col value form a30
SQL> select name, value from v$parameter where name like 'log_arc%' order by 1 asc

SQL> set lines 200
SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG .65 0 1
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0

7 rows selected.

SQL> select * from v$recovery_file_dest

NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------------------- ---------- ----------------- ---------------
/u01/app/oracle/flash_recovery_area 4039114752 26259456 0 1





Lets play, starting with generating to 2 archived logs
by with  running twice : alter system switch logfile;





SQL> set lines 200
SQL> select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
--------------------         ------------------                      -------------------------                            ---------------
CONTROL FILE                          0                         0                                            0
REDO LOG                                0                         0                                            0
ARCHIVED LOG                         0                         0                                            0
BACKUP PIECE                         0                         0                                            0
IMAGE COPY                            0                         0                                            0
FLASHBACK LOG                     0                         0                                            0
FOREIGN ARCHIVED LOG         0                         0                                           0

7 rows selected.

SQL> alter system switch logfile;

System altered.

SQL>  select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
--------------------         ------------------                      -------------------------                            ---------------
CONTROL FILE                          0                         0                                            0
REDO LOG                                0                         0                                            0
ARCHIVED LOG                      0.2                         0                                            1
BACKUP PIECE                         0                         0                                            0
IMAGE COPY                             0                        0                                            0
FLASHBACK LOG                       0                        0                                            0
FOREIGN ARCHIVED LOG          0                        0                                            0


7 rows selected.

SQL> alter system switch logfile;
System altered.

SQL>  select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
--------------------         ------------------                      -------------------------                            ---------------
CONTROL FILE                          0                         0                                            0
REDO LOG                                0                         0                                            0
ARCHIVED LOG                      0.2                         0                                            2
BACKUP PIECE                         0                         0                                            0
IMAGE COPY                             0                        0                                            0
FLASHBACK LOG                       0                        0                                            0
FOREIGN ARCHIVED LOG          0                        0                                            0

 

7 rows selected.




Now, with RMAN






RMAN> list backup;

using target database control file instead of recovery catalog
specification does not match any backup in the repository

RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT;

Starting backup at 01-OCT-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=1 STAMP=924096057
input archived log thread=1 sequence=10 RECID=2 STAMP=924096084
input archived log thread=1 sequence=11 RECID=3 STAMP=924096215
channel ORA_DISK_1: starting piece 1 at 01-OCT-16
channel ORA_DISK_1: finished piece 1 at 01-OCT-16
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_10_01/o1_mf_annnn_TAG20161001T132335_cyz75qvp_.bkp tag=TAG20161001T132335 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_10_01/o1_mf_1_9_cyz70sgb_.arc RECID=1 STAMP=924096057
archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_10_01/o1_mf_1_10_cyz71nvr_.arc RECID=2 STAMP=924096084
archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2016_10_01/o1_mf_1_11_cyz75q4v_.arc RECID=3 STAMP=924096215
Finished backup at 01-OCT-16


RMAN> list backup;

List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1       978.00K    DISK        00:00:01     01-OCT-16      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20161001T132335
        Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_10_01/o1_mf_annnn_TAG20161001T132335_cyz75qvp_.bkp

  List of Archived Logs in backup set 1
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    9       895024     01-OCT-16 896346     01-OCT-16
  1    10      896346     01-OCT-16 896357     01-OCT-16
  1    11      896357     01-OCT-16 896431     01-OCT-16

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---

1       B  A  A DISK        01-OCT-16       1       1       NO         TAG20161001T132335
  
SQL> select * from V$RECOVERY_AREA_USAGE;

FILE_TYPE            PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE                           0                         0               0
REDO LOG                                 0                         0               0
ARCHIVED LOG                          0                         0               0 
BACKUP PIECE                        .02                         0              1 
IMAGE COPY                             0                         0               0
FLASHBACK LOG                      0                         0               0
FOREIGN ARCHIVED LOG          0                         0               0

7 rows selected.




Obrigado pela leitura, espero que este post o tenha ajudado :)
Thank you for reading, hope this post was helpful  :) 

Further Reading :
Fast Recovery Area
Planning Space Usage and Location for the Fast Recovery Area
Configuring the Fast Recovery Area


Comments

Popular posts from this blog

DB - How to monitor Oracle datapump jobs

These days there is lot of work around database migrations not only but mainly to cloud providers. One of the ways to migrate Oracle databases is using data pump (expdp/impdp). In general works fine, it allows an easy way to bring the database even different OS. It is always good to monitor the progress, to know where we are and estimate how long we are from the end. In this post, I am sharing some queries to help with database monitoring progress. The queries can be easily tailed to various scenarios. Starting with a simple one - the track the number of objects loaded during an import operation. When there is a massive amount of errors during the import. Drop and run the import again. The bellow query can be useful also to monitor the number of objects if we are dropping the users. Here, I’m making the assumption there were no other database activity in progress on the last 24 hours. select owner, count(0) from dba_objects where owner in ( select username from dba_users where created...

DB – How to monitor Oracle database long ops ?

As DBAs, some questions we are often asked and to be fair we ask ourselfs when we are doing massive operations, are : Is the database doing something? How long the database takes to complete the task? There a data dictionary view, GV$SESSION_LONGOPS whom is really usefull for monitoring and to provide estimated time to get the task done. Starting with a first example, a query for general propose . set lines 240 col message form a100 col opname form a50 select * from ( select round(l.sofar/l.totalwork*100,2) as complete, --l.* l.sid, --l.opname, l.message, l.start_time, l.time_remaining/60 "minuts remaining", l.elapsed_seconds from gv$session_longops l where totalwork !=0 ) where complete < 100; The view is also usefull on specific operations such as Oracle Recovery Manager (RMAN) jobs monitoring, this query returns information about backup,restore and recovery. select sid, serial#,opname, context, sofar, totalwork, round(sofar/totalwork*100,2) "%_complet...

VM - Resize a .vdi disk

I created a VM with 10G disk, after the Linux 7 installation, and the first upgrade, decided was better to increase the disk to 50GB. This post , i'm sharing the steps and commands I ran to increase the disk size. Software : Host : Windows 10 Pro , Oracle VM 6.1.2 Guest : Red Hat Enterprise Linux Server release 7.1 (Maipo) / Oracle Linux Server release 7.1 Ok - the first step is to resize the *vdi disk on the host side. Open a PowerShell console in the VM folder (Left Shift + Mouse Right Click on Windows) Quick list and check on the files. PS D:\VMs\OracleLinux7_MSSQL> ls Directory: D:\VMs\OracleLinux7_MSSQL Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 09/02/2020 18:40 Logs -a---- 09/02/2020 18:41 5689 OracleLinux7_MSSQL.vbox -a---- 09/02/2020 18:41 5688 OracleLinux7_MSSQL.vbox-prev -a---- 09/02/2020 18:40 9268363264 OracleL...