Help Center/ Database Security Service/ FAQs/ Functions/ How Long Is the Database Audit Data Stored by Default?
Updated on 2025-07-09 GMT+08:00

How Long Is the Database Audit Data Stored by Default?

Database audit can store online and archived audit data for at least 180 days. If the backup function is disabled and disk space is sufficient, logs are stored on the audit instance for 180 days by default. If a large number of new audit logs need to be stored, the system automatically deletes the old logs on a rolling basis to ensure sufficient disk space. If the backup function is enabled, logs and backup logs will also be stored in OBS for same duration.

However, the storage duration also depends on the disk capacity of the log database. To store your audit data long enough, you are advised to:
  • Choose a database audit edition suitable for your business.
    • To audit a small volume of data, purchase the starter or basic edition.
    • To audit a large volume of data, purchase the professional or advanced edition.

      For more information, see Table 1.

  • Back up audit logs.

    For details, see Backing Up and Restoring Database Audit Logs.

Table 1 Database audit editions

Edition

Specification

Maximum Databases

Performance

Starter

Database audit starter edition

1

  • Peak QPS: 1,000 queries/second
  • Database load rate: 1.2 million statements/hour
  • Online SQL statement storage: 100 million statements

Basic

Database audit basic edition

3

  • Peak QPS: 3,000 queries/second
  • Database load rate: 3.6 million statements/hour
  • Online SQL statement storage: 400 million statements

Professional

Database audit professional edition

6

  • Peak QPS: 6,000 queries/second
  • Database load rate: 7.2 million statements/hour
  • Online SQL statement storage: 600 million statements

Advanced

Database audit advanced edition

30

  • Peak QPS: 30,000 queries/second
  • Database load rate: 10.8 million records/hour
  • Online SQL statement storage: 1.5 billion statements
  • A database instance is uniquely defined by its database IP address and port.

    The number of database instances equals the number of database ports. If a database IP address has N database ports, there are N database instances.

    Example: A user has two database IP addresses, IP1 and IP2. IP1 has a database port. IP2 has three database ports. IP1 and IP2 have four database instances in total. To audit all of them, select professional edition DBSS, which supports a maximum of six database instances.

  • To change the edition of a DBSS instance, unsubscribe from it and purchase a new one.
  • The table above lists the system resources consumed by a database audit instance. Ensure your system has the required configurations before purchasing database audit instances.
  • Online SQL statements are counted based on the assumption that the capacity of an SQL statement is 1 KB.