Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

Backup - Control File

Back


Backup Control File

Lab: Verifying Automatic Backups of the Control File and SPFILE

-- rman

-- query all configuration
show all;
-- CONFIGURE CONTROLFILE AUTOBACKUP ON; # default

Backing Up the Control File to a Trace File


Lab: Back up the control file to a trace file

-- Verify that the control files are multiplexed.
SELECT name FROM v$controlfile;
-- /u01/app/oracle/oradata/ORCL/control01.ctl
-- /u01/app/oracle/fast_recovery_area/ORCL/control02.ctl

-- Query the diagnostic path
show parameter DIAGNOSTIC_DEST;
-- /u01/app/oracle

-- Back up the control file to a trace file
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
-- in this case, the dest is /u01/app/oracle
--  then cf path: /u01/app/oracle/diag/rdbms/orcl/orcl/trace/
cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace
ls
# look for the last trace file
tail alert_orcl.log
# Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8996.trc

lab_backup_cf_trace

cat orcl_ora_8996.trc

lab_backup_cf_trace

  • The code use CREATE CONTROLFILE command to re-create the control file.
  • Execute this sql script to re-create control file
  • The code includes
    • all data and temp files of the different containers (the CDB root, CDB seed, PDB1, and so on)
    • the multiplexed redo log files
    • the ARCHIVELOG mode
    • the character set
    • the name of the CDB

Lab: Creates a SQL script to re-create a control file.

-- Generate a trace file with a path
ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS
'/home/oracle/backup/orcl/control.sql';

lab_backup_cf_trace


TOP