創(chuàng)建表空間
SQL>?create?tablespace?soe
datafile?'/u01/app/oracle/oradata/wallet/soe01.dbf'
size?1024M
extent?management?local
uniform?size?1M;
擴(kuò)展表空間
方法一:在表空間中增加數(shù)據(jù)文件
SQL>?alter?tablespace?soe
add?datafile?'/u01/app/oracle/oradata/wallet/soe02.dbf'
size?2048M;
方法二:數(shù)據(jù)文件自動擴(kuò)展
SQL>?alter?database?datafile?'/u01/app/oracle/oradata/wallet/soe01.dbf'?autoextend?on;
方法三:增加表空間中數(shù)據(jù)文件的大小
SQL>?alter?database?datafile?'/u01/app/oracle/oradata/wallet/soe01.dbf'?resize?2048M;
移動表空間數(shù)據(jù)文件
SQL>?alter?tablespace?soe?offline;?
SQL>?host?cp?/u01/app/oracle/oradata/wallet/soe02.dbf?/u02/app/oracle/oradata/wallet
SQL>?alter?tablespace?soe
rename?datafile?'/u01/app/oracle/oradata/wallet/soe02.dbf'
to?'/u02/app/oracle/oradata/wallet/soe02.dbf';
SQL>?alter?tablespace?soe?online;
SQL>?host?rm?-rf?/u01/app/oracle/oradata/wallet/soe02.dbf
刪除表空間
SQL>?drop?tablespace?soe?including?contents?and?datafiles;
![](/upload/ad_content/xuanchuantu-19.jpg)
創(chuàng)新互聯(lián)公司成立于2013年,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目
成都做網(wǎng)站、網(wǎng)站建設(shè)網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元薩迦做網(wǎng)站,已為上家服務(wù),為薩迦各地企業(yè)和個人服務(wù),聯(lián)系電話:18980820575創(chuàng)建臨時表空間
SQL>?create?temporary?tablespace?temp01
tempfile?'/u01/app/oracle/oradata/wallet/temp01.dbf'
size?1024M
extent?management?local
uniform?size?1M;
擴(kuò)展臨時表空間
SQL>?alter?tablespace?temp01???????
add?tempfile?'/u01/app/oracle/oradata/wallet/temp02.dbf'
size?1024M;
查詢數(shù)據(jù)庫默認(rèn)臨時表空間
SQL>?col?property_name?for?a40
SQL>?col?property_value?for?a40
SQL>?col?description?for?a40
SQL>?select?*?from?database_properties?where?property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_NAME????????????????????????????PROPERTY_VALUE???????????????????????????DESCRIPTION
----------------------------------------?----------------------------------------?----------------------------------------
DEFAULT_TEMP_TABLESPACE??????????????????TEMP?????????????????????????????????????Name?of?default?temporary?tablespace
修改數(shù)據(jù)庫默認(rèn)臨時表空間
SQL>?alter?database?default?temporary?tablespace?temp01;
SQL>?select?*?from?database_properties?where?property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_NAME????????????????????????????PROPERTY_VALUE???????????????????????????DESCRIPTION
----------------------------------------?----------------------------------------?----------------------------------------
DEFAULT_TEMP_TABLESPACE??????????????????TEMP01???????????????????????????????????Name?of?default?temporary?tablespace
刪除臨時表空間
SQL>?drop?tablespace?temp?including?contents?and?datafiles;
創(chuàng)建UNDO表空間
SQL>?create?undo?tablespace?undotbs2
datafile?'/u01/app/oracle/oradata/wallet/undotbs02.dbf'
size?2048M;
查詢活動UNDO表空間
SQL>?show?parameter?undo_tablespace
NAME?????????????????????????????????TYPE??????????????????????????????VALUE
------------------------------------?---------------------------------?------------------------------
undo_tablespace??????????????????????string????????????????????????????UNDOTBS1
SQL>?select?count(*)?from?dba_undo_extents?where?status?=?'ACTIVE'?and?tablespace_name?=?'UNDOTBS1';
??COUNT(*)
----------
?????????6
修改活動UNDO表空間
SQL>?alter?system?set?undo_tablespace=undotbs2;
SQL>?show?parameter?undo_tablespace
NAME?????????????????????????????????TYPE??????????????????????????????VALUE
------------------------------------?---------------------------------?------------------------------
undo_tablespace??????????????????????string????????????????????????????UNDOTBS2?
刪除UNDO表空間
SQL>?select?count(*)?from?dba_undo_extents?where?status?=?'ACTIVE'?and?tablespace_name?=?'UNDOTBS1';
??COUNT(*)
----------
?????????0
?????????
SQL>?drop?tablespace?undotbs1?including?contents?and?datafiles;
SQL>?@dba_tablespaces.sql
+------------------------------------------------------------------------+
|?Report???:?Tablespaces?????????????????????????????????????????????????|
|?Instance?:?wallet??????????????????????????????????????????????????????|
+------------------------------------------------------------------------+
Tablespace?Name????????????????Status????TS?Type?????????Ext.?Mgt.??Seg.?Mgt.????????TS?Size?(MB)??????????Used?(MB)?Pct.?Used
------------------------------?---------?---------------?----------?----------?------------------?------------------?---------
SYSAUX?????????????????????????ONLINE????PERMANENT???????LOCAL??????AUTO????????????????????2,048????????????????482????????24
UNDOTBS1???????????????????????ONLINE????UNDO????????????LOCAL??????MANUAL??????????????????1,024????????????????114????????11
TEMP???????????????????????????ONLINE????TEMPORARY???????LOCAL??????MANUAL??????????????????1,024?????????????????28?????????3
SYSTEM?????????????????????????ONLINE????PERMANENT???????LOCAL??????MANUAL??????????????????2,048????????????????738????????36
SOE????????????????????????????ONLINE????PERMANENT???????LOCAL??????AUTO????????????????????4,096??????????????1,035????????25
USERS??????????????????????????ONLINE????PERMANENT???????LOCAL??????AUTO????????????????????1,024??????????????????1?????????0
???????????????????????????????????????????????????????????????????????????????------------------?------------------?---------
Average?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????16
Total??????????????????????????????????????????????????????????????????????????????????????11,264??????????????2,398
6?rows?selected.
SQL>?@dba_file_space_usage.sql
+------------------------------------------------------------------------+
|?Report???:?File?Usage??????????????????????????????????????????????????|
|?Instance?:?wallet??????????????????????????????????????????????????????|
+------------------------------------------------------------------------+
Tablespace?Name??????Filename??????????????????????????????????????????????FILE_ID?????File?Size?(MB)??????????Used?(MB)?Pct.?Used
--------------------?--------------------------------------------------?----------?------------------?------------------?---------
SOE??????????????????/u01/app/oracle/oradata/wallet/soe01.dbf????????????????????5??????????????2,048????????????????522????????25
SOE??????????????????/u01/app/oracle/oradata/wallet/soe02.dbf????????????????????6??????????????2,048????????????????513????????25
SYSAUX???????????????/u01/app/oracle/oradata/wallet/sysaux01.dbf?????????????????2??????????????2,048????????????????482????????23
SYSTEM???????????????/u01/app/oracle/oradata/wallet/system01.dbf?????????????????1??????????????2,048????????????????738????????36
TEMP?????????????????/u01/app/oracle/oradata/wallet/temp01.dbf???????????????????1??????????????1,024?????????????????28?????????2
UNDOTBS1?????????????/u01/app/oracle/oradata/wallet/undotbs01.dbf????????????????3??????????????1,024????????????????114????????11
USERS????????????????/u01/app/oracle/oradata/wallet/users01.dbf??????????????????4??????????????1,024??????????????????1?????????0
???????????????????????????????????????????????????????????????????????????????????------------------?------------------?---------
Average?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????17
Total??????????????????????????????????????????????????????????????????????????????????????????11,264??????????????2,398
7?rows?selected.
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
本文名稱:【OracleDatabase】數(shù)據(jù)庫表空間管理-創(chuàng)新互聯(lián)
標(biāo)題鏈接:http://bm7419.com/article28/hdjjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、網(wǎng)站營銷、ChatGPT、手機(jī)網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站、搜索引擎優(yōu)化
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源:
創(chuàng)新互聯(lián)