View a markdown version of this page

Preparing Amazon RDS metadata for the AWS Glue Data Catalog - Amazon Relational Database Service

Preparing Amazon RDS metadata for the AWS Glue Data Catalog

AWS Glue Data Catalog brings your Amazon RDS databases into a single, governed catalog alongside your other AWS data, giving your teams and AI agents a shared, current view of your data estate. When you enable data discovery and cataloging in your account, resource metadata such as resource identifiers, engine versions, and endpoints for your RDS instances become available in the catalog automatically. AWS keeps this metadata current as resources are created and changed, with no crawlers, or discovery pipelines to manage. In preview, you can also choose which RDS for Oracle databases make schema metadata available in the Glue Catalog, including databases, schemas, tables, and columns. You and your AI agents can then start from a business question, find which databases hold the relevant data, and understand what the data represents. Your teams can add business context, such as descriptions, classifications, and glossary terms, so you can interpret data accurately.

Metadata that Amazon RDS prepares

Resource metadata describes your Amazon RDS DB instances in them. The Data Catalog builds it from the configuration of each resource. It does not require any collection on your database.

Schema metadata (Preview) describes the databases, schemas, tables, views, materialized views, and external tables inside an RDS for Oracle DB instance. Amazon RDS produces it by running a collection process that reads only the system catalog of the database engine.

After you turn on auto-discovery for your account, the Data Catalog populates metadata for your resources in the background over time, with no further action from you.

Resource metadata is available in all AWS Regions where AWS Glue Data Catalog is available. Schema metadata is available in preview in the following AWS Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Malaysia), Asia Pacific (Mumbai), Asia Pacific (Thailand), Asia Pacific (Tokyo), Europe (Ireland), and Europe (Spain).

Eligibility for schema metadata collection

Schema metadata is available only for RDS for Oracle. The requirements in this section apply to schema metadata, not to resource metadata. Amazon RDS collects schema metadata for a DB instance that meets all of the following requirements, which it evaluates in no particular order.

  • Status: A DB instance is eligible once creation finishes and remains eligible until deletion starts. A DB instance in a terminal state, such as a storage failure or one of the incompatible or insufficient states, is not eligible.

  • Database engine: Every RDS for Oracle engine (oracle-*) is eligible. For Amazon RDS for PostgreSQL, Amazon RDS for MySQL, Amazon RDS for MariaDB, Amazon RDS for SQL Server, Amazon RDS for Db2, and Amazon RDS Custom, Amazon RDS prepares resource metadata only.

  • Engine major version: RDS for Oracle versions 19 and 21 are eligible.

  • Operating system: A DB instance that runs Oracle Linux 7 is not eligible.

  • Read replicas: Amazon RDS collects schema metadata from the source DB instance rather than from its read replicas. The source DB instance is eligible when it meets the other requirements in this list.

  • Multi-tenant architecture: A CDB that uses the single-tenant configuration is eligible. This configuration is the default for new DB instances on Oracle Database 19c and higher. The multi-tenant configuration of the CDB architecture is not eligible.

In addition to these requirements, you control collection with the following two settings:

  • Auto-discovery – Your AWS account must have auto-discovery turned on.

  • Opt-out tag – The DB instance must not have the opt-out tag. For the tag and how to apply it, see Turning off schema metadata collection.

If either of these settings stops a collection, Amazon RDS records the reason in the AWS CloudTrail event for the DescribeSchemas request. If a resource doesn't meet one of the preceding requirements, Amazon RDS doesn't report a reason.

Turning off schema metadata collection

To stop Amazon RDS from collecting schema metadata for an RDS for Oracle DB instance, add the tag key DataModelPreviewOptOut with the tag value true to it. The following AWS CLI example adds the tag.

aws rds add-tags-to-resource \ --resource-name arn:aws:rds:us-east-1:111122223333:db:my-oracle-instance \ --tags Key=DataModelPreviewOptOut,Value=true

For more information about tagging, see Tagging Amazon RDS resources. To turn collection back on, remove the tag or change its value.

When Amazon RDS collects schema metadata

Amazon RDS doesn't collect schema metadata on a fixed schedule. A collection starts only when the Data Catalog requests the schema metadata for a resource, and only if all of the following are true:

  • The resource is eligible for schema metadata collection.

  • The status of the resource is available.

  • No collection has run for the resource, or at least 8 hours have passed since the last change in collection status for the resource. Amazon RDS records a status change when a collection starts, when it is processed, when it completes, and when it fails.

  • No other schema collection is already pending for the resource.

While the status of a resource is anything other than available, such as modifying, stopped, or backing-up, the Data Catalog continues to show the most recently collected schema metadata, and Amazon RDS does not start a new collection. If you delete a DB instance, Amazon RDS cancels any pending or running collection for it.

The Data Catalog refreshes schema assets only when it crawls a resource. For how the crawl adds and removes assets, see "Amazon RDS and Aurora asset types" in the AWS Glue Data Catalog User Guide.

Resource checks during schema collection

The eligibility requirements determine whether Amazon RDS can collect schema metadata for a resource at all. The checks in this section determine whether a collection can run at a given time. The collection process runs the checks on the DB instance that it reads.

Only one collection runs on a DB instance at a time. If a second collection starts while one is already running, the second collection stops before it runs any checks or queries.

DB instance checks

The following table describes the checks that the collection process runs on the DB instance, and the event that Amazon RDS sends when a check fails.

Check Requirement Event
Idle vCPU At least 1 idle vCPU, measured over a 5-second sample INSUFFICIENT_RESOURCES
CPU utilization Less than 90 percent, over the same 5-second sample. Amazon RDS also fails this check when it cannot take the sample. INSUFFICIENT_RESOURCES
Available memory At least 256 MB. Amazon RDS also fails this check when it cannot measure available memory. INSUFFICIENT_RESOURCES
Open pluggable databases (PDBs) A CDB has at least one PDB that is not closed, mounted, or the seed None
Number of databases Up to 100 open PDBs with supported names. A non-CDB counts as one database. SIZE_LIMIT_EXCEEDED
Output size Up to 140 MiB of collected metadata, checked after the collection SIZE_LIMIT_EXCEEDED

Some conditions stop a collection without producing an event. For the full list, see Events for skipped schema collections.

Database checks

Amazon RDS checks each PDB, or the non-CDB, before it reads it. The first database that fails a check stops the entire collection, and Amazon RDS uploads nothing, including metadata from databases that it already admitted.

The following list describes the database checks and related collection behavior.

  • Expected query time: By default, the estimated time to read the database can be up to 60 seconds. This value is an admission threshold for the estimate only. Amazon RDS does not enforce a time limit on the read of each database.

  • Order of checks: Buffer cache first, then expected query time.

  • Cache protection: The data dictionary segments C_OBJ#, C_COBJ#, OBJ$, COM$, I_OBJ2, and I_COM1 can use up to 10 percent of the DEFAULT buffer cache. If Amazon RDS cannot read their size, the database fails the check.

  • Session: A read-only database role and a read-only transaction. Each PDB is read from its own consistent snapshot.

  • Time limit for the whole collection: 900 seconds for the whole collection, of which reading all PDBs is limited to 540 seconds. Finding the PDBs and running the database checks must finish early enough to leave time to read the PDBs within the 900-second limit.

  • Databases that Amazon RDS never collects: CDB$ROOT, PDB$SEED, any container that is not open in read/write or read-only mode, and any PDB whose name does not match the supported pattern of 1 to 8 characters. Amazon RDS skips such a PDB.

Events for skipped schema collections

When Amazon RDS skips a schema preparation or cannot complete it, Amazon RDS can send an Amazon RDS event with one of the two reasons in the following table. The event is SCHEMA_COLLECTION_FAILED, and its source is the DB instance. Amazon RDS sends these events on a best-effort basis. For more information about Amazon RDS events, see Amazon RDS event categories and event messages .

In the messages, name is the name of the resource.

Reason Event ID Message When Amazon RDS sends it
INSUFFICIENT_RESOURCES RDS-EVENT-0665 Schema collection was skipped for the name because of insufficient available resources. No action is required. Schema collection will be retried later. The idle vCPU, CPU utilization, available memory, or buffer cache check fails.
SIZE_LIMIT_EXCEEDED RDS-EVENT-0665 Schema collection was skipped for the name because the schema exceeds the maximum supported size. Reduce the schema size to enable schema collection. The output size, number of databases, or expected query time check fails, or the collection process is stopped at its time limit.

Amazon RDS does not send an event in the following cases:

  • The output size cannot be measured.

  • A collection is still running at the end of the wait period.

  • The upload of the collected metadata fails.

  • Another collection is already running on the DB instance.

  • The collection result does not include a checksum.

  • A CDB returns metadata for more than one database.

Any other failure that the preceding table does not list also ends without an event.

What the collection reads from your database

The collection process reads only catalog metadata, such as the names, types, keys, indexes, and comments of your schema objects. It never reads table or column data, and every collection session is read-only. Amazon RDS does not collect sequences, triggers, stored procedures, packages, or the bodies of views, materialized views, and row security policies.

Note

Schema metadata is encrypted at rest while Amazon RDS prepares it and while it is in the Data Catalog. During preparation, Amazon RDS encrypts the metadata with an AWS owned key, not the AWS KMS key that encrypts your DB instance, and you do not need to configure anything. In the Data Catalog, the metadata is encrypted with the key that you choose in your Data Catalog settings.

Limits for schema metadata collection

The following table lists the limits that apply to one schema metadata collection.

Limit Value
Tables, views, materialized views, and external tables in one collection 100,000
Objects of one asset type in one collection 1,000 batches of at most 100 objects or 5 MiB each
Size of collected metadata 140 MiB (146,800,640 bytes)

The limits for the size of collected metadata, the number of tables and similar objects, and the number of objects of one asset type apply to the whole collection. If a collection exceeds any of these limits, the whole collection fails as too large. Amazon RDS does not retry that collection, and the previously collected metadata remains in the Data Catalog.