RedHat AS5(x86_64)安装oracle10g10.2.01
一:安装系统
安装redhat5
LinuxRedHat EnterPrise5默认安装(自定义软件时,全选)
设置redhat5
如果没有全选,则需要安装telnet,vsftp包。
安装方法:将安装光盘放入cdrom,然后再系统的安装光盘里面/serverl下面找到相应的包,点击安装。
或者是在终端下面,cd /media 然后进入光盘/Srver
查找telnet,vsftp包命令:find –L telnet
安装完后启动服务!
二:oracle10g安装
2.1 oracle下载
ftp到57.88上用户soft密码:soft
2.2准备工作
2.2.1查询所需安装包是否完整
rpm -qa | grep gcc-c++
rpm -qa | grep make-3.80-5
rpm -qa | grep glibc-2.3.4-2.9
rpm -qa | grep glibc-devel-2.3.4-2.9
rpm -qa | grep glibc-headers-2.3.4-2.9
rpm -qa | grep glibc-kernheaders-2.4-9.1.87 *
rpm -qa | grep cpp-3.4.3-22.1
rpm -qa | grep compat-db-4.1.25-9
rpm -qa | grep compat-gcc-32-3.2.3-47.3
rpm -qa | grep compat-gcc-32-c++-3.2.3-47.3
rpm -qa | grep compat-libstdc++-33-3.2.3-47.3
rpm -qa | grep compat-libstdc++-296-2.96-132.7.2
rpm -qa | grep openmotif-2.2.3-9.RHEL4.1
rpm -qa | grep setarch-1.6-1
rpm -qa | grep iscsi-initiator-utils-4.0.3.0-2.i386.rpm
2.2.2设置系统参数
调整Oracle核心参数:vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 4294967200
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
之后分别执行/sbin/sysctl –p
vi /etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
vi /etc/pam.d/login
添加下行
session required /lib/security/pam_limits.so
vi /etc/selinux/config
设置安全linux失效
SELINUX=disabled
2.2.3设置oracle环境变量
# Oracle Settings
TMP=/tmp
export TMP
TMPDIR=$TMP
export TMP
ORACLE_BASE=/home/oracle10gr2/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1
export ORACLE_HOME
ORACLE_SID=CWXT
export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH;
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LD_LIBRARY_PATH
#export DISPLAY=192.168.1.128:0.0
#此处设置用户字符集,
export LANG=zh_CN.gbk
export LC_ALL=zh_CN.gbk
2.3安装
1、vi /etc/redhat-release把Red Hat Enterprise Linux Server release 5 (Tikanga) 把5改成4;(注:安装完ORACLE之后记得改回来,不然没准别的地方又出问题了)
2、运行ORACLE安装程序时,使用-ignoreSysPrereqs参数;如:./runInstaller –ignoreSysPrereqs
三:问题总结
Oracle10gEM问题
Em启动:
$emctl status dbconsolefhYLinux联盟
$ emctl stop dbconsole fhYLinux联盟
$ emctl start dbconsolefhYLinux联盟
Em显示汉字乱码:
一直没怎么用10g的EM工具,今天打开来看看,发现也有相传已久的乱码问题.网上也流传着N种解决方案,仔细看一下,其实这个问题很好解决.
如果安装时,我们系统环境变量设置的是中文环境,那么就不会有这个问题.这个问题根本原因在于安装时,JDK/JRE字符集的自动选择.
在$ORACLE_HOME/jdk/jre/lib和$ORACLE_HOME/jre/1.4.2/lib/目录下都有多种字符集字体配置文件:
[oracle@danaly ~]$ cd $ORACLE_HOME/jdk/jre/lib
[oracle@danaly lib]$ ls font*zh_CN*
font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat2.1
font.properties.zh_CN.Sun font.properties.zh_CN_UTF8.Sun
[oracle@danaly lib]$ cd $ORACLE_HOME/jre/1.4.2/lib/
[oracle@danaly lib]$ ls font*zh_CN*
font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat2.1
font.properties.zh_CN.Sun font.properties.zh_CN_UTF8.Sun
我们只要用合适的中文字符集文件替换缺省文件即可,我选择使用font.properties.zh_CN.Redhat来替换缺省字体定义文件:
[oracle@danaly lib]$ cp font.properties.zh_CN.Redhat font.properties
替换之后需要清理一下Cache,重启EM即可.
Cache路径通常位于:
$ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
清除所有gif文件即可.然后重新启动EM:
[oracle@danaly zhs]$ emctl stop dbconsole
TZ set to PRC
oracle Enterprise Manager10gDatabase Control Release10.2.0.1.0
Copyright (c) 1996, 2005 oracle Corporation. All rights reserved.
http://danaly.hurrray.com.cn:1158/em/console/aboutApplication
Stopping oracle Enterprise Manager10gDatabase Control ...
... Stopped.
[oracle@danaly zhs]$ emctl start dbconsole
TZ set to PRC
oracle Enterprise Manager10gDatabase Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 oracle Corporation. All rights reserved.
http://danaly.hurrray.com.cn:1158/em/console/aboutApplication
Starting oracle Enterprise Manager10gDatabase Control .............. started.
------------------------------------------------------------------
Logs are generated in directory
/opt/oracle/product/10.2.0/danaly.hurrray.com.cn_danaly/sysman/log
现在登陆Web页面,EM显示就可以正常显示中文了.
Oracle10g字符集问题
从oracle9i中导出的数据导入到oracle10g中,经过程序的调用后,发现都是乱码,
开始以为是RHEL5系统字符集的事情,修改了几次后,发觉还是数据库的字符集有问题。
以下是用dba进入后查看的实际情况:
select * from V$NLS_PARAMETERS ;
NLS_LANGUAGE SIMPLIFIED CHINESE
NLS_TERRITORY CHINA
NLS_CURRENCY RMB
NLS_ISO_CURRENCY CHINA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE SIMPLIFIED CHINESE
NLS_CHARACTERSET WE8ISO8859P1
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY RMB
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
select userenv('language') from dual;
显示字符集:
SIMPLIFIED CHINESE_CHINA.WE8ISO8859P1
select * from sys.props$ WHERE NAME='NLS_CHARACTERSET';
-----------------------
参考了网上的几个解决方法,都没有解决,最后还是使用了这样的方法解决了问题:
sqlplus "/as sydba"
shutdown immediate
Startup restrict
ALTER DATABASE CHARACTER SET ZHS16GBK;
有时候会遇到如下错误:
ORA-12712: new character set must be a superset of old character set
可以执行如下:跳过超集的检查
ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
然后重启数据库即可,不过最好先做备份哦!