Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.
You are advised to enable the archiving mode for Oracle databases to archive database operations to local log files.
You can run the following command to check whether archiving is enabled:
archive log list
Copy the code
As shown, archiving has been started!
What are the benefits?
RMAN allows you to back up data in real time. When you configure the DataGuard, you must enable the archiving mode to guarantee zero loss.
The disadvantages may be:
Occupies a large amount of disk space. Occupies some system resources. If the archive space is full, the database may break down
Overall, the pros outweigh the cons, and who needs disk space and system resources these days? There you are!
To enable archive mode:
1. Set the archive path
alter system set log_archive_dest_1='LOCATION=/archivelog';
Copy the code
this/archivelog
The directory must be a physical path on the disk; otherwise, archiving cannot be performed! 2. Close the database and open it to the mount state
shutdown immediate
startup mount
Copy the code
If you are in a RAC cluster environment, use SRVCTL to shut down all node databases and then open a node to the mount state!
3, Open the archive mode, open the database to Open
alter database archivelog;
alter database open;
Copy the code
4. Check the archive status and switch logs
archive log list
alter system switch logfile;
Copy the code
This is the end of sharing ~
If you think the article is helpful to you, please like it, favorites it, pay attention to it, comment on it, and support it four times with one button. Your support is the biggest motivation for my creation.
❤️ technical exchange can follow the public number: Lucifer think twice before you do ❤️