search
HomeDatabaseMysql TutorialOracle数据字典文档

select * from dictionary;

  --数据字典

  数据字典是Oracle存放有关信息的地方,其用途是用来描述数据的。

  比如一个表的创建者信息,创建时间信息,所属表空间信息,用户访问权限信息等。

  数据库数据字典是一组表和视图结构。它们存放在SYSTEM表空间中

  当用户在对数据库中的数据进行操作时遇到困难就可以访问数据字典来查看详细的信息。

  用户可以用SQL语句访问数据库数据字典。

  数据字典内容包括:

  1,数据库中所有模式对象的信息,如表、视图、簇、及索引等。

  2,分配多少空间,当前使用了多少空间等。

  3,列的缺省值。

  4,约束信息的完整性。

  5,Oracle用户的名字。

  6,用户及角色被授予的权限。

  7,用户访问或使用的审计信息。

  8,其它产生的数据库信息。

  Oracle中的数据字典有静态和动态之分。

  1,静态数据字典-->主要是在用户访问数据字典时不会发生改变的,

  --例如某用户创建的表

  2,动态数据字典-->是依赖数据库运行的性能的,反映数据库运行的一些内在信息,所以在访问这类数据字典时往往不是一成不变的。

  --当前锁住的对象

  静态数据字典:这类数据字典主要是由表和视图组成

  数据字典中的表是不能直接被访问的,但是可以访问数据字典中的视图。

  静态数据字典中的视图分为三类,它们分别由三个前缀够成:user_*、 all_*、 dba_*。

  user_*

  该视图存储了关于当前用户所拥有的对象的信息。(即所有在该用户模式下的对象)

  all_*

  该试图存储了当前用户能够访问的对象的信息。(与user_*相比,all_* 并不需要拥有该对象,只需要具有访问该对象的权限即可)

  dba_*

  该视图存储了数据库中所有对象的信息。(前提是当前用户具有访问这些数据库的权限,一般来说必须具有管理员权限)

  -----------------------------------------------------------------------------------------------------------

  select * from dictionary;

  --查询该用户拥有哪些表

  --user_tables主要描述当前用户拥有的所有表的信息,

  ----主要包括表名、表空间名、簇名等。通过此视图可以清楚了解当前用户可以操作的表有哪些

  desc user_tables;

  select table_name from user_tables;

  select * from user_tables;

  --查询该用户拥有哪些索引

  select index_name from user_indexes;

  --查询该用户拥有哪些视图

  select view_name from user_views;

  --查询该用户拥有哪些数据库对象,对象包括表、视图、存储过程、触发器、包、索引、序列、JAVA文件等。

  select object_name from user_objects;

  --主要描述当前用户的信息,主要包括当前用户名、帐户id、帐户状态、表空间名、创建时间等。

  select * from user_users;

  -----------------------------------------------------------------------------------------------------------

  --user_/all_区别:

  ----all_列出来的信息是当前用户可以访问的对象而不是当前用户拥有的对象。

  --查询某一用户下的所有表、过程、函数等信息。

  select owner , object_name ,object_type from all_objects

  -----------------------------------------------------------------------------------------------------------

  --对于dba_开头的需要管理员权限,

  --查询表空间的信息(当前用户必须拥有DBA角色)。

  select * from dba_data_files

 

  -----------------------------------------------------------------------------------------------------------

  动态数据字典

  Oracle包含了一些潜在的由系统管理员如SYS维护的表和视图,由于当数据库运行的时候它们会不断进行更新,所以称它们为动态数据字典(或者是动态性能视图)。这些视图提供了关于内存和磁盘的运行情况,所以我们只能对其进行只读访问而不能修改它们。

  Oracle中这些动态性能视图都是以v$开头的视图.

  v$access

  该视图显示数据库中锁定的数据库对象以及访问这些对象的会话对象(session对象)。

  select * from v$access

  v$session

  该视图列出当前会话的详细信息。

  v$active_instance

  该视图主要描述当前数据库下的活动的实例的信息。依然可以使用select语句来观察该信息。

  v$context

  该视图列出当前会话的属性信息。比如命名空间、属性值等。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQL BLOB : are there any limits?MySQL BLOB : are there any limits?May 08, 2025 am 12:22 AM

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

MySQL : What are the best tools to automate users creation?MySQL : What are the best tools to automate users creation?May 08, 2025 am 12:22 AM

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

MySQL: Can I search inside a blob?MySQL: Can I search inside a blob?May 08, 2025 am 12:20 AM

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools