Oracle archiving operations, oracle archiving logs

Source: Internet
Author: User

Oracle archiving operations, oracle archiving logs
Oracle uses redo log files to record database operations, But redo log file groups are used cyclically. When all log files are filled up, the system automatically switches to the first log file, of course, the database administrator can also use commands to manually switch between them. When the log file is recycled, the existing Log File Content in the log file will be overwritten. To fully record all database operations, orale puts forward the concept of archiving logs.

If the log file is not in archive mode, the content in the log file will be overwritten by the new content. If the log file is in archive mode, the system will archive the log file before writing new log content to the file. '
 
Oracle has two log modes,
Non-archive log mode (noarchivelog)
In non-archive log mode, if a log switch occurs, the original content of the log file overwrites the new content;
Archivelog)
In archive log mode, if a log switch occurs, the oracle System copies and saves the log files to a specified place. This process is called archive ", the copied log file is called "archive log" before new log content can be written to the file.

Set database mode
When installing oracle, the database runs in non-archive mode by default. This avoids archiving logs generated during database creation and shortens the database creation time, after the database runs successfully, the database administrator can modify the running mode of the database as needed.
To modify the running mode of the database, use the following statement:
Alter database archivelog | noarchivelog;
Archivelog indicates the archive mode, while noarchivelog indicates the non-archive mode.


The specific operations are as follows:
SQL> connect c # scott/tiger as sysdba;
Connected.
SQL> archive log list; -- query the log mode of the current database
Database Log mode non-archive Mode
Disable automatic archiving
Archive endpoint D: \ oracle \ app \ Administrator \ product \ 12.1.0 \ dbhome_1 \ RDBMS
Oldest online log sequence 68
Current Log sequence 71
SQL> shutdown
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.
SQL> startup mount; -- start the database instance, but do not open the database
The ORACLE routine has been started.
Total System Global Area 2550136832 bytes
Fixed Size 3048872 bytes
Variable Size 671091288 bytes
Database Buffers 1862270976 bytes
Redo Buffers 13725696 bytes
The database has been loaded.
SQL> alter database archivelog; // archive mode operation
The database has been changed.
SQL> alter database open;
The database has been changed.
SQL> archive log list;
Database Log mode archiving Mode
Enable automatic archiving
Archive endpoint D: \ oracle \ app \ Administrator \ product \ 12.1.0 \ dbhome_1 \ RDBMS
Oldest online log sequence 68
Next archive log sequence 71
Current Log sequence 71
SQL>

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.