Archive logs and oracle archive logs

Source: Internet
Author: User

Archive logs and oracle archive logs

RAC
Sqlplus/as sysdba
SQL> alter system set cluster_database = false scope = spfile; -- in node1
SQL> create pfile = '/opt/oracle/pfile_20120301' from spfile; -- in node1
SQL> alter system set log_archive_format = 'ora11g _ % r _ % t _ % s. log' scope = spfile; -- in node1, using default value is OK
SQL> alter system set log_archive_start = TRUE scope = spfile; -- in node1
SQL> alter system set log_archive_dest = ''scope = spfile; -- in node1
SQL> alter system set log_archive_dest_1 = 'location =/oracle/ora_arch 'scope = spfile; -- in node1 using the specificated DIR
SQL> shutdown immediate; -- two nodes
SQL> startup mount; -- in node1
SQL> alter database archivelog; -- in node1
SQL> alter database open; -- in node1
SQL> alter system set cluster_database = true scope = spfile; -- in node1
SQL> shutdown immediate; -- in node1
SQL> startup; -- in two nodes

NORAC
Sqlplus/as sysdba
SQL> create pfile = '/opt/oracle/pfile_20120301' from spfile;
SQL> alter system set log_archive_format = 'ora11g _ % r _ % t _ % s. log' scope = spfile; -- using default value is OK
SQL> alter system set log_archive_start = TRUE scope = spfile;
SQL> alter system set log_archive_dest = ''scope = spfile;
SQL> alter system set log_archive_dest_1 = 'location =/oracle/ora_arch 'scope = spfile; -- using the specificated DIR
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;
SQL> archive log list;


What is the difference between online logs and archived logs?

I. NO ARCHIVELOG
The database has a redo log of the connected machine. This log records changes made to the database, such as insertion, deletion, and data update. All these operations are recorded in the online redo log. Generally, a database must have at least two online redo log groups. When an online redo log group is full, log switching occurs. At this time, online redo log group 2 becomes the currently used log. When online redo log group 2 is full, log switching occurs again. Write online redo log group 1, and then repeat it.
Ii. ARCHIVELOG
The basic situation is the same as above. The only difference is that when a log switch occurs, the log to be switched will be archived. For example, currently online redo log 1 is used. When 1 is full, log switching occurs and online redo log 2 is started, at this time, the content of online redo log 1 will be copied to another specified directory. This directory is called the archive directory, and the copied file is called the archive redo log.
The difference between them is that one archive and one non-archive. You can perform catastrophic recovery only when the database is running in archive mode.

Archive logs in oracle differ from database backup

Archiving logs redo the backup of logs, and redo logs record all the changes to the data (DML, DDL, or structural changes made to the data by the Administrator). You can recover the data, you can also restore other files.

Database Backup can be divided into many types, such as common exp and rman. The Archiving status of rman backup must be enabled, that is, rman backup and archiving logs are closely related, rman backup can back up control files, data files, redo log files, and other files, comprehensive.
Exp logical backup backs up data in data files.
The difference is that exp can only restore database data, archive logs can restore data and other files (using rman backup ).
Archive logs must be used together with rman backups and cannot be used separately for comparison with Database backups. This makes no sense.

Hope to help you!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.