search
HomeDatabaseMysql TutorialOracle 10g 读书笔记之数据库常用文件

查询文件位置: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
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
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

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

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software