Syntax oninit [-s] [-I] [-p] [-y]
Oninit changes the system from off-line mode to on-line mode
Oninit-s changes the system from off-line mode to quiescent Mode
Oninit-I initialization system
Oninit-p does not search when the shared memory is initialized. It deletes the temporary table.
Oninit-y automatically answers yes
Oninit-v adds this option to display the oninit processing process
Oninit -- enter this command for help
The oninit command is used to change the operating mode of the system. The-I option is used to initialize the system's root dbspace. Note that once the root-dbspace is initialized, the entire database system is initialized.
If you want to automatically start the dynamic server system when the computer starts, add the oninit command to/etc/rc in many UNIX systems in the system's initial file without any options ).
Onmode command
Syntax: onmode [-k] [-m] [-s] [-u] [-y]
Onmode-k: Execute shutdown immediately and change the system to off-line mode.
Onmode-m changes the system from quiescent mode to on-line mode
Onmode-s executes graceful shutdown
Onmode-u run immediate shutdwon
Onmode-y automatically answers yes
The onmode command is also used to change the running mode of a dynamic server. In addition to the above options, onmode has many options that are irrelevant to changing the system running mode.
Use the onspaces command to create a data space
Syntax: onspaces-c [-B] [-d] [-z] [-m] [-o] [-p] [-s] [-t]
-C: Create blobspace or dbspace
-B blobspace name
-D dbspace name
-G page size blobpages size
-The full path name and offset KB of the m mirror image device)
-O offset KB)
-P pathname: full path name of the chunk Device
-S sizedbspace size KB)
-T create temporary dbspace
The onspaces command is used to create a data space, a temporary space, and a blobspace for storing blob data ). Type onspaces to obtain the online help of this command. Onstat-D or onstat-d can be used to view important information about the data space in the system. Including: The chunk status, idle, and the number of reads and writes per chunk. Multiple System spaces that may be included in the system, especially after data sharding, we recommend that you use the command line to create a data space.
You can use the following command to create a data space:
Onspaces-c-d datadbs1-o 0-p/dev/rrvol3-s 60000
You can create a temporary data space as follows:
Onspaces-c-d tempdbs1-t-o 0-p/dev/rrvol5-s 80000
In the system, temporary data space is very important. Generally, multiple temporary data spaces should be distributed on independent physical devices.
Use the onspaces command to delete a Data Space
Add or delete chunks
Syntax: onspaces-a-d [-m] [-o] [-p]
-A spacename: dbspace added chunk
-M pathname: full path name and offset KB of the image device)
-O offset: the offset KB of the master device)
-P pathname: full path name of the chunk Device
-S sizechunk size
-D spacename: delete chunk
-O offset chunk device offset KB)
Onspaces can not only create a data space, but also delete a data space, a temporary data space, or a space that stores blob data. When deleting a data space, you must first ensure that it is useless, that is, there is no database or table in the data space.
To delete a data space, enter the following command: onspaces-d dbspace_name/blobspace_name
The data space is initially composed of a chunkfirst chunk). Once the space is exhausted, you must append the chunk to improve system performance, when allocating chunks to a data space, you need to calculate the chunk to ensure its size can meet future needs. Otherwise, when appending a chunk, it is physically not necessarily adjacent to the previous chunk, this increases the time for reading data. The requirements for computing space will be described in later sections. The onspaces command can be used to add or delete a chunk to or from a data space. In addition, the command can also perform the following tasks: Start an image, stop an image, or change the chunk status.
For example, you can use the following command to add a chunk to the data space:
Onspaces-a-d datadbs1-0 60002-p/dev/rrvol3-s 60000
You can delete a chunk from a data space as follows:
Onspaces-d datadbs1-o 60002-p/dev/rrvol3-s 60000
Onparams command
Syntax: onparams-a-d-p [-d] [-s] [-l]
-A: added logical logs.
-D dbspace: Specify the dbspace for storing logs.
-S size: the size of the new logical log is KB)
-D. Delete logical logs.
-L logid: Specify to delete a logical log.
-P changes the physical log
-D dbspace: dbspace name for storing new physical logs
-S size physical log size KB)
The system automatically creates logical logs and physical logs in the root dbspace during initialization. In DBMS systems, especially in OLTP environments, database operations are very frequent and logs must record a large amount of information, therefore, it is best for users to distribute multiple log files on different devices. There is a very simple method: create logical logs according to the required size, and create a small physical log. After the system initialization is complete, move the physical logs to other devices. The details on how to determine the size of the required physical logs will be detailed in subsequent sections. The onstat-l command can be used to identify all new logic logs in the system as. These logical logs are actually used only after the system is archived. There is a simple way to activate these logical logs: execute a "pseudo" archive. The procedure is as follows: Set the parameter TAPEDEV to/dev/null and run ontape-s once. You can also run the onbar-F command. Because pseudo-archive does not actually archive system information, you must archive the system in a timely manner.
You can delete a logical log only when it is actually unavailable. Using onstat-l, we can see that all idle logs are marked as F. If the logical log contains the information required for transaction rollback or quick recovery, the logical log cannot be deleted. Using the onstat-l command, we can see that the logs that accept the current transaction are marked as C. If the logical log contains the last checkpoint record, it cannot be deleted. Only when the checkpoint record is written to the next log and the previous log is backed up can the log be deleted. Using the onstat-l command, we can see that logs containing the last checkpoint record are marked as L. You can use the onmode-c command to forcibly write the checkpoint record until the last checkpoint record is written into the required log.
Onstat Tool
Displays information in the shared memory of a dynamic server.
Involves a small number of disk I/O operations
Will have minimal impact on system performance
Provide valuable information about the system
Command Line interactive monitoring system
In this chapter, we will explain the various important options of onstat. Familiarize yourself with their usage.
The onstat command is a very useful system real-time monitoring tool. This command reads information directly from the data structure of the shared memory and reports the current system status. Generally, the onstat command does not perform disk I/O operations or lock system resources. Therefore, it minimizes the impact on system performance. In short, onstat is an interactive system monitoring tool provided by informix.
Some common options of onstat:
Onstat -- list all options
Onstat-I settings enter Interaction Mode
Onstat-display running mode and Database Engine status
Onstat-g sub_option Option
Onstat-r Every Repeated in seconds
Onstat-g act displays all activity clues in the system
Onstat-g ath-r 2 shows all activity clues in the system every two seconds
System Monitoring page
The sysmaster database is automatically created during system initialization.
The database includes data dictionary information pointing to the system shared memory structure.
Provides instantaneous system performance and status information
Provides an SQL interface to learn Data Dictionary Information
Allow administrators to automate System Management
Used to execute repetitive monitoring tasks
System Monitoring Interface -- SMI) is an SQL-based system tool. You can easily obtain system information through SMI. During initialization, the system automatically creates the sysmaster System database in the root dbapace. Each system includes a sysmaster database. Most of the tables in this database are virtual tables and are pointers to the data structure in the shared memory. SMI can be used to automatically monitor the system, especially when repeated tasks are executed.
The sysmaster database is read-only. Therefore, you cannot perform insert update or DELETE operations on it. All users have the query permission for the database.
After system initialization, you must check whether the sysmaster database is successfully established. Information about the sysmaster database is stored in the message log file online. log) Please note that because all DDL statements will be recorded in the log, you must leave enough space in the log file to ensure that the sysmaster is required to be created.
The sysmaster database mode is recorded in the $ INFORMIXDIR/etc/sysmaster. SQL file.
Oncheck command
Check the data structure on the dynamic server disk
Locate and repair damaged indexes and Data
Disk I/O operations
Some operations will be locked in the table during processing
The oncheck command is used to repair damaged indexes and data pages on the disk. It can also be used to check and print the data structure of the system. Be careful when using oncheck, because some options of the change command will apply a shared lock to the table, for example: oncheck-pt
To prevent system corruption, the system checks the consistency of all data in the shared memory. Once a consistency error or index error is found on the data page, the system writes the problem and possible solutions to the Message Log File Using oncheck and returns the isam error code 105.
If consistency error information is found, you should immediately shut down the system and run oncheck as prompted in the message log file. If oncheck fails, try to unload the table and reload the table. If the index is faulty, delete the index and recreate it. If all these steps fail, the system can only be restored based on the original system archive backup.
The following command provides extend information: oncheck-pe