The relocatedb command moves the journal, dump, checkpoint, or default work location for a database to another location (when a disk fills or is swapped out, for example).
The relocatedb command can also make a copy of an entire database. Any location in the original database can be moved to a new location in the new database.
The relocatedb command has the following format:
relocatedb dbname[/server_class] -new_ckp_location=locationname |
-new_dump_location=locationname | -new_jnl_location=locationname |
-new_work_location=locationname | -new_database=newdbname
[-location=locationname{, locationname} -new_location=locationname
{, locationname}]
Specifies the name of the database whose files are to be moved, and if required, the server_class, as described in Standard Flags and Parameters.
Specifies the name of the new checkpoint location. The location must be defined with checkpoint usage. Checkpoints should not be run when relocating a checkpoint location.
Specifies the name of the new dump location. The location must be defined with dump usage. Checkpoints should not be run when relocating a dump location.
Specifies the name of the new journal location. The location must be defined with journal usage. Journaling and checkpoints should not be run when relocating a journal location.
Specifies the name of the new work location. The database must have been previously extended to this location for work usage. An exclusive lock is required during the relocation operation.
Specifies the name of the new database to be created.
This option creates all the directories and copies all the files from the old database to the new database.
An exclusive lock on the original database is required while the original database is copied to the new database.
Note: Files for data recovery (*.ckp, *.jnl, *.dmp) are applicable to the original database only and are not valid for the new database. Following a relocatedb -new_database=newdbname, the new database should have a checkpoint taken with the appropriate journaling flags set according to its usage.
Specifies a list of locations. All locations in the list must be valid locations for the database. The physical files in the data areas are copied to the same location for the new database.
When new_location is specified, the physical files in each data area in the location list is copied to the corresponding data area in the new location list.
This option is valid only for database relocation (-new_database=newdbname).
Specifies a list of new locations. All locations in the list must be defined for the installation, and the usage must be compatible with the usage of the corresponding area in the location list. Each location in the location list must be mapped to a distinct location in the new location list.
This option is valid only for database relocation (-new_database=newdbname).
The following command relocates the checkpoint location for the empdata database to newckp:
relocatedb empdata –new_ckp_location=newckp
This command example does the following:
The following command relocates the journal location for the empdata database to newjnl:
relocatedb empdata –new_jnl_location=newjnl
This command example does the following:
The following command relocates the dump location for the empdata database to newdump:
relocatedb empdata –new_dump_location=newdump
This command example does the following:
The following command relocates the work location for the empdata database to newwork:
relocatedb empdata –new_work_location=newwork
The command above does the following:
The following command copies the empdata database to a new database called empdev:
relocatedb empdata –new_database=empdev
This command example does the following:
After the new database is created, you should be able to connect to it and access all data.