DMS / Redshift: Replication task hangs, Redshift logs "Cannot connect to shared database "awsdatacatalog".


We have a DMS CDC task. Source Mongo, destination Redshift. It's been running fine for months.

When we stop and restart, several tables load, but others don't. There are no errors being logged in stl_load_errors, nor any errors visible in CloudWatch logs. The only error I see being logged is in stl_error, which repeatedly logs

Cannot connect to shared database "awsdatacatalog". Connect to the databases in your cluster instead and use cross-database query notation <shareddatabase>.<schema>.<object> to query the data in shared database.


terminating connection due to administrator command

I have not seen this issue before. It has only started occurring after maintenance was done on the replication instance (current engine version 3.5.1).

Any ideas?

asked 9 months ago748 views
2 Answers


The error -

"Cannot connect to shared database "awsdatacatalog". Connect to the databases in your cluster instead and use cross-database query notation <shareddatabase>.<schema>.<object> to query the data in shared database."

is from Redshift. It is not related to DMS.

It seems that directly connecting to the awsdatacatalog database is not possible as it is a shared database. As a workaround, try the suggestion from the error message and use a 3 dot annotation (cross database query) in a custom SQL. Connect the data source to any other database that user has access to (dev for example) and try to use a custom SQL with a cross database query to check if it works.

If you are getting errors with DMS, I would request you to reach out to AWS Support with the Replication Instance and DMS Tasks, in order to have a better understanding.

I sincerely hope this helps!

answered 9 months ago


The error - Cannot connect to shared database "awsdatacatalog" occurs when you are trying to directly connect to "awsdatacatalog" database. Kindly note, it is an external database i.e. Glue Data Catalog that is mounted on to Redshift cluster for easier access of External tables without need of creating external schemas.

Also, for accessing tables of "awsdatacatalog" database by connecting to Redshift cluster, please use 3-part notation i.e. "awsdatacatalog"."<glue database>"."<glue table name>" by connecting to any Redshift daabase such as "dev".

The error - terminating connection due to administrator command occurs when a session is explicitly terminated by a DbUser using Ctrl+c or Ctrl+x commands. For insights on why a session is terminates, please make use of SVL_TERMINATE system table.

If the suggestions above do not help resolve the issue, we might need to troubleshoot based on your current DMS-Redshift replication setup. In such case, please feel free to create a support case instead so we may discuss details on your resource configurations.

I sincerely hope this helps ! As always, feel free to reach back with any further questions or concerns in the meantime.

Thank you.

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions