OCM培訓課程-Server config 之管理表空間
最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!
我要咨詢OCM培訓課程-Server config 之管理表空間
OCM考試大綱針對表空間的要求:
* Create and manage temporary, permanent, and undo tablespaces
* Create and manage bigfile tablespaces
這個環節的考點是要求熟練掌握表空間管理的語句,最好是記熟,到時查聯機文檔,時間可能會很緊張。
1、創建普通表空間
sql> create tablespace ts1 datafile ‘$ORACLE_BASE/oradata/orcl/datafile/ts1.dbf’ size 100m
autoextend on next 10m maxsize 200m extent management local uniform size 128k
space segment space management auto;
-- extent management local、space segment space management auto是默認的。
2、創建undo表空間
sql> create undo tablespace undo_ts2 datafile 'u01/app/oracle/oradata/orcl/datafile/undo_ts2.dbf' size 100m autoextend on next 10m maxsize 200m;
3、創建臨時表空間
sql> CREATE TEMPORARY TABLESPACE temp2 TEMPFILE'u01/app/oracle/oradata/orcl/datafile/temp02.dbf'
SIZE 50M autoextend on next 10m maxsize 200m;
4、創建臨時表空間組
alter tablespace temp1 tablespace group temp_grp;
alter tablespace temp2 tablespace group temp_grp;
查看數據庫當前默認臨時表空間:
select property_name,property_value from database_properties where property_name like '%TEMP%'
-------------------------------------------------------------------------------------------
DEFAULT_TEMP_TABLESPACE TEMP
修改數據庫默認臨時表空間:
alter database default temporary tablespace temp2;
只修改某用戶的默認臨時表空間:
alter user u1 temporary tablespace temp;
5、創建bigfile表空間
create bigfile tablespace bigts datafile '/u01/app/oracle/oradata/orcl/datafile/bigts.dbf' size 50G;
6、修改datafile大小
sql> alter database datafile ''u01/app/oracle/oradata/orcl/datafile/ts1.dbf' resize 500m;
7、重命名datafile
sql> alter tablespace datafile '''u01/app/oracle/oradata/orcl/datafile/ts1.dbf' to '''u01/app/oracle/oradata/orcl/datafile/ts1_new.dbf' ; 或
sql> alter database file '''u01/app/oracle/oradata/orcl/datafile/ts1.dbf' to '''u01/app/oracle/oradata/orcl/datafile/ts1_new.dbf' ;