To work with DB dumps you should use the special script dump.sh
which can be typically found at /opt/hydra/oracle/scripts/dump.sh
. It is necessary to access this script under the oracle user within an initialized environment. You can initialize environment for oracle user with sudo utility by using the following command:
sudo -u oracle -i
The script for DB dumps has the following starting options:
- export — for exporting the dump. The dump is exported to the dump directory specified in the DB (typically,
/var/oradata/dumps
). - drop — for dropping of DB contents. Before dropping please make sure that the DB is not a production one.
- import — for importing dump into the DB. Before importing the dump it is necessary to drop its contents. The dump imports from the dump directory specified in the DB (typically,
/var/oradata/dumps
). After the import is completed, the production mode is disabled.
Additional parameters of the script:
- -i — the DB name
- -o — the scheme name
- -p — the AIS_NET user password
- -f — the dump (dump file) name
- -s — prevent displaying of DB drop warning
See below an example of using the script for dump transfer from DB hydra to hydra2:
Export dump from hydra:
/opt/hydra/oracle/scripts/dump.sh -i hydra -p password -f hydra_dump export
Drop hydra2:
/opt/hydra/oracle/scripts/dump.sh -i hydra2 -p password drop
Import dump at hydra2:
/opt/hydra/oracle/scripts/dump.sh -i hydra2 -p password -f hydra_dump import
During the import of the dump to a new DB there may be some errors of the following kind:
Failing sql is: GRANT SELECT ON "AIS_NET"."SR_V_GOOD_SERVS" TO "NET_GOODS" ORA-39083: Object type OBJECT_GRANT failed to create with error: ORA-01917: user or role 'NET_GOODS' does not exist
Such errors are not critical as the export script imports only the AIS_NET scheme. The missing roles are created within the DB with a separate script at the end of import procedure.
The backup procedure with the expdp utility (the dump.sh
script) is highly resource-intensive. It is recommend to backup DB at time with the lowest server load (typically, from 2 am till 4 am).
You can cancel the unfinished export/import process by CTRL-C
and with kill_job
command:
... . . exported "AIS_NET"."SS_JOB_LOGS" 635.2 MB 1550063 rows . . exported "AIS_NET"."SD_PROCESSING_REQUESTS_T" 563.8 MB 7204 rows . . exported "AIS_NET"."SD_MV_DOCUMENTS" 479.7 MB 3247473 rows ^C Export> kill_job Are you sure you wish to stop this job ([yes]/no): yes