Oracle的一些简单知识

 

 

Oracle 9默认密码
sys:      change_on_install
system: manager
scott:    tiger
Oracle 10则不行
Oracle命令行命令:
    启动监听服务:lsnrctl start {service} //service 有默认值,因此可以不填
创建用户:
    create user zhangsan identified by zhangsan
登录:
    zhangsan/zhangsan
授予权限:
    grant ession to zhangsan:登录权限
    grant create table to zhangsan:创建表权限,但需要使用表空间权限
    grant unlimited tablespace to zhangsan:可以无限制地使用表空间
撤销权限:
    revoke ...(同授予权限)
    
查看系统权限:
    select * from user_sys_privs
查看用户权限
    select * from user_tab_privs;
查看用户对某一列的权限
    select * from user_col_privs;
根据角色授权
    grant select on mytable to lisi
    grant all on mytable to lisi
    all: 所有权限
授予所有用户某种权限
    grant create any table to public
    public: 所有用户
设置宽度
    set linesize 400
显示当前用户:
    show user
对象权限可以控制到列
授予针对某一列的权限
    grant update(name) on mytable to lisi
    grant insert(name) on mytable to lisi
但查询和删除不能控制到列
    select drop can't be limited to a column/columns
权限的传递:通过管理员选项
    grant alter any table to lisi with grant option

 

角色:权限的集合
    create role myrole;
    grant create session to myrole;
    drop role myrole;
注意:有些系统权限无法直接赋予角色,如unlimited tablespace。
    create table    create any table
    [alter table]       alter any table
    [drop table]     drop any table
数据库的三种验证机制
    操作系统验证
    文件密码验证
    数据库系统验证
sys(sysoper, sysdba) 用户不能使用数据库验证,使用的是操作系统验证,即如果用户在Oracle组里,那么这个用户可以任意链接Oracle。
l inux下Oracle的启动过程
    lsnrctl start
    sqlplus sys/oracle as sysdba
    startup
    sqlplus scott/tiger
windows下Oracle的启动过程

    lsnrtcl start

    oradim -starup -sid orcl

 

更改Oracle sysoper&sysdba的密码
    找到Oracle的安装目录product/10.20/db_2/database,在这个目录下有个名为PWDorcl.ora的文件
    在命令行下,输入:orapwd file=E:/product/10.20/db_2/database/PWDorcl.ora password=123456 entries=10 (这里没有用户名,因为用户名就是sys用户,【不是当前操作系统用户,就是sys】)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值