> ## Documentation Index
> Fetch the complete documentation index at: https://artie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon RDS

> Learn how to configure Amazon RDS for Oracle as a source in Artie, including archive log mode, supplemental logging, LogMiner access, and service account permissions.

## Required settings

* Host name
* Port (default is `1521`)
* Service account
* Database name
* Schema name
* Database log mode to be `ARCHIVELOG`
* Supplemental logging to be enabled

<Warning>
  Due to the [limitation of Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Concepts.CDBs.html#Oracle.Concepts.single-tenant-limitations), we cannot replicate from a multi-tenant database.
</Warning>

## Setup instructions

<Accordion title="Enable archive log mode">
  To enable archive log mode, you'll need to enable automated backups. This change will take effect upon the next database restart.

  Once this is enabled, we recommend you to set the log retention to at least 24 hours.

  ```sql theme={null}
  -- We recommend setting the log retention to at least 24 hours.
  EXECUTE rdsadmin.rdsadmin_util.set_configuration('archivelog retention hours', 24);
  COMMIT;
  ```
</Accordion>

<Accordion title="Enable supplemental logging">
  ```sql theme={null}
  EXECUTE rdsadmin.rdsadmin_util.alter_supplemental_logging(p_action => 'ADD');
  COMMIT;
  ```
</Accordion>

<Accordion title="How to create a service account">
  ```sql theme={null}
  CREATE USER ARTIE_USER IDENTIFIED BY PASSWORD;

  CREATE TABLESPACE ARTIE_LOGMINER_TBS DATAFILE SIZE 25M AUTOEXTEND ON MAXSIZE UNLIMITED;
  ALTER USER ARTIE_USER DEFAULT TABLESPACE ARTIE_LOGMINER_TBS;
  ALTER USER ARTIE_USER QUOTA UNLIMITED ON ARTIE_LOGMINER_TBS;
  GRANT CREATE SESSION TO ARTIE_USER;

  -- Grant access to LogMiner
  GRANT LOGMINING TO ARTIE_USER; 

  -- Flashback for backfilling
  GRANT FLASHBACK ANY TABLE TO ARTIE_USER; 
  GRANT SELECT ANY TRANSACTION TO ARTIE_USER; 

  -- Required to read and write to the data dictionary to track schema history
  GRANT SELECT_CATALOG_ROLE TO ARTIE_USER; 
  GRANT EXECUTE_CATALOG_ROLE TO ARTIE_USER; 

  -- We'll need this to create a table for managing internal log buffers (LGWR)
  GRANT CREATE TABLE TO ARTIE_USER; 
  GRANT CREATE SEQUENCE TO ARTIE_USER; 

  -- Read access to system tables (redo, archive and current transaction logs)
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$DATABASE','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOG','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOG_HISTORY','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGMNR_LOGS','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGMNR_CONTENTS','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGMNR_PARAMETERS','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGFILE','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$ARCHIVED_LOG','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$ARCHIVE_DEST_STATUS','ARTIE_USER','SELECT'); 
  EXECUTE rdsadmin.rdsadmin_util.grant_sys_object('V_$TRANSACTION','ARTIE_USER','SELECT');

  -- Grant access to the service account to query the tables.
  -- GRANT SELECT ON {schema}.{table} TO ARTIE_USER;
  GRANT SELECT ANY TABLE TO ARTIE_USER;
  ```
</Accordion>
