oracle的权限是通过命令来授权的,如:1、创建用户 sql>create user test identified by test default tablespace users;2、授权 sql>grant connect,resource,unlimited tablespace to test;connect:连接角色,最基本的; resource:能创建基本对象的角色; unlimited tablespace:无表空间大小限制。
只有"GRANT 权限 ON TABLE TO USER "授权语句的使用 详细可以GOOGLE
当然有了 Oracle时功能相当强大的数据块系统 。 详细的查看Oracle 官方文档 。
大家看下,下面是我为MSSQLSERVER实验的时候为学生建立的创建登录帐号的事务命令!! 我想知道的是如何在ORACLE里也创建出这样功能的事务命令,执行后自动获得相应的角色和权限! declare @i int declare @temp char(7) select @i=1 while @i<=9 begin select @temp='xg0210'+cast(@i as char) //上面的xg0210是要创建的登录帐号的一部分,后面的i是序号 //如果帐号宽度不是7位要修改上面的 @temp的宽度 use northwind exec sp_dropuser @temp use pubs exec sp_dropuser @temp exec sp_dropsrvrolemember @temp,'dbcreator' exec sp_droplogin @temp exec sp_addlogin @temp,@temp,'northwind' //创建新的登录 exec sp_addsrvrolemember @temp,'dbcreator' //添加到固定服务器角色dbcreator中,创建和改变数据库 use northwind exec sp_adduser @temp,@temp //为当前数据库中的新用户添加安全帐户 use pubs exec sp_adduser @temp,@temp select @i=@i+1 end
sql>create user test identified by test default tablespace users;2、授权
sql>grant connect,resource,unlimited tablespace to test;connect:连接角色,最基本的;
resource:能创建基本对象的角色;
unlimited tablespace:无表空间大小限制。
详细可以GOOGLE
我想知道的是如何在ORACLE里也创建出这样功能的事务命令,执行后自动获得相应的角色和权限!
declare @i int
declare @temp char(7)
select @i=1
while @i<=9
begin
select @temp='xg0210'+cast(@i as char)
//上面的xg0210是要创建的登录帐号的一部分,后面的i是序号
//如果帐号宽度不是7位要修改上面的 @temp的宽度
use northwind
exec sp_dropuser @temp
use pubs
exec sp_dropuser @temp
exec sp_dropsrvrolemember @temp,'dbcreator'
exec sp_droplogin @temp
exec sp_addlogin @temp,@temp,'northwind'
//创建新的登录
exec sp_addsrvrolemember @temp,'dbcreator'
//添加到固定服务器角色dbcreator中,创建和改变数据库
use northwind
exec sp_adduser @temp,@temp
//为当前数据库中的新用户添加安全帐户
use pubs
exec sp_adduser @temp,@temp
select @i=@i+1
end