Re: What to backup in Oracle?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Tue, 27 Feb 2001 09:51:02 -0000
Message-ID: <97ftaf$d7t$1_at_soap.pipex.net>


[Quoted] Kind of backup 101 but there you are.

There are two different types of backups that can be performed on an Oracle database.

    [Quoted]
  1. Logical - otherwise known as export. Sybrand has covered this well.
  2. Physical - otherwise known as copying the files someplace else.

Either of these can be done on a full or partial basis. Export because it is [Quoted] a logical solution ranges from a single table or index , up to the entire database. Backup because it works at the file level can work from a single file upwards though typically you'd want to backup at least one tablespace or all the control files. I believe that using RMAN you can backup just changed data blocks since the last backup. I have yet to meet anyone actually using this though.

If you take the physical backup route you have to do one of two things.

  1. shut the database down before copying the files. or
  2. tell oracle you are about to perform a backup, and then tell it when it is finished.

Finally a physical backup can be performed either in archivelog mode , or not. If your database is in archivelog mode you can restore up to the point [Quoted] of failure from your last good backup. Otherwise you can only restore the last good backup.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"None" <nospam_at_nospam.com> wrote in message
news:8fvd9tsib22qd6l5qid0e0h3gnmbs7vghu_at_4ax.com...

> Dude, CHILL!!! He is actually correct. Most of the news groups cater
> to realworld problems beyond a learning phase. In other words, they
> expect that most people asking questions have tried various solutions
> and used other references before asking everyone your question.
>
> I am not an "expert" like many of the other folks here, but this is
> what light I can shed on your question:
>
> The script you looked at was indeed what is known as an export script.
> The "logical" backup of your database would use this method to save
> off what is *in* your database. For example, when you run the exp
> utility, you can save off the table data, the table structures, views,
> synonyms, triggers, indexes, grants (permissions), etc. - all in one
> big file.
>
> What you do with that big backup file is use the imp utility (import).
> Using imp, you can import all of the things that you saved into an
> existing database. So, for example, you could use exp to save off
> your database every night. Then, if your data gets screwed up, you
> can dump it all and import one of the backups.
>
> Using exp and imp is not saving the whole database. Instead it is
> working at a table or user level. The other type of backup would be a
> "physical" backup. I don't know how to do that, but I would guess it
> would backup the actual *physical* files that make up the database, or
> at least work on a tablespace level and higher.
>
> Hope that helps. Oh, and I don't care who finds me rude, as I suspect
> the other fellow doesn't either. Ego's need to be kept in check when
> you are asking for or giving help!
>
> - Chris (NOT a DBA, but I do a bunch of his work!)
>
>
> On Fri, 23 Feb 2001 13:18:49 GMT, "user Linux" <kankossa_at_free.fr>
> wrote:
>
> >Dans l'article <pYel6.1043$02M1.41549906_at_news.xtra.co.nz>, "Jason Seeley"
> ><me_at_127.0.0.1> a écrit :
> >
> >I find that you are rude. How You can tell something like this?
> >How You can speak behalf people which are devoted to answer freely anyone
> >and give their time and effort to do that?
> >If you having 20 years experienced as DBA of oracle and more for
> >Unix/Linux I'm soo happy for your. This is not my case, I came just to
> >begin with oracle and linux.
> >Only note, I don't forced you to answers me!. This is the sense
> >fortunatly of news!
> >
> >Thanks anyway, for your answer on my questions.
> >
> > are
> >> Mate you better start reading a least a couple of manuals, if you keep
> >> asking similar questions you're going to start annoying some of the
> >> people here - and believe me you won't like it when their annoyed 8-0
> >>
> >> I'm no expert but AFAIK an export script creates a file containing the
> >> data and structures of your database. The files it creates are not so
> >> much restored as they are "imported" at a later date or into another
> >> database should you wish. Sybrand called this a logical backup because
> >> the files it creates are on your harddrive. If you then backed this up
> >> onto tape then you would be creating a physical backup (which could
then
> >> be stored seperate from your machine)
> >>
> >> The reason the script didn't have to mention your oracle sid (bas 1) is
> >> because its a variable and when you ran the script Oracle would have
> >> looked for that variable to determine what your sid was (if you don't
> >> know what a variable is try typing in set at the command prompt to
> >> see a list of variables that currently have values set for them. And
> >> perhaps you need to find a book on linux 8-) Try "Teach yourself
linux
> >> in 21 days" I understand its very good for people just starting out.
> >>
> >> Hopefully I have answered some of your questions - I intended this to
be
> >> read in good humor - I was not trying to be nasty or insulting.
> >>
> >>
> >> Cheers
> >>
> >>
> >>
> >> user Linux <kankossa_at_free.fr> wrote in message
> >> news:d_cl6.3068$Yj2.4934760_at_nnrp6.proxad.net...
> >>> Dans l'article <gtla9tg0kh7nqed6crmj95ctjmlc0juegm_at_4ax.com>, "Sybrand
> >>> Bakker" <postbus_at_sybrandb.demon.nl> a écrit :
> >>>
> >>> > On Thu, 22 Feb 2001 16:41:48 GMT, "user Linux" <kankossa_at_free.fr>
> >>> > wrote:
> >>> >
> >>> >>Hello,
> >>> >>
> >>> >>I find the following script for backup the oracle database. But I
> >>> >>don't know what to do exactly.
> >>> >>
> >>> >>#!/bin/sh
> >>> >>PATH=$PATH:$ORACLE_HOME/bin export PATH echo "BEGIN: $(date)"
> >>> >>file1="YOUR_DATABASE_$(date +%Y%m%d).dmp"
file2="YOUR_DATABASE_$(date
> >>> >>+%Y%m%d).log" exp userid=login/password file=$file1 log=$file2
> >>> >>full=yes
> >>> >>echo "END: $(date)"
> >>> >>
> >>> >>I know that my instance has the same name as th db_name both called
> >>> >>"bas1" as I can see from initbas1.ora in /pfile directory.
> >>> >>However in can't find where this base lies physical, grep, find can
> >>> >>not find it. What to replace in place of "YOUR_DATABASE" in the
> >>> >>above script? Can somebody helping me?
> >>> >
> >>> >
> >>> > This in an export script. Export is *logical* backup, not
*physical*,
> >>> > so in this case the location of your files is completely irrelevant.
> >>> > The script assumes the env var ORACLE_SID has been set. I would you
> >>> > this variable for YOUR_DATABASE warning: export as logical backup
can
> >>> > not replace a physical backup
> >>> >
> >>> > Hth,
> >>> >
> >>> >
> >>> > Sybrand Bakker, Oracle DBA
> >>>
> >>> Thanks for reply. My ORACLE_SID=bas1. Now when I replace
> >>> "YOUR_DATABASE" by any file like
> >>> "somthing", the script works and backup me a file called
> >>> somthing_20010222.dmb and somthing_20010222.log. Is this means that
the
> >>> DB has been effectivelly backup even if I dont mentionne "bas1"
> >>> anywhere in the script? How I can restore?
> >>>
> >>> What the difference between logical and physical backup? In the case
of
> >>> physical backup, where is the emplacement of the my database "bas1".
> >>>
> >>> Thanks so.
> >>
> >>
>
Received on Tue Feb 27 2001 - 10:51:02 CET

Original text of this message