Database renaming
The dbimport utility gives the new database the same name as the database that you exported. If you export a database to tape, you cannot change its name when you import it with dbimport. If you export a database to disk, you can change the database name.
You can use the RENAME DATABASE statement to change the database name.
Alternative ways to change the database name
The following examples show alternative ways to change the database name. In this example, assume that dbexport unloaded the database stores_demo into the directory /work/exports/stores_demo.exp. Thus, the data files (the .unl files) are stored in /work/exports/stores_demo.exp, and the schema file is /work/exports/stores_demo.exp/stores_demo.sql.
To change the database name to a new name on UNIX™ or Linux™:
- Change the name of the .exp directory. That is, change /work/exports/stores_demo.exp to /work/exports/newname.exp.
- Change the name of the schema file. That is, change /work/exports/stores_demo.exp/stores_demo.sql to /work/exports/stores_demo.exp/newname.sql. Do not change the names of the .unl files.
- Import the database with the following command:
dbimport -i /work/exports newname
To change the database name to a new name on Windows™:
In the following example, assume that dbexport unloaded the database stores_demo into the directory D:\work\exports\stores_demo.exp. Thus, the data files (the .unl files) are stored in D:\work\exports\stores_demo.exp, and the schema file is D:\work\exports\stores_demo.exp\stores_demo.sql.
- Change the name of the .exp directory. That is, change D:\work\exports\stores_demo.exp to D:\work\exports\newname.exp.
- Change the name of the schema file. That is, change D:\work\exports\stores_demo.exp\stores_demo.sql to D:\work\exports\stores_demo.exp\newname.sql. Do not change the names of the .unl files.
- Import the database with the following command:
dbimport -i D:\work\exports