oracle 列出所有当前数据库属性的 ​​SQL 语句

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

SQL statement to list all of the current database properties

sqloracle

提问by randy white

I have tried a few different ways to list the db properties and have come up short.

我尝试了几种不同的方法来列出 db 属性,但结果不尽如人意。

SQL> SHOW DATABASE VERBOSE emp;
SP2-0158: unknown SHOW option "DATABASE"
SP2-0158: unknown SHOW option "VERBOSE"
SP2-0158: unknown SHOW option "emp"

Heres another that I dont understand why its not working

这是另一个我不明白为什么它不起作用

 SQL> show database;
 SP2-0158: unknown SHOW option "database"


SQL> DGMGRL
SP2-0042: unknown command "DGMGRL" - rest of line ignored.

Does anyone have ideas as to what I am missing.

有没有人对我缺少的东西有任何想法。

回答by Sathyajith Bhat

There's a table called database_properties- you should query that

有一个表叫database_properties- 你应该查询

select property_name, property_value, description from database_properties

If this isn't what you're looking for, you should be more specific

如果这不是你要找的,你应该更具体

回答by Ollie

If you wan the full version information for your DB then:

如果您想要数据库的完整版本信息,则:

SELECT *
  FROM v$version;

If you want your DB parameters then:

如果你想要你的数据库参数,那么:

SELECT *
  FROM v$parameter;

If you want more information about your DB instance then:

如果您想了解有关数据库实例的更多信息,请执行以下操作:

SELECT *
  FROM v$database;

If you want the database properties then:

如果您想要数据库属性,则:

SELECT *
  FROM database_properties;

If you want the "size" of your database then this will give you a close enough calculation:

如果您想要数据库的“大小”,那么这将为您提供足够接近的计算:

SELECT SUM(bytes / (1024*1024)) "DB Size in MB" 
  FROM dba_data_files;

You will need DBA level permissions to see these views or you could request the data from your DBA and he will (probably) oblige.

您将需要 DBA 级别的权限才能查看这些视图,或者您可以向您的 DBA 请求数据,他(可能)会同意。

Hope it helps...

希望能帮助到你...

回答by eaolson

SHOW DATABASEis not a valid SQL*Plus command.

SHOW DATABASE不是有效的 SQL*Plus 命令。

The correct syntax is SHOW optionwhere option is one of:

正确的语法是SHOW 选项,其中选项是以下之一:

system_variable ALL BTI[TLE]ERR[ORS] [ { FUNCTION | PROCEDURE | PACKAGE | 
PACKAGE BODY | TRIGGER | VIEW | TYPE | TYPE BODY | DIMENSION | JAVA CLASS } 
[schema.]name] LNO PARAMETERS [parameter_name] PNO RECYC[LEBIN] [original_name] 
REL[EASE] REPF[OOTER] REPH[EADER] SGA SPOO[L] SPPARAMETERS [parameter_name 
SQLCODE TTI[TLE] USER XQUERY