更新或刪除Oracle Table時,出現的錯誤訊息,這是因為還有其它SQL操作鎖定了Table,可以依下列步驟排除 :


1. 查詢所有正在執行的SQL操作
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time

2. 用上列的sid查詢正在執行的SQL語法
select sql_text from v$session a,v$sqltext_with_newlines b
  where DECODE(a.sql_hash_value, 0, prev_hash_value, sql_hash_value)=b.hash_value
  and a.sid=<sid> order by piece


3. 如果該執行的SQL不重要,就可以用sid,serial把它刪除
alter system kill session '<sid>,<serial>'

felixhuang 發表在 痞客邦 留言(2) 人氣()

原因是你的 MANIFEST.MF 裡的 Class-Path 參數過長,可以改寫成以下的格式:

Manifest-Version: 1.0
Main-Class: com.acer.dtp.DTP060M.DTP060MCalculation
Sealed: true
Class-Path: dt_pricing_util.jar
  lib\msutil.jar
  lib\mssqlserver.jar
  lib\msbase.jar
  lib\commons-digester-1.8.jar
  lib\commons-collections-3.2.jar
  lib\commons-logging-1.1.jar
  lib\commons-beanutils-1.7.jar
  lib\commons-dbcp-1.2.2.jar
  lib\commons-lang-2.3.jar
  lib\commons-pool-1.3.jar
  lib\commons-dbutils-1.1.jar
  lib\naming-common.jar
  lib\naming-factory.jar
  lib\naming-resources.jar
  lib\ojdbc14.jar
  lib\jdom.jar
  lib\xml-apis.jar
  lib\xercesImpl-2.9.0.jar
  lib\jxl-2.6.3.jar
  lib\mail.jar
  lib\activation.jar
  lib\log4j-1.2.15.jar


要注意每行Class-Path前,都要放兩個空白鍵,然後最後要多留一個空白行,很不聰明的設定檔,但也沒辦法,照做囉。

felixhuang 發表在 痞客邦 留言(0) 人氣()

nvl(expr1,expr2) - 檢查null,回傳參數1 or 2
ex: select nvl('a','b') from dual  ==> a
      select nvl(null,'b') from dual  ==> b

to_number(string1) - 轉換文字型態為數字(varchar to number)
ex: select to_number('234') from dual  ==> 234

to_date(string1,[foramt_mark],[nls_language]) - 轉換文字型態為日期格式(varchar to date)
ex: to_date('2009/07/09', 'yyyy/mm/dd') ==> 2009/7/9
      to_date('20090709', 'yyyymmdd') ==> 2009/7/9
      to_date('200907'),'yyyymm') ==> 2009/7/1

last_day(date1) - 日期月份的最後一天
ex: select last_day(sysdate) from dual ==> 月底,系統本月的最後一天
      select last_day(add_months(sysdate,1)) from dual ==> 下個月月底
      select last_day(sysdate)+1 from dual ==> 下個月1號

decode(條件, 條件1, 結果1, [條件2, 結果2]... [, default] ) - 條件等於條件1則傳回結果1,條件2則結果2,類似MSSQL 的 Case When應用。
ex:  select decode('C','a1','a2','b1','b2','c1') from dual ==> c1
       UPDATE UPDDATE= decode(PRICE,InputPRICE,UPDDATE,SYSDATE) ==> 我常用的語法,當輸入價格不同時,才更新Update

cast(column_name as DataType) - 變更欄位資料型態與長度
ex:  select cast('1000' as number) from dual
       select cast('abc' as varchar2(100)) from dual

instr(string1,string2) - 查詢字串位置
ex: select INSTR('aaabbbcdddeee','c') from dual ==> 7

參考來源 http://www.techonthenet.com/oracle/index.php

felixhuang 發表在 痞客邦 留言(0) 人氣()

之前重裝了Oracle clent 10g,結果因為沒有完全移除乾淨,造成一堆問題,把完整移除的方法貼上來。

    * Uninstall all Oracle components using the Oracle Universal Installer (OUI).
    * Run regedit.exe and delete the HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE key. This contains registry entires for all Oracle products.
    * Delete any references to Oracle services left behind in the following part of the registry:
      HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Ora*
      It should be pretty obvious which ones relate to Oracle.
    * Reboot your machine.
    * Delete the "C:\Oracle" directory, or whatever directory is your ORACLE_BASE.
    * Delete the "C:\Program Files\Oracle" directory.
    * Empty the contents of your "c:\temp" directory.
    * Empty your recycle bin.

felixhuang 發表在 痞客邦 留言(0) 人氣()

SQL Server 本機用 Enterprise Manager  用 工具->選項->進階,加大逾時秒數。

或是用指令

USE master
GO
EXEC sp_configure 'remote query timeout', 1200
GO
RECONFIGURE
GO

1200 代表的是秒(SQL Server預設是 600 秒,),設為0表示永不愈時。

felixhuang 發表在 痞客邦 留言(0) 人氣()