[ORACLE] Open backup

Hengki's Oracle 2010. 4. 16. 16:41 |

1. 컨트롤 파일 오픈 백업

SQL> !mkdir /u01/app/oracle/oradata/devdb_backup/open_backup

SQL> alter database backup controlfile to trace as '/u01/app/oracle/oradata/devdb_backup/open_backup/control.sql';

SQL> cat /u01/app/oracle/oradata/devdb_backup/open_backup/control.sql


2. 데이터 파일 오픈 백업

SQL> spool open_backup.sql

SQL> select 'alter tablespace '||tablespace_name||' begin backup;'||chr(10)||
     '!cp '||file_name||' /u01/app/oracle/oradata/devdb_backup/open_backup'||chr(10)||
     'alter tablespace '||tablespace_name||' end backup;' as commands
     from dba_data_files;

SQL> spool off

SQL> ed open_backup.sql (alter~ !cp~ alter~ 빼고 나머지 정리)

SQL> @open_backup.sql

SQL> !ls -l /u01/app/oracle/oradata/devdb_backup/open_backup

Posted by hengki

댓글을 달아 주세요