In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how Oracle cleans up useless files in the database". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "Oracle how to clean up useless files in the database".
Oracle cleans up various log files in the database
1. (optional) you can create a backup directory. If you back up in advance, you need to clean the log.
Mkdir / log_bak_date
two。 Log file paths of the database
Sqlplus / as sysdbaSYS@honor1 > show parameter dump_dest NAME TYPE VALUE---background_dump_dest string / U01 A new diagnostic information architecture is introduced after / app/oracle/diag/rdbms/honor/honor1/tracecore_dump_dest string / u01/app/oracle/diag/rdbms/honor/honor1/cdumpuser_dump_dest string / u01/app/oracle/diag/rdbms/honor/honor1/trace11gR1: SYS@honor1 > show parameter diag NAME TYPE VALUE---diagnostic_dest string / U01 / app/oracleSYS@honor1 > show parameter audit_file_dest NAME TYPE VALUE-- audit_file_dest string The database audit information file is stored in the / u01/app/oracle/admin/honor/adumpaudit_file_dest / * path. If audit_trail is not set to OS By default, only SYS login audit information is stored in this directory. Background_dump_dest / * stores database background process debugging information, and records trace files and alert log files that affect instances and databases. After 11gR1, this parameter setting is ignored by default. After storing diagnostic_dest / * 11gR1 according to diagnostic_dest, the background process and alert alarm log will store user process debugging trace files according to the ADR base directory. After 11gR1, the background process and alert alarm log will store user process debugging trace files according to the ADR base directory. The parameter of introducing a new diagnostic architecture will be ignored. Diagnostic_dest controls the trace file generation directory core_dump_dest / * stores the Oracle core dump file.
3. Database audit information file cleaning
Find / u01/app/oracle/admin/honor/adump-mtime + 30-name\ * .aud/* can choose the following command to back up the audit file: find / u01/app/oracle/admin/honor/adump-mtime + 30-name\ * .aud-exec mv {} / log_bak_date\ / * check the audit file find audit_file_dest-mtime + 30-name 30 days ago under the audit directory. Aud/* ensures that the audit log does not need to be retained. You can choose to delete cd / log_bak_daterm-rf * .Audit in the aud/* database can choose to truncate aud$ directly.
4. Database trace file
/ * Clean up the trace files under the background_dump_dest path, and move the files from 30 days ago to the folder to be deleted. Execute the command as follows: find / opt/oracle/diag/rdbms/orcl/czh29c/trace-mtime + 30-name\ * .tr*/* (optional) optionally backup the files $find / opt/oracle/diag/rdbms/orcl/czh29c/trace-mtime + 30-name\ * .tr*-exec mv {} / log_bak_date/background_dump_dest\ / * after ensuring that the log is useless, manually execute the delete command cd / log_bak_date/background_dump_destrm-rf * .tr*
5. Clean up database alert logs
/ * there are two ways for alert to clean up / * / * cp backup cd / u01/app/oracle/diag/rdbms/honor/honor1/tracecp alert_$ORACLE_SID.log / log_bak_date/alert_$ORACLE_SID.log.bak (make sure there is enough space) / * cleanup method 1:echo 0 > alert_$ORACLE_SID.log (empty content) method 2:rm alert_$ORACLE_SID.log (delete directly)
6. Database sql trace file cleanup
The default user_dump_dest and background_dump_dest paths of the database are the same. If they are inconsistent, refer to the steps in 4 to clean up the trace file.
7. Database snooping log cleanup
/ * Oracle 11g snooping log and alarm log are available under $ORACLE_BASE of grid user: $ORACLE_BASE/diag/tnslsnr/hostname/listener/trace (text snooping log) $ORACLE_BASE/diag/tnslsnr/hostname/listener/alert (xml snooping log) / * the method to delete snooping log is as follows: / * switch to oracle user (if it is RAC) Switch to the grid user) $su oracle$ lsnrctl LSNRCTL > set log_status off$ mv listener.log listener.log.bak / * (back up the listening file or delete the listening log file) $mv listener.xml listener.xml.bakLSNRCTL > set log_status on / * (a listener.log file is automatically created in this case) / * 11g you can use the ADRCI tool to view the alarm log / * you can view the alarm log under the oracle user. Execute adrci$ adrciadrci > show alert / * to view the database or listen to the log contents as prompted. $adrciadrci > SHOW TRACEFILE / * you can see all the trace and alert log files / * use adrci to clean trace files $adrciadrci > show homeadrci > set homepath diag/rdbms/honor/honor1adrci > help purge / * you can check the log error messages according to the number of minutes before the data can be cleaned up. I believe you have a deeper understanding of "Oracle how to clean up useless files in the database". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.