了解 oracle 中的 Lob 段 (SYS_LOB)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/531488/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Understanding Lob segments (SYS_LOB) in oracle?
提问by MOZILLA
Most of the tables (if not all) have a "blob" field in it. One of the table that stores the Logs of the user's action has now grown to 8 GB (about 5 million records).
大多数表(如果不是全部)都有一个“blob”字段。存储用户操作日志的表之一现在已增长到 8 GB(约 500 万条记录)。
And our DBA has seen that this schema is now eating space exponentially. We investigated a bit and found out that there is one of the tables with (SYS_LOB) which takes around 116GB of 140GB database.
我们的 DBA 已经看到这个模式正在以指数方式占用空间。我们调查了一下,发现其中一个表(SYS_LOB)占用了大约 116GB 的 140GB 数据库。
Our DBA has told us that this table is related to the table that saves the logs of user actions (which is 8GB)
我们的DBA告诉我们这个表与保存用户操作日志的表有关(8GB)
Does anyone know what this SYS_LOB tables does? Is the actual blob saved in the table we created OR oracle actually stores these blob this in a different table (if yes, then SYS_LOB would be that table)?
有谁知道这个 SYS_LOB 表是做什么的?实际的 blob 是否保存在我们创建的表中或 oracle 实际上将这些 blob 存储在不同的表中(如果是,那么 SYS_LOB 就是该表)?
回答by Justin Cave
There is no table SYS_LOB
in the Oracle database (at least, there is no such table that is part of a basic database install. There is a table DBA_LOBS
that displays information about all the LOB columns in the database, but it doesn't actually store any LOB data, just metadata. The actual LOB segments in the database have system-generated names that take the form SYS_LOBidentifier$$.
SYS_LOB
Oracle 数据库中没有表(至少,基本数据库安装中没有这样的表。有一个表DBA_LOBS
显示有关数据库中所有 LOB 列的信息,但实际上并不存储任何LOB 数据,只是元数据。数据库中实际的 LOB 段具有系统生成的名称,这些名称采用 SYS_LOB标识符$$的形式。
My guess is that your DBA has identified a segment named SYS_LOB
identifier$$ that is consuming 116 GB of space. Assuming that is correct, you can find out what column of what table that LOB column maps to using the DBA_LOBS
table, i.e.
我的猜测是您的 DBA 已经识别出一个名为SYS_LOB
标识符$$的段,它占用了 116 GB 的空间。假设是正确的,就可以找出LOB列映射到哪个表的哪一列使用该DBA_LOBS
表,即
SELECT owner, table_name, column_name
FROM dba_lobs
WHERE segment_name = 'SYS_LOB<<identifier>>$$'