由于wine 1.3使用了winepath代替wineprefixcreate,所以安裝ies4linux的時候,會提示wine版本太舊,wineprefixcreate有誤。可以通過修改ies4linux 2.99.0.1/lib的functions.sh、install.sh來簡單解決ie6的安裝問題。
在install.sh 426行左右
subsection $MSG_CREATING_PREFIX
set_wine_prefix "$BASEDIR/ie1/"
wineprefixcreate &> /dev/null
clean_tmp
改為:
subsection $MSG_CREATING_PREFIX
set_wine_prefix "$BASEDIR/ie1/"
winepath &> /dev/null
clean_tmp
在functions.sh 242行左右
function create_wine_prefix {
if which wineprefixcreate &> /dev/null; then
( wineprefixcreate 2>&1 ) | debugPipe
else
error $MSG_ERROR_NO_WINEPREFIXCREATE
fi
}
改為:
function create_wine_prefix {
if which winepath &> /dev/null; then
( winepath 2>&1 ) | debugPipe
else
error $MSG_ERROR_NO_WINEPREFIXCREATE
fi
}
保存后重新運(yùn)行./ies4linux安裝即可。
PS:因為沒有需要,所以我安裝的時候沒有安裝flash player。
(摘自Ubuntu中文論壇 作者:孫高勇)
http://wiki.ubuntu.org.cn/%E9%A6%96%E9%A1%B5/%E6%95%B0%E6%8D%AE%E5%BA%93%E6%9C%8D%E5%8A%A1/Oracle%E6%9C%8D%E5%8A%A1%E4%B9%8B%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97
本文是在 ununtu linux 下 Oracle10g 的安裝筆記。我假設(shè)您已經(jīng)成功的安裝并配置了Ubuntu
Linux。并且安裝好了 gcc, make, binutils, lesstif2, libc6, and rpm libaio1 awk
rpm j2re 的運(yùn)行環(huán)境,可通過 apt-get install 完成安裝(ununtu 和 debian 的這種安裝方式蠻方便的)。
- 創(chuàng)建用戶和組
oracle 安裝需要兩個 unix 用戶組和一個運(yùn)行時的 oracle 用戶。
#sudo addgroup oinstall
$sudo addgroup dba
$sudo addgroup nobody
$sudo useradd -m -s /bin/bash oracle
# 設(shè)置oracle用戶密碼
$sudo passwd oracle
$sudo gpasswd -a oracle oinstall
$sudo gpasswd -a oracle dba
$usermod -g nobody nobody
- 創(chuàng)建目錄
有很多文檔,建議您將 oracle
安裝到一個獨(dú)立的分區(qū)上面。比如:/opt。請您根據(jù)您的需要選擇合適自己的安裝目錄。在本文檔中,我們假設(shè) Oracle
的安裝目錄為/opt/ora10。確保有至少 3.0G 的可用空間。
#mkdir -p /opt/ora10
#chown -R oracle:oinstall /opt/ora*
#chmod -R 775 /opt/ora*
您生成了 oracle 的運(yùn)行時路徑,并且授寫權(quán)限給 oracle 用戶,執(zhí)行權(quán)限給 dba 組。
- 設(shè)置內(nèi)核參數(shù)
- 修改 sysctl.conf
添加如下的行到/etc/sysctl.conf 中:
# 這個最大內(nèi)存要實(shí)現(xiàn)情況給,底下是給了3000M
kernel.shmmax = 3147483648
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
注:shmmax(最大共享內(nèi)存)是一個很重要參數(shù),根據(jù)您的機(jī)器的內(nèi)存來設(shè)定。如果您設(shè)置不合適的
話,在創(chuàng)建數(shù)據(jù)庫到約 86%的時候就會掛掉。祝您好運(yùn)。_
-
- 修改 limits.conf
添加下面的行到/etc/security/limits.conf 以修改你的資源限制:
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
-
- 讓修改生效
修改了以上文件后,您必須讓其生效,您重啟系統(tǒng),或者切換到 root 用戶下用以下的方式改變內(nèi)核運(yùn)行參數(shù):
#sysctl -p
#ln -s /usr/bin/awk /bin/awk
#ln -s /usr/bin/rpm /bin/rpm
#ln -s /usr/bin/basename /bin/basename
- 設(shè)置 Oracle 用戶環(huán)境
以 oracle 用戶登錄:
~$su oracle
修改~/.bash_profile (也有可能是.profile)文件,去掉下列三行的注釋符,使.bashrc 文件生效:
#if [ -f ~/.bashrc ]; then
# . ~/.bashrc
#fi
ununtu 默認(rèn)是沒有注釋的,debian 用戶需要取消掉這個。
添加下列行到~/.bashrc:
# oracle 10g
export ORACLE_BASE=/opt/ora10
export ORACLE_HOME=/opt/ora10
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=compiere
export ORACLE_TERM=xterm
# Edit paths
export LD_LIBRARY_PATH=/usr/lib:/lib/:$LD_LIBRARY_PATH:/opt/ora10/lib:/opt/ora10/lib/stubs/
export PATH=/opt/ora10/bin:$PATH
我是將上面的內(nèi)容保存到另一個文件中,.bash_oracle,然后在.bashrc 中使用 source.bash_oracle 進(jìn)行調(diào)用
的。您可以根據(jù)您的好惡進(jìn)行設(shè)置。您需要注意的是,ORACLE_BASE 和ORACLE_HOME 的設(shè)置一定得和您在前面創(chuàng)建的目錄相符。
ORACLE_SID 是默認(rèn)數(shù)據(jù)庫的名稱,在本文檔中,我們假設(shè)默認(rèn)的數(shù)據(jù)庫名叫 compiere,如果您想用其他的名字,請您作相應(yīng)的修改。
- 執(zhí)行安裝
- 交換分區(qū)的調(diào)整
以 oracle 用戶啟動 X,進(jìn)行安裝。
差點(diǎn)忘了,為了安裝 Oracle 10g,oracle 推薦至少 512M 內(nèi)存和至少 400M
交換空間。內(nèi)存,好象不夠關(guān)系也不大,但是交換分區(qū)呢,您還是大方一點(diǎn)吧。如果您的交換分區(qū)不夠 400M,那么您還是先看看這一步吧。
重設(shè)交換分區(qū)可以使用如下操作:
shell# dd if=/dev/zero of=tmp_swap bs=1k count=900000
shell# chmod 600 tmp_swap
shell# mkswap tmp_swap
shell# swapon tmp_swap
完成安裝以后,可以釋放這個空間:
shell# swapoff tmp_swap
shell# rm tmp_swap
count 值是根據(jù)您需要調(diào)整的交換分區(qū)大小而定。
-
- 安裝前的準(zhǔn)備
終于可以安裝了。我們假設(shè)下載的安裝文件位于/home/sungaoyong/oracle 下,名稱為
10201_database_linux32.zip 解壓后。 創(chuàng)建一個文件 /etc/redhat-release:添加如下內(nèi)容。
Red Hat Linux release 3.1 (drupal)
安裝了的話, 這一步是也沒有必要。
oracle 將會把系統(tǒng)認(rèn)為是 redhat 3 了:)
- java 中文的顯示
進(jìn)入 java 的安裝路徑
$ cd /usr/lib/j2se/1.4/lib
$ sudo cp font.properties.zh_CN_UTF8.Sun font.properties
將最下面的一行改為如下:
filename.-misc-fzsongti-medium-r-normal--*-%d-*-*-p-*-iso10646- 1=/usr/share/fonts/VeraSansYuanTi/VeraSansYuanTi-Regular.ttf
appendedfontpath=/usr/share/fonts/VeraSansYuanTi
java 就支持中文顯示了。以上這步,在java6中是無效的,因為java6的字體配置不是這樣子的.
-
- 運(yùn)行 Installer
進(jìn)入 oracle 數(shù)據(jù)庫解壓的目錄
./runInstaller -jreLoc /usr/lib/j2se/1.4/jre
指定 jre 的目的就是始安裝界面可以顯示中文,否則安裝界面的中文都是小框框,不信試試,嘿嘿!接下的一般選擇默認(rèn)設(shè)置就可以了。
以上這步,如果你安裝的是java6,那么還是請你用
export LANG=en_CN
比較好, 直接使用英文環(huán)境來安裝,
因為在安裝界面用上面所說的方法,確實(shí)是中文了,但到后面的數(shù)據(jù)庫配置界面,又會重新變回小方塊。所以還是推薦大家直接用英文環(huán)境來安裝吧。
$ sqlplus " scott/tiger as sysdba"
將出現(xiàn)如下連接數(shù)據(jù)庫信息:
SQL*Plus: Release 10.1.0.2.0 - Production on 星期三 3 月 24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
連接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明登錄數(shù)據(jù)庫系統(tǒng)成功,運(yùn)行 startup 命令啟動數(shù)據(jù)庫。
SQL> startup
ORACLE instance started.
Total System Global Area 336356520 bytes
Fixed Size 279720 bytes
Variable Size 268435456 bytes
Database Buffers 67108864 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
SQL>
表示數(shù)據(jù)庫正常啟動。
-
- 關(guān)閉 Oracle10g 數(shù)據(jù)庫
$ sqlplus "scott/tiger as sysdba" //以 sysdba 用戶登錄數(shù)據(jù)庫
成功登錄數(shù)據(jù)庫系統(tǒng)后,運(yùn)行 shudown 命令關(guān)閉數(shù)據(jù)庫。
SQL> shutdown
-
- 啟動 Oracle10g 監(jiān)聽程序
Oracle 的監(jiān)聽程序主要是為客戶端的連接提供接口,在控制臺窗口鍵入如下命令:
$ lsnrctl
將出現(xiàn)如下監(jiān)聽程序信息:
LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 24-3 月 -2004 16:59:51
Copyright (c) 1991, 2004, Oracle. All rights reserved.
歡迎來到 LSNRCTL, 請鍵入"help"以獲得信息。
LSNRCTL>
表明登錄監(jiān)聽程序控制臺成功,運(yùn)行 start 命令啟動監(jiān)聽程序。
LSNRCTL> start
將出現(xiàn)監(jiān)聽程序的一系列啟動和配置情況信息列表。信息行的最后一行是“The command completed
successfully”字樣時,監(jiān)聽程序啟動成功。
-
- 關(guān)閉 Oracle10g 監(jiān)聽程序
運(yùn)行 stop 命令關(guān)閉監(jiān)聽程序。
LSNRCTL> stop
- 創(chuàng)建自啟動腳本
創(chuàng)建 oracledb 腳本到/etc/init.d/oracledb,內(nèi)容如下
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_HOME=/opt/ora10
export ORACLE_SID=compiere
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
su $ORA_OWNR -c $ORACLE_HOME/bin/emctl start dbconsole
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
su $ORA_OWNR -c $ORACLE_HOME/bin/emctl stop dbconsole
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
***)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
設(shè)置權(quán)限,放到啟動腳本中去
#chmod 755 /etc/init.d/oracledb
#update-rc.d oracledb defaults 99
#emctl start dbconsole
訪問數(shù)據(jù)庫控制器http://localhost.localdomain:1158/em/ 要提供 sys/passwd
as sysdba; 你要從一個客戶端瀏覽器訪問 em 數(shù)據(jù)庫控制器,必須要運(yùn)行 dbconsole 進(jìn)程.安裝之后,dbconsole
進(jìn)程是自動會啟動的.然后,如果這個集成沒有啟動,你可以向下面的命令行手工的啟動它:
#cd $ORACLE_HOME/bin
#emctl start dbconsole
這樣你就可以打開 web 瀏覽器,輸入下面的 http://hostnameortnumber/em
來訪問 em db control. host 那么是你的計算機(jī)的名字或地址.portnumber 是 em db control http
的端口號,這是在安裝的時候指定的.默認(rèn)的是 1158 ,你可以在$ORACLE_HOME/install/portlist.ini
文件中找到這個值.
如果實(shí)例啟動了,EM 就會顯示 db control 登錄頁.你必須使用授權(quán)訪問 db control 的用戶登錄到數(shù)據(jù)庫.一開始是 sys
用戶,使用在安裝的時候你確定的 sys 用戶的密碼.從 connect as 下拉框選 sysdba,然后點(diǎn)登錄.這樣就會出現(xiàn)
dbcontrol 的主頁.這是同 Oracle 9i 的不同的。其它的大家共同學(xué)習(xí)吧!
ibatis操作oracle數(shù)據(jù)庫時,如果出現(xiàn)空值,ibatis不是插入NULL,而是出現(xiàn)異常,異常信息大致如下:
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in [someSqlMapFile.xml].
--- The error occurred while applying a parameter map.
--- Check the insertUser-InlineParameterMap.
--- Check the parameter mapping for the '[someProperty]' property.
--- Cause: java.sql.SQLException: 無效的列類型
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:59)
如果你先插入空值,必須告訴IBatis當(dāng)該字段出現(xiàn)NULL值該用什么值來替代,方法有2種,如下:
方法一(parameterClass):
1 INSERT INTO TEST(ID, NAME, PASSWD) VALUES (#id#,#name#, #passwd:VARCHAR:NULL#)
支持的類型在 java.sql.Types 中列示出來了
注意:DATA 類型默認(rèn)不能為NULL
方法二(parameterMap):
使用這個方法時,首先應(yīng)保證你的Oracle jdbc driver是10G以上版本,不然也是白搭。
1 <parameterMap id="insert-person-paraMap" class="com.unmi.Person" >
2 <parameter property="id"/>
3 <parameter property="name"/>
4 <parameter property="passwd" jdbcType="VARCHAR"/>
5 </parameterMap>
6
7 <!-- 插入一條Person對應(yīng)的記錄到數(shù)據(jù)庫中 -->
8 <insert id="insertPerson" parameterMap="insert-person-paraMap">
9 INSERT INTO PERSON (ID, NAME, PASSWD) VALUES (?,?,?)
10 </insert>
11
參考:http://www.tkk7.com/fatbear/archive/2007/06/07/122607.html iBatis 應(yīng)用程序向 Oralce 數(shù)據(jù)表字段插入 NULL 值 作者:肥熊熊