Tags: ext com any hang TCO back mes parameter sofEnvironment preparation1. Create a new table[Email protected]:~> DB2 "CREATE TABLE TB1 (ID int,dt timestamp,name varchar (100))";db20000i the SQL command completed successfully.2. Inserting data[Email protected]:~> DB2 "INSERT into TB1 values (1,current timestamp, ' Jack ')";db20000i the SQL
1. Open the cmd command window, enter d: db2 under the db2 installation directory, and run the command: DB2CMD to enter the db2 CLP window. Www.2cto.com 2. create a data folder command: mkdir data description:
1. Using db2move to export all data db2move is an integrated data migration tool that supports export, import, and load operations. In fact, the three methods of db2move are implemented by simply using the db2export, db2import, and db2load commands. This section only describes its export
1. Using db2move to export all
. Disconnect the database
DB2 Force application All
6. Connecting to the database
DB2 Connect to
7. Disconnect the database
Disconnect Current Database connection: DB2 connect reset
Or: DB2 Disconnect current
Disconnect all databases: DB2 disconnect All
8. Ba
.001.546201.36088 /""000190", "xwd", "lobs.001.582289.65650 /"The third field is of the Blob type. Only one flag is saved in the file, which is equivalent to a pointer. The real lob data is stored in D: /lobs.001, lobs.002 ,...... and other files. In the command, specify the path in which the big object data is stored after lobs to (note that this path must already exist in advance; otherwise, an error is reported ), after the lobfile, specify the fil
stored in d: \ lobs.001, lobs.002 ,...... and other files. In the command, specify the path in which the big object data is stored after lobs to (note that this path must already exist in advance; otherwise, an error is reported ), after the lobfile, specify the files in which the big object data is stored. do not specify the extension. DB2 automatically appends data based on the data volume. 001 ,. 002 ex
Tables for system17. List User Tables#db2 List Tables for user18. List specific user tables#db2 list tables for schema [user]19. Create a new table (T1) with the same structure as a table (T2) in the database#db2 CREATE table T1 like T220. Import data from one table T1 to another table T2#db2 "INSERT INTO T1 select *
command27. Online BACKUP Database#db2-v BACKUP DATABASE 28. Restore the Database#db2 Restore DB 29. Online Recovery Database#db2 "RESTORE DB #db2 "Rollforward DB 30. Export Data File#db2move [-SN [-tn 31. Import data Files#db2move 32. Get
user's password on it. If you want to change the user's password, you can change that user's password on the operating system.
1, open the Command line window
Copy Code code as follows:
#db2cmd
2, open the control center
Copy Code code as follows:
# Db2cmd DB2CC
3. Open Command Editor
Copy Code code as follows:
Db2cmd Db2ce
One, loading data:
1,
application All6. Connecting to the databaseDB2 Connect to 7. Disconnect the databaseDisconnect Current Database connection: DB2 connect resetOr: DB2 Disconnect currentDisconnect all databases: DB2 disconnect All8. Backing Up the databaseDB2 Backup DB Note: You need to disconnect the database before you perform the above command9. Restoring the DatabaseDB2 Resto
To log on to the database, follow these steps:
DB2 uses the command window to connect to the database
1. Export to a file to obtain the SQL statementDb2look-D cqyancao-e-o dB. SQL-I db2user-W pswDatabase Name to output file name username and password
Example: db2look-D department-u Walid-e-o db2look. SQL
-- This generates DDL statements for all tables and
How can I avoid an error when executing SQL statements in DB2? This is a problem that many people have mentioned. The following describes how to execute SQL statements in DB2 and export table records for your reference.
When writing DB2 SQL statements on the console, many people habitually press enter to wrap the line,
Method One
In the Object view window of the control center, select the datasheet you want to export the table structure to, hold down CTRL or SHIFT, and then select-> to generate the DDL by clicking the right mouse button.
Method Two
Step one: Open the DB2 command-line tool, create a new folder data in the Bin folder of the
The DB2 Online Export method may not be known to everyone. The following describes the detailed steps for online DB2 export. If you are interested in online DB2 export, take a look.
DB2
The so-called data movement in DB2, including:1. Importing data (Import)2. Exporting the data (export)3. Loading of data (load)Both import and load are used to save data from a file in a format to a table in a database using DB2 's related commandsExporting refers to saving data from tables in a DB2 database to a file
Disconnect the current database connection:
DB2 Connect reset or: DB2 disconnect current
To disconnect all database connections:
DB2 Disconnect All
8. Backing Up the database
DB2 Backup DB
Note: You need to disconnect the database before you perf
1, close DB2.
Db2stop or db2stop force.
Write two of the scripts in general, avoiding the use of Db2stop force commands, such as:
Db2stop
Db2stop Force
2, start DB2
Db2start
3, create the database
DB2 Create DB
or DB2 create DB using CodeSet GBK territory CN
4, delete the database
Be careful to do this.
30. Export Data File#db2move [-SN [-tn 31. Import data Files#db2move 32. Get DB2 Database management configuration environment information#db2 get dbm CFG33. Get DB2 a database Database management configuration environment information#db2 get db cfg for Or: Execute
Db2 command list has been working for more than a month. Because the company wants to use DB2 databases, it always tries its best to read this book. For a while, I have some experiences and summarized some commonly used DB2 commands, share it with you! I hope you will be helpful .. Start the
import from ETL_BUSI_TYPE_TOSEND.IXF of ixf modified by forcecreate commitcount 10000 replace_create INTO ETL_BUSI_TYPE_TOSENDDb2 import from ETL_CONTACT_PEPOLE.IXF of ixf modified by forcecreate commitcount 10000 replace_create INTO ETL_CONTACT_PEPOLE
How to export only the table definitions from the ixf file instead of the table data in the ixf file in the DB2 database?
You can add a ROWCOUNT to specify
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.