二.Oracle安装1.创建和配置用户/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle
为Oracle用户设置密码:
passwd oracle
2.创建安装目录mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
3.开始安装从Oracle网站下载10201_database_linux_x86_64.cpio.gz到/pkg/oracle/
使用oracle用户登录后,解压此文件:
cd /pkg/oracle
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -idmv 10201_database_linux_x86_64.cpio
以上操作将Oracle安装文件解压到database/目录
使用oracle用户,登录到图形界面后,运行database/目录下的runInstaller
cd /pkg/oracle/databse
./runInstaller
按照提示完成安装,最后一步会提示你,使用root登录,运行两个Shell脚本。
4. 自动运行OracleA.在/etc/profile的ORACLE_BASE后面,加上
export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
B. 修改/etc/oratab文件,将orcl那一行的N,设置为Y
C. 修改$ORACLE_HOME/bin/dbstart, dbshut ,将
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr
改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
D.新建一个启动脚本,如下:
#!/bin/bash
#
# chkconfig: 345 90 05
# description: Oracle 10g Server
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
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
chmod a+x /etc/init.d/oracle
chkconfig oracle on
5. 服务介绍oracle 10g在自身的dbstart已经启动了lsnrctl,所以上面的脚本上注释掉了lsnrctl的启动
主要服务启动方式
a:$ORACLE_HOME/bin/dbstart | dbshut
b:$ORACLE_HOME/bin/lsnrctl start | stop 监听器启动|关闭。
c:$ORACLE_HOME/bin/emctl start | stop dbconsole
访问 http://yourIP:1158/em
d:$ORACLE_HOME/bin/isqlplusctl start | stop
访问 http://yourIP:5560/isqlplus
三.Oracle升级以下步骤将10.2.0.1升级到10.2.0.3
1. Download p5337014_10203_Linux-x86-64.zip From MetaLink
2. Stop All Oracle Services (login as root)
3. Backup Oracle ( or Use RMAN backup whole database)
4. unzip p5337014_10203_Linux-x86-64.zip (login as oracle)
5. cd Disk1(login as oracle)
6. run ./runInstaller (run as oracle)
7. Select the oracle Home, and Next, Next..
8. Run root.sh (run as root) and finish install,
9. For Oracle single-instance installations, start the listener as follows: $ lsnrctl start
10. Run Oracle Database Upgrade Assistant($ORACLE_HOME/bin/) :$ dbua
11. Update $ORACLE_HOME/bin/dbstart & dbshut, set ORACLE_HOME_LISTNER=$ORACLE_HOME
12. Done, Reboot or Restart Oracle.