Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with excessive alert of ORACLE alarm log

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Now, it's no longer a problem for me to deal with the size of the ORACLE alarm log alert; however, since the database is the company's most important device, you have to be very careful when dealing with database-related processes or files.

Currently, the ORACLE database is mainly divided into widows and LINUX/UNIX versions. For the LINUX/UNIX platform, we can use tail-n / path/alert*.log | more to view it, which is very convenient. However, on the windows operating platform, we encounter a large alarm log as shown in the figure below, how to view it. If you say that you can open TXT text directly, it may not be successful; some people say that you can upload it to linux for viewing, it is better to deploy Oracle database on linux in the first place. Therefore, excessive ORACLE alarm logs are not easy to view and need to be checked and processed by our operation and maintenance staff on a regular basis.

For linux platform, the processing is very simple: echo / dev/null > / path/alert*.log, as an example:

First, check the location of the alarm log:

[oracle@oradbs ~] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 19 18:09:19 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > show parameter dump

NAME TYPE VALUE

-

Background_core_dump string partial

Background_dump_dest string / home/oracle/oracle/diag/rdbms/oradb/oradb/trace

Core_dump_dest string / home/oracle/oracle/diag/rdbms/oradb/oradb/cdump

Max_dump_file_size string unlimited

Shadow_core_dump string partial

User_dump_dest string / home/oracle/oracle/diag/rdbms/oradb/oradb/trace

[oracle@oradbs ~] $ls-l / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log

-rw-r- 1 oracle dba 94275 May 19 18:00 / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert_oradb.log

Second, be sure to make a backup first:

[oracle@oradbs ~] $cp / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log / home/oracle/alert_bak20160607

[oracle@oradbs ~] $ls

Alert_bak20160607 oracle oraInventory

Thirdly, truncate the alarm log:

[oracle@oradbs ~] $echo / dev/null > / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log

[oracle@oradbs ~] $ls-l / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log

-rw-r- 1 oracle dba 10 May 19 18:13 / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert_oradb.log

The result of the process:

[oracle@oradbs ~] $cat / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log

/ dev/null

Some people wonder whether the database will no longer write logs to the alarm log if the alarm log is moved. The answer is no. Let's switch to the redo log and have a look:

[oracle@oradbs ~] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 19 18:15:49 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > alter system switch logfile

System altered.

SQL >

SQL >! cat / home/oracle/oracle/diag/rdbms/oradb/oradb/trace/alert*.log

/ dev/null

Thu May 19 18:15:58 2016

Thread 1 advanced to log sequence 7 (LGWR switch)

Current log# 1 seq# 7 mem# 0: / oradata/oradb/redo01.log

Thu May 19 18:15:58 2016

Archived Log entry 4 added for thread 1 sequence 6 ID 0x9ecc00e3 dest 1:

See! The database will still be written to the truncated alarm log.

So, what if the alarm log of widows is too large? the process is like this: make a backup first, and then delete it directly. When a checkpoint occurs in the database or redo logs are switched, the database will automatically create a new alarm log. Examples are as follows:

View the alarm log:

C:\ Users\ localadmin > sqlplus sys/oracle as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tuesday June 7 08:59:53 2016

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > show parameter dump

NAME TYPE VALUE

-

Background_core_dump string

Partial

Background_dump_dest string

C:\ oracle\ diag\ rdbms\ oradb\ ora

Db\ trace

Core_dump_dest string

C:\ oracle\ diag\ rdbms\ oradb\ ora

Db\ cdump

Max_dump_file_size string

Unlimited

Shadow_core_dump string

None

User_dump_dest string

C:\ oracle\ diag\ rdbms\ oradb\ ora

Db\ trace

SQL >

Since it was a demonstration, I backed up the alarm log in the trace directory:

Next, you can delete the original alarm log:

By cutting the redo log, you can make the database generate a new alarm log file:

SQL > alter system switch logfile

The system has changed.

SQL >

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report