Oracle建立資料庫表空間

2021-08-19 09:20:38 字數 1650 閱讀 5039

1.首先,建立(新)使用者:

create userusername identified by password;

username:新使用者名稱的使用者名稱

password: 新使用者的密碼

也可以不建立新使用者,而仍然用以前的使用者,如:繼續利用scott使用者

2.建立表空間:

createtablespace tablespacename datafile 'd:\data.dbf' size ***m;

tablespacename:表空間的名字

d:\data.dbf':表空間的儲存位置

***表空間的大小,m單位為兆(m)

3.將空間分配給使用者:

alter userusername default tablespace tablespacename;

將名字為tablespacename的表空間分配給username

4.給使用者授權:

grant createsession,create table,unlimited tablespace to username;

5.然後再以樓主自己建立的使用者登入

,登入之後建立表即可。

conn username/password;

--刪除使用者

drop user osoadata_newcascade;

--刪除表空間

drop tablespace osoadata_new_temp including contents and datafiles;

drop tablespace osoadata_new  including contents anddatafiles;

--建立臨時表空間

create temporary tablespace certcmsuser_new_temptempfile ' certcmsuser_new_temp.dbf'

size 500m autoextend on;

--建立表空間

create tablespace certcmsuser_new loggingdatafile ' certcmsuser_new.dbf'

size 500m autoextend on;

--建立使用者並指定表空間

create user certcmsuser_new

identified by certcmsuser_new

default tablespace certcmsuser_new

temporary tablespace certcmsuser_new_temp

profile default;

--給使用者授予角色許可權

grant connect to certcmsuser_new;

grant resource to certcmsuser_new;

grant dba to certcmsuser_new;

--給使用者授予系統許可權

grant unlimited tablespace to certcmsuser_new;

--cmd執行下面語句

--impcertcmsuser/[email protected]:1521/orcl file=f:\workplace\思迪工具包\資料庫相關文件\certcmsuser.dmpfull=y

建立Oracle資料庫表空間

以管理員身份登陸 建立臨時表空間mydb temp create temporary tablespace mydb temp tempfile c database mydb temp.dbf 檔案路徑c database一定要存在,否則建立失敗。同時路徑中盡量不要有中文名稱。size 50m a...

ORACLE資料庫建立表空間

擴充套件表空間檔案 alter tablespace tbs yjtx data ldz oradata orcl tbs yjtx data 02.dbf size 1000m 建立臨時表空間 表空間自動擴容 size 1024m reuse autoextend on next 100m max...

oracle資料庫建立表空間

第1步 建立臨時表空間create temporary tablespace 臨時表空間名 tempfile 臨時表空間路徑x oracle data temp.dbf size 50m autoextend on next 50m maxsize 20480m extent management ...