当前位置:操作系统 > Unix/Linux >>

减轻dictionary cache压力的方法

减轻dictionary cache压力的方法
 
1) SQL中减少公共同义词的使用,SQL中明确的写明schema的名字。
 
Large OLTP systems where users log in to the database as their own user ID can benefit from explicitly qualifying the segment owner, rather than using public synonyms. This significantly reduces the number of entries in the dictionary cache. For example: SELECT employee_id FROM hr.employees WHERE department_id = :dept_id;
 
2) application使用相同的id登录DB。
 
An alternative to qualifying table names is to connect to the database through a single user ID, rather than individual user IDs. User-level validation can take place locally on the middle tier. Reducing the number of distinct userIDs also reduces the load on the dictionary cache.
 
3) 使用PL/SQL
 
Using stored PL/SQL packages can overcome many of the scalability issues for systems with thousands of users, each with individual user sign-on and public synonyms. This is because a package is executed as the owner, rather than the caller, which reduces the dictionary cache load considerably.
 
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,