易截截图软件、单文件、免安装、纯绿色、仅160KB

【转】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


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

Oracle CASE表达式


CASE表达式可以在SQL中实现if-then-else型的逻辑,而不必使用PL/SQL。CASE的工作方式与DECODE()类似,但应该使用CASE,因为它与ANSI兼容。
CASE有两种表达式:
1. 简单CASE表达式,使用表达式确定返回值.
语法:
CASE search_expression
WHEN expression1 THEN result1
WHEN expression2 THEN ......

Oracle中NVL2 和NULLIF的用法

NULL指的是空值,或者非法值。
NVL (expr1, expr2)->expr1为NULL,返回expr2;不为NULL,返回expr1。注意两者的类型要一致
NVL2 (expr1, expr2, expr3) ->expr1不为NULL,返回expr2;为NULL,返回expr3。expr2和expr3类型不同的话,expr3会转换为expr2的类型
NULLIF (expr1, expr2) ->相等返回NULL,不等返回ex ......

Oracle 分页语句,存储过程

select * from (select t.*,rownum rn from (select * from emp) t where rownum<=10) where rn>=6;
创建分页结果集的游标
create or replace package fenyepackage as
type testcursor is ref cursor;
end fenyepackage;
创建分页存储过程
create or replace procedure fenye3(
tableName varchar2, --表名 ......

ORACLE中给表、列增加注释以及读取注释

在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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号