IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Install Oracle database 11g on SLES 11 (SUSE Enterprise Linux 11 64bit SP4)

    Adamhuan发表于 2017-02-22 15:26:04
    love 0

    关于安装Oracle数据库,可以参考官方的文档:
    http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#BHCGGJAB

    本文为我在自己的环境中的搭建过程。

    ————————————————————————

    一、当前平台版本(Operating System Requirements)

    根据官方文档,目前Oracle database 11g支持的操作系统平台版本包括:
    Asianux Server 3 SP2
    Asianux Server 4 SP3
    Oracle Linux 4 Update 7
    Oracle Linux 5 Update 2 (with Red Hat Compatible Kernel)
    Oracle Linux 5 Update 5
    Oracle Linux 6
    Oracle Linux 6 (with Red Hat Compatible Kernel)
    Oracle Linux 7
    Oracle Linux 7 (with the Red Hat Compatible Kernel)
    Red Hat Enterprise Linux 4 Update 7
    Red Hat Enterprise Linux 5 Update 2
    Red Hat Enterprise Linux 6
    Red Hat Enterprise Linux 7
    SUSE Linux Enterprise Server 10 SP2
    SUSE Linux Enterprise Server 11
    SUSE Linux Enterprise Server 12 SP1
    NeoKylin Linux Advanced Server 6

    查看当前的操作系统版本(SUSE)

    suse-me:~ # cat /proc/version 
    Linux version 3.0.101-63-default (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP Tue Jun 23 16:02:31 UTC 2015 (4b89d0c)
    suse-me:~ # 
    suse-me:~ # ls -ltr /etc | grep --color release
    -rw-r--r--  1 root root        110 May  6  2010 lsb-release
    -rw-r--r--  1 root root        156 Jun 20  2015 os-release
    -rw-r--r--  1 root root         69 Jun 20  2015 SuSE-release
    drwxr-xr-x  2 root root       4096 Feb 20 10:42 lsb-release.d
    suse-me:~ # 
    suse-me:~ # cat /etc/lsb-release
    LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
    suse-me:~ # 
    suse-me:~ # cat /etc/os-release 
    NAME="SLES"
    VERSION="11.4"
    VERSION_ID="11.4"
    PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"
    ID="sles"
    ANSI_COLOR="0;32"
    CPE_NAME="cpe:/o:suse:sles:11:4"
    suse-me:~ # 
    suse-me:~ # cat /etc/SuSE-release 
    SUSE Linux Enterprise Server 11 (x86_64)
    VERSION = 11
    PATCHLEVEL = 4
    suse-me:~ # 
    suse-me:~ #

    二、内核版本(Kernel Requirements)

    官方要求如下:
    ##############
    On Oracle Linux 4 and Red Hat Enterprise Linux 4:2.6.9 or later
    ——–
    On Oracle Linux 5 Update 2 with Red Hat Compatible Kernel:2.6.18 or later
    On Oracle Linux 5 Update 5 with Red Hat Compatible Kernel:2.6.18 or later
    On Oracle Linux 5 Update 5 with Unbreakable Enterprise Kernel:2.6.32-100.0.19 or later
    ——–
    On Oracle Linux 6:2.6.32-100.28.5.el6.x86_64 or later
    On Oracle Linux 6 with Red Hat Compatible Kernel:2.6.32-71.el6.x86_64 or later
    ——–
    On Oracle Linux 7:3.8.13-33.el7uek.x86_64 or later
    On Oracle Linux 7 with Red Hat Compatible Kernel:3.10.0-54.0.1.el7.x86_64 or later
    ##############
    On Red Hat Enterprise Linux 5 Update 2:2.6.18 or later
    On Red Hat Enterprise Linux 5 Update 5:2.6.18 or later
    ——–
    On Red Hat Enterprise Linux 6:2.6.32-71.el6.x86_64 or later
    ——–
    On Red Hat Enterprise Linux 7:3.10.0-54.0.1.el7.x86_64 or later
    ##############
    On Asianux Server 3:2.6.18 or later
    ——–
    On Asianux Server 4:2.6.32-71.el6.x86_64 or later
    ##############
    On SUSE Linux Enterprise Server 10:2.6.16.21 or later
    ——–
    On SUSE Linux Enterprise Server 11:2.6.27.19 or later
    On SUSE Linux Enterprise Server 12:3.12.49-11 or later
    ##############
    On NeoKylin Linux Advanced Server 6:2.6.32-431.el6.x86_64 or later
    ##############

    查看当前系统内核版本:

    suse-me:~ # uname -r
    3.0.101-63-default
    suse-me:~ #

    三、软件包支持(Package Requirements)

    对于SUSE 11来说,以下软件包是需要安装的:

    The following or later version of packages for SUSE Linux Enterprise Server 11 must be installed:

    binutils-2.19
    gcc-4.3
    gcc-32bit-4.3
    gcc-c++-4.3
    glibc-2.9
    glibc-32bit-2.9
    glibc-devel-2.9
    glibc-devel-32bit-2.9
    ksh-93t
    libaio-0.3.104
    libaio-32bit-0.3.104
    libaio-devel-0.3.104
    libaio-devel-32bit-0.3.104
    libstdc++33-3.3.3
    libstdc++33-32bit-3.3.3
    libstdc++43-4.3.3_20081022
    libstdc++43-32bit-4.3.3_20081022
    libstdc++43-devel-4.3.3_20081022
    libstdc++43-devel-32bit-4.3.3_20081022
    libgcc43-4.3.3_20081022
    libstdc++-devel-4.3
    make-3.81
    sysstat-8.1.5

    在SUSE中,软件包的安装不像RHEL或者CENTOS那样可以通过YUM安装。
    在SUSE中,软件包的安装时通过YaST中的包管理器(软件管理器)来操作的,如下:


    像截图中那样,对照上面的RPM包列表,一个个的装上去。

    安装完成后,可以检查以下:

    suse-me:~ # rpm -qa binutils gcc gcc-32bit gcc-c++ glibc glibc-32bit glibc-devel glibc-devel-32bit ksh libaio libaio-32bit libaio-devel libaio-devel-32bit libstdc++33 libstdc++33-32bit libstdc++43 libstdc++43-32bit libstdc++43-devel libstdc++43-devel-32bit libgcc43 libstdc++-devel make sysstat
    libstdc++43-4.6.9-0.14.1.9
    binutils-2.24-3.62
    sysstat-8.1.5-7.50.25
    libgcc43-4.6.9-0.14.1.9
    libaio-32bit-0.3.109-0.1.46
    libstdc++43-devel-4.3.4_20091019-0.37.30
    libaio-0.3.109-0.1.46
    libstdc++33-3.3.3-11.9
    libstdc++43-32bit-4.6.9-0.14.1.9
    libaio-devel-0.3.109-0.1.46
    libaio-devel-32bit-0.3.109-0.1.46
    libstdc++-devel-4.3-62.200.2
    gcc-4.3-62.200.2
    make-3.81-128.20
    libstdc++33-32bit-3.3.3-11.9
    ksh-93u-0.26.1
    glibc-devel-2.11.3-17.84.1
    gcc-32bit-4.3-62.200.2
    glibc-2.11.3-17.84.1
    glibc-devel-32bit-2.11.3-17.84.1
    gcc-c++-4.3-62.200.2
    glibc-32bit-2.11.3-17.84.1
    libstdc++43-devel-32bit-4.3.4_20091019-0.37.30
    suse-me:~ #

    额外的软件包支持:

    On SUSE 11:

    unixODBC-2.2.12 or later
    unixODBC-devel-2.2.12 or later
    unixODBC-32bit-2.2.12 (32-bit) or later

    安装完成后检查:

    suse-me:~ # rpm -qa unixODBC unixODBC-devel unixODBC-32bit
    unixODBC-32bit-2.2.12-198.17
    unixODBC-devel-2.2.12-198.17
    unixODBC-2.2.12-198.17
    suse-me:~ #

    四、创建需要的系统组与用户(Creating Required Operating System Groups and Users)

    The following local operating system groups and users are required if you are installing Oracle Database:

    The Oracle Inventory group (typically, oinstall)
    The OSDBA group (typically, dba)
    The Oracle software owner (typically, oracle)
    The OSOPER group (optional. Typically, oper)

    开始创建:

    suse-me:~ # grep dba /etc/group
    suse-me:~ # grep oinstall /etc/group
    suse-me:~ # 
    suse-me:~ # groupadd oinstall
    suse-me:~ # groupadd dba
    suse-me:~ # 
    suse-me:~ # grep oracle /etc/passwd
    suse-me:~ # 
    suse-me:~ # useradd -g oinstall -G dba oracle
    suse-me:~ # 
    suse-me:~ # grep oracle /etc/passwd
    oracle:x:1001:1000::/home/oracle:/bin/bash
    suse-me:~ # 
    suse-me:~ # id oracle
    uid=1001(oracle) gid=1000(oinstall) groups=1001(dba),1000(oinstall)
    suse-me:~ #

    修改账户口令:

    suse-me:~ # passwd oracle
    Changing password for oracle.
    New Password: 
    Bad password: too simple
    Reenter New Password: 
    Password changed.
    suse-me:~ # 
    suse-me:~ #

    五、配置内核参数与资源配额(Configuring Kernel Parameters and Resource Limits)

    内核参数:
    Using any text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following:

    Note:
    Include lines only for the kernel parameter values to change. For the semaphore parameters (kernel.sem), you must specify all four values. However, if any of the current values are larger than the minimum value, then specify the larger value.

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

    具体如下:

    suse-me:~ # cat /etc/sysctl.conf 
    # Disable response to broadcasts.
    # You don't want yourself becoming a Smurf amplifier.
    net.ipv4.icmp_echo_ignore_broadcasts = 1
    # enable route verification on all interfaces
    net.ipv4.conf.all.rp_filter = 1
    # enable ipV6 forwarding
    #net.ipv6.conf.all.forwarding = 1
    # increase the number of possible inotify(7) watches
    fs.inotify.max_user_watches = 65536
    # avoid deleting secondary IPs on deleting the primary IP
    net.ipv4.conf.default.promote_secondaries = 1
    net.ipv4.conf.all.promote_secondaries = 1
    
    # for oracle database 11g
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    suse-me:~ # 
    suse-me:~ # chkconfig boot.sysctl on
    suse-me:~ # 
    suse-me:~ # sysctl -p
    net.ipv4.icmp_echo_ignore_broadcasts = 1
    net.ipv4.conf.all.rp_filter = 1
    fs.inotify.max_user_watches = 65536
    net.ipv4.conf.default.promote_secondaries = 1
    net.ipv4.conf.all.promote_secondaries = 1
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    suse-me:~ #

    配置完成后,验证:

    suse-me:~ # /sbin/sysctl -a | grep --color shmall
    kernel.shmall = 2097152
    suse-me:~ #

    对于SUSE的Linux来说,为了让oinstall系统组成员有权限创建共享内存段,还需要做如下参数配置:
    Doing this grants members of oinstall a group permission to create shared memory segments.

    具体如下:

    suse-me:~ # /sbin/sysctl -a | grep --color hugetlb_shm_group
    vm.hugetlb_shm_group = 0
    suse-me:~ # 
    suse-me:~ # grep oinstall /etc/group
    oinstall:!:1000:
    suse-me:~ # 
    suse-me:~ # cat /proc/sys/vm/hugetlb_shm_group 
    0
    suse-me:~ # 
    suse-me:~ # echo 1000 > /proc/sys/vm/hugetlb_shm_group
    suse-me:~ # 
    suse-me:~ # cat /proc/sys/vm/hugetlb_shm_group 
    1000
    suse-me:~ # 
    suse-me:~ # /sbin/sysctl -a | grep --color hugetlb_shm_group
    vm.hugetlb_shm_group = 1000
    suse-me:~ # 
    
    suse-me:~ # grep hugetlb_shm_group /etc/sysctl.conf 
    suse-me:~ # 
    suse-me:~ # echo "vm.hugetlb_shm_group = 1000" >> /etc/sysctl.conf 
    suse-me:~ # grep hugetlb_shm_group /etc/sysctl.conf 
    vm.hugetlb_shm_group = 1000
    suse-me:~ #

    文件:/etc/security/limits.conf

    suse-me:~ # tail -n 8 /etc/security/limits.conf 
    # End of file
    
    # for oracle database 11g
    oracle soft nproc  2047
    oracle hard nproc  16384
    
    oracle soft nofile 4096
    oracle hard nofile 65536
    
    oracle soft stack  10240
    oracle hard stack  32768
    suse-me:~ #

    验证:

    suse-me:~ # su - oracle
    su: warning: cannot change directory to /home/oracle: No such file or directory
    oracle@suse-me:/root> 
    oracle@suse-me:/root> ulimit -Sn
    4096
    oracle@suse-me:/root> ulimit -Hn
    65536
    oracle@suse-me:/root> 
    oracle@suse-me:/root> ulimit -Su
    2047
    oracle@suse-me:/root> ulimit -Hu
    16384
    oracle@suse-me:/root> 
    oracle@suse-me:/root> ulimit -Ss
    10240
    oracle@suse-me:/root> ulimit -Hs
    32768
    oracle@suse-me:/root>

    六、创建需要的目录结构(Creating Required Directories)

    具体如下:

    suse-me:~ # mkdir -p /u01/app
    suse-me:~ # chown -R oracle.oinstall /u01
    suse-me:~ # chmod -R 775 /u01
    suse-me:~ # 
    suse-me:~ # mkdir -p /home/oracle
    suse-me:~ # chown -R oracle.oinstall /home/oracle/
    suse-me:~ # chmod -R 775 /home/oracle/
    suse-me:~ #

    七、配置用户环境变量(Configuring the oracle User’s Environment)

    主要是用户【oracle】的环境变量。

    具体如下:

    suse-me:~ # su - oracle
    oracle@suse-me:~> pwd
    /home/oracle
    oracle@suse-me:~> ls -altr
    total 8
    drwxr-xr-x 4 root   root     4096 Feb 21 07:09 ..
    drwxrwxr-x 2 oracle oinstall 4096 Feb 21 07:09 .
    oracle@suse-me:~> 
    oracle@suse-me:~> echo $SHELL
    /bin/bash
    oracle@suse-me:~> 
    
    oracle@suse-me:~> vi .bash_profile
    oracle@suse-me:~> cat .bash_profile 
    
    # for oracle database 11g
    
    export TMP=/u01/tmp
    export TMPDIR=/u01/tmp
    
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11g/db_1
    
    export ORACLE_SID=orcl
    
    export PATH=$ORACLE_HOME/bin:$PATH
    oracle@suse-me:~> 
    oracle@suse-me:~> env | grep ORACLE_SID
    oracle@suse-me:~> 
    oracle@suse-me:~> source .bash_profile 
    oracle@suse-me:~> 
    oracle@suse-me:~> env | grep ORACLE_HOME
    ORACLE_HOME=/u01/app/oracle/product/11g/db_1
    oracle@suse-me:~> 
    oracle@suse-me:~> mkdir -p $ORACLE_HOME
    oracle@suse-me:~> mkdir -p $TMPDIR
    oracle@suse-me:~>

    到这里,准备工作就完成了。

    八、上传安装介质。

    具体如下:

    suse-me:~ # mkdir /software
    suse-me:~ # 
    suse-me:~ # cd /software
    suse-me:/software # ls -ltr
    total 0
    suse-me:/software # 
    suse-me:/software # ls -ltr
    total 2489640
    -rw-r--r-- 1 root root 1395582860 Aug 28  2013 p13390677_112040_Linux-x86-64_1of7.zip
    -rw-r--r-- 1 root root 1151304589 Aug 28  2013 p13390677_112040_Linux-x86-64_2of7.zip
    suse-me:/software # 
    suse-me:/software # du -sh *
    1.4G    p13390677_112040_Linux-x86-64_1of7.zip
    1.1G    p13390677_112040_Linux-x86-64_2of7.zip
    suse-me:/software # 
    suse-me:/software #

    解压:
    unzip xxx

    解压后:

    suse-me:/software # ls
    database  p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_2of7.zip
    suse-me:/software # 
    suse-me:/software # cd database/
    suse-me:/software/database # 
    suse-me:/software/database # ls
    install  readme.html  response  rpm  runInstaller  sshsetup  stage  welcome.html
    suse-me:/software/database # 
    suse-me:/software/database #

    当前解压的用户是root,后面要执行安装的是oracle,所以要授权:

    suse-me:/software/database # chmod -R 777 /software/
    suse-me:/software/database #

    九、配置DISPLAY

    具体如下:

    suse-me:/software/database # ping -c 3 192.168.147.1
    PING 192.168.147.1 (192.168.147.1) 56(84) bytes of data.
    64 bytes from 192.168.147.1: icmp_seq=1 ttl=64 time=0.240 ms
    64 bytes from 192.168.147.1: icmp_seq=2 ttl=64 time=0.150 ms
    64 bytes from 192.168.147.1: icmp_seq=3 ttl=64 time=0.173 ms
    
    --- 192.168.147.1 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 1998ms
    rtt min/avg/max/mdev = 0.150/0.187/0.240/0.041 ms
    suse-me:/software/database # 
    suse-me:/software/database # env | grep DISPLAY
    suse-me:/software/database # 
    suse-me:/software/database # export DISPLAY=192.168.147.1:0.0
    suse-me:/software/database # xhost +
    access control disabled, clients can connect from any host
    xhost:  must be on local machine to enable or disable access control.
    suse-me:/software/database # 
    
    suse-me:/software/database # su - oracle
    oracle@suse-me:~> env | grep DISPLAY
    oracle@suse-me:~> export DISPLAY=192.168.147.1:0.0
    oracle@suse-me:~> xhost +
    access control disabled, clients can connect from any host
    xhost:  must be on local machine to enable or disable access control.
    oracle@suse-me:~>

    十、图形化安装

    这个部分以前的文档重复很多次了,不再重复;我只会列举一些特别的错误。

    启动:OUI

    oracle@suse-me:~> cd /software/database/
    oracle@suse-me:/software/database> ls -ltr
    total 60
    drwxrwxrwx  2 root root  4096 Aug 27  2013 sshsetup
    -rwxrwxrwx  1 root root  3267 Aug 27  2013 runInstaller
    drwxrwxrwx  2 root root  4096 Aug 27  2013 rpm
    drwxrwxrwx  2 root root  4096 Aug 27  2013 response
    -rwxrwxrwx  1 root root 30016 Aug 27  2013 readme.html
    drwxrwxrwx 14 root root  4096 Aug 27  2013 stage
    -rwxrwxrwx  1 root root   500 Aug 27  2013 welcome.html
    drwxrwxrwx  4 root root  4096 Aug 27  2013 install
    oracle@suse-me:/software/database> 
    oracle@suse-me:/software/database> ./runInstaller &
    [1] 59348
    oracle@suse-me:/software/database> Starting Oracle Universal Installer...
    
    Checking Temp space: must be greater than 120 MB.   Actual 8791 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 2053 MB    Passed
    
    oracle@suse-me:/software/database>

    这个过程中遇到过这样的一些报错:

    The information provided for this listener is currently in use by other software on this computer

    具体的情况如下:

    报错日志如下:

    INFO: ConfigClient.executeToolsInAggregate action assigned
    INFO: Started Plugin named: Oracle Net Configuration Assistant
    INFO: Found associated job
    INFO: Starting 'Oracle Net Configuration Assistant'
    INFO: Starting 'Oracle Net Configuration Assistant'
    INFO: Parsing command line arguments:
    INFO:     Parameter "orahome" = /u01/app/oracle/product/11g/db_1
    INFO:     Parameter "orahnam" = OraDb11g_home1
    INFO:     Parameter "instype" = typical
    INFO:     Parameter "inscomp" = client,oraclenet,javavm,server,ano
    INFO:     Parameter "insprtcl" = tcp
    INFO:     Parameter "cfg" = local
    INFO:     Parameter "authadp" = NO_VALUE
    INFO:     Parameter "responsefile" = /u01/app/oracle/product/11g/db_1/network/install/netca_typ.rsp
    INFO:     Parameter "silent" = true
    INFO: Done parsing command line arguments.
    INFO: Oracle Net Services Configuration:
    INFO: Profile configuration complete.
    INFO: Oracle Net Listener Startup:
    INFO: The information provided for this listener is currently in use by other software on this computer. 
    INFO:     Listener start failed.
    INFO: Check the trace file for details: /u01/app/oracle/cfgtoollogs/netca/trace_OraDb11g_home1-1702218AM0653.log
    INFO: Oracle Net Services configuration failed.  The exit code is 1
    INFO: 
    WARNING: 
    INFO: Completed Plugin named: Oracle Net Configuration Assistant

    这个问题,是由于:
    1. HOSTS文件配置不正确
    2. 监听器配置文件的主机名设定不正确

    具体如下:

    HOSTS文件的错误

    suse-me:~ # cat /etc/hosts | grep -v '#'
    
    127.0.0.1       localhost
    
    ::1             localhost ipv6-localhost ipv6-loopback
    
    fe00::0         ipv6-localnet
    
    ff00::0         ipv6-mcastprefix
    ff02::1         ipv6-allnodes
    ff02::2         ipv6-allrouters
    ff02::3         ipv6-allhosts
    
    suse-me:~ # 
    suse-me:~ # ping -c 3 `hostname`
    PING suse-me.localdomain (180.168.41.175) 56(84) bytes of data.
    
    --- suse-me.localdomain ping statistics ---
    3 packets transmitted, 0 received, 100% packet loss, time 2000ms
    
    suse-me:~ #

    可以看到,/etc/hosts中没有本机的公网IP的记录。

    添加该记录:

    suse-me:~ # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:C7:B8:AE  
              inet addr:192.168.147.130  Bcast:192.168.147.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:fec7:b8ae/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2643514 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1272023 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:2716098288 (2590.2 Mb)  TX bytes:247222386 (235.7 Mb)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:108 errors:0 dropped:0 overruns:0 frame:0
              TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:8897 (8.6 Kb)  TX bytes:8897 (8.6 Kb)
    
    suse-me:~ # 
    suse-me:~ # cat /etc/hosts
    #
    # hosts         This file describes a number of hostname-to-address
    #               mappings for the TCP/IP subsystem.  It is mostly
    #               used at boot time, when no name servers are running.
    #               On small systems, this file can be used instead of a
    #               "named" name server.
    # Syntax:
    #    
    # IP-Address  Full-Qualified-Hostname  Short-Hostname
    #
    
    127.0.0.1       localhost
    
    # special IPv6 addresses
    ::1             localhost ipv6-localhost ipv6-loopback
    
    fe00::0         ipv6-localnet
    
    ff00::0         ipv6-mcastprefix
    ff02::1         ipv6-allnodes
    ff02::2         ipv6-allrouters
    ff02::3         ipv6-allhosts
    
    # Public
    192.168.147.130 suse-me
    suse-me:~ # 
    suse-me:~ # ping -c 3 `hostname`
    PING suse-me (192.168.147.130) 56(84) bytes of data.
    64 bytes from suse-me (192.168.147.130): icmp_seq=1 ttl=64 time=0.014 ms
    64 bytes from suse-me (192.168.147.130): icmp_seq=2 ttl=64 time=0.020 ms
    64 bytes from suse-me (192.168.147.130): icmp_seq=3 ttl=64 time=0.024 ms
    
    --- suse-me ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 1998ms
    rtt min/avg/max/mdev = 0.014/0.019/0.024/0.005 ms
    suse-me:~ #

    监听器配置文件的不正确。

    如下:
    不正确的样子:

    suse-me:~ # su - oracle
    oracle@suse-me:~> cat $ORACLE_HOME/network/admin/listener.ora
    # listener.ora Network Configuration File: /u01/app/oracle/product/11g/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 180.168.41.175)(PORT = 1521))
        )
      )
    
    ADR_BASE_LISTENER = /u01/app/oracle
    
    oracle@suse-me:~>

    修改正确后的样子:

    oracle@suse-me:~> cat $ORACLE_HOME/network/admin/listener.ora
    # listener.ora Network Configuration File: /u01/app/oracle/product/11g/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          #(ADDRESS = (PROTOCOL = TCP)(HOST = 180.168.41.175)(PORT = 1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.147.130)(PORT = 1521))
        )
      )
    
    ADR_BASE_LISTENER = /u01/app/oracle
    
    oracle@suse-me:~>

    然后重新执行OUI中的错误的任务:

    做之前,先检查当前有没有监听进程启动:

    oracle@suse-me:~> ps -ef | grep lsnr
    oracle    66157  66127  0 09:20 pts/2    00:00:00 grep lsnr
    oracle@suse-me:~>

    可以看到,没有监听启动。

    OUI操作:


    可以看到,如上修复问题点后,重新跑失败的任务,已经走过去了。

    这时候看看监听进程的情况:

    suse-me:~ # ps -ef | grep lsnr
    oracle    66436      1  0 09:21 ?        00:00:00 /u01/app/oracle/product/11g/db_1/bin/tnslsnr LISTENER -inherit
    root      69825  65792  0 09:28 pts/2    00:00:00 grep lsnr
    suse-me:~ #

    可以看到,监听进程已经启动。
    该问题的处理结束。

    接下来都没有什么问题,最后运行下安装后脚本:

    suse-me:~ # /u01/app/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.
    suse-me:~ # 
    suse-me:~ # /u01/app/oracle/product/11g/db_1/root.sh 
    Performing root user operation for Oracle 11g 
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/11g/db_1
    
    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 script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.
    suse-me:~ # 
    suse-me:~ #

    这样,数据库就安装完成了。

    十一、使用一下

    进数据库做一些查询与使用:

    suse-me:~ # whoami
    root
    suse-me:~ # df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda2        18G   15G  2.6G  85% /
    udev            1.9G   88K  1.9G   1% /dev
    tmpfs           1.9G  391M  1.5G  21% /dev/shm
    /dev/sr0        3.2G  3.2G     0 100% /media/SLES-11-SP4-DVD-x86_6412211
    suse-me:~ # 
    suse-me:~ # su - oracle
    oracle@suse-me:~> 
    oracle@suse-me:~> ps -ef | grep pmon
    oracle    66718      1  0 09:25 ?        00:00:00 ora_pmon_orcl
    oracle    70538  70510  0 09:32 pts/2    00:00:00 grep pmon
    oracle@suse-me:~> 
    oracle@suse-me:~> env | grep SID
    ORACLE_SID=orcl
    oracle@suse-me:~> 
    oracle@suse-me:~> sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 21 09:32:40 2017
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> 
    SQL> select name,database_role,open_mode,current_scn from v$database;
    
    NAME      DATABASE_ROLE    OPEN_MODE            CURRENT_SCN
    --------- ---------------- -------------------- -----------
    ORCL      PRIMARY          READ WRITE                999978
    
    SQL> 
    SQL> select instance_name,status from v$instance;
    
    INSTANCE_NAME    STATUS
    ---------------- ------------
    orcl             OPEN
    
    SQL> 
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    oracle@suse-me:~> 
    oracle@suse-me:~> lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-FEB-2017 09:33:27
    
    Copyright (c) 1991, 2013, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
    Start Date                21-FEB-2017 09:21:12
    Uptime                    0 days 0 hr. 12 min. 15 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11g/db_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/suse-me/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.147.130)(PORT=1521)))
    Services Summary...
    Service "orcl" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
      Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    oracle@suse-me:~> 
    oracle@suse-me:~> tnsping orcl
    
    TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-FEB-2017 09:33:32
    
    Copyright (c) 1997, 2013, Oracle.  All rights reserved.
    
    Used parameter files:
    /u01/app/oracle/product/11g/db_1/network/admin/sqlnet.ora
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.147.130)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
    OK (0 msec)
    oracle@suse-me:~> 
    oracle@suse-me:~>

    十二、终了

    至此,在SUSE 11上安装Oracle Database 11g,就结束了。

    ——————————————————
    Done。



沪ICP备19023445号-2号
友情链接