顯示具有 oracle 標籤的文章。 顯示所有文章
顯示具有 oracle 標籤的文章。 顯示所有文章

2011年8月30日 星期二

SQL*Loader基本用法

指令:
sqlldr username/password control=loader.ctl DIRECT=TRUE

loader.ctl:

load data
infile 'd:\work\mydata.csv'
append into table SPECIAL_PRODUCT
fields terminated by "," optionally enclosed by '"'         
( UUID, PROD_NO, PROD_NAME, PRICE )

mydata.csv:

"10013","Scott Tiger","1000",40
"10014","Frank Naude","500",20

參考:
http://www.orafaq.com/wiki/SQL*Loader_FAQ

EnterpriseDB對應的工具是EDB*Loader:
http://www.enterprisedb.com/docs/en/8.4/oracompat/Postgres_Plus_Advanced_Server_Oracle_Compatibility_Guide-191.htm

2010年11月25日 星期四

如何關掉Toad的呱呱聲

View –> Toad Options –> StartUp –> uncheck the option “Play Toad wave file”

2009年7月15日 星期三

修改Oracle Express的HTTP port

Oracle database express edition default http port是8080,容易與其他的web server衝到,以下指令可將其改為8087

C:\>sqlplus /nolog

SQL> connect
Enter user-name: system
Enter password: <輸入密碼>
Connected.
SQL> Exec DBMS_XDB.SETHTTPPORT(8087);

PL/SQL procedure successfully completed.

SQL>quit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production

修改後立即生效。

2009年3月13日 星期五

用 Spring 取得 Oracle Sequence 及 Hibernate 的設定

Oracle:
create sequence ORDER_SEQ
start with 1 
increment by 1 
nomaxvalue;

Spring:
使用Spring提供的org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer:
OracleSequenceMaxValueIncrementer incr = new OracleSequenceMaxValueIncrementer(dataSource, "ORDER_SEQ");
int seq = incr.nextIntValue();

Hibernate:
<id name="id" column="ID" type="java.lang.Long">
    <generator class="sequence">
        <param name="sequence">ORDER_SEQ</param>
    </generator>
</id>

2009年3月3日 星期二

How do I change the IP address on Oracle 10g

If the server's IP address changed, these are the first things I would look at:

The TNSNAMES.ORA file on the client -- does it have the IP address hardcoded? If so, change it. Does it use the machine name? If so, does the machine name resolve to the correct IP address on your client machine?

The LISTENER.ORA file on the server -- does it explicitly specify the old IP address as its listening address?