The db2 tutorial you are watching is: DB2 UDB V8.1 Management Study Notes (III). Force disconnect the existing connection, stop the instance and delete it.
$ db2idrop -f instance_name
Used to migrate instances under UNIX.
$ db2imigr instance_name
Update the instance to use the instance to gain access to some new product options or fix packages.
$ db2iupdt instance_name
Get the current instance.
$ db2 get instance
When the instance level or database level parameters are updated, some can take effect immediately, while others need to restart the instance to take effect. immediate Explanatory indicates that the change takes effect immediately, deferred explicitly indicates that the change takes effect after the instance is restarted.
When you need to configure connections between many clients and DB2 servers, you can use the configuration assistant to export the server's profile and then import the profile using the configuration assistant on each client. If the client only has the runtime client installed, you can use the following command to import the profile.
$ db2cfimp access_profile_name
Question: Should a profile be exported from a configured client?
List all database connections
$ db2 list applications
Terminates the specified connection handle, the transaction is interrupted and rolled back. Operating multiple handles simultaneously can be separated by commas, or the keyword all is specified. This command terminates only the specified connection and does not prevent new applications from connecting to the database.
$ db2 force application (2)
When creating a database, you can specify the sorting method:
collate using identity
The system schema set is created with each database and they are placed in the SYSCATSPACE tablespace.
SYSIBM: Basic system directory, it is recommended not to access it directly
SYSCAT:PUBLIC is granted SELECT permission for this mode, and catalogues read-only views. This is the recommended way to obtain directory information.
SYSSTAT: Updateable Directory View - Impact Optimizer
SYSFUN: User-defined function
If an existing row in the table does not satisfy the constraint, the constraint cannot be defined. Constraint checking can be turned off to speed up the addition of large amounts of data, but the table is in the CHECK PENDING state.
When creating a table, you can use options to specify one or more tablespaces to which the table and indexes will be placed:
CREATE TABLE TEST (column 1 definition, column 2 definition, ...) IN INDEX IN
This command gives you an option: specify where to create tables and indexes. If no separate index tablespace is specified, an index is created in the same tablespace where the table resides. After creating the table, there is no chance to create an index in a different tablespace. To create an index, you need to plan ahead!
CREATE INDEX ON (column 1 ,column 2 ...)
The UNIQUE property tells DB2 that the index must force the uniqueness of all inserted values.
If the result set is sorted in ascending and descending order, ALLOW REVERSE SCANS will tell DB2 to include additional pointers in the index to allow efficient forward and backlinking in the record.
DB2 can add additional columns to the index being created. The CREATE INDEX command allows users to specify columns that do not belong to the actual index but are saved in the index record for performance reasons.
CREATE UNIQUE INDEX ON EMPLOYEE (EMPNO) INCLUDE (LASTNAME,FIRSTNAME)
For columns contained in the index, the index must be UNIQUE. When an index is created, additional columns are added to the index value. Indexes do not use these values to sort or determine uniqueness, but they can be used when satisfying SQL queries. For example, the following SELECT statement will not require reading the actual data row:
SELECT LASTNAME, FIRSTNAME FROM EMPLOYEE WHERE EMPNO < '000300'
To create a cluster index on a table, append the CLUSTER keyword to the end of the CREATE INDEX command, for example:
CREATE INDEX DEPTS-IX ON EMPLOYEE(WORKDEPT) CLUSTER
Use the following common rules to determine the classic number of indexes defined for the table. The number of indexes depends on the main purpose of the database:
For an online transaction processing (OLTP) environment, create one or two indexes.
For hybrid query and OLTP environments, create two to five indexes.
For a read-only query environment, create more than five indexes.
In the command line mode of DB2 on Windows platforms, or in Unix-like platforms, use the command db2cc to start the Control Center.
db2move provides the ability to batch move data between databases, you can specify a certain table or the entire database table.
$ db2move dbname action
action can be specified as:export, import or load
Use the -l parameter to specify the folder in the lob object storage
Performing incremental backup requires setting the value of the database configuration parameter "trackmod" to "YES"
Performing online backup requires setting the value of the database configuration parameter "logretain" to "YES". Online backup syntax:
$ db2 backup db dbname online to path
When the home directory of the das user is deleted and the das service is not dropped first, then the dasdrop is executed unsuccessful. Tip:
The db2admin command cannot be found because the db2admin command is saved in the home directory of das.
You can delete the home directory of the das user and restart the server to solve this problem.
$ dasupdt dasName Upgrade das$ db2iupdt instName Upgrade instance$ db2licd end Stop the license daemon
After installing DB2 V8.1 on Linux system, the db2fmcd process will start automatically, even if the instance and DAS are not started.
DB2 database service is installed in the Chinese Linux environment, and a database is created using the GBK code page (codepage). After completion, you can connect normally. If the operating system code page is changed to English, an error will be reported when using "db2 connect", and the code page cannot be converted during connection.
$ db2idrop -f instance_name
Used to migrate instances under UNIX.
$ db2imigr instance_name
Update the instance to use the instance to gain access to some new product options or fix packages.
$ db2iupdt instance_name
Get the current instance.
$ db2 get instance
When the instance level or database level parameters are updated, some can take effect immediately, while others need to restart the instance to take effect. immediate Explanatory indicates that the change takes effect immediately, deferred explicitly indicates that the change takes effect after the instance is restarted.
When you need to configure connections between many clients and DB2 servers, you can use the configuration assistant to export the server's profile and then import the profile using the configuration assistant on each client. If the client only has the runtime client installed, you can use the following command to import the profile.
$ db2cfimp access_profile_name
Question: Should a profile be exported from a configured client?
List all database connections
$ db2 list applications
Terminates the specified connection handle, the transaction is interrupted and rolled back. Operating multiple handles simultaneously can be separated by commas, or the keyword all is specified. This command terminates only the specified connection and does not prevent new applications from connecting to the database.
$ db2 force application (2)
When creating a database, you can specify the sorting method:
collate using identity
The system schema set is created with each database and they are placed in the SYSCATSPACE tablespace.
SYSIBM: Basic system directory, it is recommended not to access it directly
SYSCAT:PUBLIC is granted SELECT permission for this mode, and catalogues read-only views. This is the recommended way to obtain directory information.
SYSSTAT: Updateable Directory View - Impact Optimizer
SYSFUN: User-defined function
If an existing row in the table does not satisfy the constraint, the constraint cannot be defined. Constraint checking can be turned off to speed up the addition of large amounts of data, but the table is in the CHECK PENDING state.
When creating a table, you can use options to specify one or more tablespaces to which the table and indexes will be placed:
CREATE TABLE TEST (column 1 definition, column 2 definition, ...) IN INDEX IN
This command gives you an option: specify where to create tables and indexes. If no separate index tablespace is specified, an index is created in the same tablespace where the table resides. After creating the table, there is no chance to create an index in a different tablespace. To create an index, you need to plan ahead!
CREATE INDEX ON (column 1 ,column 2 ...)
The UNIQUE property tells DB2 that the index must force the uniqueness of all inserted values.
If the result set is sorted in ascending and descending order, ALLOW REVERSE SCANS will tell DB2 to include additional pointers in the index to allow efficient forward and backlinking in the record.
DB2 can add additional columns to the index being created. The CREATE INDEX command allows users to specify columns that do not belong to the actual index but are saved in the index record for performance reasons.
CREATE UNIQUE INDEX ON EMPLOYEE (EMPNO) INCLUDE (LASTNAME,FIRSTNAME)
For columns contained in the index, the index must be UNIQUE. When an index is created, additional columns are added to the index value. Indexes do not use these values to sort or determine uniqueness, but they can be used when satisfying SQL queries. For example, the following SELECT statement will not require reading the actual data row:
SELECT LASTNAME, FIRSTNAME FROM EMPLOYEE WHERE EMPNO < '000300'
To create a cluster index on a table, append the CLUSTER keyword to the end of the CREATE INDEX command, for example:
CREATE INDEX DEPTS-IX ON EMPLOYEE(WORKDEPT) CLUSTER
Use the following common rules to determine the classic number of indexes defined for the table. The number of indexes depends on the main purpose of the database:
For an online transaction processing (OLTP) environment, create one or two indexes.
For hybrid query and OLTP environments, create two to five indexes.
For a read-only query environment, create more than five indexes.
In the command line mode of DB2 on Windows platforms, or in Unix-like platforms, use the command db2cc to start the Control Center.
db2move provides the ability to batch move data between databases, you can specify a certain table or the entire database table.
$ db2move dbname action
action can be specified as:export, import or load
Use the -l parameter to specify the folder in the lob object storage
Performing incremental backup requires setting the value of the database configuration parameter "trackmod" to "YES"
Performing online backup requires setting the value of the database configuration parameter "logretain" to "YES". Online backup syntax:
$ db2 backup db dbname online to path
When the home directory of the das user is deleted and the das service is not dropped first, then the dasdrop is executed unsuccessful. Tip:
The db2admin command cannot be found because the db2admin command is saved in the home directory of das.
You can delete the home directory of the das user and restart the server to solve this problem.
$ dasupdt dasName Upgrade das$ db2iupdt instName Upgrade instance$ db2licd end Stop the license daemon
After installing DB2 V8.1 on Linux system, the db2fmcd process will start automatically, even if the instance and DAS are not started.
DB2 database service is installed in the Chinese Linux environment, and a database is created using the GBK code page (codepage). After completion, you can connect normally. If the operating system code page is changed to English, an error will be reported when using "db2 connect", and the code page cannot be converted during connection.