Archive logs (below), archive logs (

Source: Internet
Author: User

Archive logs (below), archive logs (

1 SQL> archive log list; # Check whether the archive mode is used
2 SQL> alter system set log_archive_start = true scope = spfile; # enable active Archiving
SQL> alter system set log_archive_dest = 'location =/oracle/ora9/oradata/arch 'scope = spfile;
# Set the archiving path
SQL> alter system set log_archive_dest_1 = 'location =/oracle/ora9/oradata/arch1' scope = spfile;
SQL> alter system set log_archive_dest_2 = 'location =/oracle/ora9/oradata/arch2' scope = spfile;
# If the file is archived to two locations, you can use the above method to implement
SQL> alter system set log_archive_format = 'arch _ % d _ % t _ % r _ % s. log' # set the archive diary style
3 SQL> shutdown immediate;
4 SQL> startup mount; # Open the control file instead of the data file
5 SQL> alter database archivelog; # Switch the database to archive Mode
6 SQL> alter database open; # open the data file
7. SQL> archive log list; # Check whether the file is in archive mode.
8. query to confirm that the database is in archivelog mode and the archiving process is running.
SQL> select log_mode from v $ database;
SQL> select archiver from v $ instance;
9 log Switching
SQL> alter system switch logfile;
10 This log switch writes archive to two destination locations,
 
1. Use the archive log list command to display information such as the LOG operation mode, archiving location, and the LOG serial number to be archived automatically.
Archive log list;

2. Check the current log operation mode.
SELECT log_mode from v $ database;

3. enable or disable archiving logs
Shutdown immediate;
Startup monut;
Alter database noarchivelog/archivelog;
Alter system set log_archive_dest = '/ora_arch' scope = spfile sid = 'ora11g1 ';
Alter database open;
SQL> alter system set db_recovery_file_dest = ''scope = both;
SQL> alter system set log_archive_dest_1 = 'location =/ora_arch 'scope = both;

4. The initialization parameter LOG_ARCHIVE_FORMAT is used to specify the file name format for archiving logs.
Show parameter log_archive_format; -- % t _ % s _ % r. dbf

5. Use LOG_ARCHIVE_DEST to configure the archive location
Show parameter LOG_ARCHIVE_DEST;
Alter system set log_archive_dest = '/ora_arch ';

6. view the archived Log Path status
Select dest_name, destination, status, error from v $ archive_dest;


In archive mode, how does one query the path where oracle 10 Gb archive logs are stored?

SQL> select name from v $ archived_log;

NAME
--------------------------------------------------
/U01/oracle/flash_recovery_area/ORA10G/archivelog/
2012_02_18/o1_mf_201715_7myb1ftq _. arc

/U01/oracle/arch/41516_759895721.dbf

If not, switch the log: alter system switch logfile;
Other methods:
Show parameter log_archive_dest;

Show parameter dest

Show parameter dest

How to solve the "archive log full problem"

The oracle 10g database operation interface is opened by the oem. the following error message is displayed: "The Archiving program cannot archive and redo logs because the output device is full or unavailable ." The solution is summarized as follows: Method 1: to increase the size of the archive log space, you can adjust the size of the system's flash recovery zone: first, shut down the database: link to oracle as sys, execute> shutdown immediate; start the database to the mount status:> startup mount to view the size and storage target of the flash recovery zone:> show parameter db_recovery_file_dest modify the size of the flash recovery zone> alter system set db_recovery_file_dest_size = 4G (default: 2G, you can adjust the size according to the actual situation) finally open the database:> alter database open; OK. Solve the problem. Restore the database. Method 2: Enter the oracle clearing log information and release the space to start the database to the mount state:> sqlplus "/as sysdba"> startup mount a new terminal, run the rman command> rman target/(only one oracle10g Database is installed)> crosscheck archivelog all; (list archived log information) command> delete expired archivelog all; (delete the archived logs listed above) command> exit; at this time, you 'd better back up the database and change the database's mount status to open status> alter database open; OK. solve the problem and use the database. Misunderstanding: the log information in the system to clear the archive directory (that is, the archived log is deleted physically, or the archived log is transferred elsewhere) is not available. Although the OS is deleted, however, the oracle system cannot identify that logs have been cleared. It can only enter oracle to clear the log information and release the space (method 2); or set a larger archive space (method 1 ). We recommend that you use both methods to reduce the workload and avoid frequent database suspension. At the same time, it regularly backs up the database completely or other important data.

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.