Oracle建立使用者、資料表空間並設定許可權

來源:互聯網
上載者:User

標籤:

代碼:

sqlplus /nologconn / as sysdba//建立帳號create user techrpt_data identified  by techrpt_data ;//建立暫存資料表空間create temporary tablespace TECHRPT_DATA_TEMPtempfile ‘D:\ORACLE\ORADATA\ORCL\TECHRPT_DATA_TEMP.dbf‘size 32mautoextend onnext 32m maxsize 2048mextent management local;//將空間分配給使用者alter user techrpt_data temporary tablespace TECHRPT_DATA_TEMP;//建立資料表空間create tablespace TECHRPT_DATA logging  datafile ‘D:\ORACLE\ORADATA\ORCL\TECHRPT_DATA.ora‘ size 50m  autoextend on  next 50m maxsize 2048m  extent management local; //將空間分配給使用者alter user techrpt_data default tablespace TECHRPT_DATA ;grant sysdba to techrpt_data;grant connect,resource to techrpt_data;grant create session to techrpt_data;grant create any sequence to techrpt_data;grant create any table to techrpt_data;grant delete any table to techrpt_data;grant insert any table to techrpt_data;grant select any table to techrpt_data;grant unlimited tablespace to techrpt_data;grant execute any procedure to techrpt_data;grant update any table to techrpt_data;grant create any view to techrpt_data;commit;quit;//刪除使用者sqlplussystem/manager@orcl as sysdbadrop user techrpt_data cascade;//用SYS登入,授權給相應的使用者,授權SQL如下: (在執行菜單裡你可以禁止統計,或在v$session,v$sesstat和v$statname 表裡獲得選擇許可權。)grant select on v_$statname to techrpt_data; grant select on v_$sesstat to techrpt_data; grant select on v_$session to techrpt_data; grant select on v_$mystat to techrpt_data; //修改密碼SET ORACLE_SID = 你的SID名稱sqlplus/nologconnect/as sysdbaalert user sys identified by sysalert user system identified by system//刪除資料表空間drop tablespace techrpt_data including contents and datafiles;

 

Oracle建立使用者、資料表空間並設定許可權

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.