我想编写一个PL/SQL脚本来查询索引统计数据并更新跟踪条目

发布于 2024-09-27 20:47:33 字数 400 浏览 0 评论 0原文

我创建了一个表: INDEX_SIZE_TRACKING 具有以下属性:

  • 索引名称:索引的名称。类型:VARCHAR(255)。这是主键 表。

  • 分配的空间:分配给索引的内存空间(以字节为单位)。类型: NUMBER

  • 已用空间:索引使用的内存空间。类型:NUMBER

  • 最后更新:索引详细信息更新到该表的时间。类型: VARCHAR(255)

我想编写一个PL/SQL脚本来查询索引统计数据并更新跟踪 INDEX_SIZE_TRACKING 表中的条目。如果没有现有的条目 索引,创建一个新的;否则,更新现有的。 我可以提供一个可以在 oracle XE 中执行此操作的 PL/SQL 语句吗? 提前致谢! :-)

I have created a table:
INDEX_SIZE_TRACKING with the following attributes:

  • Index Name: name of the index. Type: VARCHAR(255). This is the primary key of
    the table.

  • Allocated Space: the memory space (in bytes) allocated to the index. Type:
    NUMBER

  • Used Space: the memory space used by the index. Type: NUMBER

  • Last Update: the time when index details are updated to this table. Type:
    VARCHAR(255)

I want to write a PL/SQL script to query index statistics data and update tracking
entries in the INDEX_SIZE_TRACKING table. If there is no existing entry for the
index, create a new one; otherwise, update the existing one.
Can I please have a PL/SQL statement that can do this in oracle XE?
Thanks in advance! :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯了 2024-10-04 20:47:33

Oracle 将标识符名称限制为 30 个字符,不是吗? VARCHAR(255) 似乎是一个不寻常的选择。

我很确定 dbms_space 包具有获取已分配和已使用空间所需的内容。

最后更新将是一个日期。为什么要使用 VARCHAR(255) 呢?

Oracle limits identifier names to 30 characters, doesn't it? VARCHAR(255) seems an unusual choice.

I'm pretty sure the dbms_space package has what you need to get the allocated and used space.

Last update is going to be a date. Why on earth would you use VARCHAR(255) for that?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文