[Oracle Database] 데이터베이스 테이블 공간 관리
7329 단어 OacletablespacedatafileOracle
SQL> create tablespace soe
datafile '/u01/app/oracle/oradata/wallet/soe01.dbf'
size 1024M
extent management local
uniform size 1M;
:
SQL> alter tablespace soe
add datafile '/u01/app/oracle/oradata/wallet/soe02.dbf'
size 2048M;
:
SQL> alter database datafile '/u01/app/oracle/oradata/wallet/soe01.dbf' autoextend on;
:
SQL> alter database datafile '/u01/app/oracle/oradata/wallet/soe01.dbf' resize 2048M;
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;
SQL> create temporary tablespace temp01
tempfile '/u01/app/oracle/oradata/wallet/temp01.dbf'
size 1024M
extent management local
uniform size 1M;
SQL> alter tablespace temp01
add tempfile '/u01/app/oracle/oradata/wallet/temp02.dbf'
size 1024M;
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
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;
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.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
activemq 5.5 의 입문 은 설치, 시작, 데이터베이스 지속 화 를 포함한다Apache ActiveMQ 5.5.0 은 주로 유지보수 버 전 으로 130 개가 넘 는 문 제 를 복 구 했 으 며 대부분 bug 와 개선 이 었 다. Improved performance for offline d...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.