Oracle alert log очистить
This article mainly introduces the relevant content about Oracle 11g database history log cleaning, and shares it for your reference. The following words are not said, and let’s have a look at the detailed introduction
1. Create the path to store the database to be deleted log files
This is used to store the ready delete, which is assumed to be under the /home/oracle /delete path
2. View the path of different database log files
Find the corresponding value of audit_file_dest, background_dump_dest, user_dump_dest, core_dump_dest
The audit_file_dest path holds the database audit information file
The background_dump_dest path holds trace files and alert log files for the database
User_dump_dest is the trace file for session after SQL trace
The core_dump_dest path holds the application logs, and unless something goes wrong with the database, basically nothing will happen
The following text USES the audit_file_dest, background_dump_dest, user_dump_dest, core_dump_dest in bold instead of the actual path.
3. Clean up database audit information files
Go to the audit_file_dest path, move the files 30 days ago to the folder to be deleted, and execute the following command:
(1) execute the following command to check the current path and confirm whether it is correct
(2) execute the following command to view the audit file 30 days ago
(3) execute the following command to move the file to the folder to be deleted
(4) check the audit files in the audit directory 30 days ago and files in the folder to be deleted
(5) wait for 2 days and manually execute the delete command after ensuring that the removal of log files has no impact on the operation of Oracle database
4. Database trace file and alert log cleaning
4.1. Clean trace file
Go to background_dump_dest and move the files from 30 days ago to the folder you want to delete. Execute the following command:
(1) execute the following command to check the current path and confirm whether it is correct
(2) execute the following command to view the audit file 30 days ago
(3) execute the following command to move the file to the folder to be deleted
(4) check the audit files in the audit directory 30 days ago and files in the folder to be deleted
(5) wait for 2 days and manually execute the delete command after ensuring that the removal of log files has no impact on the operation of Oracle database
4.2. Clear alert logs
Alert log, can be deleted directly alert log (or echo cleaning), can be automatically generated, without shutting down the database (as long as it is best to backup the original cp)
(1) enter the path of the log
(3) delete the original alert log file
Method 1: echo >alert_$ORACLE_SID.log (the original alert file is still there after this method is cleaned up)
Method 2: rm alert_$ORACLE_SID.log (delete it directly)
(4) the alert file deleted by test method 2 is automatically generated
(5) see if a new log file is generated
You can see the newly generated alert log file
5. Database SQL trace file cleaning
The database default user_dump_dest and background_dump_dest paths are consistent, if not consistent, please refer to the method 4.1 for operation.
6. Database monitoring log cleaning
Oracle 11 g monitor log and alarm log in $ORACLE_BASE/diag TNSLSNR/hostname/listener/trace and $ORACLE_BASE/diag TNSLSNR/hostname/listener/alert directory, in front of the hostname according to the actual host name, the log directory for listening log and alarm for trace and alert directory for short.
The log files generated in the trace directory are relatively large and are the main cleaning objects, while the files generated in the alert directory are relatively small and need hardly be cleaned. The listening log in the trace directory is a file named listen.log, while the warning log in the alert directory is a file named log.xml, which is split into a log of log_xxx.xml every 11M or so, gradually accumulating.
The method to delete the monitor log is as follows:
Switch to oracle user
A new listener.log file is automatically created when the listening log is started, and the backup file can be deleted.
The system will not be created if the listener. Log is simply deleted without executing the above command.
Warning logs can be moved or deleted with the following command (go to the specified directory before executing this command)
To see the warning log, adrci can be executed under an oracle user
In the adrci directory you can enter help to see the help command. Enter help show alert to see the detailed usage of show alert.
You will be prompted to select the log directory or exit
Enter 1 for db1, enter 2 for listener, enter q and exit.
Type after reading the alert log :q Exit, similar to the vi command.
You can see the listening log file
7. Use of adrci command
11G adrci (Automatic Diagnostic Repository Command Interpreter) cleans up the files in ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP directory
PS:Supplement 11g can also be used for adrci cleaning: specific steps are as follows
If you want to clean up/u01 / app/oracle/diag/RDBMS/cams/cams to the contents of the directory, you can use this method.
conclusion
The above is the whole content of this article. I hope the content of this article can bring some help to your study or work. If you have any questions, please leave comments and exchange ideas
Recommended Today
More Recommendation
Oracle Slow SQL Find Tuning
First, enter the SQL command line, find out the queue SQL statement Add the result of the result of SQL to SQL_ID, put the following query Second, optimizer optimization Take PLSQL as an example, pres.
Comments
Well, Deleting trace files, won't effect you database, that's for sure , though they are used to monitor database for various reasones. I would rather suggest you to backup all of thses trace files, before making them gone from the disk.
hare krishna
Alok
-rw-r----- 1 oracle dba 793 Nov 30 17:47 orageblr_s014_27459.trc
-rw-r----- 1 oracle dba 860362 Dec 2 10:53 orageblr_s014_27741.trc
-rw-r----- 1 oracle dba 844878 Dec 2 10:54 orageblr_s015_1208.trc
-rw-r----- 1 oracle dba 842214 Dec 2 10:54 orageblr_s015_1224.trc
-rw-r----- 1 oracle dba 842570 Dec 2 10:54 orageblr_s015_1234.trc
-rw-r----- 1 oracle dba 833189 Dec 2 10:54 orageblr_s015_1245.trc
-rw-r----- 1 oracle dba 841680 Dec 2 10:54 orageblr_s015_1255.trc
-rw-r----- 1 oracle dba 843522 Dec 2 10:54 orageblr_s015_1265.trc
-rw-r----- 1 oracle dba 843536 Dec 2 10:54 orageblr_s015_1275.trc
-rw-r----- 1 oracle dba 843846 Dec 2 10:55 orageblr_s015_1285.trc
-rw-r----- 1 oracle dba 832732 Dec 2 10:55 orageblr_s015_1295.trc
-rw-r----- 1 oracle dba 843010 Dec 2 10:55 orageblr_s015_1305.trc
-rw-r----- 1 oracle dba 843339 Dec 2 10:55 orageblr_s015_1315.trc
-rw-r----- 1 oracle dba 843600 Dec 2 10:55 orageblr_s015_1325.trc
-rw-r----- 1 oracle dba 836029 Dec 2 10:55 orageblr_s015_1336.trc
-rw-r----- 1 oracle dba 843195 Dec 2 10:55 orageblr_s015_1346.trc
-rw-r----- 1 oracle dba 843354 Dec 2 10:55 orageblr_s015_1358.trc
-rw-r----- 1 oracle dba 836104 Dec 2 10:55 orageblr_s015_1368.trc
-rw-r----- 1 oracle dba 844982 Dec 2 10:56 orageblr_s015_1378.trc
-rw-r----- 1 oracle dba 631 May 20 2006 orageblr_s015_13839.trc
-rw-r----- 1 oracle dba 843934 Dec 2 10:56 orageblr_s015_1389.trc
-rw-r----- 1 oracle dba 850748 Dec 2 10:56 orageblr_s015_1399.trc
-rw-r----- 1 oracle dba 1075052 May 20 2006 orageblr_s015_14071.trc
-rw-r----- 1 oracle dba 631 Nov 30 16:35 orageblr_s015_27290.trc
-rw-r----- 1 oracle dba 630 Nov 30 16:54 orageblr_s015_27351.trc
-rw-r----- 1 oracle dba 870798 Dec 2 10:54 orageblr_s015_27745.trc
-rw-r----- 1 oracle dba 1030123 May 20 2006 orageblr_s016_14143.trc
-rw-r----- 1 oracle dba 631 Nov 30 17:47 orageblr_s016_27484.trc
-rw-r----- 1 oracle dba 1057712 Dec 3 19:27 orageblr_s016_27747.trc
-rw-r----- 1 oracle dba 972982 Dec 3 19:42 orageblr_s017_28890.trc
-rw-r----- 1 oracle dba 192743 Dec 1 12:19 orageblr_s018_28976.trc
-rw-r----- 1 oracle dba 75055 Dec 1 12:20 orageblr_s018_29153.trc
-rw-r----- 1 oracle dba 1040 Dec 1 14:02 orageblr_s018_29180.trc
-rw-r----- 1 oracle dba 132629 Dec 1 16:04 orageblr_s018_29381.trc
-rw-r----- 1 oracle dba 1068452 Dec 3 20:49 orageblr_s018_29513.trc
-rw-r----- 1 oracle dba 1000652 Dec 3 19:58 orageblr_s019_29019.trc
-rw-r----- 1 oracle dba 71530 May 18 2006 orageblr_smon_12105.trc
-rw-r----- 1 oracle dba 679 Apr 26 2006 orageblr_smon_28064.trc
-rw-r----- 1 oracle dba 656 Nov 13 20:21 orageblr_smon_2816.trc
-rw-r----- 1 oracle dba 657 Nov 10 19:29 orageblr_smon_7471.trc
Here are the some of alert log files. in this orageblr_smon_12105.trc
some smon files are also there. shall i delete it. it will affect the database.(i am taking Backup)
please explzin me in detail.
these all files are not Alert.log file. all files are trace file generated by oracle database.
When one of the Oracle background processes (such as dbwr, lgwr, pmon, smon and so on ) encounter an exception, they will write a trace file. These trace files are also recorded in the alert.log. Trace files are also created for diagnostic dump events. An ORA-00600 error also produces a trace file.
if you delete those files there is no affect on database but for troubleshooting purpose you can keep as an bkp of those files and any others place and after that you can delete.
hope this helps.
taj
As others already said that these are not the alert logs, because, there will be one and only one active alert.log for each database.
These files are trace files generated by database processes (user/background) due to N of reasons.
I suggest you to have a look in this trace files and if you find the similar message in all those trace files, it would be better to resolve the issue in order to stop generating these trace files.
If you find these are not so important, you can always delete them.
For your information, in case you delete alert.log by mistake, oracle will create new one.
Oracle snapshots generate one hour, each snapsuit contains the execution of SQL required for an hour.
Snapshot view: DBAHISTSQLSTAT
Set the timing task, because the snapshot is produced every hour, so it is triggered once every hour.
Configure logStash built-in regular fields
Configure logStash resolution Oracle configuration files
6. View Oracle's slow log and alarm log through Kibana
Fill the hole logs (20190926) PageHelper caused by slow SQL
Scene Description Today Leader remove logs from slow SQL DB to make me strip paging SQL Optimization, after reading a look ignorant force, not ah, I obviously have this SQL optimized out, how could it.
Slow Query Logs and Show Profile for SQL Analysis in MySQL
Slow query log MySQL's slow query log is a log record provided by MySQL. It is used to record the statement that responds in MySQL exceeds the threshold, and the specifically means that the run time e.
Answers
Go ahead with your plan.
Regards
Asif Kabir
user645399 wrote:
Hi everyone!
I noticed that in all the oracle databases, the trace files are piling and alert log is growing like anything .
Thought of making a copy of the trace files somewhere and remove them from the hard disk excluding the most recent ones.
For alert log, thought of making a copy and renaming the current file so that Oracle can create a new one.
Any advice if there are better approaches in handling this?
Thanks in advance.
better if you keep 1 week older of alert /trace files, Older than those you can remove.
If you rename/delete current alert log file, oracle will create a new one.
Thanks for your reply.
Should I automate this with some script or checking myself once in a blue moon and clearing them off will do?
You can automate this with the scripts also check that your scripts are working.
Regards
Asif Kabir
user645399 wrote:
Hi everyone!
I noticed that in all the oracle databases, the trace files are piling and alert log is growing like anything .
Thought of making a copy of the trace files somewhere and remove them from the hard disk excluding the most recent ones.
For alert log, thought of making a copy and renaming the current file so that Oracle can create a new one.
Any advice if there are better approaches in handling this?
Thanks in advance.
I would include the alert log file in my backup strategy as it includes many important information; database parameter values,when and how the database was shut down, the important database errors and when they occur , etc . I usually backup the alert log file once a month and keep 1 year of alert log file copies..
since the database was created,the log and trace file have't been cleared.how to clear the alertlog and trace file?3tx!!
Logstash mail alert
ELK logstash email alert
This method has a problem here that I can not give our company's mailbox mail. There is a mailbox is we have two Tencent business mail, there is a group of our mailbox Use the following methods can no.
Intelligent Recommendation
Oracle Monitoring Database Slow SQL
1. Query the slowest SQL ' 2. SQL 'inquiry.
Modify user information changeinfo
When judging the persistence layer: Problem: there is such a problem when modifying user information. For example: the user’s email is not required. It was not empty originally. At this time, the user deletes the mailbox information and submits it. At this time, if it is not empty to judge whether it needs to be […]
I noticed that in all the oracle databases, the trace files are piling and alert log is growing like anything .
Thought of making a copy of the trace files somewhere and remove them from the hard disk excluding the most recent ones.
For alert log, thought of making a copy and renaming the current file so that Oracle can create a new one.
Any advice if there are better approaches in handling this?
Thanks in advance.
Recommended Today
Logstash extracts the database to Kafka, and Something using logstash
Best Answer
user645399 wrote:
or what about zipping old files? any way to automate this using winzip or some other utility or even using windows?
Appreciate if someone has some suggestion?
Well, I can say it is out of question of ORACLE, You can get lot of stuff by googling. ;-)
to zip or anything you have to automate scripts by creating any *.bat* files. you have some third party tools where you can schedule all those.
example:-
pkzip -ex txtfiles.zip *.txt
LogStash extracts data to ElasticSearch
LogStash extracts data to ElasticSearch input filter output input filter output.
Insert the contents of the extended event (slow SQL) into the table and give an alert
For the extended events of establishing slow SQL, see:Click to open the link The extended event is a good thing, but it's more troublesome to open it manually, and it's slower. The following stored pr.
Query oracle slow session and sql
I just keep a spare, a spare, a spare. --Query the slowest sql select * from ( select parsing_user_id,executions,sorts command_type,disk_reads,sql_text from v$sqlarea order by disk_reads desc )where.
Comments
what is your OS?
you can purge the alert log with shell scripts. i normally keep the log for 30days, the rest always be purged
You just delete the files using your normal file system commands and/or utilities (del for Windows, rm for Linux/Unix).
Oracle will create a new file the first time it needs to add something to the alert log and finds that the alert log has gone missing!
Here is how I do it:
Hope this helps. . .
Don Burleson
Oracle Press author
If you are on Unix based system you can use
find -name "*.trc" -mtime -exec rm <> \;
Also, you can remove the alert_SID.log file manually. It's not a problem unless you don't need any information of prior. When Oracle needs to write to alert log it will itself make a new alter_SID.log file in bdump.
You can rename/move the alert log file, oracle automatically will create a new one. For troubleshooting purpose you can keep the old alert log file. You can delete trace file whenever you dont need them other wise compress them and keep in your repository if needed.
You can execute this command in UNIX:
Thank you for your help.
entironment:AIX+ORACLE 10G R2+RAC.
I saw the aritcle about this ,but it told me that the alertlog and trace file deleted
would affect the oracle.So,I ask for your help.the files of aix directory 'bdump' may be all deletled?
You can eliminate all the files ".TRC" (trace files) to purify the directory BDUMP. These are not necessary files in order that the Oracle Server works.
The file Alert.log is a file that the Oracle Server can recreate if you eliminate it. When Oracle Server's process realizes certain action (for example ARCH), Oracle creates again the file (if it does not exist), or it adds text (if it exists) with the new income.
It can happen, that appears some Bug if the file Alert.log does not exist. Though this is slightly possible.
Anyhow I recommend to you in UNIX to use from the prompt: $> filename in order to take the size of the file to 0 bytes, without need to eliminate it. Is the same thing when you want to purify the listener.log, the sqlnet.log or the sbtio.log.
I am woking in oracli 9i and solaris 5.8. In these i am using one database of size 30 gb.
My alert log in bdump is growing more.
Ex. alert log files are ..
-rw-r----- 1 oracle dba 792 Nov 3 18:46 orageblr_s002_29573.trc
-rw-r----- 1 oracle dba 632 Nov 3 19:25 orageblr_s002_29659.trc
-rw-r----- 1 oracle dba 600 Nov 22 19:00 orageblr_s002_4826.trc
-rw-r----- 1 oracle dba 629 Nov 22 20:14 orageblr_s002_5001.trc
-rw-r----- 1 oracle dba 13150 Nov 6 23:00 orageblr_s002_632.trc
-rw-r----- 1 oracle dba 4552168 Nov 14 17:29 orageblr_s002_6671.trc
-rw-r----- 1 oracle dba 991 Nov 7 11:42 orageblr_s002_7888.trc
-rw-r----- 1 oracle dba 2159 Nov 7 12:17 orageblr_s002_7941.trc
-rw-r----- 1 oracle dba 629 Nov 7 15:21 orageblr_s002_8268.trc
-rw-r----- 1 oracle dba 1732 Nov 7 20:11 orageblr_s002_8740.trc
-rw-r----- 1 oracle dba 964 Nov 8 12:01 orageblr_s003_10050.trc
-rw-r----- 1 oracle dba 876 May 17 2006 orageblr_s003_12596.trc
-rw-r----- 1 oracle dba 625 Nov 4 15:21 orageblr_s003_1426.trc
-rw-r----- 1 oracle dba 992 Nov 16 12:31 orageblr_s003_14882.trc
-rw-r----- 1 oracle dba 627 Nov 21 12:52 orageblr_s003_1521.trc
-rw-r----- 1 oracle dba 1929 Nov 10 09:14 orageblr_s003_15709.trc
-rw-r----- 1 oracle dba 604 Nov 10 10:04 orageblr_s003_15827.trc
-rw-r----- 1 oracle dba 632 Nov 16 19:46 orageblr_s003_16428.trc
-rw-r----- 1 oracle dba 834 Nov 10 18:39 orageblr_s003_16671.trc
-rw-r----- 1 oracle dba 628 Nov 4 19:20 orageblr_s003_1864.trc
-rw-r----- 1 oracle dba 632 Nov 17 11:20 orageblr_s003_18709.trc
-rw-r----- 1 oracle dba 632 Nov 17 17:41 orageblr_s003_19576.trc
-rw-r----- 1 oracle dba 632 Nov 17 18:09 orageblr_s003_19634.trc
-rw-r----- 1 oracle dba 3495 Jun 5 2006 orageblr_s003_20513.trc
-rw-r----- 1 oracle dba 788 Oct 30 15:55 orageblr_s003_20841.trc
-rw-r----- 1 oracle dba 792 Oct 30 19:03 orageblr_s003_21230.trc
-rw-r----- 1 oracle dba 0 Nov 13 10:56 orageblr_s003_22657.trc
-rw-r----- 1 oracle dba 879 Nov 29 19:03 orageblr_s003_25032.trc
-rw-r----- 1 oracle dba 604 Nov 30 11:21 orageblr_s003_26564.trc
-rw-r----- 1 oracle dba 631 Nov 30 12:09 orageblr_s003_26689.trc
-rw-r----- 1 oracle dba 1059718 Dec 3 08:47 orageblr_s003_27050.trc
-rw-r----- 1 oracle dba 630 Apr 27 2006 orageblr_s003_29217.trc
-rw-r----- 1 oracle dba 631 Nov 3 16:26 orageblr_s003_29324.trc
-rw-r----- 1 oracle dba 630 Nov 3 18:46 orageblr_s003_29582.trc
-rw-r----- 1 oracle dba 630 Nov 3 19:27 orageblr_s003_29662.trc
-rw-r----- 1 oracle dba 628 Nov 5 17:36 orageblr_s003_3463.trc
-rw-r----- 1 oracle dba 2370 Nov 22 19:50 orageblr_s003_4941.trc
-rw-r----- 1 oracle dba 630 Nov 22 20:23 orageblr_s003_5009.trc
-rw-r----- 1 oracle dba 628 Nov 6 17:29 orageblr_s003_5973.trc
-rw-r----- 1 oracle dba 2161 Nov 6 18:39 orageblr_s003_6118.trc
-rw-r----- 1 oracle dba 960 Nov 4 09:01 orageblr_s003_686.trc
Like this more number of files are created.how can i resolve this (Delete) without affecting the Database.
if i give rm -rf
after that it will affect the Database or not.
Please explain me in Detail.
Читайте также: