(1.)授予权限语法以下: Grant 权限|角色 to 用户名; 示例:用户martin授予connect和resource两个角色 Grant connect,resource to martin (2.)撤销权限语法以下: Revoke 权限|角色 from 用户名; 撤销两个角色 Revoke connect,resource from martin; (3.)容许用户查看emp表中的记录 Grant select on scott.emp to martin; (4.)容许用户更新emp中的记录 Grant update on scott.emp to martin; 依次类推,删除和查询数据库
(1.)示例:建立序列,从序号10开始,每次增长1,最大为2000,不循环,在增长会报错,缓存30个序列号。 Create sequence seq1 Start with 10 Increment by 1 Maxvalue 2000 Nocycle 10 Cache 30; (2.)更改序列 Alter sequence [schema.] sequence_name [increment by integer] [maxvalue integer|momaxvalue] [minvalue integer|nominvalue] [cycle|nocycle] [cache integer|nocache]; (3.)删除序列:删除seq1 Drop sequence seq1; (4.)使用序列 Select sys_guid() from dual;缓存
私有同义词,和共有同义词 建立私有同义词: Create sysnonym 同义词名 for 对象名称 建立同义词:sy_emp Create synonym sy_emp for a_hr.emp 建立共有同义词: Crate public synonym 名称 for 对象; Create public synonym public_sy_emp for emp; 删除同义词: 删除私有同义词 Drop synonym 须要删除的名称; 删除共有同义词: Drop public sysnonym 须要删除的名称安全
(1.)索引分类表 物理分类 逻辑分类 分区或非分区索引 单例或组合索引 B树索引(标准索引) 惟一或非惟一索引 正常或反向建索引 基于函数索引 位图索引 (2.)建立普通索引 Crate index 索引名称 on 索引表名 多索引名称 索引空间 (3.)示例:在salgrade表中,为级别编号grade列建立惟一索引, Create unique index index_unique_grade on salgrade(grade); (4.)反向索引示例 在emp表中编号为empno列建反向索引 Create index index_reverse_empno on emp (empno) reverse; (5.)位图索引优势: 对于大批及时查询,能够减小响应时间 相比其余索引技术,占用空间比较少 即便配置低,也能得到显著的性别 (6.)删除索引: Drop index 索引名; (7.)重建索引 Alter index 索引名 rebuild noreverse;oracle
(1.)优势 改善表的查询性能 表更容易管理 便于备份和恢复 提升数据安全性 (符合如下条件能够建成区分表1.数据量大于2G,数据的划分明显) (2.)分区表的分类 范围分区,列表分区,散列分区,复合分区,间隔分区(优势:分区划分清楚,明细),虚拟化分区。 (3.)建立间隔分区语法: Alter table 分区表名称 add partition 分区名 ralue less than (maxrelue);less