Tuesday, July 30, 2013

2 Oracle Backup /Restore (1)

In this article, I am going to demo the basic Oracle Backup/Restore.

 

Find all the database files:

select name from v$datafile;
select name from v$tempfile;
select name from v$controlfile;
select member from v$logfile;

image

Offline backup/Cold backup

Shutdown the database server and use the operation command to copy.

 

Online Backup/Warm backup

-- Begin the backup for all datafile
alter database begin backup;
-- Begin backup for single data file
alter tablespace example begin backup;
-- Check if the data file is in backup mode
select * from v$backup;

image

  • Shutdown the database server and use the operation command to copy.
  • Also need to backup the parameter file.
  • Backup the log file, archive the current log and backup the log use os command
ALTER SYSTEM ARCHIVE LOG current;
  • Backup the control file
alter database backup controlfile to '/u01/app/oracle/control_back.ctl';

image

Database Recovery

-- shutdown the database and listener
-- startup listener
-- start database mount
-- recover database
-- alter database open

 

User Tablespace recovery

alter tablespace example offline immediate;
recover tablespace example;
alter tablespace example online;

image

image

image

 

image

 

DataFILE recovery

alter database datafile '/u01/app/oracle/oradata/oracledb1/system01.dbf' online;
recover datafile '/u01/app/oracle/oradata/oracledb1/system01.dbf';
alter database open;

image

2 comments:

  1. • It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have go
    https://www.besanttechnologies.com/training-courses/oracle-training

    ReplyDelete
  2. There is fake rolex watches no name in the watch industry replica Rolex Submariner watches that can compare with the status of Rolex. Literally, Rolex is synonymous with quality, and the well-known name has surpassed the watchmaking industry. It is not only an impeccable leading manufacturer of subdivided products, but also a model of international popular culture.

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates