Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

Archive, archive logs Oracle

Marcelo De Florio_1
Frequent Advisor

Archive, archive logs Oracle

I need a archive the files of archive logs of Oracle 8.1.6, I use the ar command of operating system,
anybody know if this command is appropiate to this.


Marcelo De Florio
A. Clay Stephenson
Acclaimed Contributor

Re: Archive, archive logs Oracle

Hi Marcelo,

I do not quite understand your question but I can tell you that ar is NOT the command to use. It is used to build libraries of object files to be linked with other object files to build executables. It is also used to build shared object libraries.

You can use tar or cpio to archive the Oracle archive logs to tape or to another disk area.

Regards, Clay
If it ain't broke, I can fix that.
Alexander M. Ermes
Honored Contributor

Re: Archive, archive logs Oracle

Hi there.
If you want to run Oracle in ARCHIVELOG mode,
try this :
Setup config.ora according to sample

control_files = (/u011/ORACLE/DE01/cntrl/control.ctl,
# Below for possible future use...
#init_sql_files = (?/dbs/sql.bsq,
# ?/rdbms/admin/catalog.sql,
# ?/rdbms/admin/expvew.sql)
audit_file_dest = /home/dba/oracle/admin/DE01/audit
background_dump_dest = /home/dba/oracle/admin/DE01/bdump
core_dump_dest = /home/dba/oracle/admin/DE01/cdump
user_dump_dest = /home/dba/oracle/admin/DE01/udump
log_archive_dest = /home/dba/oracle/admin/DE01/arch/arch
db_block_size = 8192

db_name = DE01

set the paramater LOG_ARCHIVE_START = TRUE

shutdown the database. startup database mount.
Do this with svrmgrl. Then activate barchive log mode :

alter database archivelog;

shutdown of database.
startup of database.
to check go to svrmgrl, connect and enter
alter system switch logfile;

Then you should find an offline redo log file in your archive directoy. Don't forget the naming and the rest of the params, but that is all in the manuals.
Hope i could help you for a start.
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"

Re: Archive, archive logs Oracle


If your DB is now in archivelog mode, I understand that you need to backup those files, use tar, cpio, fbackup or any other command to put the files on a tape or other disk.

But if the DB is not in archivelog mode, you must follow these steps:

1.- Shutdown the BD
2.- Make a Backup
3.- Modify the init file:

log_archive_start = true

look for a (maybe big) filesystem to put the archivelog files


this is the format of the name of the archivelog files

4.- Now in svrmgrl or sqlplus

Startup mount
Alter database archivelog
Alter database open
Alter system switch logfile
Shutdown immediate

5.- and start the DB in the normal way.

Now the DB is in archivelog mode.

Marcelo De Florio_1
Frequent Advisor

Re: Archive, archive logs Oracle

Clay, you undertand my question, but I use ar command for achive files, you know any problem with this.
the archive log not be restored ?

Marcelo De Florio
A. Clay Stephenson
Acclaimed Contributor

Re: Archive, archive logs Oracle

Hi again Marcelo,

Yes, if you really want to ar can be used to store with the -r option and later extract with the -x option files of any type. However, your archive library will eventually become very, very large. Ar was never really intended for this purpose but it will work.

If what you are trying to do is to keep all the needed archives in 1 file, this would work. You could use the -d (delete) option to delete the outdated archive logs while continuing to add new archive logs.

It is probably much easier to copy your archive logs to a directory and to run tar to backup the files in that directory and to use find . -mtime +3 -exec rm {} \; to remove the older archive logs (in this case older than 3 days) from the directory.

Regards, Clay
If it ain't broke, I can fix that.
Bill Thorsteinson
Honored Contributor

Re: Archive, archive logs Oracle

The ar command is generally used to build object file archives (libraries) for building programs. The archives it works with can be updated easily. It it not an
appropriate tool for archives stored on tape.

ar in native mode often limits the length of file names. This makes it unsuitable for many archiving tasks.
Oracle archive files tend to have long file names. If
the names are longer than ar uses you will lose archive
files. This is a very bad thing.

ar is the first command that man -k returns for archive.
Use 'man -k archiv' for a better list that includes tar
(tape archive) and cpio (copy in or out). As noted
above cpio, tar, and fbackup are appropriate tools.

Your archive files will be useless unless you have all
the archive files since the last consistent copy of the
tablespace you are recovering. Consistent copies are
generated after cold backups, and properly done hot
backups. Check the Oracle manuals.