oracle中如何删除视图V$SQLAREA的记录?

用toad可以查到 V$SQLAREA是从视图gv$sqlarea取的数据;再查gv$sqlarea是从x$kglcursor_child_sqlid取的数据,可是用system用户进去也查不到x$kglcursor_child_sqlid表或视图

Oracle的文档关于V$视图的介绍如下:
Oracle contains a set of underlying views that are maintained by the database
server and accessible to the database administrator user SYS. These
views are called dynamic performance views because they
are continuously updated while a database is open and in use, and their contents
relate primarily to performance.

Although these views appear to be regular database tables, they are not.
These views provide data on internal disk structures and memory structures. You
can select from these views, but you can never update or alter them.

大意为,Oracle 包含一组由数据库服务器维护的基本视图,数据库管理员SYS用户可以访问。这些视图称为动态性能视图,因为当打开数据库时不断更新,它们的内容主要涉及性能的动态性能。
虽然这些视图似乎是常规数据库表,他们不是。这些视图由内部磁盘结构和内存结构提供数据。你可以从这些视图查询,但你永远不能更新或改变他们。

多看看官方文档对学习会很有帮助。追问

你好,找到如下清理共享池的方法
SELECT ADDRESS,HASH_VALUE,SQL_TEXT FROM V$SQLAREA
WHERE sql_id='8w9hudwb6ndg2';
exec sys.dbms_shared_pool.purge('000007FEC96672B0,376059362','C');

追答

学习。
看了下这个包的文档,purge主要清理package/procedure/function/type/trigger/sequence/cursor这些PL/SQL对象,目前表和视图可能不能清理(Currently, TABLE and VIEW objects may not be kept.)

温馨提示:答案为网友推荐,仅供参考
相似回答