Introduction to the use of Informix data migration tools

Source: Internet
Author: User

I. Dbschema

USAGE:
Dbschema [-Q] [-t tabname] [-S user] [-p user] [-R RoleName] [-F procname]
[-hd TabName]-D dbname [-W passwd] [-seq sequence] [-l [num]]
             [-u [IA] udtname [all]] [-it [Type]] [-SS [- SI]] [filename] eg: 1) dbschema-d my_dbname-t all my_table.sql    Parse: Export all table structures in the database my_dbname to file My_ TABLE.SQL  2) dbschema-d my_dbname-f all my_proce.sql    Parse: Export all stored procedures in database My_dbname to file  my_ proce.sql 3) dbschema-d my_dbname my_all.sql    Parse: Export all objects in the database My_dbname (table structure, stored procedures, triggers, etc...) ) to file my_all.sql 4) dbschema-d my_dbname -t tab_name  tab_name.sql    parsing: Exporting a database My_ dbname table name tab_name to file. sql tab_name.sql 5) dbschema-d my_dbname -f Pro_name  pro_name.sql     Parse: Export database My_dbname stored procedure name pro_name to file. SQL pro_name.sql  6) dbschema-d my_dbname -ss   my_dbname .sql    parsing: Export more table information (EXTENT ...)   7) dbschema-d your_database_name-p all     dbschema-d your_database_name-r all    &NBSP Parse: Export authorization information for a user or role in a database   8) dbschema-d your_database_name-s all      parsing: exporting synonyms in the database       9) dbschema-t all-p A Ll-f all-s all-d mydbname-ss mydbname.sql    parsing: Export all table structures with the database name Mydbname, user authorization information, stored procedures, and synonyms to file mydbname.sql  two .dbaccess   1) Introduction:   query-language→ provides managers with a sqleditor, You can enter your own SQL instructions and execute     connection→ establish or disconnect from the database server     database→ provide management database setup, action and deletion      table→ provides manager management data sheet creation, and deletion     session→ Description database service library and host     exit→ exit dbaccess       new→ Clear the editor screen, enter the SQL Directive   If you enter multiple SQL statements, use ";" to split the SQL statement open  
run→ execute the SQL instructions entered in the editor modify→ modify the SQL instructions entered in the editor
use-editor→ uses the editor specified by Dbedit to output→ the execution results to the printer or archive
choose→ Select an established SQL file to copy to editor for use
The SQL commands entered in the Save→editor are stored in the editor for later reference.
The maximum length of the target file name that the user wants to save is 10 characters, and db-access automatically adds the extension ". sql" to it.
info→ Query database and table information
columns→ displays information about the columns of the specified table, including data types and whether null values are allowed
indexes→ Displays the name, owner, and type of the index for the specified table (unique index and normal index) privileges→ lists the list of users with permissions such as table-level insertions, deletions, references→ lists users who have associated permissions on the columns in the specified table
status→ lists status information for a table, number of fields, number of records, size of rows, creation Date constraints→ Association, Master code, unique limit, and default value for columns triggers→ trigger information table→ Select Table
fragments→ table Space allocation policy connect→ can contact a specific database disconnect→ can disconnect the current database server For more information, see HTTP://WENKU.BAIDU.COM/VIEW/5DA8 01bdf121dd36a32d828a.html 2) dbaccess my_dbname my_dbname.sql parsing: Import the file my_dbname.sql into the My_dbname database (with dbschema command group eg:a. Simple Execute SQL file

dbaccess TestDB sqlfile.sql or dbaccess [email protected] Sqlfile.sql
B. Execute output Print execution statement and execution result
DBACCESS-E TestDB Sqlfile.sql
C. Redirecting execution results to a file (Shell:bash)
DBACCESS-E testdb sqlfile.sql > Output.log > 2&1
Cat Output.log
1} When executing an SQL script file, print verbose error messages when an error occurs
DBACCESS-E-M TestDB sqlfile2.sql
2.} When executing a SQL script file, print verbose error message when an error occurs and stop execution of subsequent statements when the first error is encountered
Dbaccess-e-m-a TestDB Sqlfile2.sql

→ Can establish a connection with a specific database

Disconnect

→ Can disconnect the current database server

Three. Dbexport function: Dbexport The schema script and the table data file for all objects in the database, the schema script contains the creation script of the table, etc., and contains the information about the data file of the exported table; Usage:dbexport <database> [-X] [-c] [-Q] [-d] [-SS [-si]]
[{-O <dir> |-t <tapedev>-B <blksz>-S <tapesz> [-f <sql-command-file>]}] Parameter details:-X if a The string field contains the binary data, and after that parameter, Dbexport will reorganize the data.
-C unless very serious error dbexport is interrupted, these errors are as follows:
Cannot open the tape device you specified;
Cannot write tape devices or files;
Incorrect command-line arguments;
You cannot open a database or have permission to connect to a database;
-Q does not output the export process to the screen
-D let dbexport export only the descriptor of the BLOB field without exporting the BLOB data
-SS can generate more detailed information, such as:
The size of the initial and additional extent;
The Shard information of the table;
The mode of the lock on the table (row or page lock);
The space where the dbspace or BLOB data resides in the table;
-O <dir>
The database can be imported into the directory you specify
-T <tapedev> b <blksz>-S <tapesz>
Importing data to Tape
-F <sql-command-file>
Dbexport produces a DDL file when the data is exported, you can specify an absolute path to the file
EG:
1) Dbexport Stores
Parse: Export the database stores to the current directory
2) Dbexport Stores-q-C
Parse: Export the database stores to the current directory, do not output the process to the screen, and ignore the small error
3) Dbexport stores-q-c-o/tmp
Parse: Export the database stores to the specified directory
4) dbexport stores-t/dev/tape-b 2048-s 2000000-f/tmp
Parsing: Exporting database stores to tape
5) Dbexport Stores-ss
Parse: Stores the database to the pre-export directory and add additional information
Four. Dbimport effect: Dbimport According to the pattern script to import, the import process first creates the object according to the pattern script, how to import the corresponding data, the import data process is similar to the load procedure. To speed up the import, You can select the log mode of the database as the Nolog mode first. Change the log mode after the import is complete. Usage:

Dbimport <database> [-X] [-c] [-Q] [-D <dbspace>]
[-l [{buffered | <log-file>}] [-ansi]]
[{-I <dir> |-t <tapedev> [-B <blksz>-S <tapesz>] [-f <script-file>]}]
Note: <log-file> must is a complete path

DBIMPORT-V Display software version number
* Users running Dbimport will have DBA authority over the database being created
Syntax for the Dbimport utility:
-C instructs Dbimport to complete the mount work without a fatal error.
-Q indicates that no error messages and warnings are displayed on the standard output device.
The hex binary data in the-X identifier field.
Input file location options:
-i specifies the disk directory where ASCII files and schema files are stored for dbimport lookups.
-t Specifies the tape device name that contains the ASCII file and the schema file.
-b Specifies the tape device block size. Block in kilobytes, this value must be acceptable for the device being used.
-s Specifies the maximum amount of data storage for the tape.
-f Specifies the pathname of the mode file on disk so that Dbimport finds the schema file and establishes the database as input.
Build Library Options:
-d Specifies the online database space (dbspace) used to store the new database. If you do not specify a dbspace using the-D option,
The database is established by default in the root dbspace.
-L If the buffered parameter is not used to establish a non-buffered transaction log for the mounted database, and if the buffered parameter is used to establish a buffered transaction log for the mounted database, the-l option is equivalent to the WITH LOG clause of the CreateDatabase statement. If you do not use the-l option, the new database does not have a log.  -ansi establishes an ANSI-compliant transaction log for the mounted database. Eg:dbimport mydbname-d Mydbs [DBSPACE] (note: After the import is complete, update the database-level statistics updates statistics) modify the log mode of the database: Ondblog UNBUF database name
Ontape-s-L 0-U database name

Five. Loadeg: Enter the Informix Operations database operation interface with the dbaccess command, select the library (sysadmin) from which you want to export the data, and enter the following SQL statement: Load from directory test.txt insert INTO Table_ Name Six. Unloadeg:unload to "catalogue" test.txt SELECT * FROM table_name;

Introduction to the use of Informix data migration tools

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.