Informix daily management and maintenance [ZT]

xiaoxiao2021-03-06  65

Informix Online Database Daily Management and Maintenance 1, Start, Turn the Informix Database 1.1, Automatically Start Informix Startless ONLINE Commands To: OnNit But Working In /tc/rc2.d Directory, the name is S96informix, so When the operating system is started, Online starts. /Etc/rc2.d/S96informix edit the file to read as follows: INFORMIXDIR = / usr / informixINFORMIXSERVER = picc_onlineONCONFIG = onconfig.piccexport INFORMIXDIR NFORMIXSERVER ONCONFIG INFORMIXDIR / bin / oninit modify file attributes as follows: $ chmod x /etc/rc2.d/ S96INFORMIX 1.2, automatically turn off the Informix Close the online command to: onmode -ky but the general situation, the closure command is built in the /etc/rc0.d directory, the name is K01Informix, so when the operating system is turned off, Online is closed. File Edit /etc/rc0.d/K01informix follows: INFORMIXDIR = / usr / informixINFORMIXSERVER = picc_onlineONCONFIG = onconfig.piccexport INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXDIR / bin / onmode -ky modify file attributes as follows: $ chmod x /etc/rc0.d/ K01INFORMIX 2, INFORMIX ONLINE Common Working Mode Offline Quiescent Online (Running State) ONLINE (Run State) 3 When INFORMIX Online Disk Space Online is initialized, a DBSpace called rootdbs is automatically established. This rootdbs stores ONLINE management information, including physical logs, logical logs, and more. When you create a database or table, if you do not specify DBSPACE, the library or table is built in the rootdbs as the default. So, if you want to build a library or table in a DBSPACE, you must specify a DBSpace name in the SQL statement. If the database name is' Stores', we build this database in 'Workdbs'DBSpace, the SQL statement is as follows: CREATE DATABASE Stores in Workdbs; In addition, when building CHUNK or DBSPACE, you want to specify the original disk device name path, the required disk space Size, and the offset in the original disk space in the original disk device. Among them, the offset is very critical, be careful, otherwise it is easy to cause overlapping and overlapping between the CHUNK block. For example, it is assumed that the original disk device / InformixDBS1 has 500M space, where rootdbs uses to go to the top 100m, if you want to create a new CHUNK in / informixdbs1, the offset should be greater than 100m.

1) Use the onspaces command to create a DBSPACE $ ONSPACES -C -D dbspace name -P disk device -o offset-S size]: -c: Represents a new DBSPACE-D: DBSPACE Name -P: Original disk device full path Name, such as / informixdbs1-o: offset, in k byte-S: dbspace, first chunk size, using k-byte unit 2) Add CHUNK $ ONSPACES -A DBSPACE Name -P Original disk device -O offset-S size: -a: Indicates a CHUNK, followed by DBSPACE Name -P: Original disk device full path name, such as / informixdbs1-o: offset, with K Bytes are units -s: chun size, with K bytes, such as a database system, build three dbspace: rootdbs: rootdbs: rootdbs: online initialization, the first CHUNK size is 100m The offset is 0; Workdbs: Store application database data, the first CHUNK size is 100m, the offset is 100m; TMPDBS: Storage system temporary file data, the first CHUNK size is 50m, the offset is 200m; * TMPDBS must be established before online initialization; set the command as follows: $ stays -c -d Workdbs -p / informixdbs1 -o 100000 -s 100000; $ ONSPACES -C -D TMPDBS -P / InformixDBS1 -O 200000 -s 50000; 4 , Informix Online Log Management 4.1, Database Log Mode: Non-logging Mode (corresponding to non-babying applications) No buffer log mode complies with the ANSI standard log mode For insurance business features, Informix recommends using a bicycracition log mode Database to ensure that the transaction does not lose, compared with the buffer log approach, the database is slow. You can use the onTape command to modify the database log mode Use ONTAPE to open the transaction log: $ ONTAPE -S -U Stores; Open the database Stores log, log mode is a bicycle log; end logs with the Ontape: $ ONTAPE-N lifeins; change the database Lifeins For a non-log method. 4.2, the management of physical logs Physical log saves data before modifying. The location and size of the physical log can be changed. Use the onparams command to change the location and size of the physical log, after online enters the static mode: $ onparams -p -s size -d dbspace -y -p: Representation Physical Log-S: New Size, followed by K byte The size of the physical log of the unit -D: Description stores the DBSpace name of the physical log - Y: answer "Yes" to "Yes" Note: The space assigned to the physical log must be continuous, so it is necessary to confirm that DBSpace before changing Sufficient space to store physical logs. 4.3, the management logical log of the logical log saves the data in the modified image, the size of the logical log space is the product of the logical log file size and the number of logical log files. After Online is initialized, the size of the existing logical log file cannot be modified. To change the logical log space size, you can only modify the number of logical log files, the newly added logical log file size can be set to a new value, the logical log file must not Less than 3.

(1), increasing the logical log file with OnParams $ ONPARAMS -A -D RootDBS newly added logical file status is A (a represents new meanings). The newly added logical log files must be used after ROOTDBS 0-level backups. (2) Add a logical log file with new sizes $ onparams -a -d rootdbs -s new log size (3), cancel a logical log file with OnParams $ ONPARAMS -D -1 LogID Note:. Before you cancel a logical log file, you must do rootdbs' 0-level backup $ ontape -s .; This command can do a 0-level backup * Only status f (free) or A (added) logical log file can be canceled * must Know the logID number of the logical log that wants to cancel; this command can view the logical log file status and the LOG ID number 5, Informix Online database backup and restore backup content and purpose: Data Backup: Backup Database for a moment of a moment State, when the system is accidentally used to recover the system; logical log backup: After the logical log file is full, you must have a backup before it can be emptied and continued. If all logical log files are filled, the system crashes. In addition, the logical log records the change of the database after the last data backup, so the logical log backup is also used to recover the system when the system is unexpected. 5.1, Data Backup: (1) Online Provides 0 level, level 1, 2 level incremental backup; 0 level: backup the entire database system; 1 level: backup data from the 0-level backup; 2: Backup from 1 Data that changes after level backup; (2) Back up the data with the ontape command to execute the command, the system will prompt to enter the 0, 1, 2 backup level (3) Before the system is officially run, do a 0 level Backup, data backup should be done after the business system is completed. If the amount of data is not large, you can do a 0-level backup every day. (4) Manage backup tapes, do tags, such as date, time, backup level, logical log number 5.2, logical log file backup (1) Timed backup logical log file Timed logical log file backup, the system will only The logical log file is filled back to the tape, then clear and release these log files. When you make a fixed backup, you must do it before all logical log files are written. So, if you use a timed backup, you should pay attention to the observation logical log usage. In addition, if there is a long transaction, you should avoid using a timed backup, and the continuous backup is safer. Command: ONTAPE -A (2) Continuous backup logical log file Continuous backup, the logical log file is full, back up one, then the log file is fetched, release. Therefore, to make a continuous backup, there must be a tape in the tape drive. Continuous backups need to occupy a screen or terminal display information. When the magnetic tape is full, the system will prompt the band.

转载请注明原文地址:https://www.9cbs.com/read-119165.html

New Post(0)