Oracle索引-新建 维护 监督使用等
来源:互联网 发布:血小板计数算法 编辑:程序博客网 时间:2024/06/06 07:28
1、查询用户的索引
SQL> select index_name,table_name,tablespace_name,index_type,uniqueness,status from dba_indexes
where owner='SCOTT';
2、新建索引
SQL> create index scott.emp_ename_idex on scott.emp(job)
2 pctfree 20
3 storage(initial 100K next 100K pctincrease 0 maxextents 100)
4 tablespace lianxi_index;
Index created
SQL> select index_name,table_name,tablespace_name,index_type,uniqueness,status from dba_indexes
2 where owner='SCOTT';
INDEX_NAME TABLE_NAME TABLESPACE_NAME INDEX_TYPE UNIQUENESS STATUS
------------------------------ ------------------------------ ------------------------------ --------------------------- ---------- --------
PK_DEPT DEPT USERS NORMAL UNIQUE VALID
PK_EMP EMP USERS NORMAL UNIQUE VALID
EMP_ENAME_IDEX EMP LIANXI_INDEX NORMAL NONUNIQUE VALID
3、修改索引
SQL> alter index scott.EMP_ENAME_IDEX rebuild pctfree 25 storage(next 250K);
Index altered
4、修改索引所在的区段
SQL> alter index scott.EMP_ENAME_IDEX allocate extent;
Index altered
5、联机创建索引
alter index scott.scott.EMP_ENAME_IDEX rebuild online;
6、回收木有用的空间
alterindex scott.scott.EMP_ENAME_IDEX deallocate unused;
7、合并碎片
alterindex scott.scott.EMP_ENAME_IDEX coalesce;
================================索引使用情况进行监督========================================================================
1、开启监督语句
SQL> alter index scott.EMP_ENAME_IDEX monitoring usage;
Index altered
2、查看使用情况
SQL> select * from v$object_usage;
INDEX_NAME TABLE_NAME MONITORING USED START_MONITORING END_MONITORING
------------------------------ ------------------------------ ---------- ---- ------------------- -------------------
3、关闭监督语句
SQL> alter index scott.EMP_ENAME_IDEX nomonitoring usage;
Index altered
SQL> select index_name,table_name,tablespace_name,index_type,uniqueness,status from dba_indexes
where owner='SCOTT';
2、新建索引
SQL> create index scott.emp_ename_idex on scott.emp(job)
2 pctfree 20
3 storage(initial 100K next 100K pctincrease 0 maxextents 100)
4 tablespace lianxi_index;
Index created
SQL> select index_name,table_name,tablespace_name,index_type,uniqueness,status from dba_indexes
2 where owner='SCOTT';
INDEX_NAME TABLE_NAME TABLESPACE_NAME INDEX_TYPE UNIQUENESS STATUS
------------------------------ ------------------------------ ------------------------------ --------------------------- ---------- --------
PK_DEPT DEPT USERS NORMAL UNIQUE VALID
PK_EMP EMP USERS NORMAL UNIQUE VALID
EMP_ENAME_IDEX EMP LIANXI_INDEX NORMAL NONUNIQUE VALID
3、修改索引
SQL> alter index scott.EMP_ENAME_IDEX rebuild pctfree 25 storage(next 250K);
Index altered
4、修改索引所在的区段
SQL> alter index scott.EMP_ENAME_IDEX allocate extent;
Index altered
5、联机创建索引
alter index scott.scott.EMP_ENAME_IDEX rebuild online;
6、回收木有用的空间
alterindex scott.scott.EMP_ENAME_IDEX deallocate unused;
7、合并碎片
alterindex scott.scott.EMP_ENAME_IDEX coalesce;
================================索引使用情况进行监督========================================================================
1、开启监督语句
SQL> alter index scott.EMP_ENAME_IDEX monitoring usage;
Index altered
2、查看使用情况
SQL> select * from v$object_usage;
INDEX_NAME TABLE_NAME MONITORING USED START_MONITORING END_MONITORING
------------------------------ ------------------------------ ---------- ---- ------------------- -------------------
3、关闭监督语句
SQL> alter index scott.EMP_ENAME_IDEX nomonitoring usage;
Index altered
阅读全文
0 0
- Oracle索引-新建 维护 监督使用等
- Oracle 索引的维护
- Oracle 索引的维护
- Oracle 索引的维护
- Oracle 索引的维护
- Oracle 索引维护
- Oracle 索引的维护
- Oracle索引维护
- Oracle 索引的维护
- Oracle 索引维护
- Oracle索引的维护方法
- ORACLE索引的日常维护
- oracle索引的维护方法
- 【ORACLE RAC】维护:asm维护, srvctl、crsctl,orcconfig等指令的使用。
- oracle学习笔记---新建表、索引、空间、修改表名、列名列类型、授权等命令
- 中索引使用及维护
- oracle索引操作等
- oracle视图、索引等
- 很有用的图像数据转换工具
- iOS UITextView 光标位置
- 47种常见的浏览器兼容性问题大汇总
- 为什么普通用户没有/etc/passwd的写权限,可以修改用户密码
- 20170922--mysql--奇偶数查询
- Oracle索引-新建 维护 监督使用等
- mysql怎么在分组后排序所有字段
- mysql 链接查询
- BigDecimal的构造方法与setScale()方法解析
- 6、Spring Session-WebSocket集成
- 如何借助教学工具判断直线与圆的位置关系
- mysql 集合函数,分组查询
- 通过Scanner从控制台获取数据
- Java数组