Oracle modifies the archive log path

Source: Internet
Author: User

One: First query the database whether to open the archive mode:

sql> archive Log list; ----Archive mode is turned on
Database Log Mode Archive mode
Automatic Archival Enabled
Archive Destination Use_db_recovery_file_dest----Modify this archive path
Oldest online log sequence 3
Next Log sequence to archive 5
Current log Sequence 5

Two: Create an archive directory:

[Email protected] ~]# mkdir-p/oracle/archive1
[Email protected] ~]# mkdri-p/oracle/archive2

Three: Set the database archive log target:

Sql> alter system set log_archive_dest_1= ' location=/oracle/archive1/' scope=spfile;

System altered.

Sql> alter system set log_archive_dest_1= ' location=/oracle/archive2/' scope=spfile;

System altered.

Sql> alter system set log_archive_format= ' Arch_%d_%t_%r_%s.log ' scope=spfile;

System altered.

Four: Restart the database:

sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sql> startup Mount;
ORACLE instance started.

Total System Global area 835104768 bytes
Fixed Size 2232960 bytes
Variable Size 633343360 bytes
Database buffers 197132288 bytes
Redo buffers 2396160 bytes
Database mounted.
sql> ALTER DATABASE Archivelog;---------If you have not previously opened the archive, you should turn on archive mode in the Mount state

Database altered.

sql> ALTER DATABASE open;

Database altered.

Five: Confirm that the database is in archived log mode and run the archiver with the following two queries:

Sql> Select Log_mode from V$database;

Log_mode
------------
ARCHIVELOG

Sql> Select archiver from V$instance;

ARCHIVE
-------
STARTED

Six: Force log switchover:

sql> alter system switch logfile;

System altered.

Sql> select name from V$archived_log;

NAME
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_22_9k57ms6o_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_23_9k57mswx_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_21_9k57mvl6_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_23/o1_mf_1_1_9lxm5kto_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_18/o1_mf_1_2_9t35pvw9_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_18/o1_mf_1_3_9t36mqn3_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_20/o1_mf_1_4_9t8d0003_.arc

7 rows selected.

----------found no archive log occurred

Troubleshoot the problem:

One: Into the database Background query log report:

Ora-16014:log 2 sequence# 5 not archived, no available destinations
Ora-00312:online Log 2 thread 1: '/s01/oracle/oradata/athena/redo02.log '
Mon June 23 22:49:18 2014
Arc2:error 19504 Creating Archive log file to '/oracle/archive2/arch_4e31002f_1_841143545_5.log '
Arch:archival stopped, error occurred. would continue retrying
ORACLE Instance Athena-archival Error
Ora-16038:log 2 sequence# 5 cannot be archived
ora-19504:failed to create File ""
Ora-00312:online Log 2 thread 1: '/s01/oracle/oradata/athena/redo02.log '
Mon June 23 22:49:18 2014

The query is not right, because the directory created under root does not have permissions for Oracle:

[Email protected] oracle]# chown oracle:oinstall archive1
[Email protected] oracle]# chown oracle:oinstall archive2

To continue the query:

sql> select name from V$archived_log;

NAME
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_22_9k57ms6o_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_23_9k57mswx_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_02/o1_mf_1_21_9k57mvl6_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_03_23/o1_mf_1_1_9lxm5kto_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_18/o1_mf_1_2_9t35pvw9_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_18/o1_mf_1_3_9t36mqn3_.arc
/s01/oracle/fast_recovery_area/athena/archivelog/2014_06_20/o1_mf_1_4_9t8d0003_.arc
/oracle/archive2/arch_4e31002f_1_841143545_5.log
/oracle/archive2/arch_4e31002f_1_841143545_6.log
/oracle/archive2/arch_4e31002f_1_841143545_7.log
/oracle/archive2/arch_4e31002f_1_841143545_8.log

Problem Solving!!!

This article is from "one van" blog, please be sure to keep this source http://1336014.blog.51cto.com/1326014/1429427

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.