查询我的块大小 oracle

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4862724/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 03:04:18  来源:igfitidea点击:

Query my block size oracle

oraclestorageadmin

提问by filippo

Is there a way I can tell the block size of my Oracle database if I don't have access to the v$parameterview?

如果我无权访问v$parameter视图,有没有办法告诉我 Oracle 数据库的块大小?

Thanks!

谢谢!

f.

F。

回答by Tony Andrews

You could do this:

你可以这样做:

select distinct bytes/blocks from user_segments;

回答by andrew

In oracle, the block size is set per tablespace. You can query the user_tablespaces or dba_tablespaces (if you have access) and see the block size for each tablespace; these views usually run instantly.

在 oracle 中,块大小是按表空间设置的。您可以查询 user_tablespaces 或 dba_tablespaces(如果您有访问权限)并查看每个表空间的块大小;这些视图通常立即运行。

You can also join either of those 2 to dba_tables, user_tables, or all_tables and multiply the number of blocks by the block size to get the total size of the table in bytes (divide by 1024*1024 to get size in MB, etc.)

您还可以将这 2 个加入 dba_tables、user_tables 或 all_tables 并将块数乘以块大小以获得表的总大小(以字节为单位)(除以 1024*1024 以获得以 MB 为单位的大小等)

回答by Hybris95

Since the block size is different for each tablespace you better use the following query :

由于每个表空间的块大小不同,您最好使用以下查询:

select block_size, tablespace_name from dba_tablespaces;

回答by Guido Leenders

Yes, then you have a major problem. Querying user_segments can be really slow, especially when running SAP or Infor BAAN that create ten thousands of segments and tend to fragment the data dictionary. Best is to convince your DBA to grant you access in some way, maybe through a view with v_$.

是的,那么你有一个大问题。查询 user_segments 可能真的很慢,尤其是在运行 SAP 或 Infor BAAN 时,它们会创建一万个段并倾向于对数据字典进行碎片化。最好的办法是说服您的 DBA 以某种方式授予您访问权限,也许是通过带有 v_$ 的视图。

Alternative, which performs better: when you can create segments, you have some tablespace access (please note that the distinct does not work when you don't have any segments). This list is generally shorter, so for instance use:

替代方案,性能更好:当您可以创建段时,您就可以访问一些表空间(请注意,当您没有任何段时,distinct 不起作用)。此列表通常较短,因此例如使用:

select bytes/blocks from user_ts_quotas

从 user_ts_quotas 中选择字节/块

That still leaves you with a social engineering problem with the local DBA when the user is so restricted that it does not have a quota :-)

当用户受到如此限制以至于没有配额时,这仍然会给您带来本地 DBA 的社会工程问题:-)