阻止使用者(除SA使用者)刪除資料庫表

2021-05-26 02:11:58 字數 656 閱讀 2711

/****** 物件:  ddltrigger [tr_safety_table]    指令碼日期: 06/07/2011 14:20:06 ******/

set ansi_nulls on

goset quoted_identifier on

go-- author: <,>

-- create date: <2010-04-03>

-- description: 《除了sa使用者,禁止其他資料庫使用者 alter table 和drop table的許可權》

create trigger [tr_safety_table]  

on database  

for drop_table, alter_table

as  

if( ( suser_sname() <>'sa' )and (suser_sname() <>'登入使用者名稱') )

begin

print '你無drop table 和 alter table 的許可權!'  

rollback

endgo

set ansi_nulls off

goset quoted_identifier off

goenable trigger [tr_safety_table] on database

刪除資料庫使用者

usr bin ksh 1 upload the shell command to the server 2 grant the 777 to the command 3 use method like as follow dropuser.sh username the username as t...

轉刪除資料庫使用者時占用

ora 01940 無法刪除當前已鏈結的使用者 1 檢視使用者的連線狀況 select username,sid,serial from v session 如下結果 username sid serial netbnew 513 22974 netbnew 514 18183 netbnew 51...

oracle11g刪除資料庫使用者刪除及表空間刪除

以system使用者登入,查詢需要刪除的使用者 查詢使用者 select from dba users 查詢工作空間的路徑 select from dba data files 刪除使用者 drop user 使用者名稱 cascade 刪除表空間 drop tablespace 表空間名稱 inc...