Oracle的一些简单知识
2009-08-01 18:10
375 查看
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。
linux下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】)
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。
linux下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】)
相关文章推荐
- 关于Oracle的一些学习简单知识
- HTML介绍和一些简单的知识
- 今天开始做战斗,回合制战斗代码实现第一篇补充,从头开始,简单的2d回合制游戏一些文档方面的知识
- 【基础知识】Oracle的一些基本操作和
- 【问题】 oracle 安装 时一些简单问题
- Oracle基础知识笔记(4) 简单查询、限定查询、数据的排序
- 关于Oracle的一些基础知识以及注意事项
- C语言中函数的一些简单知识
- oracle函数的一些简单例子
- Oracle 简单知识
- Oracle 和 mysql 的一些简单命令对比参照
- oracle 一些简单的笔记
- 简单讲解一些linux的小知识吧
- 今天第一次在杭电做题,虽然做的题比较简单,出错也依旧多,花费了很长时间,不过很开心,还学到一些知识,继续努力
- 论Linux运维的一些基础安全知识和简单办法
- ORACLE 有关存储过程的一些基础知识
- 数据结构 (2)-多个章节的一些简单知识
- 一些简单知识的整理—C语言(一)
- oracle后台进程的一些知识
- 关于一些简单的存储过程知识