Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle 11g archive opening and closing

Shulou Source: shulou.com Published: 2022-06-01 17:31:51 11月13日 Update

The archive log process is an optional process, which is not started when the instance is started. The purpose of this process is to write the data of the full redo log file to an archive log. This archive log is used to repair the database in the event of a media failure. Archiving is strongly recommended in the production environment.

We use ps-ef | grep oracle to view several classic processes of oracle [system monitoring process, process monitoring process, redo log writing process, database writing process, checkpoint process] and find that there is no archiving process. This is because archiving is not enabled in our database, so how to open archiving?

Log in to sqlplus and start archiving

1.shutdown immediate

2.startup mount

3.alter database archivelog

4.alter database open

5.archive log list

After archiving is enabled, check whether the archiving process exists.

Ps-ef | grep oracle

Know how to close an archive in addition to opening an archive?

Shut down the database

1.shutdown immediate

2.startup mount

3.alter database noarchivelog

4.archive log list to see if archiving is enabled

Find the archive file path

Show parameter log_archive_format; views the archive log format, which is officially explained as follows

% s-- log sequence number; log serial number

% t-- thread number; redo thread number

% r-- ID value of resetlogs ID that ensures unique names are constructed for the archived log files across multiple incarnations of the database; RESETLOGS

Show parameter DB_RECOVERY_FILE_DEST; View Archive Directory

You can see the previously archived directory files in the archive directory.

So I would like to ask Brother Chicken, when will the filing be generated?

Automatic archiving: when the redo log is full, there are two options: 1: erase and rewrite the previous redo logfile; 2: archive the backup of the redo log written, and then rewrite

By using archived logs (archive mode is enabled), all redo history can be retained. When the database is in ARCHIVELOG mode and log switching is performed, the background process ARCH saves the contents of the redo logs to the archived log.

Manual archiving: dba must manually execute the archiving command to archive, ALTER SYSTEM ARCHIVELOG ALL

Tags: Process log data database file directory manual time format mode monitoring media role content history background meaning command brother backup Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information Shulou Technology MySQL MariaDB