在RED HAT ENTERPRICE LINUX4 上安装ORACLE 10G (10.2.0.1.0) 第一步 准备工作 ?检查内存 SZ_TOMCAT:/home/xjy/soft grep SwapTotal /proc/meminfo SwapTotal: 2031608 kB ?检查内核 Linux reaky.com 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686
在RED HAT ENTERPRICE LINUX4 上安装ORACLE 10G (10.2.0.1.0)
第一步 准备工作
? 检查内存
SZ_TOMCAT:/home/xjy/soft> grep SwapTotal /proc/meminfo
SwapTotal: 2031608 kB
? 检查内核
Linux reaky.com 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux
? 检查软件包
SZ_TOMCAT:/home/xjy/soft> rpm -q gcc make binutils glibc libaio
gcc-3.4.3-9.EL4
make-3.80-5
binutils-2.15.92.0.2-10.EL4
glibc-2.3.4-2
libaio-0.3.102-1
SZ_TOMCAT:/home/xjy/soft> rpm -q openmotif
openmotif-2.2.3-6.RHEL4.2
setarch-1.6-1
检查内核参数
sysctl –a
然后在/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 = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
执行/sbin/sysctl –p
中文化显示工作
修改/etc/sysconfig/i18n文件,改为
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-:en_US:en"
SYSFONT="lat0-sun16"修改/etc/sysconfig/i18n文件,改为
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-:en_US:en"
SYSFONT="lat0-sun16"
第二步:
? 创建用户
su – root
[root@reaky etc]# groupadd dba
[root@reaky etc]# groupadd oinstall
[root@reaky etc]# useradd -c "Oracle software owner" -g oinstall -G dba oracle
? 设置环境
编辑/home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias ls='ls -CF'
PS1='SZ_TOMCAT:$PWD> '; export PS1
umask 022
set -o vi
stty intr '^c'
stty -istrip
#if [ $USER = "oracle" ]; then
# if [ $SHELL = "/bin/ksh" ]; then
# ulimit -p 16384
# ulimit -n 65536
# else
# ulimit -u 16384 -n 65536
# fi
#fi
EDITOR=vi; export EDITOR
TEMP=/tmp; export TEMP
TMPDIR=/tmp; export TMPDIR
### SETUP ORACLE ENVIRONMENT ###
ORACLE_SID=ora10; export ORACLE_SID
ORACLE_BASE=/home/oracle; export ORACLE_BASE
ORACLE_HOME=/home/oracle/product/10.2.0; export ORACLE_HOME
ORACLE_TERM=ansi; export ORACLE_TERM
JAVA_FONTS=/usr/share/fonts/zh_CN/TrueType/; export JAVA_FONTS
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
PATH=.:$ORACLE_HOME/bin:$PATH
export PATH
### FOR ORACLE INSTALL ###
export LC_ALL="en_US"
export LC="en_US"
第三步、安装Oracle10g
1.开始Oracle普通安装
以oracle用户登录linux,加载oracle Oracle10g光盘, 在执行runInstaller前,确定Oracle环境变量已经设置,可以执行如下命令检验环境变量的设置:
oracle 用户登陆
$set
在终端命令窗口,执行如下命令,开始oracle10g的安装:
oracle$/mnt/cdrom/runInstaller
2.在欢迎窗口界面: 点击“下一步”按钮
3.指定Inventory 路径和身份证明窗口:
inventory路径是: /home/oracle/oraInventory
指定操作系统组名: oinstall
点击“下一步”按钮
4.这时会弹出一个执行orainstRoot.sh 脚本的窗口:
打开另一个终端,以root用户执行如下命令:
su – root
cd /home/oracle/oraInventory
./orainstRoot.sh
然后,切换到oracle安装窗口,点击“继续”按钮
5. 在指定文件位置窗口弹出后,指定相应的路径:
源:
路径: /mnt/cdrom/stage/products.xml
目的:
名称: OraDb10g_home1
路径: /home/oracle/product/10.1.0/db_1
然后,点击“下一步”按钮
6.选择安装类型:
选择"企业版"选项,然后点击“下一步”按钮。安装程序验证系统是否符合安装和配置所选产品的所有最低要求
7. 安装程序验证系统是否符合安装和配置所选产品的所有最低要求。当检测完成并成功后,点击“下一步”按钮
8. 选择数据库设置:
选择"通用"选项,然后点击“下一步”按钮
9.指定数据库配置参数:
全局数据库名称: "test".
SID: "test".
选中“创建带样本方案的数据库”复选框,然后,点击“下一步”按钮
10.选择数据库管理设置:
选择"使用 Database Control管理数据库"。
然后,点击“下一步”
11.指定数据库文件存储选项
选择 "文件系统"选项.
指定数据库路径: /home/oracle/oradata/
然后点击“下一步”按钮,
12.指定备份和恢复选项:
选择"不启用自动备份".
点击 “下一步”按钮
13.指定数据库方案口令:
可以为SYS、SYSTEM、SYSMAN、DBSNMP单独指定口令,或选择"所有用户使用同一口令"选项.为这些用户指定同一个口令。
指定口令不要以数字开始,否则会得到错误信息.然后点击 “下一步”按钮
14. 出现概要窗口后, 点击“安装”按钮
15. 这时你会看到数据库安装过程窗口,然后会出现辅助设置窗口,再出现数据库创建窗口。
16. 数据库创建完毕,弹出数据库创建完成窗口,点击Ok按钮。
当弹出一个执行root.sh脚本的窗口时在另一个终端执行如下命令:
su – root
cd /home/oracle/product/10.1.0/db_1
./root.sh
点击确定”按钮
17. 在概要安装完毕,会报告一个发现$ORACLE_BASE/product/10.1.0/db_1/portlist.ini文件,这时点击OK按钮
18. 安装结束:
点击“退出”按钮,结束安装程序。
六、数据库的启动和停止
要使数据库启动,执行如下命令:
oracle$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup
要使数据库停止,执行如下命令:
oracle$ sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown
删除oracle10g
如果oracle10ganzhuang过程中出现错误,需要重新安装,可以执行如下命令删除以前安装的oracle:
su –oracle
rm –rf /home/oracle/*
rm –f /etc/oraInst.loc /etc/oratab /etc/oracle
su –root
export ORACLE_HOME=/home/oracle/product/10.1.0/db_1
$ORACLE_HOME/bin/localconfig delete
rm –f /etc/inittab.cssd
rm –f /usr/local/bin/coraenv /usr/local/bin/dbhome
rm –f /usr/local/bin/oraenv
执行完上述命令后,重新启动系统,可以重新安装oracle10g数据库系统
FAQ (在Linux平台安装Oracle比较常见的问题)
1. 不能启动安装界面
运行runInstaller提示信息类似如下:
xlib:connection to "localhost:0.0" refused by server
xlib:client is not authorized to connect to server
Exception in thread "main" java.lang.InternalError:
can't connect to x11 window server using "localhost:0.0" at .......
解决办法: 设定你的DISPLAY环境参数.
# export DISPLAY= your_IPaddress :0.0
把your_IPaddress换成你的IP.或者用root简单的执行一下# xhost + (要注意这样会有安全上的隐患)
2.安装界面显示很多"口口"样子的乱码
解决办法:查看locale输出
# locale
LANG=en_US.UTF-8
LC_CTYPE=zh_CN.GB18030
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
执行#export LC_CTYPE=en_US.UTF-8 然后重新调用安装程序.
3. 用IE登录Linux服务器上的em出现乱码
在Linux(Unix) 环境下成功安装了Oracle 10g,从windows下用IE浏览器登录 10g 的em, 按钮是"口口"这样的方框.
解决办法: 参考:
http://www.dbanotes.net/Oracle/Oracle-10g-font.properties.htm
4.创建数据库的时候出现ORA-03113的错误
解决办法: 查看核心参数是否调整正确.参考:
http://www.dbanotes.net/Oracle/ORA-03113.htm
5. RedHat 9 / FC1等系统10g不支持如何安装?
解决办法:在10g不支持的Linux发行版上安装10g的解决方法
1). 运行runInstaller -ignoreSysPrereqs,这样会跳过检查.
2). 摘自 www.puschitz.com 修改/etc/redhat-release文件:
#su - root
#cp /etc/redhat-release /etc/redhat-release.backup
#cat > /etc/redhat-release Red Hat Enterprise Linux AS release 3 (Taroon)
EOF
安装完毕,执行如下操作:
#su - root
#cp /etc/redhat-release.backup /etc/redhat-release
3). http://www.dbanotes.net/Oracle/10G-Beta-Install-Bug.htm
同样的思路,我们可以修改Oracle 的install/oraparam.ini文件达到目的.
6.如何关掉那些 ocssd.bin 进程?
解决办法:编辑/etc/inittab文件(做好备份)
注释掉这一行:
h1:3:respawn:/etc/init.d/init.cssd run >/dev/null 2>................
---------------------------------------------------------------------------------------------------------------------
参考信息
http://blog.csdn.net/itsdn/archive/2007/05/21/1619114.aspx
:
1、在 Linux x86 上安装Oracle数据库10g
http://www.oracle.com/technology/global/cn/pub/articles/smiley_10gdb_install.html#rhel3
2、Oracle 10gR2 + RedHat Enterprise Linux AS4 安装
http://www.linuxdiyf.com/viewarticle.php?id=11578
3、Oracle 10g For Linux安装手册
http://bbs.database.ccidnet.com/htm_data/27/0607/112610.html
4、Installing Oracle 10g on RHEL AS 3 Step-by-Step
http://www.dbanotes.net/Oracle/Install-Oracle10g-RHEL3.htm
/etc/rc.d/init.d/dbora文件内容
#http://staff.in2.hr/denis/oracle/10g1install_fedora3_en.html#n4_4
# chkconfig: 0356 95 1
# description: init script to start/stop oracle database 10g, TNS listener, EMS
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=CQRCDATA
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
dltelecom - "$ORACLE_USER" -c "$ORACLE_HOME/bin/dbstart"
dltelecom - "$ORACLE_USER" -c "$ORACLE_HOME/bin/emctl start dbconsole"
dltelecom - "$ORACLE_USER" -c "SORACLE_HOME/bin/isqlplusctl start"
;;
stop)
dltelecom - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
dltelecom - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
dltelecom - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.

Use the EXPLAIN command to analyze the execution plan of MySQL queries. 1. The EXPLAIN command displays the execution plan of the query to help find performance bottlenecks. 2. The execution plan includes fields such as id, select_type, table, type, possible_keys, key, key_len, ref, rows and Extra. 3. According to the execution plan, you can optimize queries by adding indexes, avoiding full table scans, optimizing JOIN operations, and using overlay indexes.

Subqueries can improve the efficiency of MySQL query. 1) Subquery simplifies complex query logic, such as filtering data and calculating aggregated values. 2) MySQL optimizer may convert subqueries to JOIN operations to improve performance. 3) Using EXISTS instead of IN can avoid multiple rows returning errors. 4) Optimization strategies include avoiding related subqueries, using EXISTS, index optimization, and avoiding subquery nesting.

Methods for configuring character sets and collations in MySQL include: 1. Setting the character sets and collations at the server level: SETNAMES'utf8'; SETCHARACTERSETutf8; SETCOLLATION_CONNECTION='utf8_general_ci'; 2. Create a database that uses specific character sets and collations: CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci; 3. Specify character sets and collations when creating a table: CREATETABLEexample_table(idINT

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

Renaming a database in MySQL requires indirect methods. The steps are as follows: 1. Create a new database; 2. Use mysqldump to export the old database; 3. Import the data into the new database; 4. Delete the old database.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
