You might have to clone a production database onto a test
database that uses a different machine. The test machine and production
server are likely to have different storage group paths. The test
system might not have paths backed by the newest and fastest storage
disks.
About this task
Suppose you have a production database proddb,
where some data is in storage group sg_hot, which
has paths on an SSD device. You want to restore the data into the
less expensive and lower-performance test database testdb.
The test system does not have the SSD device, but the other paths
are equivalent. Performing a redirected restore can change the paths
for sg_hot on the test system without changing the
other storage groups.
Procedure
To restore data from a production database to a test
database:
- Back up the production database. Issue the following
command:
BACKUP DATABASE production_db TO /backup
where production_db is
the production database.
- Set up a redirected restore to the test database. Issue
the following command:
RESTORE DATABASE testdb REDIRECT
where testdb is
the test database.
- Modify the storage paths for sg_hot because
no hot storage is available on the test database. Issue
the following command:
SET STOGROUP PATHS FOR sg_hot ON '/hdd/path1', '/hdd/path2'
where sg_hot is
the sg_hot storage group.
- Proceed with the test database restore. Issue
the following command:
RESTORE DATABASE testdb CONTINUE
- Update the storage group name to correspond with the new
paths. Use the following commands:
CONNECT TO testdb
RENAME STOGROUP sg_hot TO sg_cold