This article describes how to install the sample database and the TOLLSDB database in the DB2 database, and how to install the sample database and the TOLLSDB database, the following describes the main content of the article.
Database, sample, TOLLSDB database, sample, TOLLSDB
Install the sample database and TOOLSDB database:
After the installation is complete, log on to the sample database and toolsdb and find the error:
- db2 => connect to sample
- SQL1031N The database directory cannot be found on the indicated file system.
- db2 => connect to toolsdb
- SQL1031N The database directory cannot be found on the indicated file system.
1. Assume that the DB2 database is not installed. Check that only the sqllib folder is in the/hom/db2inst1 directory:
- [db2inst1@localhost ~]$ ls
- sqllib
Compared with other students, I found that my server has a db2inst1 directory missing:
- [db2inst1@localhost ~]$ ls
- db2inst1 sqllib
2. Create two databases manually as follows:
2.1 create a sample database:
- [db2inst1@localhost ~]$ db2sampl
- Creating database "SAMPLE"...
- Connecting to database "SAMPLE"...
- Creating tables and data in schema "DB2INST1"...
- Creating tables with XML columns and XML data in schema "DB2INST1"...
- 'db2sampl' processing complete.
2.2 create a toolsbd database:
- [db2inst1@localhost NODE0000]$ db2 create tools catalog systools create new database toolsdb
- DB20000I The CREATE TOOLS CATALOG command completed successfully.
2.3 confirm the creation of the corresponding DB2 database file:
- [db2inst1@localhost NODE0000]$ cd
- [db2inst1@localhost ~]$ ls
- db2inst1 sqllib
- [db2inst1@localhost ~]$ cd db2inst1/
- [db2inst1@localhost db2inst1]$ ls
- NODE0000
- [db2inst1@localhost db2inst1]$ cd NODE0000/
- [db2inst1@localhost NODE0000]$ ls
- SAMPLE SQL00001 SQL00002 sqldbdir TOOLSDB
2.4. log on to the database. Log on to the sample, disconnect the database, and connect to toolsdb:
- [db2inst1@localhost NODE0000]$ db2
- (c) Copyright IBM Corporation 1993,2007
- Command Line Processor for DB2 Client 9.7.1
- You can issue database manager commands and SQL statements from the command
- prompt. For example:
- db2 => connect to sample
- db2 => bind sample.bnd
- For general help, type: ?.
- For command help, type: ? command, where command can be
- the first few keywords of a database manager command. For example:
- ? CATALOG DATABASE for help on the CATALOG DATABASE command
- ? CATALOG for help on all of the CATALOG commands.
- To exit db2 interactive mode, type QUIT at the command prompt. Outside
- interactive mode, all commands must be prefixed with 'db2'.
- To list the current command option settings, type LIST COMMAND OPTIONS.
- For more detailed help, refer to the Online Reference Manual.
- db2 => connect to sample
- Database Connection Information
- Database server = DB2/LINUX 9.7.1
- SQL authorization ID = DB2INST1
- Local database alias = SAMPLE
- db2 => disconnect sample
- DB20000I The SQL DISCONNECT command completed successfully.
- db2 => connect to toolsdb
- Database Connection Information
- Database server = DB2/LINUX 9.7.1
- SQL authorization ID = DB2INST1
- Local database alias = TOOLSDB
The above content is an introduction to the installation of the sample database and the TOLLSDB database in the DB2 database. I hope you will gain some benefits.