Oracle 11G 安装教程

  1. 准备环境
  1. 传输 文件服务器

  2. 创建用户和组

[root@localhost ~]# groupadd  oracle
[root@localhost ~]# useradd oracle -g oracle
[root@localhost ~]# passwd oracle
  1. 解压文件
su oracle
[oracle@localhost ~]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@localhost ~]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
  1. 安装
cd database
./runInstaller
5.1  报错
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 38010 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2047 MB    Passed
Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

Some requirement checks failed. You must fulfill these requirements before

continuing with the installation,

Continue? (y/n) [n] y


>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-07-13_12-56-54AM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh:                      % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash:         $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
        echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
        echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
        % <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock

ps: 最好使用图形界面系统安装,使用xhell 会提示下载xmanager… 或者使用vnc

>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-07-13_12-58-19AM. Please wait ...[oracle@localhost database]$ No protocol specified
Exception in thread "main" java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at java.awt.Toolkit$2.run(Toolkit.java:821)
        .....

5.2 解决报错

  DISPLAY=:0.0; export DISPLAY or DISPLAY=IP:0.0; export DISPLAY

​  xhost +

5.3 再一次执行

cd database  
 /.runInstaller 
  1. 弹出Oracle安装界面之后

image-20230713130535960

image-20230713130609371

image-20230713130625737

image-20230713130639032

image-20230713130719648

image-20230713130730745

image-20230713130740098

image-20230713130824815

ps: 密码复杂度要求:大小写+数字即可

image-20230713130904673

image-20230713130922882

image-20230713131009140

  1. 安装 配置文件

    yum -y install binutils compat-libcap1  compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp
    

    7.1 再一次检测

    image-20230713132149281

7.2 安装 pdks

wget  http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
[oracle@localhost database]$ rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm 
warning: pdksh-5.2.14-37.el5_8.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
error: Failed dependencies:
	pdksh conflicts with (installed) ksh-20120801-144.el7_9.x86_64

安装时可能会报错

7.3 删除 ksh…包

rpm -e   ksh-20120801-144.el7_9.x86_64
 rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm 
  1. 忽略 swap size

image-20230713132637151

[root@localhost database]# vim /home/oracle/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk

image-20230713140849010

然后continue

image-20230713133830790

负责 然后执行脚本

image-20230713133915283

  1. 放行防火墙

​ [root@localhost database]# firewallcmdadd-port=1521/tcp
​ success
​ [root@localhost database]# firewallcmdadd-port=1521/tcp –permanent
​ success

  1. 配置环境变量
    su oracle
    切换oracle用户操作
    编辑配置文件
vi ~/.bash_profile
文件末尾加入以下内容,ORACLE_HOME中换成你实际安装的路径

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1/
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin

使用配置文件立即生效

source ~/.bash_profile

启动oracle

su oracle
sqlplus /nolog
SQL> connect /as sysdba
SQL> startup

sys用户登录

[oracle@localhost ~]$ sqlplus /nolog

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect as sysdba
Enter user-name: sys
Enter password: 
Connected.
SQL> select 1 from dual;

SQL> 

SQL> connect as sysdba
Enter username: sys
Enter password:
Connected.
SQL> select 1 from dual;

SQL>


参考链接:  https://blog.csdn.net/lxyoucan/article/details/113547596

原文地址:https://blog.csdn.net/weixin_46291263/article/details/131702904

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_9889.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注