SHOW REPLICATION DATABASES¶
Lists all the primary and secondary databases (that is to say, all the databases for which replication has been enabled) in your account and indicates the region in which each account is located.
- See also:
Syntax¶
SHOW REPLICATION DATABASES [ LIKE '<pattern>' ]
[ WITH PRIMARY <account_identifier>.<primary_db_name> ]
Parameters¶
LIKE 'pattern'
Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (
%
and_
).For example, the following patterns return the same results:
... LIKE '%testing%' ...
... LIKE '%TESTING%' ...
. Default: No value (no filtering is applied to the output).
WITH PRIMARY {account_identifier}.{primary_db_name}
Specifies the scope of the command, which determines whether the command lists records only for the specified primary database. The
account_identifier
can be in the formorg_name.account_name
orsnowflake_region.account_locator
. See Account identifiers for replication and failover for details.
Output¶
The command output provides primary and secondary database properties and metadata in the following columns. The command output for organizations that span multiple region groups includes an additional
region_group
column.
Column |
Description |
---|---|
|
Region group where the account is located. Note: This column is only displayed for organizations that span multiple region groups. |
|
Snowflake Region where the account that stores the database is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). |
|
Date and time when the database was created. |
|
Name of the account in which the database is stored. |
|
Name of the database. |
|
Comment for the database. |
|
Whether the database is a primary database; otherwise, is a secondary database. |
|
Fully-qualified name of a primary database, including the region, account, and database name. |
|
Where |
|
Where |
|
Name of your Snowflake organization. |
|
Account locator in a region. |
Usage notes¶
Returns results for a role with any privilege on the database (for example, USAGE or MONITOR).
The command doesn’t require a running warehouse to execute.
The command only returns objects for which the current user’s current role has been granted at least one access privilege.
The MANAGE GRANTS access privilege implicitly allows its holder to see every object in the account. By default, only the account administrator (users with the ACCOUNTADMIN role) and security administrator (users with the SECURITYADMIN role) have the MANAGE GRANTS privilege.
To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.
The command returns a maximum of ten thousand records for the specified object type, as dictated by the access privileges for the role used to execute the command. Any records above the ten thousand records limit aren’t returned, even with a filter applied.
To view results for which more than ten thousand records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.
Examples¶
Show all the replication databases whose name starts with mydb
:
SHOW REPLICATION DATABASES LIKE 'mydb%';
Show all the secondary databases for the myorg.account1.mydb1
org, account, and primary database, respectively:
SHOW REPLICATION DATABASES WITH PRIMARY myorg.account1.mydb1;