Set Up Database Instance Monitoring
Oracle Log Analytics can extract database instance records based on the SQL query that you provide in the log source configuration. You can define a parser for the database instance log records using Oracle Log Analytics.
omc_oracle_db_instance
), Microsoft SQL Server Database Instance (omc_sqlserver_db_instance
), and MySQL Database Instance (omc_mysql_db_instance
).
Overall Flow for Collecting Database Logs
The following are the high-level tasks for collecting log information stored in a database:
-
Creating your log source
-
Providing entity credentials
-
Associating an entity with the log source
Note:
By default, after you’ve installed the cloud agent, it collects the database instance records for 30 days. If you want to extract records that’re more than 30 days old, then update the property before the event collection from the database begins:omcli setproperty agent -allow_new -name loganalytics.database_sql.max_oldDays -value <newValue_for_max_oldDays>
For an example of how to collect Database Audit Logs, see Collect Database Audit Logs to Analyze Using Oracle Log Analytics ( Tutorial).
For an example of how to collect logs from Oracle Autonomous Database user tables, see Collect Logs from Oracle Autonomous Database User Tables ( Tutorial).
Provide the Database Entity Credentials
Create the JSON File with Credentials Information
Create a JSON file that contains the credential information as the following:
[{
"entity":"<Enter Entity Type>.<Enter Entity Name>",
"name":"LCAgentDBCreds",
"type":"DBCredsNormal",
"usage":"LOGANALYTICS",
"globalName":"AgentUserCredential",
"description":"SSH Credential for fetching the data from db tables via sql",
"properties":[{
"name":"USERNAME",
"value":"CLEAR[username]"
},
{
"name":"PASSWORD",
"value":"CLEAR[password]"
},
{
"name":"ROLE",
"value":"CLEAR[rolename]"
}]
}]
For example, for a database named avdf_instance
and user name, password, and role as sys
, syspasswd
, and SYSDBA
respectively, the JSON file should contain:
[{
"entity":"omc_oracle_db_instance.avdf_instance/orcl",
"name":"LCAgentDBCreds",
"type":"DBCredsNormal",
"globalName":"AgentUserCredential",
"usage":"LOGANALYTICS",
"description":"DB Credentials",
"properties":[{
"name":"USERNAME",
"value":"CLEAR[sys]"
},
{
"name":"PASSWORD",
"value":"CLEAR[syspasswd]"
},
{
"name":"ROLE",
"value":"CLEAR[SYSDBA]"
}]
}]
The name, type and usage fields should be set to LCAgentDBCreds
, DBCredsNormal
and LOGANALYTICS
respectively. The globalName
field needs to be unique within the credential store managed by the local cloud agent. The ROLE
property is optional.
Register the Credential Information
You need to register the credential information with the cloud agent.
Note:
By default, after you’ve installed the cloud agent, it collects the database instance records for 30 days. If you want to extract records that’re more than 30 days old, then update the property before the event collection from the database begins:omcli setproperty agent -allow_new -name loganalytics.database_sql.max_oldDays -value <newValue_for_max_oldDays>
Next: To associate the entity with your log source, see Working with Entity Associations.