1. Startup instance (DB2INST1):
Db2start
2. Stop instance (DB2INST1):
Db2stop
3. List all instances (DB2INST1)
Db2ilist
5. List the current instance:
DB2 Get Instance
4. View the sample configuration file:
DB2 Get DBM Cfg|more
5. Update Database Manager parameter information:
DB2 update dbm CFG using Para_name para_value
6. Create a database:
DB2 Create DB Test
7. View database configuration parameter information
DB2 get DB CFG for Test|more
8. Update database parameter configuration information
DB2 Update DB CFG for test using Para_name para_value
10. Delete database:
DB2 Drop DB Test
11. Connecting to the database
DB2 Connect to test
12. List the details of all tablespaces.
DB2 List tablespaces Show Detail
13. Query data:
DB2 SELECT * FROM TB1
14. Data:
DB2 Delete from TB1 where id=1
15. CREATE INDEX:
DB2 CREATE INDEX IDX1 on tb1 (ID);
16. Create a view:
DB2 CREATE VIEW VIEW1 as select ID from TB1
17. Query view:
DB2 SELECT * FROM View1
18. Node Cataloging
DB2 catalog TCP node Node_name remote SERVER_IP Server Server_port
19. See the port number
DB2 Get dbm Cfg|grep SVCENAME
20. Attach to test node
DB2 Attach to Node_name
21. View Local nodes
DB2 List Node Direcotry
22. Node Reverse Cataloging
DB2 uncatalog Node Node_name
23. Database Cataloging
DB2 Catalog DB db_name as Db_alias at node Node_name
24. Viewing the catalogue of databases
DB2 List DB Directory
25. Connecting to the database
DB2 Connect to Db_alias user user_name using User_password
26. Database Reverse Cataloging
DB2 Uncatalog DB Db_alias
27. Export Data
DB2 Export to MyFile of IXF messages MSG select * FROM TB1
28. Import data
DB2 import from MyFile to IXF messages msg replace into TB1
29. Export all table data for a database
Db2move Test Export
30. Creating a Database definition
db2look-d db_alias-a-e-m-l-x-f-o db2look.sql
31. Create a Database
DB2 Create DB Test1
32. Build Definition
DB2-TVF Db2look.sql
33. Import all data from the database
Db2move Db_alias Import
34. Reorganization Inspection
DB2 Reorgchk
35. Reorganization Table TB1
DB2 reorg Table TB1
36. Update statistical information
DB2 runstats on table TB1
37. Backup DATABASE Test
DB2 Backup DB Test
38. Restore DATABASE Test
DB2 Restore DB Test
399\. List information for a container
DB2 list tablespace containers for tbs_id Show Detail
40. Create a table:
DB2 ceate table tb1 (ID integer not null,name char (10))
41. List all Tables
DB2 List Tables
42. Insert Data:
DB2 INSERT INTO TB1 values (1, ' Sam ');
DB2 INSERT INTO TB2 values (2, ' Smitty ');