Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ocopy and Archived Logs

0 views
Skip to first unread message

Gary

unread,
Dec 8, 2009, 2:26:31 PM12/8/09
to
What command can be used to show which archive log files needed to
restore from the most recent ocopy backup? Is there such a command?

Thanks in advance.

ddf

unread,
Dec 8, 2009, 3:34:12 PM12/8/09
to

There is no such command; ocopy is merely the standard copy command
'gussied up' to allow it to copy files currently in use. It is not a
fully featured backup utility; for that you use RMAN.

David Fitzjarrell

Gary

unread,
Dec 8, 2009, 5:38:17 PM12/8/09
to
ddf wrote:
> There is no such command; ocopy is merely the standard copy command
> 'gussied up' to allow it to copy files currently in use. It is not a
> fully featured backup utility; for that you use RMAN.
>
>
>
> David Fitzjarrell

I figured as much. Thanks for the response.

The trouble I'm having is knowing when to remove unneeded archive logs.
Currently, I remove older logs based on the file creation date. I figure
that retaining logs created at least a day before the most recent
successful backup should guarantee that the first archive log in the
restore sequence will be present. This is error prone, I know. I was
hoping the DB would keep track of the name of the first archive log
after the ocopy was started, but seeing as ocopy just concurrently
copies the datafiles, it makes sense that it doesn't.

Regarding RMAN vs ocopy, I inherited this setup and plan to change it in
the future. To what, I'm not sure. I've heard RMAN is complicated (never
used it). I'm after something simple like exp, but faster.

joel garry

unread,
Dec 8, 2009, 6:19:55 PM12/8/09
to

RMAN could be complicated, but for simple use, it is simple. What
version are you on? For any recent version, it is simpler than any
other way. It also has commands so you can have it figure out if what
it needs is around, or what it would need if it isn't. There are
situations where you need something older than the first archive log
after the copy was started. Don't forget, there are things going on
in the background, too.

RMAN stands for Recovery Manager, which is a lot more important than
backups, right? See the backup manuals for examples.

If you are on fully patched 10gR2 or above and have dbcontrol, default
backup is almost good enough (though I'd recommend copying the backup
command it makes elsewhere for when it screws up). Just a few
configuration changes are necessary, site dependent - you can tell it
things like retention policies. The compressed backups work good, and
wind up being quicker than any other backup method plus compression.
Also, RMAN is smarter than user managed backups as far as fractured
blocks (look it up), it doesn't have to generate excess redo because
of placing files in backup mode.

All the other stuff it does is icing. Really good icing if your
management decides it is needed.

jg
--
@home.com is bogus.
http://www.signonsandiego.com/news/2009/dec/05/sec-slaps-nova-gen-charges/

Jeremiah Wilton

unread,
Dec 12, 2009, 12:30:19 PM12/12/09
to
On Dec 8, 9:26 am, Gary <gjwater...@gmail.com> wrote:
> What command can be used to show which archive log files needed to
> restore from the most recent ocopy backup? Is there such a command?

You can query something like:

select l.name
from v$archived_log l,
v$database d
where l.activation# = d.activation#
and l.next_change# <
(select min(change#)
from v$backup);

The above query lists all archivelogs older than the earliest start-
backup time of all datafiles. You can delete logs in this list,
assuming that:

1. You are in fact using tablespace hot backup mode. If not, then all
open backups are invalid.
2. You never want to recover to a point in time prior to the most
recent backup using a prior backup
3. You are in fact copying all files that you put into backup mode
4. Your controlfile record keep time is longer than the age of your
oldest archivelog

Regards,

Jeremiah Wilton
Blue Gecko, Inc.
http://www.bluegecko.net

Gary

unread,
Dec 14, 2009, 10:50:15 AM12/14/09
to
Jeremiah Wilton wrote:
> You can query something like:
>
> select l.name
> from v$archived_log l,
> v$database d
> where l.activation# = d.activation#
> and l.next_change# <
> (select min(change#)
> from v$backup);
>
> The above query lists all archivelogs older than the earliest start-
> backup time of all datafiles. You can delete logs in this list,
> assuming that:

Excellent. This is exactly what I was looking for. Thank you.

> 1. You are in fact using tablespace hot backup mode. If not, then all
> open backups are invalid.
> 2. You never want to recover to a point in time prior to the most
> recent backup using a prior backup
> 3. You are in fact copying all files that you put into backup mode
> 4. Your controlfile record keep time is longer than the age of your

> oldest archivelog.

1. Correct. The database is in archivelog mode and the backups are being
done within 'begin backup' and 'end backup' statement.
2. Correct. Any older ocopy backups will be restored from the time they
are run. Transactions logs will not be used.
3. Correct. I'm using a script which loops through the tablespaces in
sys.dba_tablespaces, putting them in backup mode, backing them up with
ocopy, and taking them out of backup mode.
4. I'm not sure. The control files are being backed up to trace, then
backed up to file:

dbms_output.put_line('alter database backup controlfile to trace;');
dbms_output.put_line('alter database backup controlfile to '||''''||
copy_dest||'control.'||dbname||'.'||
to_char(sysdate,'DDMonYYHH24MI')||''''||';');

This section comes last in the backup script, just before the the
logfile is switched. I'm not sure what is meant by "keeptime is longer
than the age of the oldest archivelog"; does this mean the controlfile
should be backed up /first/ in the script?

Thanks again,
-Gary

joel garry

unread,
Dec 14, 2009, 12:41:54 PM12/14/09
to
On Dec 14, 7:50 am, Gary <gjwater...@gmail.com> wrote:

>
> This section comes last in the backup script, just before the the
> logfile is switched. I'm not sure what is meant by "keeptime is longer
> than the age of the oldest archivelog"; does this mean the controlfile
> should be backed up /first/ in the script?
>

There is an entry in the system reference manual for an alter system
command called CONTROL_FILE_RECORD_KEEP_TIME "...specifies the minimum
number of days before a reusable record in the control file can be
reused."

The default is 7 days, which is entirely too short for many places.
Google about for opinions on how this should be set for different ways
of dealing with archived logs like
http://mrothouse.wordpress.com/2006/11/06/oracle9i-control_file_record_keep_time/
Personally, I set it to 30 and then figure out what it should be with
management sign-off on a given retention policy.

jg
--
@home.com is bogus.

http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf

0 new messages