Using adrcli on AWS RDS
Introduction
To deliver DBAS, Amazon RDS does not provide command line access to ADRCI. Instead, a Amazon RDS package has been provided which allows you to perform diagnostic tasks. This package is called
rdsadmin.rdsadmin_adrci_util.
Listing Incidents
To list incidents, there are two steps.
Call the procedure list_adrci_incidents. This will create a log file that you can then read to see what incidents exist
Read the log file created by list_adrci_incidents
Generating a List of Incidents
To list "diagnostic incidents" in the diagnostics directory, use the procedure list_adrci_incidents, in the rdsadmin_adrci_util package.
The procedure has 4 parameters, all optional and will create a log file containing the details of the "diagnostic incidents" The parameters are...
incident_id (Number) - A valid incident ID or null
problem_id (number) - A valid problem ID or null
last (Number) - A valid integer greater than 0 or null. The default is to list the 50 most recent incidents.
detail (Boolean) - True or False
The following command will list the last 50 incidents
rdsadmin.rdsadmin_adrci_util.list_adrci_incidents
Example
SQL> SELECT rdsadmin.rdsadmin_adrci_util.list_adrci_incidents AS task_id FROM DUAL;
TASK_ID
------------------
1590786706158-3126
Reading the Log File Created by list_adrci_incidents
To read the log file, use the procedure rdsadmin.rds_file_util.read_text_file, ensuring you use the task_id returned in the step above.
Example
SQL> SELECT * FROM TABLE(rdsadmin.rds_file_util.read_text_file('BDUMP', 'dbtask-<task id>.log')); <-------- where task ID = 1590786706158-3126
TEXT
-------------------------------------------------------------------------------------------------------------------------
2020-05-29 21:11:46.193 UTC [INFO ] Listing ADRCI incidents.
2020-05-29 21:11:46.256 UTC [INFO ]
ADR Home = /rdsdbdata/log/diag/rdbms/orcl_a/ORCL:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
----------- ----------------------------------------------------------- ----------------------------------------
53523 ORA 700 [EVENT_CREATED_INCIDENT] [942] [SIMULATED_ERROR_003 2020-05-29 20:15:20.928000 +00:00
53522 ORA 700 [EVENT_CREATED_INCIDENT] [942] [SIMULATED_ERROR_002 2020-05-29 20:15:15.247000 +00:00
53521 ORA 700 [EVENT_CREATED_INCIDENT] [942] [SIMULATED_ERROR_001 2020-05-29 20:15:06.047000 +00:00
3 rows fetched
2020-05-29 21:11:46.256 UTC [INFO ] The ADRCI incidents were successfully listed.
2020-05-29 21:11:46.256 UTC [INFO ] The task finished successfully.
14 rows selected.
Producing an incident zip file
To produce an incident zip file, there are three steps.
Call the procedure create_adrci_package. This will create a zip file and output the location and name of the zip file in a log
Read the log file created by lcreate_adrci_package to discover the name and location of the Zip file
Download the Zip file
Creating the Zip File and Log File
Once you know the incident number you want to zip up, you run the procedure create_adrci_package in the rdsadmin_adrci_util package. This will run a job to zip up the incident files and create a log file with the details
This function uses the following parameters:
problem_id
incident_id
The following example submits the job to zip up the incident files. The example, uses one of the incident IDs returned in the previous step. e.g Incident ID 53523.
Example
SQL> SELECT rdsadmin.rdsadmin_adrci_util.create_adrci_package(incident_id=>53523) AS task_id FROM DUAL;
TASK_ID
------------------
1590786706158-2040
Reading the Log File Created by create_adrci_package
To read the log file, use the procedure rdsadmin.rds_file_util.read_text_file, ensuring you use the task_id returned in the step above.
SQL> SELECT * FROM TABLE(rdsadmin.rds_file_util.read_text_file('BDUMP', 'dbtask-<task id>.log')); <-------- where task ID = 1590786706158-2040
TEXT
--------------------------------------------------------------------------------------------------------------------------------------
2020-05-29 21:20:43.031 UTC [INFO ] The ADRCI package is being created.
2020-05-29 21:20:47.641 UTC [INFO ] Generated package 1 in file /rdsdbdata/log/trace/ORA700EVE_20200529212043_COM_1.zip, mode complete
2020-05-29 21:20:47.642 UTC [INFO ] The ADRCI package was successfully created.
2020-05-29 21:20:47.642 UTC [INFO ] The task finished successfully.
Note the zip file name in the log file output above (in red)
Downloading the Zip File
You can download the Zip file using the following guide "How to Download Files from AWS RDS "
Published on
4 October 2024