易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle合并表的碎片

Shrink space合并表的碎片
一般表里有碎片我们都采用alter table table_name move tablespace_name,或者exp,drop table table_name,imp的2种方式10G给我们其他的方法.下面我来试一吧
用Shrink Space收缩Oracle数据段
在oracle中可以使用alter table table_name shrink space收缩表,使用shrink有两个前提条件:
  1、表必须启用row movement
  2、表段所在表空间的段空间管理(segment space management)必须为auto
实验如下:
--建立一个segment space management auto表空间
SQL> create tablespace ts_auto datafile 'd:\oracle\product\10.2.0\oradata\orcl\ts_auto.dbf' size 100m
 extent management local segment space management auto;
表空间已创建。
--建议测试表
SQL> create table  table_auto  as select * from dba_objects;
表已创建。
--查看shrink前的块数量
SQL> select blocks from dba_segments where segment_name='table_auto';
    BLOCKS                                                                    
----------                                                                    
       768                                           &nbs


相关文档:

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

linux oracle缩小回滚表空间大小undotbs01.dbf


http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
回滚表空间大小
-- 创建一个新的小空间的UNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- 设置新的表空间为系统UNDO_TABLESPACE
Alter SYSTE ......

Oracle中SQL PLUS的常用指令

进入sql*plus需要输入用户名、口令和主机标志符
system/manager
sys/change_on_intall
scott/tiger
internal/oracle
以上为初始密码
主机字符串空或者是@+你的服务名,在本地登陆不需要本地服务名。
下面就介绍一下一些常用的sql*plus命令:
首先查看当前使用的数据库实例:
select name from V$database;
切换两个 ......

oracle_百分比计算

select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%'  SCALE from order o
说明:使用sum对一定条件的数据求和后,与总数进行比较。
         ||'%' 为以的百分号形式输出结果(例:2%) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号