ora
jshttp://www.javaeye.com/topic/474476
http://www.javaeye.com/topic/492487
javaFile:
http://louisling.javaeye.com/blog/460080
http://bestxiaok.javaeye.com/blog/462622
http://www.javaeye.com/topic/69606
oracle:
http://www.javaeye.com/topic/437409
http://bibye-domain.javaeye.com/blog/305926
http://www.javaeye.com/topic/360327
http://www.javaeye.com/topic/620306
http://www.javaeye.com/topic/548387
http://taiwei-peng.javaeye.com/blog/838005
http://jinjiabao.javaeye.com/blog/406443
SELECT trunc((1 - (bb.free_space / aa.total_space)) * 100, 2) AS used_percent
FROM (SELECT a.tablespace_name,
sum(a.bytes) AS total_space
FROM dba_data_files a
WHERE a.tablespace_name = upper('aa') || 'DB'
GROUP BY a.tablespace_name) aa,
(SELECT b.tablespace_name,
sum(b.bytes) AS free_space
FROM dba_free_space b
WHERE b.tablespace_name = upper('aa') || 'DB'
GROUP BY b.tablespace_name) bb
WHERE aa.tablespace_name = bb.tablespace_name(+)
select * from dba_data_files
select * from free_space
select * from SYS.SM$TS_AVAIL
select * from SYS.SM$TS_USED
select * from SYS.SM$TS_FREE
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
select
total.tablespace_name,
round(total.MB,2) as Total_MB,
round(total.MB-free.MB, 2) as Used_MB,
round((1-free.MB/total.MB)*100, 2) as Used_Pct
from
(select tablespace_name, sum(bytes)/1024/1024 as MB from dba_free_space group by tablespace_name) free,
(select tablespace_name, sum(bytes)/1024/1024 as MB from dba_data_files group by tablespace_name) total
where
free.tablespace_name=total.tablespace_name
--select tablespace_name, sum(bytes) as MB from dba_free_space group by tablespace_name
is same to select * from SYS.SM$TS_FREE
--select tablespace_name, sum(bytes) as MB from dba_data_files group by tablespace_name is same to
select * from SYS.SM$TS_AVAIL
--but
SYS.SM$TS_FREE:206,438,400
SYS.SM$TS_AVAIL:209,715,200
SYS.SM$TS_USED:3,407,872
SYS.SM$TS_AVAIL-SYS.SM$TS_FREE=3,276,800 but in use 3,407,872
select 209715200-206438400 from dual//3,276,800
--------------------编程问答-------------------- http://shenhaocric.iteye.com/blog/649216
http://blog.csdn.net/jillcomputer/article/details/5405049;
http://blog.csdn.net/paulhuiwu/article/details/4252655;http://blog.csdn.net/xuefuhe/article/details/6675982
oracle 默认导出路径:F:\Documents and Settings\lKF45999.china
e:/testSqlplus/sqlplus SYSTEM/abcordb@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.78.195.196)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=abc))) <e:/testSqlplus/test.sql >e:/testSqlplus/test.log;
sqlplus system/abcordb@10.78.195.196:1521/abc @E:\aa\test1.sql
exp system/abcordb@10.78.195.196:1521/abc file=e:\orcl20110919.dmp full=y
E:\app\lKF45999\product\10.2.0\client_1\BIN\exp system/ddd@10.78.195.61:1521/orcl file=e:\orcl20110919.dmp full=y
exp system/ddd@10.78.195.61:1521/orcl file=e:\orcl20110919.dmp full=y
ORA-00904: "MAXSIZE": 标识符无效:
x86_64bit的Oracle导出x86bit的Oracle会报此错,11gR1,11gR2导出10g的Oracle也会报此错,只有满足10g的x86bit客户端导出10g的x86bit的Oracle Database才能正常导出;
版本问题,在虚拟机上重新导,什么问题都没有... --------------------编程问答-------------------- 让切换目录更方便: pushd,popd,dirs,cd -
http://qiuye.iteye.com/blog/505615 --------------------编程问答-------------------- (11) 用Where子句替换HAVING子句:
避免使用HAVING子句, HAVING 只会在检索出所有记录之后才对结果集进行过滤. 这个处理需要排序,总计等操作. 假如能通过WHERE子句限制记录的数目,那就能减少这方面的开销. (非oracle中)on、where、having这三个都可以加条件的子句中,on是最先执行,where次之,having最后,因为on是先把不符合条件的记录过滤后才进行统计,它就可以减少中间运算要处理的数据,按理说应该速度是最快的,where也应该比having快点的,因为它过滤数据后才进行sum,在两个表联接时才用on的,所以在一个表的时候,就剩下where跟having比较了。在这单表查询统计的情况下,假如要过滤的条件没有涉及到要计算字段,那它们的结果是一样的,只是where可以使用rushmore技术,而having就不能,在速度上后者要慢假如要涉及到计算的字段,就表示在没计算之前,这个字段的值是不确定的,根据上篇写的工作流程,where的作用时间是在计算之前就完成的,而having就是在计算后才起作用的,所以在这种情况下,两者的结果会不同。在多表联接查询时,on比where更早起作用。系统首先根据各个表之间的联接条件,把多个表合成一个临时表后,再由where进行过滤,然后再计算,计算完后再由having进行过滤。由此可见,要想过滤条件起到正确的作用,首先要明白这个条件应该在什么时候起作用,然后再决定放在那里
(12) 减少对表的查询:
在含有子查询的SQL语句中,要非凡注重减少对表的查询.例子:
SELECT TAB_NAME FROM TABLES WHERE (TAB_NAME,DB_VER) = ( SELECT
TAB_NAME,DB_VER FROM TAB_COLUMNS WHERE VERSION = 604)
(13) 通过内部函数提高SQL效率.:
复杂的SQL往往牺牲了执行效率. 能够把握上面的运用函数解决问题的方法在实际工作中是非常有意义的
(14) 使用表的别名(Alias):
补充:Java , 非技术区