Working with Repositories
A repository contains a number of collections. A collection can be a backup of a database, a database export, or a set of saved daemon logs and configuration files. Collections are essentially subdirectories that use the name of the collection and are stored inside of a repository. Each collection can contain a combination of files and sub-collections.
Ensure that you create your repository where there is enough file system space to store your database backups, database exports, and collections of log and configuration files.
You must create a repository for your grid before attempting to backup a database, export a database, or create a daemon log collection.
TimesTen Scaleout enables you to perform the following procedures with repositories:
Create a Repository
Before you back up a database, export a database, or create a daemon log collection,
you need to configure a repository for your grid. Depending on the
value of the -method
parameter, the
ttGridAdmin repositoryCreate
command
creates a repository as a directory path mounted using NFS on each
host or as a directory path that is accessible on each host with SSH
or SCP.
Note:
For more information on valid names for repositories, see Grid Objects and Object Naming in Oracle TimesTen In-Memory Database Reference.
The mount (NFS) method can only be used if all instances are on the same network and all instances must use the same NFS. The SCP method can be used on any system but may be slower for larger grids.
For more information about the ttGridAdmin repositoryCreate
command,
see Create
a Repository (repositoryCreate) in Oracle TimesTen In-Memory Database
Reference.
Create a Repository as a Directory Path Mounted Using NFS on Each Host
This example creates a repository as a directory path mounted using NFS on each host of your grid. Ensure that the directory specified by the -path
parameter exists and is accessible by the instance administrator on each element. This directory must have the same identical mount path on every element. For example, if the directory path is mounted at /repositories
on one element, it must be mounted at /repositories
on all elements.
% ttGridAdmin repositoryCreate repo1 -path /repositories -method mount
Repository repo1 created
Create a Repository as a Directory Path That Is Accessible on Each Host with SSH or SCP
This example creates a repository as a directory path that is not directly mounted
on each host of your grid. Ensure that the path value specified by the
-path
parameter exists on the host that you specify with the
-address
parameter. The address parameter is the fully
qualified domain name of the host on which the repository exists. Also, ensure that
each host can use the scp
command to access files in the path value
specified by the -path
parameter. You can use the
ttGridAdmin gridSshConfig
command to verify that your hosts can
communicate through SSH with each other. For more information, see Configure SSH
(gridSshConfig) in Oracle TimesTen In-Memory Database
Reference.
% ttGridAdmin repositoryCreate repo2 -path /repositories -method scp -address host1.example.com
Repository repo2 created
Attach a Repository
Multiple grids can use a single repository as long as each grid is associated with that repository. If you have an existing repository, you can attach it to another grid as long as each host from your grid has access to the path of the repository. Depending on the value of the -method
parameter, you can attach a repository as a directory path mounted using NFS on each host or as a directory path that is accessible on each host with SSH or SCP. However, you can only attach a repository with the same -method
as which was used to create it. For example, if you created a repository with -method mount
, you can only attach it to another grid with -method mount
.
For more information about the ttGridAdmin repositoryAttach
command, see Attach a Repository (repositoryAttach) in Oracle TimesTen In-Memory Database
Reference.
Attach a Repository as a Directory Path Mounted Using NFS on Each Host
This example attaches a repository as a directory path mounted using NFS on each host of your grid. Ensure that the path value specified by the -path
parameter exists and is accessible by the instance administrator on each host of your grid.
The name of the repository needs to be the same on each grid to which you attach your repository.
% ttGridAdmin repositoryAttach repo1 -path /repositories -method mount
Repository repo1 attached
Attach a Repository as a Directory Path That Is Accessible on Each Host with SSH or SCP
This example attaches a repository as a directory path that is not directly mounted on each host of your grid. Ensure that each host can use the scp
command to access files in the path value specified by the -path
parameter. The address parameter is the fully qualified domain name of the host on which the repository exists.
The name of the repository needs to be the same on each grid to which you attach your repository.
% ttGridAdmin repositoryAttach repo2 -path /repositories -method scp -address host1.example.com
Repository repo2 attached
Detach a Repository
TimesTen Scaleout enables you to detach, but not destroy, a repository from a grid when you no longer need to use that repository with your grid.
To detach a repository from a grid, specify the name of the repository to detach from your grid:
% ttGridAdmin repositoryDetach repo1
Repository repo1 detached
Detaching a repository from a grid does not delete the directory or the contents of that repository.
For more information about the ttGridAdmin repositoryDetach
command, see Detach a Repository (repositoryDetach) in Oracle TimesTen In-Memory Database
Reference.
List Repositories and Collections
TimesTen Scaleout enables you to view a list of all repositories that are attached to a grid and all collections within the repository.
To view a list of all repositories that are attached to a grid:
% ttGridAdmin repositoryList
Repository Method Location Address
---------- ------ ------------------- --------
repo1 mount /repositories/repo1
To view a list of all collections that are part of every repository that are attached to a grid:
% ttGridAdmin repositoryList -contents
Repository Collection Type Date Details
---------- ------------- ------------- ------------------------ ------------------
repo1 B20170222145544 Backup 2017-02-22T14:55:48.000Z Database database1
repo1 B20170615142115 Backup 2017-06-15T14:21:20.000Z Database database1
repo2 L20170615143145 gridLogCollect 2017-06-15T14:31:48.000Z
repo2 L20170616102242 gridLogCollect 2017-06-16T10:22:50.000Z
Note:
You can add the name of a repository to only view the collections that are part of a specific repository. For example, ttGridAdmin repositoryList repo1 -contents
shows all collections of the repo1
repository.
For more information about the ttGridAdmin repositoryList
command,
see List
Repositories (repositoryList) in Oracle TimesTen In-Memory Database
Reference.