oracle新建使用者相關操作

2021-08-11 14:14:47 字數 1457 閱讀 3061

oracle新建使用者相關操作

檢視使用者及表空間

select username,default_tablespace from dba_users;
–檢視表空間 users 資訊

select t.*  from sys.dba_data_files t where t.tablespace_name ='users';
查詢當前資料庫中表空間sec_d是否為自動擴充套件

select tablespace_name,file_name,autoextensible from dba_data_files where tablespace_name = 'sec_d';
通過修改sec_d的資料檔案為自動擴充套件達到表空間sec_d為自動擴充套件的目的

alter
新建表空間:

create tablespace new_tablespacename datafile 『dir』 size

1024m reuse;

還有一種方法是在建立表空間的設定自增加屬性,這樣在表空間不足的時候會自己增加,這是一種比較合理的策略

create tablespace new_tablespacename datafile 'dir'

size

1m autoextend on

next

50m maxsize unlimited;

autoextend 自動增長 50m是自增的大小

例如:

create tablespace test_db_data datafile 'test_db_data.dbf'

size

10240m autoextend on

next

2048m maxsize unlimited;

–刪除使用者:

drop

user username cascade;

cascade:刪除使用者下的所有資料

–新建使用者

create

user username identified by

" password"

default tablespace tablespacename

profile default account unlock;

–給新建使用者授dba許可權

grant

create

session

to new_username;

grant dba to new_username;

grant unlimited tablespace to new_username;

新建oracle使用者

啟動oracle的控制台,並彈出add database to tree對話方塊,並填寫 hostname 本機ip sid ora9i 安裝之前配置好的 port number 1521 然後在connect database介面上輸入 username sy an password oem te...

Oracle 新建使用者

臨時資料檔案 臨時表空間 預設資料檔案 預設表空間 建立使用者 賦許可權 當然也可以直接沿用已經存在的資料檔案和表空間 臨時資料檔名 xiaoqi temp.dbf 臨時表空間名 xiaoqi temp 預設資料檔名 xiaoqi data 臨時表空間名 xiaoqi data 預建立的使用者名稱 ...

新建乙個使用者操作oracle

今天出現了乙個問題,linux下root使用者不能切換到oracle使用者,但是能切換到其他的使用者,症狀如下 root localhost su oracle root localhost root localhost who am i root pts 1 2010 10 08 10 53 19...