Oracle建立表空間和用戶方式
1、建立表空間、用戶(文檔模式)
用戶
建立:create user 用戶名 identified by "密碼";
授權(quán):grant create session to 用戶名;
grant create table to 用戶名;
grant create tablespace to 用戶名;
grant create view to 用戶名;表空間
建立表空間(一般建N個(gè)存數(shù)據(jù)的表空間和一個(gè)索引空間):
create tablespace 表空間名 datafile ' 路徑(要先建好路徑)\***.dbf ' size *M tempfile ' 路徑\***.dbf ' size *M autoextend on --自動(dòng)增長 --還有一些定義大小的命令,看需要 default storage( initial 100K, next 100k, );
例子:創(chuàng)建表空間
create tablespace DEMOSPACE datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf' size 1500M autoextend on next 5M maxsize 3000M; 刪除表空間 drop tablespace DEMOSPACE including contents and datafiles
用戶權(quán)限
授予用戶使用表空間的權(quán)限:
alter user 用戶名 quota unlimited on 表空間; 或 alter user 用戶名 quota *M on 表空間;
2、完整示例(懶人模式)
--表空間
CREATE TABLESPACE sdt
DATAFILE 'F:\tablespace\demo' size 800M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--索引表空間
CREATE TABLESPACE sdt_Index
DATAFILE 'F:\tablespace\demo' size 512M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--2.建用戶
create user demo identified by demo
default tablespace sdt;
--3.賦權(quán)
grant connect,resource to demo;
grant create any sequence to demo;
grant create any table to demo;
grant delete any table to demo;
grant insert any table to demo;
grant select any table to demo;
grant unlimited tablespace to demo;
grant execute any procedure to demo;
grant update any table to demo;
grant create any view to demo;3、數(shù)據(jù)庫導(dǎo)入、導(dǎo)出
--導(dǎo)入導(dǎo)出命令 ip導(dǎo)出方式: exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y exp demo/demo@orcl file=f:/f.dmp full=y imp demo/demo@orcl file=f:/f.dmp full=y ignore=y
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Oracle數(shù)據(jù)庫中RETURNING子句的使用
RETURNING子句允許您檢索插入、刪除或更新所修改的列的值,本文主要介紹了Oracle數(shù)據(jù)庫中RETURNING子句的使用,感興趣的可以了解一下2024-08-08
使用Oracle進(jìn)行數(shù)據(jù)庫備份與還原
這篇文章詳細(xì)介紹了使用Oracle進(jìn)行數(shù)據(jù)庫備份與還原,本文通過示例代碼講解的非常詳細(xì),有一定的參考價(jià)值,感興趣的同學(xué)可以參考閱讀2023-04-04
oracle 11g數(shù)據(jù)庫安全加固注意事項(xiàng)
這篇文章主要介紹了oracle11g數(shù)據(jù)庫安全加固須謹(jǐn)慎 ,需要的朋友可以參考下2015-08-08
Oracle undo_management參數(shù)不一致錯(cuò)誤
因RAC的undo_management參數(shù)不一致導(dǎo)致Oracle數(shù)據(jù)庫mount報(bào)ORA-01105 ORA-01606錯(cuò)誤,本文就這個(gè)問題2013-11-11
Oracle刪除重復(fù)的數(shù)據(jù),Oracle數(shù)據(jù)去重復(fù)
這篇文章主要介紹了Oracle刪除重復(fù)的數(shù)據(jù),Oracle數(shù)據(jù)去重復(fù),需要的朋友可以參考下2016-08-08
Oracle 數(shù)據(jù)庫管理腳本命名規(guī)范
Oracle 數(shù)據(jù)庫管理腳本命名規(guī)范...2007-03-03
Centos下Oracle11gR2安裝教程與自動(dòng)化配置腳本的方法
這篇文章主要介紹了Centos下Oracle11gR2安裝教程與自動(dòng)化配置腳本的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-10-10
Oracle 插入超4000字節(jié)的CLOB字段的處理方法
我們可以通過創(chuàng)建單獨(dú)的OracleCommand來進(jìn)行指定的插入,即可獲得成功,這里僅介紹插入clob類型的數(shù)據(jù),blob與此類似,這里就不介紹了,下面介紹兩種辦法2009-07-07
Oracle數(shù)據(jù)庫數(shù)據(jù)遷移完整解決步驟
我們常常需要對數(shù)據(jù)進(jìn)行遷移,遷移到更性能配置更高級的主機(jī)OS上、遷移到遠(yuǎn)程的機(jī)房、遷移到不同的平臺下,這篇文章主要給大家介紹了關(guān)于Oracle數(shù)據(jù)庫數(shù)據(jù)遷移的相關(guān)資料,需要的朋友可以參考下2024-02-02

