就是在已有的數據庫實例上創建一個新的帳號,訪問一些新的表
操作步驟如下:
1、登錄linux,以oracle用戶登錄(如果是root用戶登錄的,登錄后用 su - oracle命令切換成oracle用戶)
2、以sysdba方式來打開sqlplus,命令如下: sqlplus "/as sysdba"
3、查看我們常規將用戶表空間放置位置:執行如下sql:
lect name from v$datafile;
上邊的sql一般就將你的用戶表空間文件位置查出來了。
4、創建用戶表空間:
CREATE TABLESPACE NOTIFYDB DATAFILE '/oracle/oradata/test/notifydb.dbf' SIZE 200M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
5、創建用戶,指定密碼和上邊創建的用戶表空間
CREATE USER hc_notify IDENTIFIED BY hc_password DEFAULT TABLESPACE NOTIFYDB;
6、賦予權限
grant connect,resource to hc_notify;grant unlimited tablespace to hc_notify;grant create databa link to hc_notify;grant lect any quence,create materialized view to hc_notify;
經過以上操作,我們就可以使用hc_notify/hc_password登錄指定的實例,創建我們自己的表了
續:
創建臨時表空間:
create temporary tablespace test_temptempfile 'F:app hinkoradataorcl est_temp01.dbf'size 32mautoextend onnext 32m maxsize 2048mextent management local;
創建表空間:
create tablespace test_dataloggingdatafile 'F:app hinkoradataorcl est_data01.dbf'size 32mautoextend onnext 32m maxsize 2048mextent management local;
創建用戶:
create ur jack identified by jackdefault tablespace test_datatemporary tablespace test_temp;
為用戶賦予權限:
GRANT create any table TO jack;GRANT resource,dba TO jack;GRANT lect any table TO jack;
第一個是授予所有table有create權限,第三是授予所有table有lect權限.
第二個就是賦予DBA的權限,這才是最重要的,其實只要第二就可以了.
1.connect role(連接角色)2. resource role(資源角色)3. dba role(數據庫管理員角色)
四:刪除用戶表空間的步驟:
Alter tablespace 表空間名稱 offline;Drop tablespace 表空間名稱;(表空間無有數據時用)
或者
drop tablespace 表空間名稱 including contents;(表空間下有數據時候用)
temporary tablespace是oracle里臨時表空間,臨時表空間主要用途是在數據庫進行排序運算、管理索引、訪問視圖等操作時提供臨時的運算空間,當運算完 成之后系統會自動清理。當oracle里需要用到sort的時候,而pga又沒有足夠大的時候,將會把數據放入臨時表空間里進行排序,同時如果有異常情況 的話,也會被放入臨時表空間,但是我們需要重建temporary tablespace,直接是不能drop默認的臨時表空間的,不過我們可以通過以下方法來做。
查看目前的temporary tablespace
SQL> lect name from v$tempfile;
整個的命令是:
create tablespace qicheloggingdatafile '/u01/oradata/orcl/qiche.dbf'size 320mautoextend onnext 32m maxsize 2048mextent management local;create ur qiche identified by qichedefault tablespace qiche;grant connect,dba to qiche;
本文發布于:2023-02-28 19:58:00,感謝您對本站的認可!
本文鏈接:http://www.newhan.cn/zhishi/a/167764664275449.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:oracle 創建數據庫(Linux oracle創建數據庫).doc
本文 PDF 下載地址:oracle 創建數據庫(Linux oracle創建數據庫).pdf
| 留言與評論(共有 0 條評論) |