db2_fast_import.sh script
Use the db2_fast_import.sh
script to import
the contents of the tar file generated by running the db2_export.sh
script
into the database for a new IBM® Product Master environment.
You can use this script to import the schema into the same or a different
database under the same schema name or a different schema name.
Prerequisites
Before you can run thedb2_fast_import.sh
script,
you must:- Make sure that there are no errors at the time of export. If there
are any errors, you must rectify the errors, run the
db2_export.sh
script again and then try the import. - Make sure that there is enough space in the tablespaces before importing the database schema. You can use the db2 list tablespaces show detail command to check the available space in the tablespaces, and add more space if required.
- Make sure that the
db2_fast_import.sh
script is saved in the UNIX format if you copy it from a Windows-based computer to the database server. If it is not in the UNIX format, the system might introduce end-of-line characters that will cause the script to fail. - Run this script only when you log in as the DB2® database administrator.
- Optional: Create a new empty database user if you want to import to a new database user.
CAUTION:
If you import into an existing
schema with tables, all existing tables will be dropped and data will
be lost.
Syntax
db2_fast_import.sh --db=databasename --dbuser=touser --dbpassword=touserpassword --backupdir=bkpdirectory
Parameters
- db
- Specify the name of the database into which you are importing the schema. It can be the same database from which you exported the schema.
- dbuser
- Specify the name of the database user into which you want to import the schema.
- dbpassword
- Specify the password of the target database user.
- backupdir
- Specify the name of the directory that contains the expanded tar file.
Example
In this example, the db2_fast_import.sh
script
is run to import the expanded database schema in the /u01/backup/july10/july10bkp directory
to the pimdb database schema into the trigodev user.
db2_fast_import.sh --db=pimdb --dbuser=trigodev --dbpassword=trigodev
--backupdir=/u01/backup/july10/july10bkp
Output
Running this script will display the date of last revision of the script, Db2 connection information, and the following progress information- DROP TABLES
- CREATE TABLES
- RUNSTATS
- LOADING
- REMOVE CHECK-PENDING STATUS
- CREATE SEQUENCES
- Start time <date time>
- End time <date time>
- CHECK .log FILES FOR SUCCESS