truncate table 会不会释放datafile的空间?如何才能释放?

下面我将做一这一实验来证明 oracle 10g r2 system@ORCL> create tablespace anbob datafile ‘/u01/app/oracle/oradata/ORCL/datafile/anbob.dbf’ size 40m; Tablespace created. anbob@ORCL> create table testspace as select * from all_objects; Table created. anbob@ORCL> select segment_name,tablespace_name from user_segments where segment_name=’TESTSPACE’; SEGMENT_NAME TABLESPACE_NAME ——————– ——————– TESTSPACE TT anbob@ORCL> select count(*) from testspace; COUNT(*) ———- 40770 anbob@ORCL> insert into testspace select * from testspace; 40770 … Read more

如何看待sql执行计划里的cost

cost 内部记算方法oracle也不会公开,oracle内部用来比较各个执行计划所耗费的代价的值,从而使优化器可以选择最好的执行计划。不同语句的cost值不具有可比性,只能对同一个语句的不同执行计划的cost值进行比较。