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 is started, please start the file in the system (in many UNIX systems,/etc/rc) add the oninit command (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 -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 size dbspace 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 of the image device (KB) -O offset: the offset of the master device (KB) -P pathname: full path name of the chunk Device -S size chunk 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 chunk (first chunk). Once the space is exhausted, you must append the chunk to improve system performance, when you allocate a chunk to a data space, you need to calculate it to ensure that the size of the chunk can adapt to future needs. Otherwise, when you append a chunk, it is physically not necessarily adjacent to the previous chunk, resulting in increased data reading time. 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: new logical log size (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 about how to determine the size of the required physical logs will be detailed in the following chapter. 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 repeats every second 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 The 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 solution (using oncheck) to the Message Log File 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 in onstat-L, the flag bit indicates the status of the logical log, A Indicates that logs that are not available are newly added. F indicates idle logs that can be used. Generally, logs are in this status only after 0 backups. Utable shows the used logical logs L indicates that the current log file contains a checkpoint C indicates that the current log file is being used. B Indicates the log file that has been backed up |