Home Database Mysql Tutorial 详解Oracle本地管理表空间

详解Oracle本地管理表空间

Jun 07, 2016 pm 05:06 PM
oracle database

1 名词解释与约定 表空间(Tablespace):为数据库提供使用空间的逻辑结构,其对应物理结构是数据文件,一个表空间可以包含多个

1 名词解释与约定

表空间(Tablespace):为数据库提供使用空间的逻辑结构,其对应物理结构是数据文件,一个表空间可以包含多个数据文件。

本地管理表空间(Locally Managed Tablespace简称LMT):8i以后出现的一种新的表空间的管理模式,通过本地位图来管理表空间的空间使用。

字典管理表空间(Dictionary-Managed Tablespace简称DMT):8i以前包括以后都还可以使用的一种表空间管理模式,通过数据字典管理表空间的空间使用。

段(Segment):数据库一种逻辑结构,如表段,索引段,回滚段等,段存在于表空间中,并对应一定的存储空间。

区间,可以简称区(Extent):段的存储可以分成一个或多个区间,每个区间占用一定数量的数据块(block),在本地管理的表空间中,表空间的Extent就对应段的Extent。

块(Block):数据库最小的存储单位,在本文中Block的大小约定为8192字节。

位(Bit):本地管理表空间的空间管理单位,一个位可能等于一个区间,也可能多个位组成一个区间。

2 本地管理表空间

2.1 语法

在Oracle8I的版本中,Oracle推出了一种全新的表空间管理方式:本地化管理的表空间。所谓本地化管理,就是指Oracle不再利用数据字典表来记录Oracle表空间里面的区的使用状况,而是在每个表空间的数据文件的头部加入了一个位图区,在其中记录每个区的使用状况。每当一个区被使用,或者被释放以供重新使用时,Oracle都会更新数据文件头部的这个记录,反映这个变化。

本地化管理的表空间的创建过程:

语法:CREATE TABLESPACE 表空间名字 DATAFILE '数据文件详细信息' [EXTENT MANAGEMENT { LOCAL {AUTOALLOCATE | UNIFORM [SIZE INTETER [K|M] ] } } ]

关键字EXTENT MANAGEMENT LOCAL 指定这是一个本地化管理的表空间。对于系统表空间,只能在创建数据库的时候指定EXTENT MANGEMENT LOCAL,因为它是数据库创建时建立的第一个表空间。

在8i中,字典管理还是默认的管理方式,当选择了LOCAL关键字,即表明这是一个本地管理的表空间。当然还可以继续选择更细的管理方式:是AUTOALLOCATE 还是 UNIFORM.。若为AUTOALLOCATE,则表明让Oracle来决定区块的使用办法;若选择了UNIFORM,则还可以详细指定每个区块的大小,若不加指定,则为每个区使用1M大小。

2.2 本地管理优点

1. 本地化管理的表空间避免了递归的空间管理操作。而这种情况在数据字典管理的表空间是经常出现的,当表空间里的区的使用状况发生改变时,数据字典的表的信息发生改变,从而同时也使用了在系统表空间里的回滚段。

2. 本地化管理的表空间避免了在数据字典相应表里面写入空闲空间、已使用空间的信息,从而减少了数据字典表的竞争,提高了空间管理的并发性

3. 区的本地化管理自动跟踪表空间里的空闲块,减少了手工合并自由空间的需要。

4. 表空间里的区的大小可以选择由Oracle系统来决定,或者由数据库管理员指定一个统一的大小,避免了字典表空间一直头疼的碎片问题。

5. 从由数据字典来管理空闲块改为由数据文件的头部记录来管理空闲块,这样避免产生回滚信息,不再使用系统表空间里的回滚段。因为由数据字典来管理的话,它会把相关信息记在数据字典的表里,从而产生回滚信息。

由于这种表空间的以上特性,所以它支持在一个表空间里边进行更多的并发操作,并减少了对数据字典的依赖。

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)

How to check which table space a table belongs to in Oracle How to check which table space a table belongs to in Oracle Jul 06, 2023 pm 01:31 PM

How to check which table space a table belongs to in Oracle: 1. Use the "SELECT" statement and specify the table name to find the table space to which the specified table belongs; 2. Use the database management tools provided by Oracle to check the table space to which the table belongs. Tools usually provide a graphical interface, making the operation more intuitive and convenient; 3. In SQL*Plus, you can view the table space to which the table belongs by entering the "DESCRIBEyour_table_name;" command.

How to connect to Oracle database using PDO How to connect to Oracle database using PDO Jul 28, 2023 pm 12:48 PM

Overview of how to use PDO to connect to Oracle database: PDO (PHPDataObjects) is an extension library for operating databases in PHP. It provides a unified API to access multiple types of databases. In this article, we will discuss how to use PDO to connect to an Oracle database and perform some common database operations. Step: Install the Oracle database driver extension. Before using PDO to connect to the Oracle database, we need to install the corresponding Oracle

How to retrieve only one piece of duplicate data in oracle How to retrieve only one piece of duplicate data in oracle Jul 06, 2023 am 11:45 AM

Steps for Oracle to fetch only one piece of duplicate data: 1. Use the SELECT statement combined with the GROUP BY and HAVING clauses to find duplicate data; 2. Use ROWID to delete duplicate data to ensure that accurate duplicate data records are deleted, or use "ROW_NUMBER" ()" function to delete duplicate data, which will delete all records except the first record in each set of duplicate data; 3. Use the "select count(*) from" statement to return the number of deleted records to ensure the result.

How to use php to extend PDO to connect to Oracle database How to use php to extend PDO to connect to Oracle database Jul 29, 2023 pm 07:21 PM

How to use PHP to extend PDO to connect to Oracle database Introduction: PHP is a very popular server-side programming language, and Oracle is a commonly used relational database management system. This article will introduce how to use PHP extension PDO (PHPDataObjects) to connect to Oracle database. 1. Install the PDO_OCI extension. To connect to the Oracle database, you first need to install the PDO_OCI extension. Here are the steps to install the PDO_OCI extension: Make sure

Implement data import into PHP and Oracle databases Implement data import into PHP and Oracle databases Jul 12, 2023 pm 06:46 PM

Implementing data import into PHP and Oracle databases In web development, using PHP as a server-side scripting language can conveniently operate the database. As a common relational database management system, Oracle database has powerful data storage and processing capabilities. This article will introduce how to use PHP to import data into an Oracle database and give corresponding code examples. First, we need to ensure that PHP and Oracle database have been installed, and that PHP has been configured to

How to use PHP and Oracle database connection pools efficiently How to use PHP and Oracle database connection pools efficiently Jul 12, 2023 am 10:07 AM

How to efficiently use connection pooling in PHP and Oracle databases Introduction: When developing PHP applications, using a database is an essential part. When interacting with Oracle databases, the use of connection pools is crucial to improving application performance and efficiency. This article will introduce how to use Oracle database connection pool efficiently in PHP and provide corresponding code examples. 1. The concept and advantages of connection pooling Connection pooling is a technology for managing database connections. It creates a batch of connections in advance and maintains a

Does oracle database require jdk? Does oracle database require jdk? Jun 05, 2023 pm 05:06 PM

The oracle database requires jdk. The reasons are: 1. When using specific software or functions, other software or libraries included in the JDK are required; 2. Java JDK needs to be installed to run Java programs in the Oracle database; 3. JDK provides Develop and compile Java application functions; 4. Meet Oracle's requirements for Java functions to help implement and implement specific functions.

How to query table space size in oracle How to query table space size in oracle Jul 06, 2023 pm 01:45 PM

Steps to query the table space size in Oracle: 1. Log in to the Oracle database using a database administrator account; 2. Use the "SELECT" statement to view the space list; 3. There are three methods to query the table space size: use the dbms_utility package to query, and use the dba_segments view Query, use the dba_data_files view query; 4. Use the "DBMS_OUTPUT.PUT_LINE" function or other methods to display the results to display the query results.

See all articles