??xml version="1.0" encoding="utf-8" standalone="yes"?>
在install.sh 426行左?br />
set_wine_prefix "$BASEDIR/ie1/"
wineprefixcreate &> /dev/null
clean_tmp
改ؓQ?br />
set_wine_prefix "$BASEDIR/ie1/"
winepath &> /dev/null
clean_tmp
在functions.sh 242行左?br />
if which wineprefixcreate &> /dev/null; then
( wineprefixcreate 2>&1 ) | debugPipe
else
error $MSG_ERROR_NO_WINEPREFIXCREATE
fi
}
改ؓQ?br />
if which winepath &> /dev/null; then
( winepath 2>&1 ) | debugPipe
else
error $MSG_ERROR_NO_WINEPREFIXCREATE
fi
}
保存后重新运?/ies4linux安装卛_?br />
PSQ因为没有需要,所以我安装的时候没有安装flash player?/span>
]]>
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 的安装笔记。我假设您已l成功的安装q|了Ubuntu Linux。ƈ且安装好?gcc, make, binutils, lesstif2, libc6, and rpm libaio1 awk rpm j2re 的运行环?可通过 apt-get install 完成安装(ununtu ?debian 的这U安装方式蛮方便??/p>
#sudo addgroup oinstall
$sudo addgroup dba
$sudo addgroup nobody
$sudo useradd -m -s /bin/bash oracle
# 讄oracle用户密码
$sudo passwd oracle
$sudo gpasswd -a oracle oinstall
$sudo gpasswd -a oracle dba
$usermod -g nobody nobody
#mkdir -p /opt/ora10
#chown -R oracle:oinstall /opt/ora*
#chmod -R 775 /opt/ora*
您生成了 oracle 的运行时路径Qƈ且授写权限给 oracle 用户Q执行权限给 dba l?/p>
# q个最大内存要实现情况l,底下是给?000M
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(最大共享内?是一个很重要参数Q根据您的机器的内存来设定。如果您讄不合适的 话,在创建数据库到约 86%的时候就会挂掉。祝您好q?sup>_
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
#sysctl -p
#ln -s /usr/bin/awk /bin/awk
#ln -s /usr/bin/rpm /bin/rpm
#ln -s /usr/bin/basename /bin/basename
~$su oracle
修改~/.bash_profile Q也有可能是.profileQ文ӞL下列三行的注释符Q.bashrc 文g生效Q?/p>
#if [ -f ~/.bashrc ]; then
# . ~/.bashrc
#fi
ununtu 默认是没有注释的Qdebian 用户需要取消掉q个?br /> d下列行到~/.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
我是上面的内容保存到另一个文件中Q?bash_oracleQ然后在.bashrc 中?source.bash_oracle q行调用
的。您可以Ҏ您的好恶q行讄。您需要注意的是,ORACLE_BASE 和ORACLE_HOME 的设|一定得和您在前面创建的目录相符?
ORACLE_SID 是默认数据库的名Uͼ在本文档中,我们假设默认的数据库名叫 compiereQ如果您想用其他的名字,h作相应的修改?/p>
重设交换分区可以使用如下操作Q?br />
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
完成安装以后Q可以释放这个空_
shell# swapoff tmp_swap
shell# rm tmp_swap
count 值是Ҏ您需要调整的交换分区大小而定?/pre>
Red Hat Linux release 3.1 (drupal)
安装了的话, q一步是也没有必要?/p>
oracle 会把系l认为是 redhat 3 了:Q?/p>
$ 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 支持中文显CZ。以上这步,在java6中是无效的,因ؓjava6的字体配|不是这样子?
./runInstaller -jreLoc /usr/lib/j2se/1.4/jre
指定 jre 的目的就是始安装界面可以昄中文Q否则安装界面的中文都是框框,不信试试Q嘿嘿!接下的一般选择默认讄可以了?/p>
以上q步Q如果你安装的是java6Q那么还是请你用
export LANG=en_CN
比较好, 直接使用英文环境来安装, 因ؓ在安装界面用上面所说的ҎQ确实是中文了,但到后面的数据库配置界面Q又会重新变回小方块。所以还是推荐大家直接用英文环境来安装吧?/p>
$ sqlplus " scott/tiger as sysdba"
出现如下连接数据库信息Q?/p>
SQL*Plus: Release 10.1.0.2.0 - Production on 星期?3 ?24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
q接?
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明d数据库系l成功,q行 startup 命o启动数据库?/p>
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>
表示数据库正常启动?/p>
$ sqlplus "scott/tiger as sysdba" //?sysdba 用户d数据?/pre>成功d数据库系l后Q运?shudown 命o关闭数据库?/p>
SQL> shutdown
$ lsnrctl
出现如下监听程序信息:
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"以获得信息?br />
LSNRCTL>
表明d监听E序控制台成功,q行 start 命o启动监听E序?/p>
LSNRCTL> start
出现监听程序的一pd启动和配|情况信息列表。信息行的最后一行是“The command completed successfully”字样Ӟ监听E序启动成功?/p>
LSNRCTL> stop
#!/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
讄权限Q放到启动脚本中?/p>
#chmod 755 /etc/init.d/oracledb
#update-rc.d oracledb defaults 99
#emctl start dbconsole
讉K数据库控制器http://localhost.localdomain:1158/em/ 要提?sys/passwd as sysdba; 你要从一个客L览器访?em 数据库控制器,必须要运?dbconsole q程.安装之后,dbconsole q程是自动会启动?然后,如果q个集成没有启动,你可以向下面的命令行手工的启动它:
#cd $ORACLE_HOME/bin
#emctl start dbconsole
q样你就可以打开 web 览?输入下面?http://hostnameortnumber/em
来访?em db control. host 那么是你的计机的名字或地址.portnumber ?em db control http
的端口号,q是在安装的时候指定的.默认的是 1158 ,你可以在$ORACLE_HOME/install/portlist.ini
文g中找到这个?
如果实例启动?EM ׃昄 db control d?你必M用授权访?db control 的用L录到数据?一开始是 sys
用户,使用在安装的时候你定?sys 用户的密??connect as 下拉框?sysdba,然后点登?q样׃出现
dbcontrol 的主?q是?Oracle 9i 的不同的。其它的大家共同学习吧!
LegacyQ如果没有generatorSet属性的话,默认是Legacy。但q不推荐使用Legacy因ؓ它在生成Examplec(用于查询条gQ的时候有很多限制Q他查询条件写在sqlMap配置文g中,查询值写在Example中,q样对修改产生一些困难?/p>
Java2和Java5Q他们只支持iBATIS 2.20以上的版本。在以这个模式成生的Example文g中包含了查询条g和查询倹{这样修改就方便多了Q对于用join的select时的查询更?便了Q自己可以定义查询条Ӟ自由度高了很多(对于join的and查询可能q得自己修改一下Example代码Q。对于or和and的应用Legacy 的限制就比较大了?/p>
<javaModelGenerator>?<sqlMapGenerator>?<daoGenerator>描述了个自生成的位置?lt;daoGenerator>中type属性则用来告诉abator生成的DAO是用于iBATISq是SPRING{容器?/p>
<table>告诉abator生成那个table的sqlMap?/p>
<generatedKey>来告诉abator那些列需要自动返回|当插入的时候可以返回插入记录的主键Q这Ҏ外键的数据库极其有用Qidentity默认为falseQ则在sqlMap配置文g?lt;selectKey>的位|在sql命o前面Q所以identity应该改ؓtrue。根据数据库cd的不同sqlStatement属性取g不同?br>
ps: 如果<daoGenerator>中type属性是ibatis的话Q由于Abator生成的DAOImpl文gl承自com.ibatis.dao.client.template.SqlMapDaoTemplateQ在ibatis ver. 2.3.0.677中会有错误提C,需酌情修改?br> ps的ps: 不徏议用自动生成的ExampleL作数据,一是因为Example中生成的Ҏ有拼写SQL之嫌不符合OO思想Q二是拼写后SQL效率有待q一步考证Q没仔细看,但至看到not in语句Q如果要使用的话臛_要进行一些修攏V?^-^)个h愚见?/em>
q行Q?/strong>
右键单击配置文gQ点击Generate iBatis ArtifactsQ生成文件?/p>
参考:Abator document: http://ibatis.apache.org/docs/tools/abator/
?/font> iBATIS的Eclipse插gAbator使用Ҏ
]]>
#<!-- 初始化连?-->
dataSource.initialSize=10
#<!-- 最大空闲连?-->
dataSource.maxIdle=20
#<!-- 最空闲连?-->
dataSource.minIdle=5
#最大连接数?br />dataSource.maxActive=50
#是否在自动回收超时连接的时候打印连接的时错误
dataSource.logAbandoned=true
#是否自动回收时q接
dataSource.removeAbandoned=true
#时旉(以秒Cؓ单位)
dataSource.removeAbandonedTimeout=180
#<!-- 时{待旉以毫Uؓ单位 6000毫秒/1000{于60U?-->
dataSource.maxWait=1000
以下是我在连接控制中调用的方法:
Properties dbProps=null;
//下面的读取配|文件可以根据实际的不同修改
dbProps = ConfigProperties.getInstance().getProperties("jdbc.properties");
try {
String driveClassName = dbProps.getProperty("jdbc.driverClassName");
String url = dbProps.getProperty("jdbc.url");
String username = dbProps.getProperty("jdbc.username");
String password = dbProps.getProperty("jdbc.password");
String initialSize = dbProps.getProperty("dataSource.initialSize");
String minIdle = dbProps.getProperty("dataSource.minIdle");
String maxIdle = dbProps.getProperty("dataSource.maxIdle");
String maxWait = dbProps.getProperty("dataSource.maxWait");
String maxActive = dbProps.getProperty("dataSource.maxActive");
//是否在自动回收超时连接的时候打印连接的时错误
boolean logAbandoned = (Boolean.valueOf(dbProps.getProperty("dataSource.logAbandoned","false"))).booleanValue();
//是否自动回收时q接
boolean removeAbandoned = (Boolean.valueOf(dbProps.getProperty("dataSource.removeAbandoned","false"))).booleanValue();
//时旉(以秒Cؓ单位)
int removeAbandonedTimeout = Integer.parseInt(dbProps.getProperty("dataSource.removeAbandonedTimeout","300"));
dataSource = new BasicDataSource();
dataSource.setDriverClassName(driveClassName);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
//初始化连接数
if(initialSize!=null)
dataSource.setInitialSize(Integer.parseInt(initialSize));
//最空闲连?br /> if(minIdle!=null)
dataSource.setMinIdle(Integer.parseInt(minIdle));
//最大空闲连?br /> if(maxIdle!=null)
dataSource.setMaxIdle(Integer.parseInt(maxIdle));
//时回收旉(以毫Uؓ单位)
if(maxWait!=null)
dataSource.setMaxWait(Long.parseLong(maxWait));
//最大连接数
if(maxActive!=null){
if(!maxActive.trim().equals("0"))
dataSource.setMaxActive(Integer.parseInt(maxActive));
}
System.out.println("logAbandoned="+logAbandoned);
dataSource.setLogAbandoned(logAbandoned);
dataSource.setRemoveAbandoned(removeAbandoned);
dataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
Connection conn = dataSource.getConnection();
if(conn==null){
log("创徏q接池时,无法取得q接!查设|?!!");
}else{
conn.close();
}
System.out.println("q接池创建成?!!");
}
catch (Exception e) {
e.printStackTrace();
System.out.println("创徏q接池失?h查设|?!!");
}
有用问题或可与我联p:yy-man@163.com
2006-04-20 By: 土