Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Online Backup Oracle 7.3
Henrik Ørsted Hansen wrote:
> Hi DBA's
>
> It is not a problem to write a script, which performs online backup.
> But I
> want my backup dynamic, so if an ekstra datafile is added, it is
> automatically added to the backup routine.
>
> The platform is Digital Alpha NT, but thats not important. I had in
> mind,
> that the script out of the DBA_TABLESPACES and DBA_DATA_FILES using
> dynamic
> SQL should create another SQL script like this:
>
> alter tablespace SYSTEM begin backup;
> !ntbackup /a /v c:\orant\database\system01.dbf
> !ntbackup /a /v c:\orant\database\system02.dbf
> alter tablespace SYSTEM end backup;
> alter tablespace TABSPC1 begin backup;
> !ntbackup /a /v c:\orant\database\tabspc01.dbf
> !ntbackup /a /v c:\orant\database\tabspc02.dbf
> alter tablespace TABSPC1 end backup;
>
> and so on for each for each tablespace and datafile.....
> Unfortunately my PL/SQL is not that good, so I hope that you can help
> me!
>
> Henrik Ørsted Hansen
Hi!
Make a sql script that query the dba_tablespaces and dba_datafiles and spools to a file. Run it with sqlplus.
run than spool with
svrmgrl < hotbak.sql
this script puts each tablespace in BEGIN BACKUP state ,execute external
commands (use ! before command) for backup datafiles, and then puts
tblaespace in END BACKUP state
hotbak.sql may look like this:
>>>>>>
connect user/passwd
alter tablespace1 begin backup;
!external_command_for_backup <path_of_datafile_in_tablespace_1>
< new_name_in_backup_volume>
alter tablespace1 end backup
...
...
disconnect;
<<<<<<<<<<<<<<<<<<
Goodby,
javier mugueta
Received on Fri May 29 1998 - 06:25:43 CDT
![]() |
![]() |