sql> alter table reader enable row movement;
table altered
sql> flashback table reader to timestamp to_timestamp('2018-11-23
19:00','yyyy-mm-dd:hh24:mi');
done
建立使用者
sql> create user huyao identified by huyaoyao;
user created
分配表空間
sql> alter user huyao default tablespace data166;
user altered
擁有角色
sql> grant connect, resource to huyao;
grant succeeded
新增許可權
sql> grant select,update,delete,insert on s5120165564.book to huyao;
grant succeeded
sql> grant select,update,delete,insert on s5120165564.bookdetail to huyao;
grant succeeded
sql> grant select,update,delete,insert on s5120165564.cat to huyao;
grant succeeded
sql> grant select,update,delete,insert on s5120165564.fine to huyao;
grant succeeded
sql> grant select,update,delete,insert on s5120165564.lend to huyao;
grant succeeded
sql> grant select,update,delete,insert on s5120165564.reader to huyao;
grant succeeded
檢視使用者擁有的...
直接看sql> create role huyao_role;
role created
#許可權sql> grant execute on s5120165564.bookingbook to huyao_role;
grant succeeded
sql> grant execute on s5120165564.lendbook to huyao_role;
grant succeeded
sql> grant execute on s5120165564.sendback to huyao_role;
grant succeeded
#connect許可權
sql> grant connect to huyao_role;
grant succeeded
# 使用者_oper
sql> create user huyao_oper identified by huyaoyao;
user created
sql> grant huyao_role to huyao_oper;
grant succeeded
借還書sql> call s5120165564.lendbook('20151001','2001232');
method called
sql> call s5120165564.sendback('20151001', '2001232',null);
method called
9.建立檢視
sql> create or replace view view_reader
2 as
3 select bookdetail.isbn,bookdetail.bname, bookdetail.bauther, bookdetail.bpublish, cat.cname from cat, bookdetail where cat.cid = bookdetail.cid;
view created
10建立使用者有檢視許可權
sql> create user huyao_user1 identified by huyaoyao;
user created
sql> grant select on s5120165564.view_reader to huyao_user1;
grant succeeded
11.建立鎖
sql> create profile login_hy_lock limit failed_login_attempts 3;
profile created
sql> alter user huyao_user1 profile login_lock;
user altered
12.解鎖
sql> alter user huyao_user1 account unlock;
user altered
13. 撤銷刪除
sql> revoke select on s5120165564.view_reader from huyao_user1;
revoke succeeded
資料庫許可權
物件許可權 select 對錶,同義詞,檢視資料查詢許可權 update 對錶,同義詞,檢視資料修改許可權 delete 對錶,檢視資料刪除許可權 insert 對錶,檢視資料插入許可權 execute 執行儲存過程和函式許可權 recevie 從對列中檢索訊息的許可權 view defintion...
資料庫許可權
ora 01031 許可權不足?建立使用者後,我們需要給使用者分配角色,connect角色是必需的否則,使用者都無法登陸了,其次有個地方需要注意,不要以為你給了使用者dba角色許可權就可以 為所欲為 了。雖然分配了許可權,如果後面你不給使用者分配查詢許可權,你很可能會出現下面這種情況,其實原因的想很...
資料庫(實驗2 資料庫表)
建立資料庫 建立資料庫資料檔案 create database testbase2 on name testbase2 data,filename d 張小山資料庫 lianxi2 testbase2 data.mdf size 5mb,maxsize 50mb,filegrowth 20 建立資料...