0% found this document useful (0 votes)
9 views2 pages

SQL Query Guidelines

The SQL Query Guidelines document provides best practices for writing SQL queries to extract log data in Oracle Cloud Infrastructure. Key recommendations include using read-only queries, ensuring proper privileges, optimizing query performance, and including an ordering column for new records. It advises against using ORDER BY or WHERE clauses on time or sequence fields, as Oracle Logging Analytics handles sorting and filtering automatically.

Uploaded by

achref
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

SQL Query Guidelines

The SQL Query Guidelines document provides best practices for writing SQL queries to extract log data in Oracle Cloud Infrastructure. Key recommendations include using read-only queries, ensuring proper privileges, optimizing query performance, and including an ordering column for new records. It advises against using ORDER BY or WHERE clauses on time or sequence fields, as Oracle Logging Analytics handles sorting and filtering automatically.

Uploaded by

achref
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Query Guidelines https://docs.oracle.com/en-us/iaas/logging-analytics/doc/sql-query-guide...

Help Center Oracle Cloud Infrastructure Search

Oracle Cloud Infrastructure Documentation


Try Free Tier

Infrastructure Services Logging Analytics Appendices All Pages

Updated 2023-01-06

SQL Query Guidelines


You should use the SQL queries that are used to extract the data carefully.

Follow these guidelines when writing SQL queries for extracting log data:

• Use read-only queries only.

• The credentials provided to execute the queries should have only the required privileges to
extract the necessary data.

• The query performance is also an important consideration, because it can affect both the target
database and other software running on the same host.

• The query should include at least one column that can be used to order the database records.
This can be either some kind of a sequence number or a time-stamp column. Every new entry
should have a value for this column that’s equal to or greater than the one in older records. The
SQL query will be run at regular intervals to extract new data. Oracle Logging Analytics will use
this column to identify the new records that have been introduced since the previous collection.
It’s recommended that this column should have an index to avoid full table scans.

• Do not use ORDER BY or WHERE clauses on the time or your sequence field, because Oracle
Logging Analytics does that for you. The necessary filtering and sorting is applied by Oracle
Logging Analytics on the query that you provide. However, you can use the WHERE clause for
other fields.

Was this article helpful?

1 sur 2 5/23/2025, 12:56 AM


SQL Query Guidelines https://docs.oracle.com/en-us/iaas/logging-analytics/doc/sql-query-guide...

Copyright © 2025, Oracle and/or its affiliates. About Oracle Contact Us Legal Notices Terms of Use & Privacy
Document Conventions Cookie Preferences

2 sur 2 5/23/2025, 12:56 AM

You might also like