建立oracle資料庫使用者

2021-08-08 17:31:15 字數 1049 閱讀 7725

--查詢表空間

select tablespace_name, 

file_id, 

file_name, 

round(bytes / (1024 * 1024), 0) total_space 

from dba_data_files 

order by tablespace_name;

1.建立表空間

create tablespace summit datafile '/data01/oradata/pilotdevdb/summit_dev_data01.dbf' size 10m autoextend on next 10m maxsize 30g;

2.建立使用者

create user sumdev identified by paic1234 default tablespace summit;

3.給使用者賦許可權

grant connect,resource to sumdev;

4.增加表空間的大小

alter tablespace summit add datafile '/data01/oradata/pilotdevdb/summit_dev_data02.dbf' size 20g;

5.查詢表空間

select tablespace_name, 

file_id, 

file_name, 

round(bytes / (1024 * 1024), 0) total_space 

from dba_data_files 

order by tablespace_name;

刪除以上建立的內容

步驟一: 刪除user

drop user sumdev cascade;

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

步驟二: 刪除tablespace

drop tablespace summit_dev_data including contents and datafiles;

為Oracle資料庫建立使用者

oracle安裝完後,其中有乙個預設的資料庫,除了這個預設的資料庫外,我們還可以建立自己的資料庫。對於初學者來說,為了避免麻煩,可以用 database configuration assistant 嚮導來建立資料庫。建立完資料庫後,並不能立即在資料庫中建表,必須先建立該資料庫的使用者,並且為該使...

為Oracle資料庫建立使用者

oracle安裝完後,其中有乙個預設的資料庫,除了這個預設的資料庫外,我們還可以建立自己的資料庫。對於初學者來說,為了避免麻煩,可以用 database configuration assistant 嚮導來建立資料庫。建立完資料庫後,並不能立即在資料庫中建表,必須先建立該資料庫的使用者,並且為該使...

為Oracle資料庫建立使用者

oracle安裝完後,其中有乙個預設的資料庫,除了這個預設的資料庫外,我們還可以建立自己的資料庫。對於初學者來說,為了避免麻煩,可以用 database configuration assistant 嚮導來建立資料庫。建立完資料庫後,並不能立即在資料庫中建表,必須先建立該資料庫的使用者,並且為該使...