我的Oracle 9i学习日志(9)--数据字典与动态性能视图及练习

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介:

一、数据字典

不仅是每个Oracle数据库的核心组件之一,也是所有数据库用户重要的信息资源;描述数据与对象的数据;包含只读的表和视图;存储在系统表空间;所有者为sys;由Oracle server维护;通过select语句访问。
执行数据定义语言 (definition language,DDL)语句或有些数据操纵语言  (data manipulation language ,DML) 语句时会更新数据字典。
包括两部分:
1、 基表(base tables),在create database执行时(执行sql.bsq脚本)创建;用户不能直接访问因为它们是被加密的,无法用DML语句直接更新这些表,有一个例外,AUD$。基表举例:IND$,包含数据的索引信息。
2、数据字典视图,在执行 $ORACLE_HOME/rdbms/admin/catalog.sql,catproc.sql脚本时创建。
数据字典的内容:审计、用户被赋予的特权和角色、用户名字、完整性约束、资源的分配情况、逻辑和物理结构。
数据字典视图种类:
 

数据字典举例:
概览: DICTIONARY, DICT_COLUMNS
Schema objects: DBA_TABLES, DBA_INDEXES,DBA_TAB_COLUMNS, DBA_CONSTRAINTS
空间分配: DBA_SEGMENTS, DBA_EXTENTS
数据库结构: DBA_TABLESPACES,DBA_DATA_FILES
Data dictionary views are static views that answer questions such as:
• Was the object ever created?
• What is the object a part of?
• Who owns the object?
• What privileges do users have?
• What restrictions are on the object?
二、动态性能视图
虚表;记录当前数据库活动及活动状态;在数据库运行期间持续更新;可通过访问内存和控制文件获得的信息;用于数据库的监视和性能调优;所有者为sys;synonymous以v$开头;在V$FIXED_TABLE里列出所有这些表的名字。
DBA可以在这些视图上再创建视图。
The dynamic performance tables answer questions such as:
• Is the object online and available?
• Is the object open?
• What locks are being held?
• Is the session active?
举例:
•V$CONTROLFILE : Lists the names of the control files
•V$DATABASE : Contains database information from the control file.
•V$DATAFILE : Contains data file information from the control file
•V$INSTANCE : Displays the state of the current instance
•V$PARAMETER : Lists parameters and values currently in effect for the session
•V$SESSION : Lists session information for each current session
•V$SGA : Contains summary information on the system global area (SGA)
•V$SPPARAMETER : Lists the contents of the SPFILE
•V$TABLESPACE : Displays tablespace information from the control file
•V$THREAD : Contains thread information from the control file
•V$VERSION : Version numbers of core library components in the Oracle server
三、管理脚本命名规则

 
Practice 5: Using Data Dictionary and Dynamic Performance Views
Which of the following statements are true about the data dictionary?
The data dictionary describes the database and its objects.
The data dictionary includes two types of objects: base tables and data dictionary
views.
The data dictionary is a set of tables.
The data dictionary records and verifies information about its associated database.
答案: a b c d
Base tables are created using the  catalog.sql  script.
True
False
答案: b
解析:是在 create database 时创建, catalog.sql 是创建视图。
Which three of the following statements are true about how the data dictionary is used?
The Oracle server modifies it when a DML statement is executed.
It is used to find information about users, schema objects, and storage structures.
It is used by users and DBAs as a reference.
The data dictionary is a necessary ingredient for the database to function.
答案: b c d
Data dictionary views are static views.
True
False
答案: a
The information for a dynamic performance view is gathered from the control file.
True
False
答案: b
Which of the following questions might a dynamic performance view answer?
Is the object online and available?
What locks are being held?
Who owns the object?
What privileges do users have?
Is the session active?
答案: a b d e

7 Connect as SYSTEM/MANAGER and find a list of the data dictionary views.
8 Identify the database name, instance name, and size of the database blocks.
Hint: Query the V$DATABASE, V$THREAD, and V$PARAMETER dynamic
performance views.
9 List the name of the data files.
Hint: Query the V$DATAFILE dynamic performance view.
10 Identify the data file that makes up the SYSTEM tablespace.
Hint: Query the DBA_DATA_FILES data dictionary view to identify the SYSTEM
tablespace data file.
11 How much free space is available in the database and how much is already used?
Hints
- Query the DBA_FREE_SPACE data dictionary view to show how much free
space is available in the database.
- Query the DBA_SEGMENTS data dictionary view to display how much space is
already used.
12 List the name and creation date of the database users.
Hint: Query the DBA_USERS data dictionary view to list the name and the creation
of the database users.










本文转自 d185740815 51CTO博客,原文链接:http://blog.51cto.com/luotaoyang/284100,如需转载请自行联系原作者
相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
5月前
|
XML JSON Java
Logback 与 log4j2 性能对比:谁才是日志框架的性能王者?
【10月更文挑战第5天】在Java开发中,日志框架是不可或缺的工具,它们帮助我们记录系统运行时的信息、警告和错误,对于开发人员来说至关重要。在众多日志框架中,Logback和log4j2以其卓越的性能和丰富的功能脱颖而出,成为开发者们的首选。本文将深入探讨Logback与log4j2在性能方面的对比,通过详细的分析和实例,帮助大家理解两者之间的性能差异,以便在实际项目中做出更明智的选择。
551 3
|
2月前
|
监控 Oracle 关系型数据库
Mysql、Oracle审计日志的开启
通过上述步骤,可以在 MySQL 和 Oracle 数据库中启用和配置审计日志。这些日志对于监控数据库操作、提高安全性和满足合规性要求非常重要。确保正确配置审计参数和策略,定期查看和分析审计日志,有助于及时发现并处理潜在的安全问题。
97 11
|
3月前
|
监控 测试技术 开发者
一行代码改进:Logtail的多行日志采集性能提升7倍的奥秘
一个有趣的现象引起了作者的注意:当启用行首正则表达式处理多行日志时,采集性能出现下降。究竟是什么因素导致了这种现象?本文将探索Logtail多行日志采集性能提升的秘密。
288 58
|
4月前
|
SQL Oracle 关系型数据库
【赵渝强老师】Oracle的控制文件与归档日志文件
本文介绍了Oracle数据库中的控制文件和归档日志文件。控制文件记录了数据库的物理结构信息,如数据库名、数据文件和联机日志文件的位置等。为了保护数据库,通常会进行控制文件的多路复用。归档日志文件是联机重做日志文件的副本,用于记录数据库的变更历史。文章还提供了相关SQL语句,帮助查看和设置数据库的日志模式。
129 1
【赵渝强老师】Oracle的控制文件与归档日志文件
|
4月前
|
Oracle 关系型数据库 数据库
【赵渝强老师】Oracle的参数文件与告警日志文件
本文介绍了Oracle数据库的参数文件和告警日志文件。参数文件分为初始化参数文件(PFile)和服务器端参数文件(SPFile),在数据库启动时读取并分配资源。告警日志文件记录了数据库的重要活动、错误和警告信息,帮助诊断问题。文中还提供了相关视频讲解和示例代码。
124 1
|
5月前
|
Oracle 关系型数据库 网络安全
Oracle 19c 安装教程学习
Oracle 19c 安装教程学习
239 2
|
4月前
|
SQL Oracle 关系型数据库
【赵渝强老师】Oracle的联机重做日志文件与数据写入过程
在Oracle数据库中,联机重做日志文件记录了数据库的变化,用于实例恢复。每个数据库有多组联机重做日志,每组建议至少有两个成员。通过SQL语句可查看日志文件信息。视频讲解和示意图进一步解释了这一过程。
|
8月前
|
SQL JSON 数据处理
5% 消耗,6 倍性能:揭秘新一代 iLogtail SPL 日志处理引擎与 Logstash 的 PK
在本文中,我们将深入探讨为何选择 iLogtail,以及它在 SPL 数据处理方面相较于 Logstash 有何独特优势。通过对比这两款工具的架构、性能以及功能,我们希望能够揭示 iLogtail 如何在日益复杂的日志处理需求中脱颖而出,帮助您做出明智的技术选择。
40519 27
|
6月前
|
缓存 监控 算法
分析慢日志文件来优化 PHP 脚本的性能
分析慢日志文件来优化 PHP 脚本的性能
|
7月前
|
SQL Oracle 关系型数据库
"揭秘!一键解锁Oracle日志清理魔法,让海量归档日志无处遁形,守护数据库健康,告别磁盘空间告急噩梦!"
【8月更文挑战第9天】随着Oracle数据库在企业应用中的普及,归档日志管理对保持数据库健康至关重要。归档日志记录所有更改,对数据恢复极为重要,但也可能迅速占用大量磁盘空间影响性能。利用Oracle提供的RMAN工具,可通过编写Shell脚本来自动清理归档日志。脚本包括设置环境变量、连接数据库、检查和删除指定时间前的日志,并记录执行情况。通过Cron作业定时运行脚本,可有效管理日志文件,确保数据库稳定运行。
180 7

推荐镜像

更多