分享

CentOS5安装oracle 10g(10.1.0.3)

 忧郁_小刚 2011-05-01
CentOS5安装oracle 10g(10.1.0.3)

注意:1~7步都是以root的身份操作


1、创建所需的用户与用户组

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
/usr/bin/passwd oracle
2、创建oracle安装路径与数据目录

mkdir -p /mnt/pros/oracle
mkdir -p /mnt
/data/db/oracle
chown -R oracle:oinstall
/mnt/pros/oracle /mnt/data/db/oracle

chmod -R 775 /mnt/pros/oracle /mnt/data/db/oracle

3、为 oracle 用户设置 Shell 限制

vi /etc/security/limits.conf 添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

4、修改操作系统的发行名称

vi /etc/redhat-release

将CentOS release 5 (Final)  修改成redhat-3(因为oracle公司没推出CentOS版本)

5修改oracle的.bash_profile文件,添加如下内容

export LANG=en_US
export ORACLE_BASE=/mnt/pros/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0.3/db_1
export ORACLE_SID=ORCL     //安装的一个数据库的实例
export PATH=.:${PATH}:$ORACLE_HOME/bin

6、修改/etc/profile文件,添加如下内容:

if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7、
以oracle用户登录,并配置其环境变量
xhost +
(确保X窗口应用程序能在系统上显示)
su - oracle
如果你的安装不是在本地,请执行如下命令
DISPLAY=local_host:0.0 ; export DISPLAY
其中local_host是你登录安装的系统的名字戓IP
8、安装
在oracle用记环境下执行Oracle安装文件目录中的runInstaller文件,如:
./runInstaller
安装之前请确保libxp安装了,如果没安装可通过yum -y install libXp来安装
安提示一步步安装就行,安装时注意安装选项要与上面的配置相一致
安装后出现如下对话框说明安装成功
 The following J2EE Applications have been deployed and are accessible at the URLs listed below.

Ultra Search URL:
http://localhost.localdomain:5620/ultrasearch

Ultra Search Administration Tool URL:
http://localhost.localdomain:5620/ultrasearch/admin

iSQL*Plus URL:
http://localhost.localdomain:5560/isqlplus

iSQL*Plus DBA URL:
http://localhost.localdomain:5560/isqlplus/dba

Enteprise Manager 10g Database Control URL:
http://localhost.localdomain:5500/em


9、启动与停止服务
 1,以oracle用户登录
su oracle
2,启动TNS监听器
$ORACLE_HOME/bin/lsnrctl start
3,用sqlplus启动数据库
$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> startup

出现如下显示,表示Oracle已经成功启动
ORACLE instance started.

Total System Global Area  205520896 bytes
Fixed Size                   778392 bytes
Variable Size              74456936 bytes
Database Buffers          130023424 bytes
Redo Buffers                 262144 bytes
Database mounted.
Database opened.

4,用sqlplus停止数据库

$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> shutdown

注:shutdown可加关闭选项,从最温和到最粗暴的行为选项为(shutdown、shutdown transactional、shutdown immediate、shutdown abort)
命令解释如下
shutdown:关闭,等待每个用户退出系统戓被取消后退出关闭数据库。

shutdown transactional:事务性关闭,等待每个用户提交戓回退当前的事务,然后oracle取消对话,在所有用户退出系统后执行关闭。

shutdown immediate:直接关闭,取消所有用户对话(促使回退),执行正常的关闭程序。

shutdown abort:终止关闭,关闭数据库时没有自动检查点戓日志开关。

出现如下显示,表示oracle已经停止
Database closed.
Database dismounted.
ORACLE instance shut down.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多