Task 6: Use the db2look command line tool to generate the DDL statements to create database objects
In this task, you will use the db2look tool to extract selected DDL statements from the MUSICDB database.
-
Enter the following commands using the Linux terminal session to generate the DDL associated with the ALBUMS table and save the output in a file named ALBUMS.DDL:
cd $HOME/ddl
db2look -d musicdb -e -z music -t albums -o ALBUMS.DDL
more ALBUMS.DDL
The db2look tool is useful for generating DDL scripts that can be used for database migration or backup purposes.
By completing this task, you have successfully used the db2look tool to generate DDL statements for database objects in the MUSICDB database.
This demonstration has provided a comprehensive guide to creating and managing database objects in the Db2 database. By following the tasks and best practices outlined, you have gained hands-on experience with various Db2 tools and commands, enhancing your database administration skills.