ORACLE Archive Log Open shutdown method

Source: Internet
Author: User

One set to archive mode

[XHTML]View Plaincopyprint?
  1. 1 SQL> Archive log list; #查看是不是归档方式
  2. 2 SQL> alter system set log_archive_start=true scope=spfile; #启用主动归档
  3. SQL> Alter system set log_archive_dest=' location=/oracle/ora9/oradata/arch ' scope=spfile;
  4. #设置归档路径
  5. SQL> Alter system set log_archive_dest_1=' location=/oracle/ora9/oradata/arch1 ' scope=spfile;
  6. SQL> Alter system set log_archive_dest_2=' location=/oracle/ora9/oradata/arch2 ' scope=spfile;
  7. #如果归档到两个位置, you can do this by using the top method
  8. SQL> Alter system set log_archive_format=' arch_%d_%t_%r_%s.log ' #设置归档日记款式
  9. 3 SQL> Shutdown immediate;
  10. 4 SQL> Startup mount; #打开控制文件, do not open the data file
  11. 5 SQL> ALTER DATABASE archivelog; #将数据库切换为归档模式
  12. 6 SQL> ALTER DATABASE open; #将数据文件打开
  13. 7 SQL> Archive log list; #查看此时是否处于归档模式
  14. 8 query to determine that the database is in Archivelog mode and the archive process is running
  15. SQL> select Log_mode from V$database;
  16. SQL> select archiver from V$instance;
  17. 9th Log Toggle
  18. SQL> alter system switch logfile;
  19. 10 This log switch writes the archive to two destinations,
  20. 1, that is, the second step of/oracle/ora9/oradata/arch1 and/oracle/ora9/oradata/arch1, if you want to confirm the directory
  21. In the Oracle scenario, run the following query:
  22. SQL> select name from V$archived_log;
  23. The files listed in the query are then confirmed in the operating system.

Two set non-archive mode

[Java] view plaincopyprint?
  1. 1 sql> archive log list; #查看是否是归档方式
  2. 2 sql> alter system set log_archive_start=false scope=spfile; #禁用自动归档
  3. 3 sql> shutdown immediate;
  4. 4 sql> startup Mount; #打开控制文件, do not open the data file
  5. 5 sql> ALTER DATABASE noarchivelog; #将数据库切换为非归档模式
  6. 6 sql> ALTER DATABASE open; #将数据文件打开
  7. 7 sql> archive Log list; #查看此时便处于非归档模式

Three-Archive related commands

[Java] view plaincopyprint?
    1. Archive log stop;
    2. Archive log start;
    3. Archive log list;
    4. Show parameters;
    5. Show Parameters Log_archive_start;
    6. Show Parameters log_archive_max_process; #归档进程数
    7. Alter system set log_archive_max_process=5; #将归档进程数改为5
    8. SELECT * from V$bgprocess; #检察后台进程

ORACLE Archive Log Open shutdown method

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.