Home Database Mysql Tutorial Oracle 10g 读书笔记之数据库常用文件

Oracle 10g 读书笔记之数据库常用文件

Jun 07, 2016 pm 05:05 PM

查询文件位置:select name, value from v$parameter where name like

一、参数文件和服务器参数文件
参数文件(Parameter File)通常称为初始文件(init file),或 init.ora 文件。默认名称为 init.ora 文本文件。
SPFILE 生成 PFILE:create pfile='/tmp/initorcl.ora' from spfile;
服务器参数文件(Server Parameter File),或简称 SPFILE。默认名称为 spfile.ora 二进制文件,可通过 RMAN 备份。
PFILE 转换为 SPFILE :create spfile from pfile
修改SPIFLE参数:alter system set parameter=value
其中,deferred 指定系统修改是否只对以后的会话生效,默认情况下,alter system 命令会立即生效。
可以使用以下查询确认哪些参数要求必须使用 deferred:
select name from v$parameter where ISSYS_MODIFIABLE='DEFFERRED';
取消 SPFILE 中的值设置:alter system reset parameter sid='sid|*'
SID 是站点标识符(Site Identifie)。在 UNIX 中,SID 和 ORACLE_HOME 一同进行散列运算,创建一个唯一的键名从而附加到 SGA。
如果 ORACLE_SID 或 ORACLE_HOME 设置不当,就会得到 ORACLE NOT AVAILABLE 错误,因为无法附加到这个唯一键所标识的共享内存段。
查看参数:show parameter 或查询视图 v$parameter
修改参数:alter system set =

二、跟踪文件
文件位置:USER_DUMP_DEST(专用服务器连接) 和 BACKGROUND_DUMP_DEST (共享服务器连接)
查询文件位置:select name, value from v$parameter where name like '%dump_dest%';
如果使用共享服务器连接,就会使用一个后台进程;如果使用专用服务器连接,则会使用一个用户或前台进程与 oracle 交互。
如果出现严重的 oracle 内部错误,,或者如果 oracle support 要求生成一个跟踪文件来得到额外的调试信息,CORE_DUMP_DEST 则定义了文件的位置。
查询跟踪文件:
select c.value || '/' || d.instance_name || '_ora_' || a.spid || '.trc' trace
from v$process a, v$session b, v$parameter c, v$instance d
where a.addr=b.paddr and b.audsid=userenv('sessionid') and c.name='user_dump_dest'
标准格式:_ora_

三、数据文件
表空间是 oracle 中的一个逻辑存储容器,位于存储层次的顶层,包括一个或多个数据文件。
段就是占用存储空间的数据库对象,如表、索引、回滚段、临时段等。
段本身又由一个或多个区段组成。区段是文件中一个逻辑上连续分配的空间。每个段至少有一个区段,回滚段需要两个。
区段进一步由块组成。它是 oracle 中最小的空间分配单位。数据行、索引条目或临时排序结果就存在块中。块大小有 2、4、8、16 K等。
一个数据库允许有多种块大小,目的是为了可以在更多的情况下使用可传输的表空间。所以一个表空间中的所有块大小都相同。
块结构:
1、首部,包含块类型的有关信息、块上发生的活动事务和过去事务的相关信息,以及块在磁盘上的地址。
2、表目录,如果有则会包含把行存储在这个块上的表的有关信息(可能一个块上存储多个表的数据)。
3、行目录,包含块中行的描述信息。这是一个指针数据,指向块中数据部分中的行。
4、空闲空间。5、数据。6、尾部。

四、临时文件(临时数据文件)
临时文件是一种特殊类型的数据文件。oracle 使用临时文件来存储大规模排序操作和散列操作的中间结果。
oracle 以一种特殊的方式处理临时文件。一般你对对象所做的每个修改都会存储在重做日志中,临时文件不包括在这个重放过程内。
对临时文件并不生成 redo 日志,不过可以生成 undo 日志。由于 undo 总是受 redo 的“保护”,因此这就会生成使用临时表的 redo 日志。

五、控制文件
参数文件告知实例控制文件的位置,控制文件则告知实例数据库和在线重做日志文件的位置。

六、重做日志文件
它们是数据库的事务日志。包括在线重做日志和归档重做日志。
从一个日志文件组切换到另一个日志文件组的动作称为日志切换。它可能会导致临时性“暂停”,数据库确保将缓存中的数据安全的写入磁盘。
在填满日志文件 A 并切换到日志文件 B 时,oracle 就会启动一个检查点。此时 DBWn 开始将日志文件组 A 所保护的所有脏块写至磁盘。

七、密码文件
它是一个可选的文件,允许远程 SYSDBA 或者管理员访问数据库。

八、修改跟踪文件
它是一个可选的文件,是 10g 企业版中新增的。它唯一的目的是跟踪自上一个增量备份以来哪些块已经修改。这样 RMAN 备份时就不必读取整个数据库。
创建修改跟踪文件命令如下:
alter database enable block change tracking using file 'c:/oracle/changed_blocks.bct';
关闭和删除修改跟踪文件:
alter database disable block change tracking;

九、闪回日志文件
简称为闪回日志,这是 oracle 10g 中为支持 FLASHBACK DATABASE 命令而引入的。包含已修改数据库块的“前镜像”,可用于将数据库返回到该时间点之前的状态。
恢复步骤如下:
1、关闭数据库。
2、启动并装载数据库,可以使用 SCN、Oracle 时钟或时间戳发出闪回数据库命令。
3、以 RESETLOGS 选项打开数据库。
要使用这个特性,必须采用 ARCHIVELOG 模式,而且必须配置为支持 FLASHBACK DATABASE 命令。

linux

Statement of this Website
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

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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

See all articles