To see if the Oracle database is in archive mode

Source: Internet
Author: User

See if the Oracle database is archive mode   [1]  1.select name,log_mode from v$database;  name log_mode ----------------- -------------------------  QUERY noarchivelog  2. Using the Archive Log LIST command   Database log mode No Archive Mo  de  Automatic Archival disabled  Archive destination/data/oracle/product/10.2.0/db_1//dbs/arch  Oldest online log sequence 739  current log sequence 741  what is Oracle Archive mode Oracle database has an online redo log that records changes made to the database, such as inserting , delete, update data, and so on, these actions are recorded in the online redo log. A generic database must have at least 2 online redo log groups. When an online redo log group is written full, a log switch occurs, the online redo log Group 2 becomes the currently used log, when the online redo log Group 2 is full, the log switch, to write online redo log Group 1, so repeated.   If the database is in non-archive mode, the online log is discarded when it switches. In archive mode, when a log switch occurs, the log that is toggled is archived. For example, in the current use of online redo log 1, when 1 is full, a log switch occurs, start to write online redo log 2, the contents of online redo log 1 will be copied to another specified directory. This directory is called the Archive directory, and the copied files are called archive redo logs. The   database can be used for a catastrophic recovery only when it is running in archive mode.   1. Differences between archived and non-archived log Modes   Non-archive mode can only be cold backed up, and only a full backup can be done when recovering. Data not recovered during the most recent full backup to system error .  archive mode can do hot backups, and can do incremental backups, Can do partial recovery .  with archive LOG LIST to see whether the current mode state is archive mode or non-archive mode .  The archiving mode of the configuration database 1. Change non-returnFile mode to archive mode:  1) sql> conn/as sysdba (database connected as DBA)   2) sql> shutdown immediate; (Close database Now)   3) sql> startup mount (launch instance and load database but not open)   4) sql> ALTER DATABASE archivelog; (change databases to archive mode)   5) sql> ALTER DATABASE open; (Open database)   6) sql> alter system archive log start; (Enable auto-archive)   7) sql> exit   Make a full backup because the backup log generated in non-archived log mode is not available for the archive mode. This step is not very important!  2. Change the archive mode to non-archive mode:   1) Sql>shutdown normal/immediate;  2) sql>startup mount;  3) sql>alter DATABASE NOARCHIVELOG;&  nbsp 4) Sql>alter DATABASE open;  3. Enable AutoArchive: log_archive_start=true  archive mode, the log file group is not allowed to be overwritten (rewritten), after the journal file is full, If manual archiving is not performed, then the system hangs, knowing that the archive is complete until .  is read only and cannot be written .  shut down and restart the archive log process during run time   sql>archive log stop  sql> ARCHIVE log start  4. Manual archive: log_archive_start=false  Archive Current log file   Sql>alter SYSTEM ARCHIVE log current;&n  Bsp Log files with the archive sequence number 052   Sql>alter SYSTEM ARCHIVE log SEQUENCE 052;  Archive all log files   Sql>alteR SYSTEM ARCHIVE Log all;  Change archive log target   Sql>alter SYSTEM ARCHIVE log current to ' &path ';  5. Archive mode and non-archive Mode conversion   Reverse process of 4th step .  6. Configuring multiple Archive Processes   Q: When to use multiple archive processes?  A: If the archiving process consumes a lot of time, you can start multiple archive processes, which is a dynamic parameter that can be used with alter  You can specify up to 10 archive processes in the system dynamic modification .  sql>alter system SET log_archive_max_processes=10;  oracle9i   Dynamic performance views related to the archive process   v$bgprocess,v$archive_processes  7. Configure archiving targets, multi-archive targets, remote archive targets, archive log formats   archive targets Log_archive_ dest_n  Local archive target:  sql>log_archive_dest_1 = "Location=d:oraclearchivedlog";  Remote archive destination:  SQL> log_archive_dest_2 = "SERVICE=STANDBY_DB1";  mandatory archive target, if error, retry:  sql>alter SYSTEM SET log_archive_ after 600 seconds Dest_4 = "Location=e:oraclearchivedlog MANDATORY reopen=600";  Optional archive target, if error, discard archive:  sql>alter SYSTEM SET LO G_archive_dest_3 = "Location=e:oraclearchivedlog OPTIONAL";  Archive target status: Close archive target and open archive target   Close archive target 1  sql> ALTER SYSTEM SET log_archive_dest_state_1 = defer  Open Archive target2  sql>alter SYSTEM SET log_archive_dest_state_2 = enable  Archive log format   log_archive_format  8. Get archived logs Info   v$archived_log  v$archive_dest  v$log_history  v$database  V$ARCHIVE_PROCESSES  AR Chive LOG LIST;

See if the Oracle database is in archive mode

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.