ybrestore Command

Each ybrestore command defines:
  • Database connection options
  • Target databases, schemas, or tables (or an alias for a database)
  • The backup name and directory to restore from
  • The restore point, expressed as an exact timestamp, an ordinal number in the backup chain, or latest
  • Other options, such as logging parameters

Syntax Summary

./ybrestore  
--name backup_chain_name 
--dirs storage_path 
--objects database_name [, ...]
--latest | -w restore_point
[ database_connection_options ]
[ other_options ]
For details about all of the options and their syntax, see ybrestore Options.
Note: In Version 2.0 the -d and --all options are deprecated. Use the -o (or --objects) option instead.

To look at your restore history, query the sys.log_restore view.

Ownership of Restored Databases and Permissions on Objects

Database administrators are responsible for ensuring that users exist on the system where a database is being restored. Users are system-wide objects that are not re-created as part of a database restore operation.

Assuming that database users with the same names exist on the system when a database is restored, their permissions (select, insert, and so on) on tables and other objects are restored along with the database itself. Ownership of the database being restored is also preserved if the owning user exists.

Users are matched by their username strings (name in sys.user), not their object IDs (user_id in sys.user). If a given user does not exist, no permissions on an object can be restored to that user. Such permissions are ignored.

For example, assume that when a backup was taken, user bobr with ID 17456 had read access to table match. If user bobr exists on the target system with ID 18123 when the database is restored, bobr is granted read access to table match.

Ownership of "unclaimed" objects defaults to the superuser with the user_id of 10 in sys.user.

Note: During a restore operation, the database that is being restored is accessible to the yellowbrick superuser. However, it is strongly recommended that you do not log into the database until the restore is complete.