【转】oracle 权限管理相关命令
一、系统的默认用户
Java代码
sys;//系统管理员,拥有最高权限
system;//本地管理员,次高权限
scott;//普通用户,密码默认为tiger,默认未解锁
二、登陆
Java代码
sqlplus conn / as sysdba;//登陆sys帐户
sqlplus sys as sysdba;//同上
sqlplus scott/tiger;//登陆普通用户scott
三、管理用户
Java代码
create user zhangsan;//在管理员帐户下,创建用户zhangsan
alert user scott identified by tiger;//修改密码
四,授予权限
1、默认的普通用户scott默认未解锁,不能进行那个使用,新建的用户也没有任何权限,必须授予权限
Java代码
/*管理员授权*/
grant create session to zhangsan;//授予zhangsan用户创建session的权限,即登陆权限
grant unlimited session to zhangsan;//授予zhangsan用户使用表空间的权限
grant create table to zhangsan;//授予创建表的权限
grant drop table to zhangsan;//授予删除表的权限
grant insert table to zhangsan;//插入表的权限
grant update table to zhangsan;//修改表的权限
grant all to public;//这条比较重要,授予所有权限(all)给所有用户(public)
2、oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的,需要互相授权
Java代码
/*oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的*/
grant select on tablename to zhangsan;//授予zhangsan用户查看指定表的权限
grant drop on tablename to zhangsan;//授予删除表的权限
grant insert on tablename to zhangsan;//授予插入的权限
grant update on tablename to zhangsan;//授予修改表的权限
grant insert(id) on tablename to zhangsan;
g
相关文档:
oracle10g创建用户
Oracle10g 的创建用户名
1、 linux 下 oracle 的启动
以 oracle 身份登录
启动 lsnrctl start
登录 sqplus /nolog
连接数据库 connect /as sysdba
启动数据库 startup
关闭数据库 s ......
在ORACLE中给表、列增加注释以及读取注释
1、给表填加注释:SQL>comment on table 表名 is '表注释";
2、给列加注释:SQL>comment on column 表.列 is '列注释';
3、读取表注释:SQL>select * from user_tab_comments where comments is not null;
4、读取列注释:SQL>select * from user_col_commnents wh ......
先构造一个表:
create table emp2(
id number(2),
name varchar(10),
currdate date,
action varchar2(1)
)
创建触发器:
create or replace trigger d_i_u_emp2
after insert or update or delete on mysort
begin
if inserting then
insert into emp2 values (12,'dog',sysdate,'i');
elsif deleting then ......
如果web方式的em,isqlplus访问不了。
1. 检查主机名/IP、端口是否正确
安装时的主机名/IP、端口记录在$ORACLE_HOME/install/portlist.ini 文件中。
缺省是:
一般用户 http://ip:5560/isqlplus
DBA用户 &nb ......