oracle物理结构和逻辑结构
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;

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

Oracle views can be exported through the EXP utility: Log in to the Oracle database. Start the EXP utility, specifying the view name and export directory. Enter export parameters, including target mode, file format, and tablespace. Start exporting. Verify the export using the impdp utility.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.
