Informix Database Common commands (GO)

Source: Internet
Author: User
Tags informix parent directory

    • Windows (27)

      Command (2)

      AD (9)

    • Unassigned Blog posts (0)
Concern

IT168 Enterprise Grade Officer Micro



Number: It168qiye


System Architect Conference



Number: SACC2013

Subscribe to recommended blog posts
    • · MySQL Memroy engine and performance ratio ...
    • Rman registering an archive log
    • • How to Completely remove ASM disk groups ...
    • • "Amazing Wentao" in the surging upsurge ...
    • • And to say that there are two basic facts ...
Hot Word Topic
    • Lua compilation (Linux)
Informix Common Commands 2011-09-27 08:18:27

Category: Db2/informix


1. Dbexport
Download the database in ASCII mode. This command is commonly used to migrate databases.
such as: Command Dbexport-o/informix/db_export stores7, the database Stores7 downloaded to the/informix/db_export/stores7.exp directory.
The database schema file is stored under/informix/db_export/stores7.exp/stores7.sql.

2. Dbimport
Used in conjunction with Dbexport to create a database based on the output of Dbexport.
such as: Command Dbimport-c-i/informix/db_export STORES7
Create the database based on the output from the previous example.

3. Dbload
The data in the ASCII file is transferred to the database.

4. Dbschema
Output the schema of the database to a file that can be used to rebuild a database or table.

5. Oncheck
Data consistency check and index repair tool. Common options are:
Oncheck-ce Check chunks and extents
ONCHECK-CD Checking data rows
Oncheck-ci Checking index values
Oncheck-ci checking index values and ROWID
ONCHECK-CR Check System hold page
ONCHECK-CC Inspection System Catalog table

6. OnInit
Start Online

7. OnLog
Displays the contents of the system logic log. Common options are:
Onlog-l Display of log information that has been backed up to tape

8. Onmode
Change the online operation mode, force the checkpoint action, toggle the logical log, and kill the specified process. Common options are:
Onmode-k Close Online
Onmode-c Force checkpoint Action
ONMODE-L switching the logical log to the next logical log file
Onmode-z kills the specified process
Onmode-f Free Extra memory
Onmode-a Dynamically allocating memory

9. Onparams
Change the configuration parameters of the online logical and physical logs. (used when adding logical logs)

Ten. Onspaces
Create, delete, and modify Dbspace, chunk tools.

Ontape.
Make a backup of the logical log, change the state of the database log, and perform data recovery. Common options are:
Ontape-a back up all the full logical logs
Ontape-c starting a continuous logical log backup
Ontape-s Start Data backup
Ontape-r Start Data Recovery
Ontape-s-B | -N | -U database name changes the state of the database log

Onstat.
Monitor the operation of the database. Common options are:
Onstat--help Show All information help
Onstat-Displaying database status information
Onstat-l displaying physical and logical log information
Onstat-g SES display user lead information
ONSTAT-G SQL Display SQL statements
Onstat-k Display lock Information
Onstat-x Show Things Information
onstat-d Displaying database space usage information
onstat-d display chunk Read and write information
ONSTAT-C Display configuration information
Onstat-m display Online.log Last 20 lines of information
Onstat-p Displaying performance information
Onstat-r Recurring Display Information
Onstat-u displaying user information
Onstat-z all statistical values to 0
Onstat-g ATH Display thread
ONSTAT-G SEG Display Memory information
Onstat-g Rea Show Waiting thread
Onstat-g Act shows active threads
Onstat-g IOF display Chunk Read and write information
Onstat-g IOQ Display AIO queue information
ONSTAT-G NTU Display network port read and write information
ONSTAT-G NTD display thread read and write information

13. Programs that can be run under X-windows
$ Onperf Database Performance monitoring
$ ipload Informix Fastest Load Data tool
$ onpload ipload Command-line method tool

Onbar.
$ onbar support for IBM Disc library, tape Library Backup tool

Dbaccess.
$ dbaccess most commonly used database management (libraries, tables, indexes) tools

Onmonitor.
$ onmonitor Menu Interface for Informix database management tools

Update statistics needs to be processed on a regular basis, preferably every day.
SQL statements that have the most impact on performance

Set explain on turn on switches for parsing SQL statement performance

Dbaccessdemo7 setting up a demo database

3.5 Database Import/Export
Databases that are backed up using Ontape, Onbar, and so on can be unrecoverable when the Informix database is restored and backed up on a system with different configurations, such as database space size, name, and so on. It is recommended to use the Import dbimport/export Dbexport method for backup and recovery.

3.5.1 Database Export (Backup)
$ cd/informix; mkdir export_db Create export directory, already exists, can skip
$ dbexport db_name-o/informix/export_db Export Database db_name
$ tar cvf db_name.tar/informix/export_db Packaging export_db directory for Db_name.tar
$ compress Db_name.tar compressed to. Z File

Dbexport Nmtips-o/home/informix/export_db20091215
Dbexport Nmips-o/home/informix/export_db20091215
Dbexport Nmmoni-o/home/informix/export_db20091215
[Email protected]

3.5.2 Database Import (Restore, new)
$ cd/informix
$ uncompress-c Db_name.tar.z | Tar xvf-Unzip, unpack
$ dbimport-d mapdbs_sd-l buffered-i < directory, db_name.exp parent directory > Db_name
Parameter description:
-D mapdbs_db Specifies that the dbspace is MAPDBS_SD and should be based on actual modifications, note that this parameter must be specified, otherwise the database may be established in Rootdbs.
-L buffered specifies that the database is buffered log mode
Db_name database name, must match directory Db_name.exp

If you need to change the name of the database, such as changing the database name db_name to New_db_name, you must do the following before importing:
A) Change the file db_name.exp/db_name.sql to Db_name.exp/new_db_name.sql, ". sql" unchanged;
$ CD Db_name.exp
$ mv Db_name.sql New_db_name.sql

b) Change the directory db_name.exp to New_db_name.exp, ". Exp" unchanged;
$ mv Db_name.exp New_db_name.exp

2.3.5.3 Modifying the database log mode
$ ontape-u db_name
If it fails, a level 0 backup may be required, using the following command
$ ontape-s-L 0-u db_name
$ onmonitor
Select Status/databases to view the status.

2.3.6 Database error code Query method
The error code for Informix can be queried for error details through the command Finderr, which is under the Bin directory of the installation directory (such as/informix/bin).
$ finderr 107 Query error code 107 for more information
$ finderr Show its help

>informix Import table and export the statement to me.
Import/Export Table contents
Unload to M_role_menu select * from M_role_menu

Load from M_role_menu INSERT INTO M_role_menu

It is necessary to convert the character data (number) into a numeric type for operation
You can use CONVERT (float,columnname) or cast (columnname as float)

Informix Database Common commands (GO)

Related Article

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.