美文网首页
云主机CentOS7.6安装Oracle 11g&Informa

云主机CentOS7.6安装Oracle 11g&Informa

作者: xuyaomvp | 来源:发表于2020-04-17 16:13 被阅读0次

个人爬坑记,未完,更新中......


一、安装FTP并设置为本地用户模式


1.关闭防火墙和SELinux

2.安装vsftp软件包和ftp客户端

[root@hsu ~]# yum install -y vsftpd
[root@hsu ~]# yum install ftp

3.添加ftp本地用户

添加用户

[root@hsu ~]# useradd -d /data/ftp/uploads -g ftp ftpadmin

设置密码

[root@hsu vsftpd]# passwd ftpadmin

4.备份vsftpd的默认配置文件

[root@hsu ~]# cd /etc/vsftpd/
[root@hsu vsftpd]# cp vsftpd.conf vsftpd.conf.bak
# grep 命令后面添加-v 参数,过滤并反选出没有包含井号( #)的参数行(即过滤掉所有的注释信息),然后将过滤后的参数行通过输出重定向符写回原始的主配置文件中
[root@hsu vsftpd]# grep -v "#" /etc/vsftpd/vsftpd.conf.bak > /etc/vsftpd/vsftpd.conf 

5.修改配置

[root@hsu vsftpd]# vim vsftpd.conf

内容修改如下:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
#dirmessage_enable=YES
xferlog_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
dual_log_enable=YES
xferlog_file=/var/log/xferlog
xferlog_std_format=YES
connect_from_port_20=YES

chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

listen=NO
listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

#上传目录被限制在/home/ftpadmin/uploads
local_root=/home/ftpadmin/uploads
allow_writeable_chroot=YES
pasv_min_port=30000
pasv_max_port=30999
pasv_enable=YES
pasv_promiscuous=YES
chroot_local_user=YES chroot_local_user=NO
chroot_list_enable=YES 1.所有用户都被限制在其主目录下 2.使用chroot_list_file指定的用户列表,这些用户作为“例外”,不受限制 1.所有用户都不被限制其主目录下 2.使用chroot_list_file指定的用户列表,这些用户作为“例外”,受到限制
chroot_list_enable=NO 1.所有用户都被限制在其主目录下 2.不使用chroot_list_file指定的用户列表,没有任何“例外”用户 1.所有用户都不被限制其主目录下 2.不使用chroot_list_file指定的用户列表,没有任何“例外”用户

6.开放端口和安全组策略

把20-22、30000-30999端口开放


7.在/etc/vsftpd下新建chroot_list文件

[root@hsu vsftpd]# touch /etc/vsftpd/chroot_list

8.重启vsftpd

systemctl restart vsftpd.service

9.本地电脑下载安装FTP工具,Xftp、FileZilla等并连接


二、上传安装包



三、安装JDK


1.解压JDK

[root@hsu jdk]# tar -xzvf /home/ftpadmin/uploads/jdk-8u191-linux-x64.tar.gz -C /usr/local
[root@hsu jdk]# mv jdk1.8.0_191 jdk jdk

2.配置环境变量

[root@hsu jdk]# vim /etc/profile

文件配置如下

export JAVA_HOME=/usr/local/jdk
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

3.生效环境变量

[root@hsu jdk]# source /etc/profile

4.验证环境变量是否生效

[root@hsu jdk]# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

四、安装Oracle 11g


1.检查硬件要求

要求:内存最小1G,推荐2G或者更高

#查看命令,下列是我的内存
[root@hsu jdk]# grep MemTotal /proc/meminfo
MemTotal:        1881700 kB

2.环境准备

安装必要的工具

#wget:下载工具;zip:打包工具;unzip:解压工具
[root@hsu jdk]# yum -y install wget zip unzip

关闭防火墙

#查看防火墙状态
[root@hsu ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
  Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
  Active: inactive (dead)
  Docs: man:firewalld(1)
#关闭防火墙
[root@hsu ~]# systemctl stop firewalld
#禁用防火墙
[root@hsu ~]# systemctl disable firewalld

关闭Selinux

#查看Selinux状态
[root@hsu~]# /usr/sbin/sestatus -v
SELinux status:                 disabled

解压安装包并放到/tmp目录下

[root@hsu database]# unzip linux.x64_11gR2_database_1of2.zip
[root@hsu database]# unzip linux.x64_11gR2_database_2of2.zip
[root@hsu uploads]# mv database /u01

安装Oracle依赖包

[root@hsu database]# yum install gcc make binutils gcc-c++ compat-libstdc++-33elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel –y

添加安装用户和用户组

[root@hsu database]# groupadd oinstall
[root@hsu database]# groupadd dba
[root@hsu database]# useradd -g oinstall -G dba oracle
[root@hsu database]# passwd oracle
Changing password for user oracle.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@hsu database]# id oracle
uid=1001(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba)

修改内核参数配置文件

vim /etc/sysctl.conf

增加以下内容

#Oracle内核配置文件
io-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

查看是否成功写进/etc/sysctl.conf文件中

[root@hsu database]# sysctl -p
vm.swappiness = 0
net.core.somaxconn = 1024
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 1024
sysctl: cannot stat /proc/sys/io-max-nr: No such file or directory
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

其中kernel.shmmax = 1073741824为本机物理内存(2G)的一半,单位为byte

修改用户的限制文件

[root@hsu database]# vim /etc/security/limits.conf

在末尾添加以下内容

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

修改/etc/pam.d/login文件

[root@hsu database]# vim /etc/pam.d/login

在末尾添加以下内容

session required  /lib64/security/pam_limits.so
session required   pam_limits.so

修改/etc/profile文件

[root@hsu database]# vim /etc/profile

在末尾添加以下内容

#oracle配置
if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
  else
      ulimit -u 16384 -n 65536
  fi
fi

3.创建安装目录和设置文件权限

#创建安装的目录
[root@hsu ~]# mkdir -p /u01/oracle/product/11.2.0/db_1
[root@hsu database]# mkdir /u01/oracle/oradata
[root@hsu database]# mkdir /u01/oracle/inventory
[root@hsu database]# mkdir /u01/oracle/fast_recovery_area
#更改oracle目录的属主
[root@hsu ~]# chown oracle:oinstall -R /u01

#更改oracle目录的权限
[root@hsu ~]# chmod 755  -R /u01/oracle

4.配置oracle用户环境变量

#切换到oracle用户环境
[root@hsu~]# su - oracle

#编辑bash_profile文件,追加下列内容
[oracle@hsu~]$ vi .bash_profile

export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=vt100
export PATH=/usr/sbin:$PATH
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
#oracle用户这个客户端所识别的时间显式格式
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'

生效环境变量

[oracle@hsu ~]$ source .bash_profile

5.解压oracle安装包

[root@hsu u01]# unzip /home/ftpadmin/uploads/linux.x64_11gR2_database_1of2.zip -d /tmp
[root@hsu u01]# unzip /home/ftpadmin/uploads/linux.x64_11gR2_database_2of2.zip -d /tmp

[root@hsu tmp]# chown oracle:oinstall -R database
[root@hsu tmp]# chmod 755  -R database

6.配置Oracle静默安装需要用到的应答文件

#切换到oracle用户
[root@hsu response]# su - oracle
[oracle@hsu u01]# cd /u01/database/response
[oracle@hsu response]# ll
total 76
#修改数据库应答文件
-rwxr-xr-x 1 oracle oinstall 44969 Feb 14  2009 dbca.rsp
#安装应答
-rwxr-xr-x 1 oracle oinstall 22557 Aug 15  2009 db_install.rsp
#建立监听、本地服务名等网络设置的应答
-rwxr-xr-x 1 oracle oinstall  5740 Feb 26  2009 netca.rsp

修改内容如下

[oracle@hsu response]# vi db_install.rsp
[oracle@hsu response]# cat db_install.rsp | grep -v "#"|grep -v "^$"
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=hsu
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ora11g
oracle.install.db.config.starterdb.SID=ORCL
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=512
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=

7.确认swap空间足够

[oracle@hsu ~]$ free
              total        used        free      shared  buff/cache   available
Mem:        1881700      185124       79976       12396     1616600     1521300
Swap:             0           0           0
[root@hsu response]# dd if=/dev/zero of=swapfile bs=1024 count=500000
500000+0 records in
500000+0 records out
512000000 bytes (512 MB) copied, 0.868331 s, 590 MB/s
[root@hsu response]# mkswap swapfile
Setting up swapspace version 1, size = 499996 KiB
no label, UUID=0bd72bfd-3bc1-4277-ba25-30ba39317edf
[root@hsu response]# swapon swapfile
swapon: /u01/database/response/swapfile: insecure permissions 0644, 0600 suggested.
[root@hsu response]# free
              total        used        free      shared  buff/cache   available
Mem:        1881700      180828       77388       12388     1623484     1522652
Swap:        499996           0      499996
[root@hsu response]# su - oracle

8.安装数据库软件

[oracle@hsu ~]$[oracle@hsu ~]$ /tmp/database/runInstaller -silent -force -ignorePrereq -responseFile  /tmp/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 23010 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 488 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-04-19_10-04-40PM. Please wait ...[oracle@hsu ~]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
   CAUSE: The Central Inventory is located in the Oracle base.
   ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
   CAUSE: The Central Inventory is located in the Oracle base.
   ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
You can find the log of this install session at:
 /u01/oracle/oraInventory/logs/installActions2020-04-19_10-04-40PM.log

查看安装日志

[root@hsu ~]# tail -f /u01/oracle/oraInventory/logs/installActions*log

静等两三分钟,会跳出下列内容,表示安装成功

[oracle@hsu ~]$ The following configuration scripts need to be executed as the "root" user. 
 #!/bin/sh 
 #Root scripts to run

/u01/oracle/oraInventory/orainstRoot.sh
/u01/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
     1. Open a terminal window 
     2. Log in as "root" 
     3. Run the scripts 
     4. Return to this window and hit "Enter" key to continue 

Successfully Setup Software.

切换到root用户执行脚本

[oracle@hsu ~]$ exit
logout
[root@hsu response]# cd
[root@hsu ~]# /u01/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@hsu ~]# /u01/oracle/product/11.2.0/db_1/root.sh
Check /u01/oracle/product/11.2.0/db_1/install/root_hsu_2020-04-19_22-28-20.log for the output of root script

9.安装监听

#切换到oracle用户
[root@hsu ~]# su - oracle
Last login: Sun Apr 19 22:02:12 CST 2020 on pts/2

#打开database
[oracle@hsu ~]$ cd /u01/database

#安装应答
[oracle@hsu database]$ $ORACLE_HOME/bin/netca /silent /responseFile /u01/database/response/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /u01/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /u01/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

#查看监听状态,监听安装完默认是启动的
[oracle@hsu database]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-APR-2020 22:31:25

Copyright (c) 1991, 2009, 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.1.0 - Production
Start Date                19-APR-2020 22:31:17
Uptime                    0 days 0 hr. 0 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/diag/tnslsnr/hsu/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hsu)(PORT=1521)))
The listener supports no services
The command completed successfully

#如果监听没有启动,可以通过下列命令启动
[oracle@hsu database]$  lsnrctl start

10.静默dbca建立数据库

#编辑dbca.rsp文件
[oracle@hsudatabase]$ vi /u01/database/response/dbca.rsp
#进入编辑模式之后,shif+;/:键,输入set nu 命令是文件显示行数
 #78行,全局数据库名字 sid+hostname
GDBNAME = "orcl.hsu"
 #149行
SID = "orcl"
 #415行,编码
CHARACTERSET = "AL32UTF8"
 #425行
NATIONALCHARACTERSET= "UTF8"

#开始安装
[oracle@hsu database]$ $ORACLE_HOME/bin/dbca -silent -responseFile /u01/database/response/dbca.rsp
#此处无任何提示
#输入 SYS 用户口令,回车
#输入 SYSTEM 用户口令,回车,然后安装会继续
Copying database files                                                                                                              
1% complete                                                                                                                         
3% complete                                                                                                                         
11% complete                                                                                                                        
18% complete                                                                                                                        
37% complete                                                                                                                        
Creating and starting Oracle instance                                                                                               
40% complete                                                                                                                        
45% complete                                                                                                                        
50% complete                                                                                                                        
55% complete                                                                                                                        
56% complete                                                                                                                        
60% complete                                                                                                                        
62% complete                                                                                                                        
Completing Database Creation                                                                                                        
66% complete                                                                                                                        
70% complete                                                                                                                        
73% complete                                                                                                                        
85% complete                                                                                                                        
96% complete                                                                                                                        
100% complete                                                                                                                       
Look at the log file "/u01/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

#安装完成后一般自动启动数据库,如果没有输入下列命令启动数据库
[oracle@node1 database]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 19 22:55:58 2020                                                                 
                                                                                                                                    
Copyright (c) 1982, 2009, Oracle.  All rights reserved. 

Connected to:                                                                                                                       
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production                                                        
With the Partitioning, OLAP, Data Mining and Real Application Testing options

#启动数据库
SQL> startup
#退出
SQL> quit

11.本地安装Oracle Client

12.本地安装PL/SQL Developer

13.PL/SQL Developer客户端连接远程Oracle数据库

ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务

#打开文件夹
[oracle@hsu database]$ cd /u01/oracle/product/11.2.0/db_1/network/admin
[oracle@hsu admin]$ ls
listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

#修改listener.ora,192.168.0.79为服务器的私有IP,千万别设置成公网IP
[oracle@hsu admin]$ cp listener.ora listener.ora.bak
[oracle@hsu admin]$ vim listener.ora

#修改内容如下
# listener.ora Network Configuration File: /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/oracle/product/11.2.0/db_1)
      (SID_NAME = orcl)
    )
  )

LISTENER =
    (DESCRIPTION =
        (ADDRESS =
            (PROTOCOL = TCP)(HOST = 192.168.0.79)(PORT = 1521)
        )
    )

ADR_BASE_LISTENER = /u01/oracle

#修改tnsnames.ora
[oracle@hsu admin]$ cp tnsnames.ora tnsnames.ora.bak                                                                                
[oracle@hsu admin]$ vim tnsnames.ora
#修改内容如下
# tnsnames.ora Network Configuration File: /u01/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.79)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = orcl)
    )
  )

#关闭监听服务
[oracle@hsu admin]$ lsnrctl stop

#启动监听服务
[oracle@hsu admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-APR-2020 23:10:35

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/oracle/diag/tnslsnr/hsu/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.79)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.79)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                19-APR-2020 23:10:35
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/diag/tnslsnr/hsu/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.79)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

14.设置数据库自启动

修改dbstart、dbshut文件

# $ORACLE_HOME/bin/dbshut修改的内容是一样的,不再重复
[oracle@hsu admin]$ vi $ORACLE_HOME/bin/dbstart
第80行
ORACLE_HOME_LISTNER=$1
修改为:
ORACLE_HOME_LISTNER=$ORACLE_HOME

修改/etc/oratab文件

#/u01/oracle/product/11.2.0/db_1/这个是自己安装路径,只需要将N改为Y
[oracle@hsu admin]$ vi /etc/oratab
orcl:/u01/oracle/product/11.2.0/db_1/:N
修改为:
orcl:/u01/oracle/product/11.2.0/db_1/:Y

把lsnrctl start和dbstart添加到rc.local文件中

oracle用户下没有权限切换到root用户
[oracle@hsu admin]$ exit
logout
[root@hsu ~]# vi /etc/rc.d/rc.local

#添加一下内容
su - oracle -lc "/u01/oracle/product/11.2.0/db_1/bin/lsnrctl start"
su - oracle -lc "/u01/oracle/product/11.2.0/db_1/bin/dbstart"

添加执行权限

[root@hsu ~]# chmod +x /etc/rc.d/rc.local

重启系统,然后查看一下是否自启动成功

五、安装Informatica9.5.1

1.创建infa用户与oinstall组

[root@hsu /]# groupadd infa
[root@hsu /]# useradd -g infa -G dba,oinstall infa

2.解压


2.配置环境变量

[root@hsu ~]# su - infa
[infa@hsu ~]$ vim .bash_profile

追加以下内容:

export JAVA_HOME=/usr/local/jdk
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=/u01/oracle/product/11.2.0/db_1
export PATH=/usr/sbin:$PATH
export ORACLE_SID=orcl
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

export PM_CODEPAGENAME="MS936"
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export INFA_HOME=/home/infa/Informatica/9.5.1
export LD_LIBRARY_PATH=$INFA_HOME/server/bin:$INFA_HOME/ODBC7.0/lib:$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
export INFA_DOMAINS_FILE=$INFA_HOME/domains.infa

NLS_LANG需要和oracle server中的保持一致

#使用.bash_profile文件生效
[infa@hsu ~]$ source .bash_profile
#测试java环境变量是否生效
[infa@hsu ~]$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
#退出infa用户到root用户
[infa@hsu ~]$ exit
logout

3.开始安装infa

[root@hsu infa]# cd /usr/local/src
#解压infa安装包
[root@hsu uploads]# tar -xvf 951HF2* -C /usr/local/src/infa
#赋予安装介质相应权限
[root@hsu src]# chmod -R 775 infa
#赋予安装介质归属用户与组
[root@hsu src]# chown -R infa:oinstall infa
#切换到infa用户准备安装infa工具
[root@hsu uploads]# su - infa

#未取消环境变量安装报错内容如下
Unset the INFA_HOME,INFA_NODE_NAME and INFA_DOMAINS_FILE before continuing the installation. Continuing the installation with the environment variables set will cause the installation to fail.
#取消变量声明
[infa@hsu infa]$ unset INFA_HOME
[infa@hsu infa]$ unset INFA_DOMAINS_FILE

[root@hsu uploads]# cp *.key /home/infa/license.key
[root@hsu uploads]# chmod 775 /home/infa/license.key
[root@hsu uploads]# chown infa:oinstall /home/infa/license.key

#安装
[infa@hsu src]$ cd /usr/local/src/infa
[infa@hsu infa]$ sh install.sh

相关文章

网友评论

      本文标题:云主机CentOS7.6安装Oracle 11g&Informa

      本文链接:https://www.haomeiwen.com/subject/vzgevhtx.html