In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What this article shares with you is about how to delete archived log files in Oracle. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
First, delete the archive log physical files. The archive logs are generally located in the archive directory. In Oracle 10g, the file format under the AIX system is "1_17884_XXX.dbf". It is recommended to back up the database before operation, and at least keep the logs of the last few days for database recovery when deleting.
2. After deleting the physical files of the archived log, we can log in to ORACLE normally, but the archived log has not been completely deleted. The information of these archivelog is still recorded in the controlfile of ORACLE, and there is a visual log in the OEM manager of oracle. When we manually clear the files in the archive directory, these records are not deleted by us from controlfile. This is what we need to do next.
1. Specify database instance
Log into the database
two。 Connect to the database
> RMAN TARGET /-- because you can only log in in nocatalog mode because you don't use catalog
3. View the status of the archive log
RMAN > list archivelog all;-- displays all archive log information
4. Manually delete archive log files
RMAN > DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7'
Description:
SYSDATA-7, indicating that the current system time is 7 days ago, and the before keyword indicates the archived logs 7 days ago. If the flashback feature is used, the flashback data will also be deleted.
By the same token, you can delete all logs from 7 days ago to the present, but this command should be carefully considered. After this deletion, it is best to make a full backup of the database immediately.
DELETE ARCHIVELOG from TIME 'SYSDATE-7'; deletes all logs from 7 days ago to the present. Use with caution.
The archived data of 7 days ago can also be found through FIND under UNIX/LINUX, and deleted using Exec sub-operation.
Find / oraarchive-xdev-mtime + 7-name "* .dbf"-exec rm-f {}
Doing so will still leave unmanaged archives in RMAN
You still need to execute the following two commands in RMAN
Crosscheck archivelog all
Delete expired archivelog all
5. Back up the whole database by hand again
Backup database
Back up control files, parameter files and archive logs at the same time
6. Report expired backups using the report obsolete command
7. Use the delete obsolete command to delete the expired backup. If it cannot be deleted, you can add another parameter, force, to force deletion.
The above is how to delete archived log files in Oracle. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.