设为首页 收藏本站
查看: 857|回复: 0

[经验分享] centos安装ORACLE 11G

[复制链接]

尚未签到

发表于 2018-4-27 12:16:06 | 显示全部楼层 |阅读模式
  As we all know Oracle database is the most popular and widely used Relational Database Management System (RDBMS) in the world. This post describes step by step installation of Oracle Database 11g>. The installation steps should not be vary on most of the Red Hat based Linux distributions.
Installing Oracle Database 11g>Step 1: Install Oracle Dependencies
  We use “oracle-rdbms-server-11gR2-preinstall” package offered by “Oracle Public Yum” repository. The Oracle public yum repository provides a free and easiest way to install all the latest Oracle Linux dependencies automatically. To setup yum repository, follow the instructions provided below.
  Use “wget” command to Download appropriate yum configuration file under /etc/yum.repos.d/ directory as root user.
RHEL/CentOs 6.x
# cd /etc/yum.repos.d  
# wget https://public-yum.oracle.com/public-yum-ol6.repo
RHEL/CentOs 5.x
# cd /etc/yum.repos.d  
# wget https://public-yum.oracle.com/public-yum-el5.repo
RHEL/CentOs 4.x
# cd /etc/yum.repos.d  
# wget https://public-yum.oracle.com/public-yum-el4.repo
  Now perform the following “yum” command to install all the necessary prerequisites automatically.
[root@oracle]# yum install oracle-rdbms-server-11gR2-preinstallWhile importing GPG key, you might get “GPG key retrieval failed” error as shown below. Here, you need to import proper GPG key for your OS>Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle  
GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

  Download and verify the appropriate Oracle Linux GPG Key that best matches your RHEL/CentOS compatible OS>RHEL/CentOs 6.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracleRHEL/CentOs 5.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracleRHEL/CentOs 4.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4 -O /usr/share/rhn/RPM-GPG-KEY-oracleStep 2: Setting Hostname
  Open the “/etc/sysconfig/network” file and modify the HOSTNAME to match your FQDN (Fully Qualified Domain Name) host name.
[root@oracle]# vi /etc/sysconfig/networkHOSTNAME=oracle.tecmint.com  Open “/etc/hosts” file and add fully qualified hostname for the server.
[root@oracle]# vi /etc/hosts192.168.246.128         oracle.tecmint.com              oracle  Now you need to restart networking on the server to make sure that changes will be persistent on reboot.
[root@oracle]# /etc/init.d/network restartStep 3: Oracle User Settings
  Set the password for the “oracle” user.
[root@oracle]# passwd oracle  

  
Changing password for user oracle.
  
New password:
  
BAD PASSWORD: it is based on a dictionary word
  
Retype new password:
  
passwd: all authentication tokens updated successfully.
  Add the entry to file “/etc/security/limits.d/90-nproc.conf” as described below.
[root@oracle]# vi /etc/security/limits.d/90-nproc.conf# Default limit for number of user's processes to prevent  
# accidental fork bombs.
  
# See rhbz #432903 for reasoning.
  

  
*          soft    nproc     1024# To this
  
* - nproc 16384
  Set SELinux to “permissive” mode by editing the file “/etc/selinux/config“.
[root@oracle]# vi /etc/selinux/configSELINUX=permissive  Once you’ve made change, don’t forger to restart the server to reflect new changes.
[root@oracle]# reboot  Login as Oracle user and open file “.bash_profile“, which is available on oracle user’s home directory, make an entries as described below. Make sure you set correct hostname to “ORACLE_HOSTNAME=oracle.tecmint.com“.
[root@oracle]# su oracle[oracle@oracle ~]$ vi .bash_profile# Oracle Settings  
TMP=/tmp; export TMP
  
TMPDIR=$TMP; export TMPDIR
  

  
ORACLE_HOSTNAME=oracle.tecmint.com; export ORACLE_HOSTNAME
  
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
  
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
  
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
  
ORACLE_SID=DB11G; export ORACLE_SID
  
PATH=/usr/sbin:$PATH; export PATH
  
PATH=$ORACLE_HOME/bin:$PATH; export PATH
  

  
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
  
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH export PATH
  Switch to root user and issue the following command to allow Oracle user to access X Server.
[root@oracle]# xhost +  Create the directories and set the appropriate permissions in which the Oracle software will be installed.
[root@oracle]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1  
[root@oracle]# chown -R oracle:oinstall /u01
  
[root@oracle]# chmod -R 775 /u01
Step 4: Downloading Oracle Software
  Sign-up and Download the Oracle software using the following link.


  •   Oracle Database 11g>

  Download Oracle 11g>  The Oracle package contains 2 zip files which you must first accept the license agreement before downloading. I’ve given the files names for you reference, please download these files for your system architecture somewhere under “/home/oracle/“.
For Linux x86 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip  
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip
For Linux x86-64 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip  
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip
Step 5: Oracle Installation
  Now let’s start Oracle installation. First of all need to switch as ‘oracle’ user to install database.
[oracle@oracle ~]$ su oracle  Extract compressed Oracle database source files to the same directory “/home/oracle/“.
[oracle@oracle ~]$ unzip linux_11gR2_database_1of2.zip  

  
[oracle@oracle ~]$ unzip linux_11gR2_database_2of2.zip
  Post unzip source file, directory called database will be created, go to inside the directory and execute below script to start Oracle database installation process.
[oracle@oracle database]$ cd database  

  
[oracle@oracle database]$ ./runInstaller
  1. RunInstaller will call Oracle Universal Installer (OUI), wherein look and feel & steps are the same across all the operating system.
  Oracle Universal Installer
  2. Provide your email address to be informed of security issues and receive security updates.
  Configure Oracle Security Updates
  3. Create and Configure a Database
  Create Oracle Database
  4. Choose the system>Desktop
or Server.

  Select Oracle System>  5. Select the type of database installation you want to perform.
  Select Database Installation Type
  6. Select “Typical install” option to install full oracle installation with basic configuration.
  Select Typical Install
  7. Set Administrative password and perform full Database installation with basic configuration.
  Set Oracle Administrative Password
  8. Please click on “Yes” to continue with installation.
  Typical Install Configuration Confirm
  9. Create Inventory
  Create Inventory
  10. If you>Fix & Check Again“. Oracle fixes Prerequisites by itself. This is the new feature of Oracle Database 11g.
  Perform Prerequisite Checks
  The pdksh package is not available in Oracle repository due to which you need to download and install it manually.
[root@oracle]# wget ftp://rpmfind.net/linux/redhat-archive/6.2/en/os/i386/RedHat/RPMS/pdksh-5.2.14-2.i386.rpm  During pdksh package installation you may encountered conflict error of ksh package. Remove ksh package forcefully and install the pdksh package with given below command:-
[root@oracle]# rpm -e ksh-20100621-19.el6_4.4.i686 --nodeps  
[root@oracle]# rpm -ivh pdksh-5.2.14-2.i386.rpm
  11. Performing Prerequisite checks: It’s test whether sufficient total SWAP space is available on the system.
  Performing Prerequisite SWAP Check
  12. Installation Summary: Click on Save Response File. This file is useful for Oracle Silent Mode Installation
  Oracle Installation Summary
  13. Save Response File somewhere in your system.
  Save Response File
  14. Product Installation Progress
  Product Install
  15. Copying database files
  Copying Database Files
  16. Click on “Password Management“.
  Oracle Password Management
  17. Set password for user “SYS” and click on OK to continue.
  Set SYS User Password
  18. Configuration scripts need to be executed as the “root” user. Go to the path given in the screen and execute the scripts one by one. Click on ‘OK‘ once scripts is executed.
  Execute Configuration Scripts
[root@oracle]# cd /u01/app/oraInventory  
[root@oracle oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.  
Adding read,write permissions for group.
  
Removing read,write,execute permissions for world.
  

  
Changing groupname of /u01/app/oraInventory to oinstall.
  
The execution of the script is complete.
[root@oracle]# cd /u01/app/oracle/product/11.2.0/dbhome_2/  
[root@oracle dbhome_2]# ./root.sh
Running Oracle 11g root.sh script...  

  
The following environment variables are set as:
  
    ORACLE_OWNER= oracle
  
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_2
  

  
Enter the full pathname of the local bin directory: [/usr/local/bin]:
  
   Copying dbhome to /usr/local/bin ...
  
   Copying oraenv to /usr/local/bin ...
  
   Copying coraenv to /usr/local/bin ...
  

  
Creating /etc/oratab file...
  
Entries will be added to the /etc/oratab file as needed by
  
Database Configuration Assistant when a database is created
  
Finished running generic part of root.sh script.
  
Now product-specific root actions will be performed.
  
Finished product-specific root actions.
  19. The installation of Oracle Database is successful.
  Oracle Installation Finish
  20. To test your Oracle installation navigate to web based management interface for your system at “localhost” with the user name “SYS” connecting as “SYSDBA” and using the password you set during the install of Oracle. Remember to open port 1158 on your firewall and restart the iptables service.
[root@oracle]# iptables -A INPUT -p tcp --dport 1158 -j ACCEPT  
[root@oracle]# service iptables restart
https://localhost:1158/em/  Oracle Enterprise Manager Login
  21. Oracle Enterprise Database Control Manager
  Oracle Database Control Manager
  Now you can start using Oracle. I highly recommend you to follow the Oracle Documentation for more help. There are number of client applications out there which can help you, like the command line tool called Oracle Instant Client and the Oracle SQL Developer UI program.
  This is end of the Oracle Database Software Installation. In our upcoming article we will be covering how to create database using DBCA and how to Start-up and Shutdown Oracle Database. Please stay tuned…!!!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-452727-1-1.html 上篇帖子: CentOs给自己看的小心得 下篇帖子: CentOS系统grub详解
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表