/*分爲四步 */
/*第1步:創建臨時表空間 */
create temporary tablespace user_temp
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第2步:創建數據表空間 */
create tablespace user_data
logging
datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第3步:創建用戶並指定表空間 */
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
[color=red][b][size=x-small]查看錶空間和剩餘表空間[/size][/b][/color]
select total.tablespace_name,
round(total.MB, 2) as Total_MB,
round(total.MB - free.MB, 2) as Used_MB,
round((1 - free.MB / total.MB) * 100, 2) as Used_Pct
from (select tablespace_name, sum(bytes) / 1024 / 1024 as MB
from dba_free_space
group by tablespace_name) free,
(select tablespace_name, sum(bytes) / 1024 / 1024 as MB
from dba_data_files
group by tablespace_name) total
where free.tablespace_name = total.tablespace_name;
如下圖:
[img]http://dl.iteye.com/upload/attachment/0083/6490/af157ec5-fc87-356e-bfcf-867a32cd27c3.png[/img]
[color=red][b][size=x-small]修改表空間[/size][/b][/color]
ALTER TABLESPACE app_data ADD DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF' SIZE 50M;
Meathod2:新增數據文件,並且允許數據文件自動增長
ALTER TABLESPACE app_data ADD DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF' SIZE 50M
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod3:允許已存在的數據文件自動增長
ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF'
AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
Meathod4:手工改變已存在數據文件的大小
ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF'
RESIZE 100M;
溫習數據庫創建和修改
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Latest Pass Exam With Avaya 31860X Exam Dumps(2022)
declanriver34125
2022-06-20 20:37:57
Databricks Certified Professional Data Scientist Exam Dumps-Easiest Preparation Method(2022)
declanriver34125
2022-06-20 20:23:31
Salesforce Sales Cloud Consultant Practice Test - Best Preparation Material
declanriver34125
2022-06-18 19:23:01
Salesforce Certified Administrator Practice Test - Effective Tips To Pass
declanriver34125
2022-06-18 19:07:55
NBA Finals Game 6 live Free
jeffreycklima
2022-06-17 03:19:12
sdghjkghjgfjhfg
jeffreycklima
2022-06-12 06:25:41
GCP-GC-REP Exam Questions Help You to Score Higher in Your Genesys Exam
jamesconnorx7
2022-06-11 20:09:00
Blood Boost Formula (2022 Update) Customer Complaints & Health Risks?
triciusti
2022-06-10 20:26:25
FWEGESR WAGESR
tahad17me
2022-06-06 15:45:12
Cost-Effective Backup Approach to Promote Backup as a Service Market
reportsfuture24
2022-05-02 17:43:41
Dissertation Writing Services UK
henryrosie890
2022-05-02 16:40:42
Global Probe Card Market segmented By Type (Cantilever Probe Card, MEMS Probe Card, and Vertical Pro
syedsimranskyquest
2022-04-29 00:21:50
Global Hard Seltzer Market Study
manti.manna.skyquestt
2022-04-27 16:17:23