Initializing the Environment
0. Start Db2start
1.CMD Environment Input Db2cmd New Open DB2 Action window
2. Connect to the database DB2 connect to Db_name
3. In the local Host BACKUP statement DB2 BACKUP DATABASE db_name to D:
Timestamp when backup image was successfully backed up
4. Create a database in this environment DB2 create databases Db_name
DB2 CREATE DATABASE pb_db using CodeSet GBK territory ZH_CN pagesize 8192---building;
DB2 Connect to pb_db---connection;
DB2 Create Bufferpool testpool size pagesize 32k--Temporary tablespace buffer pool;
DB2 Create temporary Tablespace temp (tablespace_name) pagesize 32k managed by database using the path \ file where the files ' database is located. ' 5 Extentsize bufferpool testpool-temporary table space;
------View the tablespace for a database
DB2 List tablespaces Show Detail
Command completed successfully
5. Connect to the database
DB2 Connect to Db_name
6. DB2 RESTORE Database Old_name from D:\ (write only to the root directory where the backup file resides) taken at 201722 to New_name
Error sql2542n--table space not backed up, requires redirection of tablespace backup
DB2 SQL statements commonly used in backup and restore