Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL generating SQL
Kevin
first up it is good that you realise this. Usually this is found out only when a backup needs to be applied.
Oracle has two basic physical backup modes
In order to do this the database MUST be in archivelog mode, so that you can keep all the redo.
How do you do it. well this is where the using sql to write sql comes in.
a backup script might look a bit like this
ALTER TABLESPACE USERS BEGIN BACKUP;
HOST dd '/u01/oracle/instancename/users01.dbf' '/u01/backups/instancename/users01.dbf' HOST dd '/u01/oracle/instancename/users02.dbf' '/u01/backups/instancename/users02.dbf'
which achieves (if i can recall my unix commands correctly) what i described above.
well you can just write a script along the lines shown above. this will backup just fine. However eventually you might add a datafile to the users tablespace. at this point a manual script needs updating. if however you have used sql to write the script (by query v$datafiles) your script will automatically be updated.
You should at the very least read the backup and recover guide available at technet.oracle.com. There is also a pretty good discussion in kevin loney's Oracle DBA Handbook which is an essential reference.
finally you can also keep logical backups by using cron to automate an export each night.
HTH
Niall
"Kevin S. Smith" <ksmith_at_erieplating.com> wrote in message
news:tr8tl18gv3i262_at_corp.supernews.com...
> I have just come to the stunning realization (yes, I am sort of new at
this)
> that my backups that I have been creating are useless. I need to do
> complete backups at night without shutting down. Right now I am just
using
> the cron (Linux rh6.2) to dump the directories to tape without shutting
> down. Well, this is useless because the datafiles are being written to
and
> the headers and synch are getting hosed up. To make a long story short, I
> am looking for an efficient script that would capture all my datafiles,
> control file, and archive logs, so I can put them in "backup mode", and
then
> copy them to tape one at a time. I am told the best way to do this is to
> use "sql generating sql" to create a script. It is my understanding that
> this method would freeze the headers while still allowing the datafile to
be
> written to. Please tell me if i am barking up the wrong tree. This is
> obviously very important and any help would be appreciated.
>
> Oracle 8161 on Linux RedHat 6.2
>
> Thanks
>
>
>
Received on Sat Sep 29 2001 - 04:53:27 CDT
![]() |
![]() |