2008年10月9日星期四

Archlinux 上安装 Oracle 10g

Archlinux 上安装 Oracle 10g

环境:
Archlinux 2.6.26-ARCH
Oracle Database 10.2.01

Section I 准备工作

##### 创建oracle用户和组
sudo groupadd oinstall
sudo groupadd dba
sudo useradd -m -g oinstall -G dba oracle

id oracle
uid=1004(oracle) gid=1004(oinstall) groups=1004(oinstall),1005(dba)

#host_id
确认你的 /etc/hosts 里面有 hostname 的解析。

# 设置 oracle 帐户的口令:
passwd oracle

##### 创建目录
sudo mkdir /u01/oracle/base
sudo mkdir /u01/oracle/home
sudo chown oracle:dba /u01/oracle -fR
sudo chmod 775 /u01/oracle -fR

##### 配置环境变量

# /home/oracle/.bash_profile
export ORACLE_BASE=/u01/oracle/base
export ORACLE_HOME=/u01/oracle/home
export ORACLE_SID=TEST
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:/usr/sbin:$ORACLE_HOME/bin

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native


##### 准备所需的库

到一下地址下载libaio-0.3.106.tar.gz
#http://packages.gentoo.org/packages/?category=dev-libs;name=libaio
#http://download.chinaunix.net/download/0006000/5732.shtml

tar -xvzf libaio-0.3.106.tar.gz
cd libaio-0.3.106
make prefix=`pwd`/usr install

sudo ln -s /usr/lib/libstdc++.so.6.0.3 /usr/lib/libstdc++.so.5
sudo ln -s /usr/lib/libgcc_s.so.1 /lib/libgcc_s.so.1
cd /usr/bin
sudo ln -s ../../bin/awk awk
sudo ln -s ../../bin/tr tr


##### 配置 Linux 内核参数

# /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
## execute /sbin/sysctl -p

#/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

#/etc/pam.d/login
session required /lib/security/pam_limits.so




##### 修改 Archlinux 的版本以“ 欺骗” Oracle安装程序,使之能正常安装。
sudo echo Red Hat Enterprise Linux AS rlease 3 (Taroon) > /etc/redhat-release




Section II 安装

###### 下载Oracle Database 10g
http://www.oracle.com/technology/software/products/database/index.html

Oracle Database 10g Release 2
Standard Edition, Standard Edition One, and Enterprise Edition
Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86

http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip

10201_database_linux32.zip

很奇怪这是个zip文件,不过可以把ark把它打开,解压到/tmp下, 注意,/tmp 重启后会被清理,安装过程中不要重启计算机。

##### 切换到oracle用户
su - oracle

#####
export LANG=C
/tmp/database/runInstaller

用英文界面安装,如果想要配置中文,请google 一下java 1.4的中文问题.


##### oracle 安装到29%时,
vi $ORACLE_HOME/bin/gennttab


# Change this...
LIB=`$ECHO ${TtoLIB} | $SED 's/ /\\
/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\\
/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\\
/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`


# To this...
LIB=`$ECHO ${TtoLIB} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`

主要把回车删除,把一个/换成n

###### 安装选项
按照自己的需求吧,可以参考这篇文章
http://www.souzz.net/html/database/ORACLE/12246.html


###### 错误处理
http://hi.baidu.com/edeed/blog/item/18cf87d6294cc72c07088b1f.html


Section III 调试

##### 配置文件
sudo vi /etc/hosts
xxx.xxx.xxx.xxx(本机IP) oracle-server

#listener.ora @ $ORACLE_HOME/network/admin

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/home)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE-SERVER)(PORT = 1521))
)
)

#tnsnames.ora @ $ORACLE_HOME/network/admin

LISTENER_TEST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE-SERVER)(PORT = 1521))


TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE-SERVER)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TEST)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)


#


##### startup
$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 10 11:08:33 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 83887720 bytes
Database Buffers 192937984 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.

SQL>shutdown
Database closed.
Database dismounted.


ORACLE instance shut down.
SQL>


##### 用脚本启动

#dbstart @ $ORACLE_HOME/bin
#change
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
#to
ORACLE_HOME_LISTNER=$ORACLE_HOME

#允许用dbstart 启动
#oratab @ /etc
#change
TEST:/media/udata/oracle/home:N
#to
TEST:/media/udata/oracle/home:Y

#启动
$ORACLE_HOME/bin/dbstart
Processing Database instance "TEST": log file /media/udata/oracle/home/startup.log

#检验
sudo netstat -a |grep 1521
密码:
tcp 0 0 ORACLE-SERVER:1521 *:* LISTEN
tcp 104 0 ORACLE-SERVER:1521 ORACLE-SERVER:20328 ESTABLISHED
tcp 0 0 ORACLE-SERVER:20328 ORACLE-SERVER:1521 ESTABLISHED


#关闭
$ORACLE_HOME/bin/dbshut
lsnrctl stop #关闭侦听器


参考文档:
http://hi.baidu.com/sneeze/blog/item/4e0db0777f29c51bb051b9d8.html
http://www.blogger.com/post-create.g?blogID=3560048731273076746

2008年10月6日星期一

Archlinux : xorg.conf for HP Compaq nx7400

# /.../
# SaX generated X11 config file
# Created on: 2008-08-19T16:21:40+0800.
#
# Version: 8.1
# Contact: Marcus Schaefer , 2005
# Contact: SaX-User list
#
# Automatically generated by [ISaX] (8.1)
# PLEASE DO NOT EDIT THIS FILE!
#

Section "Files"
FontPath "/usr/share/fonts/misc:unscaled"
FontPath "/usr/share/fonts/local"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/Type1"
FontPath "/usr/share/fonts/URW"
FontPath "/usr/share/fonts/Speedo"
FontPath "/usr/share/fonts/PEX"
FontPath "/usr/share/fonts/cyrillic"
FontPath "/usr/share/fonts/latin2/misc:unscaled"
FontPath "/usr/share/fonts/latin2/75dpi:unscaled"
FontPath "/usr/share/fonts/latin2/100dpi:unscaled"
FontPath "/usr/share/fonts/latin2/Type1"
FontPath "/usr/share/fonts/latin7/75dpi:unscaled"
FontPath "/usr/share/fonts/baekmuk:unscaled"
FontPath "/usr/share/fonts/japanese:unscaled"
FontPath "/usr/share/fonts/kwintv"
FontPath "/usr/share/fonts/truetype"
FontPath "/usr/share/fonts/uni:unscaled"
FontPath "/usr/share/fonts/CID"
FontPath "/usr/share/fonts/ucs/misc:unscaled"
FontPath "/usr/share/fonts/ucs/75dpi:unscaled"
FontPath "/usr/share/fonts/ucs/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/misc:unscaled"
FontPath "/usr/share/fonts/hellas/75dpi:unscaled"
FontPath "/usr/share/fonts/hellas/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/Type1"
FontPath "/usr/share/fonts/misc/sgi:unscaled"
FontPath "/usr/share/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection

Section "ServerFlags"
Option "AIGLX" "on"
Option "AllowMouseOpenFail" "on"
Option "ZapWarning" "on"
EndSection

Section "Module"
Load "glx"
Load "type1"
Load "extmod"
Load "dbe"
Load "freetype"
Load "dri"
EndSection

Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "microsoftpro"
Option "XkbRules" "xfree86"
EndSection


Section "InputDevice"
Driver "mouse"
Identifier "Mouse[1]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "Pixart Imaging USB OPTICAL MOUSE"
Option "Protocol" "explorerps/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Driver "synaptics"
Identifier "Mouse[3]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "on"
Option "HorizScrollDelta" "0"
Option "InputFashion" "Mouse"
Option "Name" "Synaptics;Touchpad"
Option "Protocol" "explorerps/2"
Option "SHMConfig" "on"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection


Section "Monitor"
DisplaySize 305 230
HorizSync 30-82
Identifier "Monitor[0]"
ModelName "1280X1024@60HZ"
Option "DPMS"
Option "PreferredMode" "1280x1024"
VendorName "--> LCD"
VertRefresh 50-60
UseModes "Modes[0]"
EndSection


Section "Modes"
Identifier "Modes[0]"
EndSection


Section "Screen"
DefaultDepth 24
SubSection "Display"
Depth 15
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720" "1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
EndSection


Section "Device"
BoardName "945 GM"
BusID "0:2:0"
Driver "intel"
Identifier "Device[0]"
Option "monitor-LVDS" "Monitor[0]"
Screen 0
VendorName "Intel"
Option "AddARGBGLXVisuals" "True"
EndSection



Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
InputDevice "Mouse[3]" "SendCoreEvents"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
EndSection


Section "DRI"
Group "video"
Mode 0660
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

2008年5月27日星期二

沙朗斯通:史上最愚蠢的女人

    之所以说沙朗斯通没有脑子,是因为再愚蠢的女人,也不会对灾民幸灾乐祸,而且是如此的公然!

    如果天灾是报应(或因果循环),那么美国的飓风,或者新奥尔良水灾。。。。美国政府该找块豆腐撞死N遍了。

    而再想到911的人祸,沙朗斯通有没有“受到很大的教训”呢?

    请留意,一些媒体说沙朗斯通最后用会帮助灾区人民来打圆场,其实,自始至终她都没这个意识,她只是觉得西藏组织受了这么大的“压迫”,现在中国受到报应了,西藏组织还主动去援助“敌人”,这种胸怀,她很受教育!

    数万条鲜活的生命一瞬间夭折,数万个笑魇从此消失,在她的眼里,他们是罪有应得!

    能坦然说出这些话的人,要么就是没脑子,要么就是极度憎恨中国。

    而我以为,比起达赖,对于中国,她充其量只是讨厌,而不是憎恨。

Blogged with the Flock Browser

2008年5月13日星期二

Ubuntu 下的 E-R 数据模型图工具

比较了一堆的工具,找到了Power*Architect

开源,JAVA软件,支持流行的数据库

下载地址:
http://www.sqlpower.ca/page/architect

也有介绍DBDesigner 4 的,对MYSQL支持最好,但关联库和UBUNTU8有冲突,安装麻烦(主要是库找不到),也就没用。

Power*Architect缺点:慢,中文支持不好,有时窗口灰白一片,重新打开就好了(JAVA的通病)

支持文档:

http://meetrice.javaeye.com/blog/102920
http://www.ventanazul.com/webzine/articles/open-source-app-for-database-modelling

Blogged with the Flock Browser

2008年5月11日星期日

Ubuntu 下画脑图的工具

freemind

不错,免费,java开发,支持中文,树状发散,方便记录。

介绍看这里

安装:

sudo apt-get install freemind

添加菜单:

sudo gedit /usr/share/applications/freemind.desktop

[Desktop Entry]
Name=FreeMind
Comment=Mind Map draw tools
Exec=/usr/bin/freemind
Icon=freemind.png
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true

运行:
应用程序-》编程 -》freemind

Blogged with the Flock Browser

2008年5月10日星期六

Ubuntu 下的开发辅助工具(绘图 UML VISIO)

先是使用了Dia,比较一般化,后来发现了以下几个软件,先试试再说。

1.Cmap Tools

    The IHMC CmapTools software empowers users to construct ,navigate ,share, and criticize knowledge models represented as Concept Maps.

     IHMC CmapTools


2. yEd

    够奇怪的名字,不过可是可以替代VISIO的好东东喔。  

    yEd is a very powerful graph editor that is written entirely in the Java programming language. It can be used to quickly and effectively generate drawings and to apply automatic layouts to a range of different diagrams and networks.


    yEd


先记着先。以后再补图。

Blogged with the Flock Browser

2008年5月9日星期五

用Flock 写 CSDN 博客

Flock 是一个功能浏览器,她满足您冲浪的一切需求,上传照片,写博客,保存喜欢的站点,收发EMAIL,看RSS文章,咦,这一般浏览器都做的到呀。不过一般浏览器都是登录了网站来做这些,而 Flock ,除了这些,她自己提供大量的功能,让你不必每个网站都打开,却也能做一样的事情?

不打开新浪,也可以看到新浪的新闻?
不打开CSDN,也可以写BLOG?
不打开PICASA,也能上传照片?
我喜欢的网站可以随时保留到互联网上?

对,Flock都可以。

这里介绍的是,如何用Flock写CSDN的博客,就像Zoundry一样,甚至更方便!

1. Edit -> Accounts and Services ->  Blogging -> Self-Hosted Blog

2.Blogging : Set up My Blog

    http://blog.csdn.net/<username>

这里填写您的博客地址

3.提示无法确定您博客的类型,按next 即可

4.Blog Connection Configuration

    XML-RPC API  : MetaWeblog

    Access Point : http://blog.csdn.net/<username>/services/metablogapi.aspx

5. Username and password


如何写?

在Flock的工具栏里,有个蓝色的羽毛图标,点击她,写一些测试的东西,选  Publish 就可以了。

Blogged with the Flock Browser