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: Arcangelo <xxx_at_yyy.com>
Date: Mon, 23 Jun 2003 05:22:38 +1000
Message-ID: <3ef60202$0$31278$afc38c87@news.optusnet.com.au>

"Peter" <peter_at_nomorenewsspammin.ca> wrote in message news:9onafvci8trn912i0g9919s4dlau757vd5_at_4ax.com...
> On Sun, 22 Jun 2003 12:09:15 +1000, "Arcangelo" <xxx_at_yyy.com> wrote:
> >>
> >> 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"?

Correct. You start and stop instances, and you open and close databases, and you online and offline tablespaces and datafiles. However, that's a counsel of perfection, since not even Oracle's own documentation always makes the distinctions clearly and consistently.

Incidentally, a 'restricted' database is merely an open database. It happens that only holders of the 'restricted session' privilege are permitted to use it, but if they do hold that privilege, they can update, delete, insert and select etc etc etc as normal.

> Many users have the impression that "startup open" is the same as
> "online", if it is not online then it is offline.

Many users have the impression that all problems with software are the software's fault, and not theirs. They are usually wrong!

>
> 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".

But think about where the information that is shown in v$datafile is coming from. It's being read from the control file (the opening and reading the contents of which is what is meant by 'mounting the database'). And as far as the controlfile is concerned, the bits needed to indicate to DBWR not to bother writing to a datafile, and to CKPT not to bother updating the datafile header SCNs, have not been set. And that's what you're seeing with the 'online' column.

But in MOUNT state, by definition, DBWR and CKPT aren't going to be writing to anything anyway. Everything is offline.

> 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..

That's a rather special case you've thrown in there. It is true that during recovery, processes are permitted to write to datafiles which have not yet been opened. That, of course, is what recovery actually means... you can't open them normally because they are inconsistent, but we need a mechanism to get them consistent in the first place. That mechanism is to apply redo.

And yes, the online marker in the controlfile means that your server process is permitted to apply redo to them, provided of course you are connected as a privileged user (AS SYSDBA).

> 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?

Online/Offline, as per the controlfile, means: are processes allowed to write to the file, DBWR/CKPT when opened, server processes for the purposes of recovery? That's all. As far as ordinary users are concerned, nothing's "online" (ie, usable) until OPEN.

;-)

>
> Thanks
>
>
Received on Sun Jun 22 2003 - 14:22:38 CDT

Original text of this message

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