Archive for the Category “计算机 ”

Installing Oracle 11g R2 on Ubuntu 10.04 64bit

这个恶心了我好几天的问题今天在一个神贴的帮助下终于搞定了,还没有测试连接,但是EM已经连接上去了,估计剩下的如果有也应该就只是配置问题了。为了避免以后该神贴失效,还是在自己的地盘上也简单做一下备份吧。原帖地址:http://forums.oracle.com/forums/thread.jspa?threadID=1115155&tstart=0

This is a of follow-up of my previous post: Installing Oracle 11g R2 on Ubuntu 10.04 (solved)
http://forums.oracle.com/forums/thread.jspa?threadID=1077139

Revisited and re-verified.

Installing Oracle 11gR2 11.2.0.1 x86_64-bit in Ubuntu Linux 10.04 Intel x86_64-bit.
(Please see the previous thread regarding feedback for 32-bit installations)

Note: You may want to review the Tips at the end prior to installing Oracle
Oracle Installation:

1. Oracle Software Prerequisites

Gain root access:
sudo su -

Install required packages
apt-get install build-essential
apt-get install libaio1
apt-get install libaio-dev
apt-get install unixODBC
apt-get install unixODBC-dev
apt-get install pdksh
apt-get install expat
apt-get install sysstat
apt-get install libelf-dev
apt-get install elfutils
apt-get install lsb-cxx

To avoid error “linking ctx/lib/ins_ctx.mk…”:
cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb
dpkg-deb -x libstdc++5_3.3.6-17ubuntu1_amd64.deb ia64-libs
cp ia64-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib64/
cd /usr/lib64/
ln -s libstdc++.so.5.0.7 libstdc++.so.5

cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/i/ia32-libs/ia32-libs_2.7ubuntu6.1_amd64.deb
dpkg-deb -x ia32-libs_2.7ubuntu6.1_amd64.deb ia32-libs
cp ia32-libs/usr/lib32/libstdc++.so.5.0.7 /usr/lib32/
cd /usr/lib32
ln -s libstdc++.so.5.0.7 libstdc++.so.5

cd /tmp
rm *.deb
rm -r ia64-libs
rm -r ia32-libs

To avoid error invoking target ‘idg4odbc’ of makefile:
ln -s /usr/bin/basename /bin/basename

To avoid errors when executing the post-install root.sh script:
ln -s /usr/bin/awk /bin/awk
2. Kernel Parameters

Gain root access:
sudo su -

Make a backup of the original file:
cp /etc/sysctl.conf /etc/sysctl.original

Modify the kernel parameter file
echo “#”>> /etc/sysctl.conf
echo “# Oracle 11gR2 entries”>> /etc/sysctl.conf
echo “fs.aio-max-nr=1048576″ >> /etc/sysctl.conf
echo “fs.file-max=6815744″ >> /etc/sysctl.conf
echo “kernel.shmall=2097152″ >> /etc/sysctl.conf
echo “kernel.shmmni=4096″ >> /etc/sysctl.conf
echo “kernel.sem=250 32000 100 128″ >> /etc/sysctl.conf
echo “net.ipv4.ip_local_port_range=9000 65500″ >> /etc/sysctl.conf
echo “net.core.rmem_default=262144″ >> /etc/sysctl.conf
echo “net.core.rmem_max=4194304″ >> /etc/sysctl.conf
echo “net.core.wmem_default=262144″ >> /etc/sysctl.conf
echo “net.core.wmem_max=1048586″ >> /etc/sysctl.conf
echo “kernel.shmmax=2147483648″ >> /etc/sysctl.conf

Note: kernel.shmmax = max possible value, e.g. size of physical memory in bytes

Load new kernel parameters
sysctl -p
3. Oracle Groups and Accounts

Gain root access:
sudo su -

groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba oracle
usermod -s /bin/bash oracle

passwd oracle

groupadd nobody
usermod -g nobody nobody

id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)

Make a backup of the original file:
cp /etc/security/limits.conf /etc/security/limits.conf.original

echo “#Oracle 11gR2 shell limits:”>>/etc/security/limits.conf
echo “oracle soft nproc 2048″>>/etc/security/limits.conf
echo “oracle hard nproc 16384″>>/etc/security/limits.conf
echo “oracle soft nofile 1024″>>/etc/security/limits.conf
echo “oracle hard nofile 65536″>>/etc/security/limits.conf
4. Oracle Directories

Using /u01/app for Oracle software and /u02/oradata for database files

mkdir -p /u01/app/oracle
mkdir -p /u01/app/oraInventory
mkdir -p /u02/oradata

chown oracle:oinstall /u01/app/oracle
chown oracle:oinstall /u01/app/oraInventory
chown oracle:oinstall /u02/oradata

chmod 750 /u01/app/oracle
chmod 750 /u01/app/oraInventory
chmod 750 /u02/oradata
5. Oracle Universal Installer

Login as the Oracle user – do not use ‘su’
ssh -Y oracle@server_address

See Tips below for mounting the Oracle installation source
/path_to_installer/runInstaller

Note: Select the “Ignore All” button at the Prerequisite Checks dialog.
Tips:

Fix backspace and arrow keys in the vi-editor:
sudo apt-get install vim

Allow the Oracle user to gain root access:
Edit /etc/sudoers and add the following:
# Members of the oinstall group may gain root privileges
%oinstall ALL=(ALL) ALL

Enable remote SSH connectivity:
sudo apt-get install ssh
Note: New accounts requires a password: passwd oracle

Connect from a X-Windows enabled terminal with trusted X11 forwarding:
ssh -Y oracle@server_address
Typing ‘xclock’ in the terminal window should display a clock on your desktop.
Note: Using ‘su’ will invalidate the X11 forwarding environment.

Mount an iso disk image:
mount -o loop /u02/oradata/oracle11gR2.iso /mnt/
Note: For this to work the iso image needs to be copied to a Linux filesystem.

Avoid Oracle runInstaller “.oui: No such file” / “bad interpreter: Permission denied:
Logout your current X-session and login as user Oracle
Insert the Oracle Installation DVD

Or from a remote terminal session:
Insert the Oracle Installation DVD
sudo umount /dev/sr0
Create a new session as user Oracle
ssh -Y oracle@server_address
sudo mount /dev/sr0 /media
/media/database/runInstaller

If you see “runinstaller” instead of “runInstaller” you can try the following:
sudo mount -o loop,norock /dev/cdrom /media

Note the OUI installer fails if there are spaces in the path to runInstaller

Regards and best of luck,
Markus

Edited by: Markus Waldorf on Sep 2, 2010 7:18 PM

最悲剧的就是因为用户部分是用的安装程序的默认设置,所以神贴中间段落略过了,没有看到 Note: Select the “Ignore All” button at the Prerequisite Checks dialog. 这句话,导致我被卡在安装前两三天,啥都没干,光google怎么解决那一堆的“错误”了。

整体来讲,ubuntu上面装oracle比windows下面多费不少劲,windows下的安装程序还是相当傻瓜化的,基本一路next下来,没有遇到啥太大的挑战跟困惑。希望linux平台下面oracle能跑的稳当点,不会再有windows下运行的那么多怪问题,也不枉我这两天的忙活,嗯嗯!

Category: 计算机  2 Comments

NSTS vs DBS

这两天NHS内部有些变动,被迫追着他们的时间表改程序,有点小忙。闲散久了,突然加速忙起来多少有点不适应,胡乱感慨一下,也从一个侧面证明一下国外的月亮一点都不比国内的圆,天下有人的地方就有腐败。

事情的大概是这样的:

NHS本来是用的tracing系统是NSTS(NHS Strategic Tracing Service),因为一些冠冕堂皇的原因,该系统在出色运转了N年以后就要被一个新的系统DBS(Demographic Batch Service)所取代,交接截止日期是本月底。所谓的tracing简言之就是我们提交患者的不完整信息,经过他们数据库匹配后返还给我们完整信息的过程。DBS据说是NHS投资数M英镑搭建的新一代平台,相交其前辈NSTS有7大好处8大有点9点进步10点超越

糟糕的现状是这样的:

1) 用NSTS trace一批数据,大约1-4小时之后就能收到反馈结果;DBS系统只能在每天凌晨处理前日的请求,理由是白天高峰期处理会降低 online tracing (相当于一个网站提供的手工检索平台)的速度,影响更多人工作。NSTS 也提供同样的服务,从来没有过这种问题。

2)NSTS时代做tracing没有数量限制,DBS每天只能处理1.1M个病人的检索,这个阈值后,未处理的记录就只能再等24小时之后继续排队。

3)NSTS系统的精确度比DBS高,最近两周我们统计的结果大约是1到3个百分点的样子。

4)DBS系统有时候会有很多奇怪的错误,比如文件发送过程中连接丢失导致的文件迷失在异空间啊(队列中排在后面的文件一并蒸发),半夜他们的tracing系统启动之后突然间莫名其妙当机啊(期间所有被trace的记录返回time out错误)等等等等。而且所有这些错误统统没有任何通知或者报告,他们甚至连个system/error log都没有,所有这些只能等第二天没有收到反馈后才能知晓。

5)当出现上述任何问题,需要重新发送文件retrace的时候,如果仅仅是把原来的文件resend一次,会在第二天早上收到邮件通知(终于见到email notification了),说系统记录显示该文件曾经被trace过,请不要藐视我们系统的智商。(我们估计他们是记录了文件的digest hash,因为具体数据是显然不能改的,所以只能改文件头的meta data,比如batch id,这样做的结果是收到反馈后还要再一次手动给改回来。赶上那天是几十个文件被通讯握手时的故障阻塞掉,第二天第三天光该文件头就得一个小时)

6)NSTS的help desk接电话的是programmer,DBS的是BT(British Telecom)的Customer Service。(DBS是BT建的)跟他们讲技术故障,完全是对牛弹琴,我觉得跟个老外讲中文都没这么费劲。

7)DBS的tracing程序客户端是用JAVA写的,但是引用了两个DLL动态连接库,所以只能在windows平台运行。开发这个程序的估计是英国的90后,明显脑残。

悲惨的结局是这样的:

两个平台的交接截至日期是9月30日(下周三),如果在此之前不把所有问题解决,我们的工作效率会被拖累降低7%~19%(老板估计的,不知道她怎么算出来的=_=##),所以国庆之前我注定要继续忙碌下去。我今天一天忙下来最大的感受就是:DBS就是英国的驴霸!

A Bear Without Any History

一夜回到解放前。

自95年正式开始存档历史文件以来十四年多的所有数据共 68G 昨晚一瞬间灰飞烟灭了。

这回是完全历史清白了,因为是在做磁盘分区格式过程中发生的状况,所以文件恢复软件基本不起作用,昨晚硬盘低阶扫描了一夜,找回来的全是之前删除的文件,重要文件全在分区表重建的过程中蒸发了,形象点说,就好像分区表扯开了一道空间裂缝,然后所有东西动沉下去,全没了踪迹。

最乐观的估计,资源类损失基本可以靠网络恢复起来,文档类数据有定期备份,大约能够恢复到06年年初或者年中的水平,代码能恢复到06年底水平,无法挽回的损失大约可以被限制在近2,3年内。而且从去年下半年开始,重要档案已经基本网络化,所以对生活的影响应该不会太大。但首先这样大撒网的广泛性恢复工作极其耗时,且业已形成的存档文件归类体系被完全打破,几无还原可能;其次对于一个心底扔坚持完美主义的熊来讲,历史断档的打击是无法承受的。眼看着多年的经营被一个愚蠢的错误葬送,不甘心啊。

小猪一直在说这种事情多经历几次习惯后就好了,但我无法释怀的关键原因是,作为IT民工,在自己专业领域犯错,而且类似的错误还每隔三五年就爆发一回,实在不可原谅。也不是想不开,甚至想过这或许将成为正式迁入64位系统的契机:终于不用再去忧虑过去的什么跟什么无法被高级系统完全兼容的难题了,但心疼的更多还是资料积累的过程中的点滴,以往它们在那里或许三两年不会去查阅一次,但心里清楚想考据任何历史,随时可以回溯。如今,这种安全感没有了,那么迅速,那么彻底,心里的感受千言万语化成一句:一夜回到解放前。

最近有点霉啊,干啥啥不顺,想啥啥不来,三周前的blog因为涉及政治人物跟事件,到现在还被屏蔽在后台的草稿箱里。考虑这周末是否应该干点啥转运攒RP的好事,比如扶英国老奶奶过马路之类的?

Category: 矫情, 计算机  6 Comments