oracle 如何在oracle模式中查找数据类型信息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6569820/
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
How To Find Datatypes information in oracle schema?
提问by vijay
How to get all the datatypes information in oracle schema.
如何获取 oracle schema 中的所有数据类型信息。
Whole datatypes with all details like name type pression etc.
具有所有详细信息的整个数据类型,例如名称类型压力等。
回答by StevieG
Assuming you have the correct access, this should do it..
假设您具有正确的访问权限,则应该这样做..
select distinct data_type,data_length,data_precision,data_scale
from all_tab_columns
回答by Nivas
Oracle has an internal Data Dictionarywith meta data about the database:
Oracle 有一个内部数据字典,其中包含有关数据库的元数据:
One of the most important parts of an Oracle database is its data dictionary, which is a read-only set of tables that provides information about the database. A data dictionary contains:
- The definitions of all schema objects in the database (tables, views, indexes, clusters, synonyms, sequences, procedures, functions, packages, triggers, and so on)
- How much space has been allocated for, and is currently used by, the schema objects
- Default values for columns
- Integrity constraint information
- The names of Oracle users
- Privileges and roles each user has been granted
- Auditing information, such as who has accessed or updated various schema objects
- Other general database information The data dictionary is structured in tables and views, just like other database data
Oracle 数据库最重要的部分之一是它的数据字典,它是一组只读的表,提供有关数据库的信息。数据字典包含:
- 数据库中所有模式对象的定义(表、视图、索引、集群、同义词、序列、过程、函数、包、触发器等)
- 为架构对象分配了多少空间以及当前使用了多少空间
- 列的默认值
- 完整性约束信息
- Oracle 用户名
- 已授予每个用户的权限和角色
- 审计信息,例如谁访问或更新了各种架构对象
- 其他通用数据库信息数据字典以表和视图的形式构建,就像其他数据库数据一样
One of the tables is ALL_TAB_COLS
, which has data about the columns of the tables, their data type prevision etc.
其中一张表是ALL_TAB_COLS
,其中包含有关表列、数据类型预置等的数据。
You can do a distinct select on the DATA_TYPE
column of the table to find the data types currently in use.
您可以DATA_TYPE
对表的列执行不同的选择以查找当前使用的数据类型。
List of all data dictionary views here.
此处列出所有数据字典视图。
PS: The fact that some data type is not used today does not mean that it will not be used in the future. You may want to either use all the data types, or query ALL_TAB_COLS
frequently, depending on your requirement.
PS:某些数据类型今天不使用的事实并不意味着将来不会使用它。您可能希望使用所有数据类型,或者ALL_TAB_COLS
频繁查询,具体取决于您的要求。