Oracle體系結(jié)構(gòu)中的基本概念,數(shù)據(jù)庫的介紹
如果你想更好的了解Oracle體系結(jié)構(gòu)的相關(guān)內(nèi)容的話,你就必須的了解Oracle體系結(jié)構(gòu)中的基本概念,數(shù)據(jù)庫,以下就是數(shù)據(jù)庫的相關(guān)內(nèi)容的具體介紹,希望你在瀏覽完此篇文章之后會有會所了解。
要了解Oracle體系結(jié)構(gòu)必須先了解它的基本概念: 數(shù)據(jù)庫.
一: 數(shù)據(jù)庫
數(shù)據(jù)庫(database)是一個數(shù)據(jù)集合.
無論數(shù)據(jù)庫是采用關(guān)系結(jié)構(gòu)還是面向?qū)ο蠼Y(jié)構(gòu), Oracle數(shù)據(jù)庫都將其數(shù)據(jù)存放在數(shù)據(jù)文件中. 在其內(nèi)部, 數(shù)據(jù)庫結(jié)構(gòu)數(shù)據(jù)對文件的邏輯映射, 使不同的數(shù)據(jù)分開存儲, 這些邏輯劃分稱為表空間.
表空間和文件介紹:
1: 表空間
表空間(tablespace)是數(shù)據(jù)庫的邏輯劃分, 每個數(shù)據(jù)庫至少有一個表空間,叫做系統(tǒng)表空間(system 表空間). 一個表空間只能屬于一個數(shù)據(jù)庫.
每個表空間由同一個磁盤上的一個或多個文件組成, 這些文件稱為數(shù)據(jù)文件. 表空間的特性:
1)控制數(shù)據(jù)庫數(shù)據(jù)磁盤分配
2)限制用戶在表空間中可以使用的磁盤空間大小
3)表空間具有 online, offline, readonly, readwrite屬性
修改表空間的屬性:
SQL> alter tablespace 表空間名稱 屬性;
查詢表空間狀態(tài):
- SQL> select tablespace_name, status from dba_tablespaces;
注意: system, undo, temp表空間不能設(shè)為offline屬性.
4)完成部分?jǐn)?shù)據(jù)庫的備份與恢復(fù)
5)在Oracle體系結(jié)構(gòu)表中空間通過數(shù)據(jù)文件來擴(kuò)大, 表空間的大小等于構(gòu)成該表空間的所以數(shù)據(jù)文件的大小只和.
查詢表空間與數(shù)據(jù)文件對應(yīng)關(guān)系:
- SQL> select tablespace_name, bytes, file_name from dba_data_files;
基于表空間的幾個操作:
1)查詢用戶缺省表空間:
- SQL> select username, default_tablespace from dba_users;
2)查詢表與存儲該表的表空間:
- SQL> select table_name, tablespace_name from user_tables;
3)修改用戶缺省表空間:
- SQL> alter user username default tablespace
tablespace_name;
4)將數(shù)據(jù)從一個表空間移動到另一個表空間:
- SQL> alter table table_name move tablespace
tablespace_name;
2: 數(shù)據(jù)文件
每個表空間由同一個磁盤上的一個或多個文件組成, 這些文件叫做數(shù)據(jù)文件(datafile),數(shù)據(jù)文件只能屬于一個表空間. 數(shù)據(jù)文件創(chuàng)建后可以改變大小. 創(chuàng)建新的表空間需要創(chuàng)建新的數(shù)據(jù)文件. 數(shù)據(jù)文件一旦加入到表空間中, 就不能從表空間中移走, 也不能與其他表空間發(fā)生聯(lián)系.數(shù)據(jù)庫必須的三類文件是 data file, control file, redolog file.
其他文件 prameter file,password file, archived log files并不是數(shù)據(jù)庫必須的, 他們只是輔助數(shù)據(jù)庫的.
查看數(shù)據(jù)庫的物理文件組成:
1)查看數(shù)據(jù)文件: SQL> select * from v$datafile;
2)查看控制文件: SQL> select * from v$controlfile;
3)查看日志文件: SQL> select * from v$logfile;
以上的相關(guān)內(nèi)容就是了解Oracle體系結(jié)構(gòu)必須先了解它的基本概念,數(shù)據(jù)庫的介紹,望你能有所收獲。
【編輯推薦】