ORACLE AND AWS RDS FOR ORACLE TIP: Where is my alert log at AWS RDS?

Managing your Oracle database on AWS RDS has some differences comparing it with the management of your Oracle database On-Prem.
One of these differences is the daily retention of 30 days for the alert log in text and 7 days for the XML type. Therefore, how can I find my alert log?
You can use the Amazon CloudWatch Logs to export the logs of your database but if you aren’t using this service you can query alertlog view or a table-like format as below:

When you query the alertlog view, the query will bring all the content of the alert log:


SQL> select message_text from alertlog;

Output:


Current log# 2 seq# 12290 mem# 0: /rdsdbdata/db/TECHDATABASKET_A/onlinelog/o1_mf_2_gvfsmgg8_.log
Archived Log entry 12288 added for thread 1 sequence 12289 ID 0x2ef34fad dest 1:
Thread 1 cannot allocate new log, sequence 12291
Checkpoint not complete
Current log# 2 seq# 12290 mem# 0: /rdsdbdata/db/TECHDATABASKET_A/onlinelog/o1_mf_2_gvfsmgg8_.log
MESSAGE_TEXT
Thread 1 advanced to log sequence 12291 (LGWR switch)
Current log# 3 seq# 12291 mem# 0: /rdsdbdata/db/TECHDATABASKET_A/onlinelog/o1_mf_3_gvfsmgsv_.log
Archived Log entry 12289 added for thread 1 sequence 12290 ID 0x2ef34fad dest 1:

59719 rows selected.

When you use the table-like format, you have to replace the value for the name of your file as in the select below.
In this case my instance is called TECHDATABASKET hence the file is named alert_TECHDATABASKET.log.


SQL> SELECT text FROM table(rdsadmin.rds_file_util.read_text_file('BDUMP','alert_TECHDATABASKET.log'));

Output:


Mon Nov 11 11:46:57 2019
Thread 1 cannot allocate new log, sequence 12293
Checkpoint not complete
Current log# 4 seq# 12292 mem# 0: /rdsdbdata/db/TECHDATABASKET_A/onlinelog/o1_mf_4_gvfsmh9m_.log
Mon Nov 11 11:47:00 2019
Thread 1 advanced to log sequence 12293 (LGWR switch)
Current log# 1 seq# 12293 mem# 0: /rdsdbdata/db/TECHDATABASKET_A/onlinelog/o1_mf_1_gvfsmg0x_.log
Mon Nov 11 11:47:00 2019
Archived Log entry 12291 added for thread 1 sequence 12292 ID 0x2ef34fad dest 1:

1255 rows selected.

Related posts

Leave a Comment