Oracle RAC practice (1)

Source: Internet
Author: User
Oracle RAC

Full name: Oracle Real Application Clusters, that is, Oracle Real-Time ApplicationProgramCluster, so that different applications can access multiple Oracle instances as if accessing one Oracle instance (of course, the performance is horizontally Scalable), and nodes communicate through private network; all operations are recorded through log files and stored on shared devices. They can be read, written, and synchronized by all cluster nodes at the same time.

Before Oracle9i, RAC is named OPS (Oracle Parallel Server ). A large area between RAC and OPS is that RAC uses the cache fusion technology. In Ops, data requests between nodes need to write data to the disk before the requested node can read the data. When cache fusion is used, the data buffer of each node of RAC transmits data blocks through a high-speed, low-latency private network.

Main features of RAC
    1. Multi-node load balance.
    2. High Availability: supports failover & switchover to minimize the impact of exceptions. Failover-operations automatically performed by the system when an exception occurs; switchover switches manually.
    3. Supports horizontal expansion of primary & standby to improve the reliability of online transaction.
    4. It can save the software development cost of horizontal scaling and has no limited requirements on devices and quantity.
    5. Use cache fusion (high-speed cache merge) technology.
Java example of connecting a RAC to a database
Public static void main (string Arg []) {try {class. forname ("oracle. JDBC. driver. oracledriver "); string url =" JDBC: oracle: thin: @ (description = (address = (Protocol = TCP) (host = host1) (Port = 1521 )) (address = (Protocol = TCP) (host = host2) (Port = 1521) (load_balance = yes) (Failover = on) (CONNECT_DATA = (Server = dedicated) (SERVICE_NAME = dB. domain) (failover_mode = (type = select) (method = Basic) (retires = 20) (delay = 15) "; connection c = drivermanager. getconnection (URL, "Demo", "Demo"); Statement S = C. createstatement (); resultset r = s.exe cutequery ("select current_date from dual"); While (R. next () {system. out. println (R. getstring (1) ;}} catch (exception e) {system. out. println (E. tostring ());}}
Common RAC configurations
    • listener. ora-each RAC server on the network must contain a listener. ora file, which lists the names, addresses, and supported instances of all listening processes in the cluster. The listening process receives connections from the Oracle RAC network client. Parameter description:
      • listener: Listener name. Multiple listeners can be configured. Multiple listeners must be separated by port numbers.
      • global_dbname: Global Database Name. It is obtained through the select * From global_name; query.
      • ORACLE_HOME: root directory of Oracle software.
      • sid_name: Sid of the server (Local Machine.
      • Protocol: Listener protocol. TCP is generally used.
      • HOST: the IP address of the local machine.
      • port: the listening port number. Use netstat -- An to check whether the port is occupied.
    • tnsnames. ora
      • localname: name of the local server machine.
      • address: the address of the server.
      • Protocol: the protocol used. TCP is generally used.
      • port: the listening port number of the server.
      • SERVICE_NAME: name of the Database Service on the server.
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.