前天按照《大话ORACLE RAC》一书中介绍RAC和STREAM相关章节的实验步骤在HP rx8640上搭建了类似的实验环境做实验,结果失败了。昨
前天按照《大话ORACLE RAC》一书中介绍RAC和STREAM相关章节的实验步骤在HP rx8640上搭建了类似的实验环境做实验,结果失败了。昨天跟着网上搜来的一篇《一步一步学ORACLE STREAM 》的文章以两个单实例搭建实验平台初获成功,晚上粗略研读了一下Oracle的官方文档《Streams Concepts and Administration 》,无奈太过繁琐,没有耐心和勇气继续读下去。今天闲来无事,硬着头皮再次挑战单实例和RAC下的ORACLE STREAM实现,按照昨天的思路,居然成功了,心里真是高兴。
细想开来,其实单实例也好,RAC 也好,数据库始终只有一个,区别只是实例多少的不同,实际操作步骤还是大同小异的。这让我想起前段时间操作的ORACLE RAC数据库版本升级(从10.2.0.1升级到10.2.0.4),我执行了两次升级,第一次当然是顺利的,第二次升级失败那是必然的了,因为数据库只有一个,升级也只需要一次即可,再次升级就是画蛇添足。这里又联想起无论是参加ORACLE原厂OCP培训还是看到李丙洋的《涂抹ORACLE》里面都着重指出一个容易混淆的概念:实例是实例,数据库是数据库,如果混为一谈就不好了。我之所以犯错,归根结底还是对数据库的概念理解不够透彻。
ORACLE官方文档《concepts》第四十一页里面有一句话说得很清楚:
"An oracle database server consists of an oracle database and an oracle insance. Every time a database is started, a system global area(SGA) is allocated and oracle background processes are started. Then combination of the background processes and memory buffers is called an oracle instance."
这句话里面有两层意思,第一,数据库是由数据文件和实例两部分组成;第二,实例只是一组内存结构,由内存缓冲区和后台进程组成。我们常常对单个数据库进行操作,所以容易混淆数据库和实例的概念, 【 Linux公社 】 认为实例就是数据库,数据库就是实例,实际根本不是这么回事。
理解了这个概念,然后再回过头来做实验,就相对比较容易了。其实无论是单实例数据库也好,ORACLE RAC也好(多实例数据库),只要认清了数据库只有一个,无论是升级也好,构建高可用性也好,按照单个节点的思路走下去就行。就比如说RAC 数据库升级,所不同的无非就是需要额外修改一下参数文件里面的个别参数,操作起来也挺简单的。基本概念很重要,这也是修房子的时候为什么要先打地基,地基打得牢,房子才盖得高,,想想学技术也是这个道理。
下面言归正传,回到此次实验。

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB

MySQL/InnoDB supports four transaction isolation levels: ReadUncommitted, ReadCommitted, RepeatableRead and Serializable. 1.ReadUncommitted allows reading of uncommitted data, which may cause dirty reading. 2. ReadCommitted avoids dirty reading, but non-repeatable reading may occur. 3.RepeatableRead is the default level, avoiding dirty reading and non-repeatable reading, but phantom reading may occur. 4. Serializable avoids all concurrency problems but reduces concurrency. Choosing the appropriate isolation level requires balancing data consistency and performance requirements.

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor