初步了解oracle
1、 Oracle的创始人
2、 Oracle版本含义
3、 Oracle安装:用户种类及初始密码
在oracle10g\11g中默认scott被锁定。
4、 Oracle数据库的启动
a) 启动两个服务***Listener/***Service
b) “开始-》运行”-》sqlplus或 sqlplusw
5、 用户连接、解锁、锁定
a) conn/connect scott/tiger; system/orcl; sys/orcl as sysdba;
b) 解锁/锁定:alter user 用户名 account unlock/lock;
6、 用户的查找
a) 显示当前的用户:show user;
b) 显示系统默认的用户:select * from all_users;
7、 创建表空间
/*分为四步 */
/*第1步:创建数据表空间 */
create tablespace user_data
datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第2步:创建临时表空间 */
create temporary tablespace user_temp
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
//删除表空间
drop tablespace user_data including contents and datafiles
/*第3步:创建用户并指定表空间 */
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
8、 创建新用户
a) 创建用户密码:SQL>CREATE USER test IDENTIFIED BY test123;
b) 更改密码:SQL>ALTER USER test IDENTIFIED BY test321;
c) 给用户授系统权限:
- 授予连接数据库权限:
a) SQL> grant create session to test;
- 授予创建数据库表权限:
a) SQL> grant create table to test;
d) 给用户授对象权限:
- 授予查询表的权限
a) SQL> grant select on dept to test;
b) SQL> grant all on scott.dept to test;
e) 给用户授角色:
- SQL>grant connect,resource to test;
f) 收回权限
- SQL> revoke select on dept from test;
- SQL> revoke all on dept from test;
g) 查看权限
- 查看当前用户的权限:select * from session_privs;
- 查看系统角色的权限:select * from dba_sys_privs where grant=’RESOURCE’;
h) 删除用户
- SQL> drop user test;
- SQL> drop user test cascade;
Cascade 作用是在删除用户的同时,删除其用有的所有对象。
9、 创建角色
a) 创建语法:create role role1;
b) 删除语法:drop role role1;
c) 给角色分配权限和给用户分配一样:grant create table to role1
d) 撤销权限也一样:revoke create table from role1
10、 表
a) 查询数据库中有哪些表:select * from tab;
b) 查询某张表的结构:desc 表名;
11、代码
create tablespace user_data
datafile 'c:\oracle\oradata\orcl\user_data.dbf'
size 50m
autoextend on next 50m
maxsize 20480m
extent management local; create temporary tablespace user_temp
tempfile 'c:\oracle\oradata\orcl\user_temp.dbf'
size 50m
autoextend on next 50m
maxsize 20480m
extent management local; create temporary tablespace user_temp1
tempfile 'c:\oracle\oradata\orcl\user_temp1.dbf'
size 50m
autoextend on next 50m
maxsize 20480m
extent management local; drop tablespace user_temp1; --------------创建用户
drop user philis;
create user philis identified by philis
default tablespace user_data
temporary tablespace user_temp; create user u1 identified by u1; ---修改密码
alter user philis identified by 123;
alter user philis identified by philis;
--- 锁定和解锁账户
alter user system account lock;
alter user system account unlock; -------授权
grant create session to philis;
grant select on scott.emp to philis;
revoke create session from philis;
revoke select on scott.emp from philis; -----授予角色
grant resource,connect to philis ;
----传递权限
grant select on scott.emp to philis with grant option;
revoke select on scott.emp from philis;
最新文章
- Sublime text 3如何编辑less并转(编译)成css文件
- PCH文件
- 虚拟机安装centos 6 报错Erro processing drive
- VirtrualBox 搭建本地lamp环境
- 连接Oracle数据库的OracleHelper.cs
- PHP计算2点经纬度之间的距离
- Adobe Flash CC 2014 下载及破解
- ACM中常见错误对应表
- log4j:ERROR Category option "; 1 "; not a decimal integer.错误解决
- Jmeter_脚本参数化与内存溢出的解决方案
- windows powershell一些操作
- mipi LCD 的CLK时钟频率与显示分辨率及帧率的关系【转】
- ubuntu16.04下 sublime text输入中文
- .html() 与.text() 获取值、取值 区别
- 测试pc大、小端
- 【xsy1143】 兔子的数字 搜索
- 彻底弄懂HTTP缓存机制及原理(转载)
- 无法将“<;s:SimpleText>;”解析为组件执行
- 禁止apache显示目录索引 apache禁止列目录
- 谷歌字体(Google Font)初探 [翻译自Google官方文档]
热门文章
- php array_shift()函数 语法
- js返回上一页并刷新 代码整理
- Linux函数的使用方法
- 线段树板子1(洛谷P3372)
- wow64 32位进程中切换64位模式,取回64位寄存器值
- Redis安装启动,Redis Desktop Manager安装
- scrapy Pipeline使用twisted异步实现mysql数据插入
- Delphi XE2 之 FireMonkey 入门(17) - 特效
- 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_03 斗地主案例(单列)_1_斗地主案例的需求分析
- 抓包工具之—charles碎言碎语