oracle硬解析执行步骤详解
oracle涉及一张表的查询语句,如果是第一次执行,也就是硬解析,需要执行的步骤涉及的对象如下: Tables #Queries Purpose access$ 1 Permissions used by a dependent object against its parent ccol$ 10 Constraint column-specific data cdef$ 3 Constra
oracle涉及一张表的查询语句,如果是第一次执行,也就是硬解析,需要执行的步骤涉及的对象如下:
Tables #Queries Purpose
access$ 1 Permissions used by a dependent object against its parent
ccol$ 10 Constraint column-specific data
cdef$ 3 Constraint-specific definition data
col$ 1 Table column-specific data --不是始终在内存中
dependency$ 1 Interobject dependencies --不是始终在内存中
hist_head$ 12 Histogram header data
histgrm$ 3 Histogram specifications
icol$ 6 Index columns
ind$, ind_stats$ 1 Indexes, index statistics
obj$ 8 Objects--dictionary cache
objauth$ 2 Table authorizations
seg$ 7 Mapping of all database segments
syn$ 1 Synonyms
tab$, tab_stats$ 1 Tables, table statistics
user$ 2 User definitions
可以看到硬解析的过程执行了59次查询,硬解析的资源消耗是相当严重的,实际生产环境应该尽量避免硬解析,而且查询中涉及的好多数据字典信息并没有全部在内存中,比如上面进行注释的部分,实际查询发现好多对象的信息并没有放到dictionary cache中,这些信息可能也会根据shared pool的LRU原则进行替换。
下面是同一条语句,在不同的环境下,执行的效果,大家也可以看出软硬解析的差别
一条语句在第一次执行时,是硬解析
select * from ttest where object_id=1000;为例
通过set autotrace traceonly statistics发现
230 consistent gets
226 physical reads
--说明,物理读的同时,,还是会有内存的一致读,因为硬盘上的数据是不能直接校验和操作的,都必须搬到内存中进行
只将alter system flush shared_pool;
298 consistent gets
6 physical reads
--硬解析,一些数据字典信息还是需要physical read,表的信息并不完全在dictionary cache中,而这个查询涉及的data又全部缓存在buffer cache中,避免了最大部分的物理读,但记住IO操作是耗cpu和IO的,而硬解析的过程是占用cpu和latch内存的,基本上会实时占用一颗cpu,当大量出现的时候,会占用多颗cpu,这时可能整个系统就不能干活了。
全部缓存后
230 consistent gets
0 physical reads
--软解析,完全没有物理读
其实还有一个软软解析,session_cached_cursors这个参数值很重要,这里不再细解。

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

Oracle views can be exported through the EXP utility: Log in to the Oracle database. Start the EXP utility, specifying the view name and export directory. Enter export parameters, including target mode, file format, and tablespace. Start exporting. Verify the export using the impdp utility.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.
