当前位置:综合 > >正文

在 Cenntos6.8 下安装 Oracle11g|视焦点讯

安装所需文件如下

1. 一台装有CentOS6.8 x64的服务器(虚拟机也可)

2.linux.x64_11gR2_database_1of2.zip

3. linux.x64_11gR2_database_2of2.zip"


(资料图片)

系统要求如下

1. SWAP分区大于3G

1. Oracle安装目录剩余空间大于20G

2. Centos6.x 系统

安装centos系统

首先我们要安装一个带X window的版本。

配置系统参数

1. 添加oracle用户使用一下命令,创建组和用户

root@localhost:~# groupadd oinstallroot@localhost:~# groupadd dbaroot@localhost:~# groupadd operroot@localhost:~# useradd -g oinstall -G dba,oper oracleroot@localhost:~# passwd oracle

2. 配置内核参数将一下内容写入/etc/sysctl.conf

fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586

3. 配置系统句柄限制在 /etc/security/limits.conf 文件中添加下列参数用于优化内核可以不修改,不修改可能会出现溢出

oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240
安装oracle

使用oracle用户,运行此命令开始安装oracle

oracle@localhost:~$ /u01/app/database/runInstaller

1. Configure Security Updates我们去掉oracle support password 的,email可以不用填写.下一步提示没有email直接点yes忽视即可

2. Select Installation Option安装和配置数据库`只安装实例升级数据库我们选择安装和配置数据库3. System Class桌面版本服务器版本我这里选择服务器版本

4. Node selection单实例集群环境我这里选择单实例模式

5. Select Install Type普通安装高级安装我这里选择高级安装

6. Select Product Language选择你所需要的语言我这里只用到英语。所已只有English就可以要用到中文存储的往后看

7. Select Database Edition企业版标准版标准版1我这里选择的是企业版PS:需要了解其中不懂的可以参考 [Oracle EE SE SE1各版本区别]

8. Specify Installation Location设置oracle 安装目录和home 目录这个位置是获取oracle 的 `$ORACLE_BASE` 和 `$ ORACLE_HOME` 的值(尽量不要修改。如果修改请一起修改oracle用户的变量值)

9. Create Inventory设置oracle 记录文件位置保持默认即可

10. Select Configuration Type

11. Specify Database Identifiers设置实例名

12. Specify Configuration Options配置实例参数,可以根据实际情况配置内存占用。尽量不要超过50%如果数据库中需要存储中文在Character sets中设置GBK字符集

13. Specify Management Options设置数据库管理选项直接下一步,暂时不需要。

14. Specify Database Storage Options知道数据库存储选项这里选择文件系统,不使用asm管理文件

15. Specify Recovery Options数据库恢复选项这里不开启自动备份数据库如果有需要可以自行调整

16. Specify Schema Passwords设置数据库密码按照需要设置数据库密码

17. Privileged Operating System Groups设置数据库权限组,用于和本机用户绑定。

18. Perform Prerequisite Checks效验数据库安装环境PS:出现以下这些包未安装。需要安装包

gcc.x86_64libaio.i686glibc.i686compat-libstdc++-33.i686compat-libstdc++-33.x86_64elfutils-libelf-develgcc-c++libaio-devel.x86_64libaio-devel.i686libstdc++.i686unixODBC.i686unixODBC.x86_64unixODBC-devel.x86_64unixODBC-devel.i686

先安装 epel源

root@localhost:~# yum install epel-release -y

然后下载pdksh-5.2.14

root@localhost:~# wget ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm

最后在安装其他包

安装完成后点击 `Check Again` 重新效验剩下的这些包是因为Oracle 11G 需要的是i386版本而centos6开始使用i686标准导致的,勾选右上角的`Ignore All`。 PS: [i386和i686区别]

19. Summary 数据安装的配置文本。有需要的可以保持配置文本

20. Install Product 开始安装,等待。。。。。安装块结束时会弹出一个对话框。

这里我们点击右下角的`Password Management` 修改密码,有需要的可以开启socct用户这个弹框提示我们需要用root权限运行这两脚本。切换到root用户运行下面命令

root@localhost:~# /u01/app/oraInventory/orainstRoot.shroot@localhost:~# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

点击ok完成安装

21. Finish完成安装图中有em控制台的地址

为oracle创建服务

1. 设置`dbstart`命令生效修改 `/etc/oratab`文件最后一行的最后一个N改为Y

orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y

2. 新建/etc/init.d/oracle 文件将下列内容写入到文件中

#chkconfig:2345 98 05#description:Oracle Server#add for oracleORACLE_BASE=/u01/app/oracle/export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_HOMEORACLE_SID=orclexport ORACLE_SIDLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/libexport LD_LIBRARY_PATHcase "$1" instart)echo "Starting Oracle..."su - oracle -c "lsnrctl start"su - oracle -c "dbstart 1> $ORACLE_HOME/bin/dbstart.log 2> $ORACLE_HOME/bin/dbstart.err"echo "Started."exit 0;;stop)echo "Stoping Oracle..."su - oracle -c "lsnrctl stop"su - oracle -c "dbshut"echo "Stoped."exit 0;;*)echo "Usage: $0 {start|stop}"exit 1esac

3. 然后给oracle文件执行权限

root@localhost:~# chmod +x /etc/init.d/oracle

4. 添加开机启动

root@localhost:~# chkconfig --add oracleroot@localhost:~# chkconfig oracle on

5. 添加开机启动em控制台

在`/etc/rc.loder`文件中添加

su - oracle -c "emctl start dbconsole"

完成安装

博主整理了一下oracle的常用命令

dbca 数据库配置器netca 监听器配置器netmgr 监听控制器dbstart 开启数据库dbshut 关闭数据库lsnrctl start 开启监听lsnrctl stop 关闭监听emctl start dbconsole 开启em控制台emctl stop dbconsole 关闭em控制台sqlplus / as sysdba 使用sysdba权限登录当前数据库

本文地址:https://www.linuxprobe.com/cenntos6-install-oracle11g.html ‎编辑:CrazyYoung,审核员:逄增宝

本文原创地址:https://www.linuxprobe.com/cenntos6-install-oracle11g.html

标签:

推荐阅读