Oracle建立表空間及使用者

2021-09-16 13:37:13 字數 1259 閱讀 2908

1、建立臨時表空間

create temporary tablespace bgt_temp  

size 50m

autoextend on

next 50m maxsize 20480m

extent management local;

2、建立資料表空間

create tablespace bgt_data  

logging

size 50m

autoextend on

next 50m maxsize 20480m

extent management local;

1、建立使用者並指定表空間

create user username identified by password  default tablespace  tablespace_name  temporary tablespace temp_tablespace_name;
2、給使用者授予許可權

grant connect,resource,dba to username;
三、刪除表空間及使用者

--刪除空的表空間,但是不包含物理檔案

drop tablespace tablespace_name;

--刪除非空表空間,但是不包含物理檔案

drop tablespace tablespace_name including contents;

--刪除空表空間,包含物理檔案

drop tablespace tablespace_name including datafiles;

--刪除非空表空間,包含物理檔案

drop tablespace tablespace_name including contents and datafiles;

--如果其他表空間中的表有外來鍵等約束關聯到了本表空間中的表的字段,就要加上cascade constraints

drop tablespace tablespace_name including contents and datafiles cascade constraints;

--說明: 刪除了user,只是刪除了該user下的schema objects,是不會刪除相應的tablespace的。

drop user username cascade

oracle建立表空間及使用者

以system使用者登入後,建立表空間 connect system manager create tablespace 表空間名稱 datafile oracle base oradata oracle sid 資料檔案.dbf size 100m reuse autoextend on next...

oracle建立表空間及使用者

分為四步 第1步 建立臨時表空間 create temporary tablespace user temp tempfile d oracle oradata oracle9i user temp.dbf size 50m autoextend onnext 50m maxsize 20480m ...

Oracle建立使用者及表空間

drop tablespace local temp create temporary tablespace local temp size 32m autoextend on next 32m maxsize 2048m extent management local drop tablespac...