open backup, close backup (RAW DEVICE)





open backup script

백업 받을 경로는 /data/open


select
'alter tablespace '||b.name||' begin backup;' as "begin backup"
, '!dd if='||a.name||' of='||'&backuppath'||'/'||substr(a.name, instrb(a.name, '/', -1)+1)||'_'||lower(b.name)||' bs=8k' as "copy"
, 'alter tablespace '||b.name||' end backup;' as "end backup"
from v$datafile a, v$tablespace b
where a.ts# = b.ts#

아래에서 파란 글씨로 만들어진 문장을 복사해서 사용.
 


Enter value for backuppath: /data/open


begin backup
--------------------------------------------------------------------------------

copy

--------------------------------------------------------------------------------

end backup

--------------------------------------------------------------------------------

alter tablespace SYSTEM begin backup;

!dd if= /dev/raw/raw3 of=/data/open/raw3_system bs=8k

alter tablespace SYSTEM end backup;


alter tablespace UNDOTBS1 begin backup;

!dd if= /dev/raw/raw17 of=/data/open/raw17_undotbs1 bs=8k

alter tablespace UNDOTBS1 end backup;


alter tablespace SYSAUX begin backup;

!dd if= /dev/raw/raw4 of=/data/open/raw4_sysaux bs=8k

alter tablespace SYSAUX end backup;


alter tablespace UNDOTBS2 begin backup;

!dd if= /dev/raw/raw18 of=/data/open/raw18_undotbs2 bs=8k

alter tablespace UNDOTBS2 end backup;


alter tablespace USERS begin backup;

!dd if= /dev/raw/raw15 of=/data/open/raw15_users bs=8k

alter tablespace USERS end backup;




CLOSE Backup script

소스코드에서 더블클릭하면 전체 선택 됩니다. 그 상태에서 복사하세요.
Control file
select '!dd if='||name||' of=&path/'||substr(name, instrb(name, '/', -1)+1)||'_control bs=8k' as "controlfile" from v$controlfile;

Datafile

select '!dd if='||a.name||' of='||'&path/'||substr(a.name, instrb(a.name, '/', -1)+1)||'_'||lower(b.name)||' bs=8k' as "Datafile"
from v$datafile a, v$tablespace b
where a.ts# = b.ts#;

Redo log

select '!dd if='||f.member||' of=&path/'||substr(f.member, instrb(f.member, '/', -1)+1)||'_redo_'||f.group#||'_'||l.members||' bs=8k' as "redo"
from v$logfile f , v$log l
where f.group# = l.group#;


$