search
HomeDatabaseMysql Tutorialoracle物理结构和逻辑结构

oracle物理结构和逻辑结构物理结构查看oracle数据库的物理文件路径一定要用命令查看,除非该数据库是你亲自安装,并做过所有的安全配置,否则非常有可能你的前任对数据库进行了更改,而在一不小心酿成大错。 查看控制文件DESC v$controlfile查看控制文件的状态和

  oracle物理结构和逻辑结构物理结构查看oracle数据库的物理文件路径一定要用命令查看,除非该数据库是你亲自安装,并做过所有的安全配置,否则非常有可能你的前任对数据库进行了更改,而在一不小心酿成大错。

  查看控制文件DESC v$controlfile查看控制文件的状态和名称(显示路径)SELECT status,name FROM v$controlfile;

  查看数据文件DESC v$datafile比如查看数据文件的文件号和状态SELECT file#,status,name FROM v$datafile;

  看日志文件DESC v$logfile查看日志文件路径信息SELECT member FROM v$logfile;

  Oracle的文件系统:控制文件(.CTL),数据文件(.DBF),日志文件(.LOG)

  这三种文件系统一般在以下路径可以找到:(默认安装路径)/u01/app/oracle/oradata/oracleSID

  除此三种文件还有一种参数文件,参数文件不是数据库系统中的有效组成部分,在启动数据库时,参数文件不直接参与工作,只是控制文件是由参数文件寻找的。参数文件位置:/u01/app/oracle/product/10.2.0/db_1/dbs/spfileorac leSID.ora控制文件的内容会显示在参数文件中。参数文件的作用起到寻找控制文件的作用。

  Oracle中有两种日志文件,一种为联机日志文件(重做日志文件),一种为归档日志文件。REDO01.LOG和REDO02.LOG,REDO03.LOG是典型的联机日志文件,特点是顺序写文件,写满后写下一个,写满第三个循环写第一个,并且覆盖掉不做备份。归档日志文件,在热备份的时候要选择的一种归档方式。

  由控制文件控制数据文件和日志文件。数据库启动时启动对应实例后,首先启动控制文件,在由控制文件打开数据文件。现象是:数据库装载:Database Mount,然后打开数据库:Database Open。其实就是先打开控制文件,在打开数据文件。

  物理结构下,这些路径是可以随意迁移的,可以存放在任何存储下,包括裸设备。

  逻辑结构数据库的逻辑结构相对于物理结构要复杂很多。学逻辑结构,非一日之功,我仅学到相关的大概。以后有时间继续深入学习。数据库存储空间由一个或多个表空间构成。(如system、sysaux.)1、表空间(tablespace)组织数据库空间的逻辑结构,其对物理结构是数据文件,一个表空间物理上由一个或多个数据文件组成,逻辑上由一个或多个数据段组成。2、数据段(segment)逻辑对象所占用空间,如表段,索引段,回滚段等,段存在于表空间中,并对应一定的存储空间。数据段又划分为一个或多个区间。3、区(extent)区间是用于为数据一次性预留的一个逻辑上连续的一组disk空间(默认8块),每个区间占用一定数量的数据块。区不能跨数据文件。4、块(block)数据库最小的存储单位(默认8k),是所有逻辑结构的基本分配单元。以上时逻辑结构的基本结构

  1.表空间概述表空间功能·组织数据段空间,控制存储空间的分配·通过使单个表空间在线或离线,控制数据的可用性·通过表空间划分实现跨越设备分配数据存储,以提高性能·通过指定用户使用指定表空间实现对用户的限制·执行部分数据的后备和恢复操作表空间特点·数据中的最大逻辑单位·一个数据库逻辑上至少由一个系统表空间构成·一个表空间物理上至少由一个数据文件构成·一个表空间至少包括一个段(控制信息)·表空间的大小等于所有从属于它的数据文件大小的总和查询表空间使用状况SQL select*from dba_tablespaces;查询数据库中所有表空间信息SQL select*from dba_data_files;查询表空间所含数据文件信息,不含临时表空间SQL select*from dba_temp_files;专查临时表空间所含数据文件SQL select tablespace_name,sum(bytes)from dba_data_files group by tablespace_name;查询表空间大小SQL select tablespace_name,sum(bytes)from dba_free_space group by tablespace_name;查询表空间空闲空间大小

  创建表空间SQL create tablespace test datafile’/u01/a.dat’size 5m;更改表空间SQL alter tablespace test add datafile’/u01/b.dat’size 6m;查询表空间SQL select tablespace_name,sum(bytes)from dba_data_files group by tablespace_name;表空间更名SQL alter tablespace test rename to fff;表空间脱机SQL alter tablespace test offline;表空间联机SQL alter tablespace test online;设置表空间只读SQL alter tablespace test read only;设置表空间可读写SQL alter tablespace test read write;扩展表空间SQL alter tablespace test add datafile’/u01/c.dat’size 500M;增加数据文件个数以扩充表空间(数据文件大约5~20个)SQL alter database datafile’/u01/a.dat’resize 80M;扩充数据文件大小扩充表空间SQL alter database datafile’/u01/a.dat’autoextend on maxsize 100M;设置自动扩充参数以自动扩充表空间删除表空间SQL drop tablespace test including contents and datafiles;删除表空间和数据文件

  表空间分类表空间主要分为系统表空间(system、sysaux),数据表空间(user),回滚表空间(undotbs),临时表空间(temp)。1、系统表空间每个数据库都必须具备一个system表空间,该表空间是在数据库创建或数据库安装时自动创建的,名称不能更改,任何时候均必须保持online状态,用于存储系统的数据字典表,程序系统单元,过程函数,包和触发器等,也可用于存储用户数据表,索引对象。为避免系统表空间产生磁场碎片以及争用系统资源的问题,应单独创建至少一个独立的表空间用来单独抽出用户数据。sysaux表空间也随数据库的创建而创建,是system表空间的辅助表空间,主要存储存放支持oracle系统活动的多种工具如logminer等,sysaux降低了system表空间的负荷。2、数据和索引表空间由用户在数据建立完毕自行创建,是数据库空间的最主要组成部分,数据表空间应该建立多个,建立不同用户及性质的数据库对象时应指定其存放在指定的数据表空间中,索引表空间也应建立多个,并分类将不同对象的索引按大小及访问频度分别指定存放到指定的数据表空间中。通常情况下,数据和索引表空间应建立适当多个,太少则单个表空间过大,数据不安全且回复费时,太小则难管理。数据库创建时默认创建users表空间,包含一个数据文件user01.dbf,新建用户的未指定存储表空间时默认使用该表空间。3、回滚表空间undo数据又称回滚(rollback)数据,用户确保数据的一致性,当执行DML操作时,事务操作前的数据被称undo记录,undo表空间用于保存undo记录。undo表空间用户保存undo记录,是数据库空间的最关键的组成部分,其对数据库的运行影响很大。数据库创建时默认建立一个回滚段表空间undotbs1,包含一个数据文件undotbs01.dbs。SQL show parameter undo;

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
MySQL's Role: Databases in Web ApplicationsMySQL's Role: Databases in Web ApplicationsApr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

MySQL: Building Your First DatabaseMySQL: Building Your First DatabaseApr 17, 2025 am 12:22 AM

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL: A Beginner-Friendly Approach to Data StorageMySQL: A Beginner-Friendly Approach to Data StorageApr 17, 2025 am 12:21 AM

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

Is MySQL Beginner-Friendly? Assessing the Learning CurveIs MySQL Beginner-Friendly? Assessing the Learning CurveApr 17, 2025 am 12:19 AM

MySQL is suitable for beginners because: 1) easy to install and configure, 2) rich learning resources, 3) intuitive SQL syntax, 4) powerful tool support. Nevertheless, beginners need to overcome challenges such as database design, query optimization, security management, and data backup.

Is SQL a Programming Language? Clarifying the TerminologyIs SQL a Programming Language? Clarifying the TerminologyApr 17, 2025 am 12:17 AM

Yes,SQLisaprogramminglanguagespecializedfordatamanagement.1)It'sdeclarative,focusingonwhattoachieveratherthanhow.2)SQLisessentialforquerying,inserting,updating,anddeletingdatainrelationaldatabases.3)Whileuser-friendly,itrequiresoptimizationtoavoidper

Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Explain the ACID properties (Atomicity, Consistency, Isolation, Durability).Apr 16, 2025 am 12:20 AM

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL: Database Management System vs. Programming LanguageMySQL: Database Management System vs. Programming LanguageApr 16, 2025 am 12:19 AM

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL: Managing Data with SQL CommandsMySQL: Managing Data with SQL CommandsApr 16, 2025 am 12:19 AM

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

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

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

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.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment