2014-08-10 Baoxinjian
I. Summary
1. Cold Backup
The process of completing all physical system file copies in a closed state, also known as offline backup
Suitable for non-archive mode, the database is in a consistent state
2. Steps
Start by getting all the physical file locations of the database running in the running library, and then shutting down the database (shutdown) within the plan
Perform a copy of the physical home to the backup path or backup device
Start the database immediately after the backup is complete to provide normal service
3. Summary-Benefits
The concept is easy to understand in cold standby mode, and the files that will need to be backed up are copied to a secure location
Simple operation, no need for too much intervention
Easy to recover to a point in time (just copy the file back)
Can be combined with the archiving method to restore the database "up-to-date state".
4. Summary-Disadvantages
Database must be in a consistent shutdown state when backing up
can only provide recovery to a point in time
Backup time is slow, especially the large performance impact of data volume is relatively large
Cannot implement table-and user-level data recovery
Second, cold backup
Case: First, you should find out the database data files, log files, control files, the location of the temporary files in the relevant view.
Note: Do not direct the oradata under the CP on the line, because the production library files are usually distributed in different disks, different places, so in the view to get the real path
1. View information about the instance and database
SQL>Select from V$instance;
SQL>Select from v$database;
2. View data files and status information
SQL>Selectfile_name from Dba_data_files;
3. View data files
SQL>Select from V$datafile;
4. View Temporary files
SQL>Select from V$tempfile;
5. View Log files
SQL>Select from V$logfile;
6. View Control files
SQL>Select from V$controlfile;
7. Create a backup directory
SQL> ho mkdir/opt/Oracle/Coolbak
8. Generate a copy File command using a connector
Select 'ho CP'|| name | |'&dir'From v$controlfile Union AllSelect 'ho CP'|| name | |'&dir'From v$datafile Union AllSelect 'ho CP'|| Member | |'&dir'From v$logfile Union AllSelect 'ho CP'|| name | |'&dir'From v$Tempfile/
9. Generate a copy File command using a connector
[gavinsit.com]> Vi/tmp/tmpbak.sql--Edit the Tmpbak.sql and enter the following into the Tmpbak.sql
Set feedback offset heading offset Verify offset trimspool offset pagesize0Set Linesize $Definedir='/opt/oracle/coolbak'Define Script='/tmp/coolbak.sql'Spool&ScriptSelect 'ho CP'|| name | |'&dir'From v$controlfile Union AllSelect 'ho CP'|| name | |'&dir'From v$datafile Union AllSelect 'ho CP'|| Member | |'&dir'From v$logfile Union AllSelect 'ho CP'|| name | |'&dir'From v$Tempfile/Create Pfile='&dir/spfilegavinsit.ora'From SPFile; HoCP/opt/oracle/product/11.2.0/gavinsit/dbs/orapwgavinsit &dirSpool Offshutdown Immediatestart&ScripthoRM&Scriptstartup
8. Implementation process and database start-up slightly
Sql> @/tmp/tmpbak.sql;
Sql>@/Tmp/Tmpbak.sqlho CP/Opt/Oracle/Oradata/Gavinsit/Control01.ctl/Opt/Oracle/coolbakho CP/Opt/Oracle/Flash_recovery_area/Gavinsit/Control02.ctl/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/System01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Sysaux01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Undotbs01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Users01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Example01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Bxj_emp_data01.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Bxj_emp_data02.dbf/Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Redo03.Log /Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Redo02.Log /Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Redo01.Log /Opt/Oracle/coolbakho CP/Opt/Oracle/Oradata/Gavinsit/Temp01.dbf/Opt/Oracle/CoolbakDatabaseclosed.Databasedismounted. ORACLE instance shut down.
9. View the backed up files after startup
/opt/Oracle/Coolbak
Control01.ctl ORAPWORCL Redo2b.rdo system01.dbf users01.dbf
Control02.ctl Redo1a.rdo Redo3a.rdo tbs1_1.dbf
EXAMPLE01.DBF Redo1b.rdo Redo3b.rdo tbs1_2.dbf
Initorcl.ora Redo2a.rdo sysaux01.dbf undotbs01.dbf
Abalone New ********************
Reference: http://blog.csdn.net/leshami/article/details/5791597
Dba_oracle Cold Backup Case Script this method (case) (database most basic backup mode)