Many companies that establish and apply information systems have begun to improve the availability and reliability of enterprise information systems while system application is constantly improving. The high availability guarantee for enterprises to provide system high availability guarantees for enterprises through two-machine fault tolerant system is the general method of universal use. Specialty in the working nature of medical institutions requires its information system for 7 days × 24 hours to operate uninterrupted, and the two-machine fault tolerance provides a high availability solution for the system. This article will give a detailed introduction to the Oracle database application in the two-machine fault-tolerant environment of the medical information system.
System Configuration
The hardware configuration of the system is as follows:
Main Database Server: Fujitsu Primergy MS-610 Server (Double Xeon 700MHz CPU, 1GB). Database Backup Server: Fujitsu Team Server C870IE GP5C875 (Double Pentium III 700MHz CPU, 1GB). Fault tolerant Software: Slha 3.0 package of heaven and earth. Disk array: iQStore R1500 (with 2 SCSI interfaces). Line connection: 2 servers are connected to RS-232 serial ports and RJ-45 network lines (as shown in Figure 1).
The software is configured as follows. Operating system: Windows NT Server 4.0 Server Software Configuration: Windows NT 4.0 Service Pack 5, Internet Explorer 5.0, Microsoft Data Access Component 2.0, Oracle Database is 7.3.3 Enterprise Edition.
Double machine fault tolerance
1. Installation of the operating system
We use A to represent database servers and use B to represent backup database servers. First, it is physically connected to the required hardware device, and the Windows NT Server 4.0 operating system and patches are installed on their respective servers. Then, enter the disk manager to divide the disk array into two logical disk D and E, and the two servers can access disk arrays.
2. Installation of Database
Turn off the B machine first, install the Oracle database on the A machine, install the path default to the D disk, the archive log is placed on the E disk. After the installation is complete, 3 services of Oracle (here SID are ORCL, so 3 services are the start-up mode of OraclesErviceorCl, ORACLESTARCL and ORACLETNSLISTENER) to manually and will stop this 3 service. Note: The purpose of change to manual is to let these three services are started by the two-machine fault tolerant software instead of starting by the operating system.
Then, turn off the A machine, start the B, format the D disk, and the Oracle directory that is just built on the disk array is also formatted; install the Oracle database on the B machine, install the path default to D disk, complete, Also change the starting way of Oracle's 3 services to manual and stops 3 services.
The essence of Oracle installed on both machines is to separate the Oracle system on two servers, while the data is only stored on disk arrays.
3. Establishment of two-machine fault tolerant software and establishment of two-machine fault tolerance
The installation of the dual-machine fault tolerant software is very simple, just start the A machine and the B machine, you can install the software on 2 servers. Establishing a dual-folding environment is to control the D disk and the E disk on the disk array and the three services of Oracle, and the two-machine fault-tolerant software is controlled, and the two-machine fault tolerant software is switched.
Set the database server to an Active state in the "Configuration" option of the dual-machine fault tolerant software SLHA, that is, the database server works, and the backup server is waiting. When A-machine Active, only A machines can access disk arrays, and the B-machine cannot access disk arrays. At this time, the Oracle database server is actually A-machine, the IP address of the A machine is Active IP address, and the host of the ACTIVE HOST NAME is active; when the A machine does not work, the A-machine status will be "heartbeat "Line" detects, at this time, the B is started to switch to the Active status, take over the disk array. At this time, the Oracle database server is changed to the B-machine, the B-machine's IP address is Active IP Address, and the B-machine host is active. Name. The above operation is automatically completed by the system, and the practice proves that the time required to switch is very fast, and the impact on the client is small. Need to pay attention
1. When the Oracle database is installed after the A machine is installed after the B-machine, you must first formulate the disk array D disk, not only the Oracle database that is already installed by the A machine, otherwise it may appear Thinking mistakes, such as Oracle listening service fail, etc.
2. After the Oracle database is finally installed, you must modify the D: / ORAANT / NETWORK / Admin / Listener.ora file, where the Server name must be changed to Active Host Name Alias, if you do not modify the client's Oracle database user Unable to connect to the Oracle database.
3. Add a record in the HOSTS file, allowing the Active IP Address and Active Host Name corresponding to each other so that the system will automatically play a resolution. The Hosts file is located in the C: / Winnt / System32 / Drivers / etc directory.
4. Don't pay attention to it, don't switch, avoid data errors. If you must switch the dual-machine, you can enter the SVRMGR Oracle server console, turn off the Oracle database with the shutdown command, and switch. Double-machine fault tolerance
Figure 2 is a schematic diagram of the system dual-machine fault tolerance, which can be seen from Figure 2 to share an external storage device, listening to the other party's working state by a method of heartbeat detection, when a server cannot provide the corresponding service because of some reason. Another server will start the corresponding service function, so that the application provided by the primary server continues to run.
The two servers in Figure 2 have the same operating system (hardware configurations do not have to be identical), such as Windows NT Server 4.0, and 2 blocks installed for each server. A network card connection switch of the server, connected to the local area network (ie, the public net in Figure 2); another network card and a network card of the other server, constitute the private net; at the same time, the servers are connected by the serial line, connected between 2 servers The RJ-45 network cable between the line and the server constitutes "heartbeat" between two servers. Two servers are listening to each other with each other through heartbeatline. Note: At the same time, the purpose of "heartbeat" is used to ensure the redundancy of "heartbeat". The Public Drives (ie, a two-machine shared disk array) in Figure 2 is a disk that can be accessed by two servers. It is actually a disk array cabinet, consisting of six SCSI hard drives. The disk array is partially connected to 2 servers via the SCSI cable. Two servers share an Active IP address and Active Host Name. When a server ACTIVE (ie, activation), Active IP Address and Active Host Name points to that server. Oracle database mechanism in a dual-machine environment
Oracle Database is installed on disk array (i.e., PUBLIC DRIVES in Figure 2), two servers can access it, but they cannot be accessed. Oracle Server for NT provides 3 services: OraclesID, OraclestartsID, and OracletNSListener. When the database server is working properly, the disk array is controlled by the database server. Only the server can access the disk array. The Oracle service on the server is in the active state. At this time, the server plays the Active Server in Figure 2. The role, the backup server is awaiting (STANDBY) state, that is, the Backup Server in Figure 2.
When the database server does not work, the dual-machine fault tolerance system detects the status of the database server, so that the backup server is automatically activated, takes over the disk array and automatically launches Oracle's 3 services, and for the client, only one The short server restart process, the data accessed is still data in the disk array.
Note: It is a dual-machine fault tolerant software instead of an operating system to control the startup and stop of Oracle, which is to control the startup and stop of these 3 Oracle services to control these three Oracle services, and implement the switch between the Oracle database.