Skip to content

sys.replica

This view captures information about replicas that have been created for database replication. See also ALTER DATABASE ADD REPLICA.

Column NameData TypeDescription
replica_idbigintUnique ID of the replica.
database_idbigintUnique ID of the source database.
remote_server_idbigintUnique ID of the remote server.
backup_chain_idvarchar(256)Unique ID of the backup chain for the replica.
namevarchar(256)Name of the replica.
last_replication_timetimestamptzWhen the snapshot was created for the last successful replication cycle that was run for this replica. This timestamp corresponds to the creation_time value in the sys.backup_snapshot view.
statusvarchar(256)Status of replication for this replica: RUNNING, PAUSED, NOT_STARTED, ERROR, FORCED, or UNKNOWN.
frequencyintegerFrequency interval for replication, such as 30 seconds or 5 minutes.
aliasvarchar(256)Name of the database being replicated to on the remote system.
bandwidth_limit_bytesbigintLimit set for maximum speed of transmission traffic.
exclude_filtervarchar(256)Schemas excluded from replication for this database, if any.
security_modevarchar(256)ALL (the default) or NONE, to indicate whether security-related objects and attributes are replicated (users, roles, ACLs, GRANTs).
user_resolution_mode, user_duplicate_resolution_modevarchar(256)Not applicable in this release. Default values are db_owner and rename.
is_sync_users, is_sync_roles, is_sync_grants, is_sync_aclsbooleanNot applicable in this release. Default values are true when security_mode is all and false when security_mode is none.
is_sync_superusersbooleanNot applicable in this release. Default value is false.
is_table_level_restartboolean*Not applicable in this release.*Default value is false.
reverse_replicavarchar(256)Name of a reverse replica associated with this replica, if any; otherwise NULL.

Examples

premdb=# select * from sys.replica where name='premdb_replica';
-[ RECORD 1 ]------------------+------------------
replica_id                     | 41547
database_id                    | 41524
remote_server_id               | 16410
backup_chain_id                | [NULL]
name                           | premdb_replica
last_replication_time          | [NULL]
status                         | NOT_STARTED
frequency                      | 10
alias                          | premdb_replica_db
bandwidth_limit_bytes          | [NULL]
exclude_filter                 | [NULL]
security_mode                  | all
user_resolution_mode           | db_owner
user_duplicate_resolution_mode | rename
is_sync_users                  | t
is_sync_roles                  | t
is_sync_grants                 | t
is_sync_acls                   | t
is_sync_superusers             | f
is_table_level_restart         | f
reverse_replica                | [NULL]
yellowbrick=# select sr.replica_id, sr.name replica_name, sr.database_id, sd.name db_name, sr.status 
from sys.replica sr, sys.database sd where sr.database_id=sd.database_id;
 replica_id | replica_name | database_id |     db_name      |   status    
------------+--------------+-------------+------------------+-------------
     16555 | replication  |       16553 | repl_source      | RUNNING
     16449 | replication2 |       16388 | yellowbrick_test | NOT_STARTED
(2 rows)

Parent topic:System Views