Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can you backup a tablespace when the database is offline

Re: Can you backup a tablespace when the database is offline

From: Brian Peasland <oracle_dba_at_remove_spam.peasland.com>
Date: Mon, 23 Jun 2003 14:17:23 GMT
Message-ID: <3EF70BF3.DC33F3B9@remove_spam.peasland.com>


If the database is in MOUNT mode, then the datafiles are not opened. When querying V$DATAFILE, you are not querying from the data dictionary, but rather the control files, which is the only thing that Oracle has touched at this point. When the database is opened, this is when the tablespace's datafiles are touched for the first time.

HTH,
Brian

Peter wrote:
>
> On Sun, 22 Jun 2003 12:09:15 +1000, "Arcangelo" <xxx_at_yyy.com> wrote:
>
> >"Peter" <peter_at_nomorenewsspammin.ca> wrote in message
> >news:kes9fvcllh5t5pp7t2dra4ueqq4iht2m2o_at_4ax.com...
> >> On 18 Jun 2003 10:27:40 -0700, mngong_at_yahoo.com (michael ngong) wrote:
> >>
> >> >Peter <peter_at_nomorenewsspammin.ca> wrote in message
> >news:<v3ruevobqem3bcbuib4fca4hmr6uddsjdj_at_4ax.com>...
> >> >> Hi,
> >> >>
> >> >> Can you backup a tablespace when the database is offline?
> >> >> I know you can backup a datafile when the databse is either online or
> >> >> offline.
> >> >>
> >> >> Thanks for your attention
> >> >
> >> >
> >> >You can only perform a hot backup (tablespace by tablespace backup)
> >> >when the database is online.When the database is not online, there is
> >> >no way I know of that you can have access to the tablespaces.So being
> >> >able to back up a tablespace when the database is offline goes without
> >> >saying "not possible"
> >> >
> >>
> >> Suppose I am using user managed backup. When the DB is offline but
> >> mounted,
> >
> >A database can't be "Offlined", but only shutdown or in some other state
> >than 'open' (the effect of 'offlining' a database and shutting it down is
> >the same, but let's get the terminology correct).
> >
>
> So , can I say there is no such thing as an "online" database, since
> there are only "nomount", "mount", "open" and "restrict" states when
> you execute "startup"?
> Many users have the impression that "startup open" is the same as
> "online", if it is not online then it is offline.
>
> >>the tablespaces and datafiles can still be online.
> >
> >By definition, that's not correct. If the database is in MOUNT state, then
> >none of the datafiles are online.
> >
> >And tablespaces don't exist until the database is open (that is, use of
> >'alter tablespace' language tends to be restricted to the fully open state.
> >Before you get there, it tends to be only 'alter database' commands that can
> >be issued).
> >
> >>so you can
> >> still copy files using OS commands.
> >
> >Your ability to copy files using OS commands has nothing to do with whether
> >the database is MOUNTed, OPENed, or off singing Christmas Carols somewhere
> >in Zurich. You can always copy O/S files, whatever state the database is in,
> >because the O/S wouldn't have a clue about the state of the database. You
> >can even copy files with the database fully open... just don't expect the
> >results of such a copy ever to be useable in a recovery situation.
> >
> >>
> >> But if the the DB is online, you can use:
> >> "alter tablespace tbs begin backup"
> >>
> >> I cannot find
> >> "alter database datafile df begin backup"
> >> in the manual. Is this command valid?
> >>
> >
> >No it's not. All datafiles within a tablespace have to have their SCNs
> >frozen at the point where you start doing a hot copy. That's why the begin
> >backup command has the tablespace as its scope.
> >
> >You can only issue 'alter tablespace' commands with the database fully open,
> >whereas 'alter database' commands work in the mount state, generally. But if
> >you were in the MOUNT state, then your datafiles would all be offline,
> >without exception, and you could do a simple O/S copy of them without
> >issuing any SQL commands at all, because it would count as a cold backup.
> >Thus, there would be no point in issuing an 'alter database' command to
> >start a hot backup.
> >
>
> Yes, this is confusing. I understand what you mean.
> If you "startup mount", users cannot access the database.
> However, you can execute
> "select * from v$datafile" you can see that the "status" column says
> that the datafiles are "online".
> If at this point you execute "recover database", all datafiles with
> "status=online" will be recovered, but those with "status=offline"
> will not be recovered..
> So a datafile with "status=online" does not really mean a user can
> access it, since the DB is in mount state. Is this the correct
> concept?
>
> Thanks

-- 
===================================================================

Brian Peasland
oracle_dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Mon Jun 23 2003 - 09:17:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US