CentOS7下使用yum快速安装配置oracle数据库
来源:互联网 发布:安卓条形码扫描源码 编辑:程序博客网 时间:2024/05/17 03:28
CentOS7下使用yum快速安装配置oracle数据库
实验环境
操作系统:CentOS Linux release 7.3.1611 (Core)IP: 192.168.230.141
原理
使用yum工具安装oracle提供的preinstall包,它将自动执行一些与配置步骤:
- 自动下载并安装 Oracle Grid Infrastructure 和 Oracle Database 11g 第 2 版 (11.2.0.3) 安装过程所需的任何额外的软件包和特定软件版本,并通过 yum 或 up2date 功能处理软件包依赖关系。
- 创建用户 oracle 和组 oinstall(针对 OraInventory)、dba(针对 OSDBA),供数据库安装期间使用。(出于安全目的,该用户没有默认口令,且不能远程登录)。要启用远程登录,请使用 passwd 工具设置一个口令。)
- 修改 /etc/sysctl.conf 中的内核参数以更改共享内存、信号、最大文件描述符数量等设置。
- 设置 /etc/security/limits.conf 中的软硬 shell 资源限制,如锁定内存地址空间、打开的文件数量、进程数和核心文件大小。
- 对于 x86_64 计算机,在内核中设置 numa=off。
如此可简化很多配置步骤
配置yum的repo文件
进入yum配置文件夹,添加oracle的yum信息库
[root@localhost ~]# cd /etc/yum.repos.d/[root@localhost yum.repos.d]# lsCentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repoCentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo[root@localhost yum.repos.d]# rm public-yum-ol7.repo rm: remove regular file ‘public-yum-ol7.repo’? y[root@localhost yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol7.repo--2017-10-09 19:26:42-- http://public-yum.oracle.com/public-yum-ol7.repoResolving public-yum.oracle.com (public-yum.oracle.com)... 23.49.60.35, 173.222.148.42Connecting to public-yum.oracle.com (public-yum.oracle.com)|23.49.60.35|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 6947 (6.8K) [text/plain]Saving to: ‘public-yum-ol7.repo’100%[=========================================================================================>] 6,947 --.-K/s in 0s 2017-10-09 19:26:44 (354 MB/s) - ‘public-yum-ol7.repo’ saved [6947/6947][root@localhost yum.repos.d]# lsCentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repoCentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo public-yum-ol7.repo
使用yum安装oracle预安装文件,这里我们选择11g的版本为实验对象
[root@localhost yum.repos.d]# yum install oracleoracleasm-support.x86_64 oracle-logos.noarchoracle-database-server-12cR2-preinstall.x86_64 oracle-rdbms-server-11gR2-preinstall.x86_64oraclelinux-release.x86_64 oracle-rdbms-server-12cR1-preinstall.x86_64[root@localhost yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall.x86_64 Loaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7 will be installed--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: kernel-uek for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Running transaction check---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed---> Package gcc-c++.x86_64 0:4.8.5-16.el7 will be installed---> Package kernel-container.x86_64 0:3.10.0-0.0.0.2.el7 will be installed---> Package ksh.x86_64 0:20120801-34.el7 will be installed---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed---> Package libstdc++-devel.x86_64 0:4.8.5-16.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================================== Package Arch Version Repository Size===================================================================================================================================Installing: oracle-rdbms-server-11gR2-preinstall x86_64 1.0-5.el7 ol7_latest 21 kInstalling for dependencies: compat-libcap1 x86_64 1.10-7.el7 base 19 k compat-libstdc++-33 x86_64 3.2.3-72.el7 base 191 k gcc-c++ x86_64 4.8.5-16.el7 base 7.2 M kernel-container x86_64 3.10.0-0.0.0.2.el7 ol7_latest 2.6 k ksh x86_64 20120801-34.el7 base 883 k libaio-devel x86_64 0.3.109-13.el7 base 13 k libstdc++-devel x86_64 4.8.5-16.el7 base 1.5 MTransaction Summary===================================================================================================================================Install 1 Package (+7 Dependent packages)Total download size: 9.8 MInstalled size: 29 MIs this ok [y/d/N]: yDownloading packages:(1/8): compat-libcap1-1.10-7.el7.x86_64.rpm | 19 kB 00:00:00 (2/8): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm | 191 kB 00:00:00 (3/8): ksh-20120801-34.el7.x86_64.rpm | 883 kB 00:00:00 (4/8): libaio-devel-0.3.109-13.el7.x86_64.rpm | 13 kB 00:00:00 (5/8): libstdc++-devel-4.8.5-16.el7.x86_64.rpm | 1.5 MB 00:00:00 warning: /var/cache/yum/x86_64/7/ol7_latest/packages/kernel-container-3.10.0-0.0.0.2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEYPublic key for kernel-container-3.10.0-0.0.0.2.el7.x86_64.rpm is not installed(6/8): kernel-container-3.10.0-0.0.0.2.el7.x86_64.rpm | 2.6 kB 00:00:00 (7/8): oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64.rpm | 21 kB 00:00:01 (8/8): gcc-c++-4.8.5-16.el7.x86_64.rpm | 7.2 MB 00:00:01 -----------------------------------------------------------------------------------------------------------------------------------Total 6.1 MB/s | 9.8 MB 00:00:01 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracleGPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle"
直接使用yum安装会报错:Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
经查,这是由于我使用的不是oracle Linux导致,强制跳过gpg检查即可:
[root@localhost yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall.x86_64 --nogpgcheckLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7 will be installed--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: kernel-uek for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64--> Running transaction check---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed---> Package gcc-c++.x86_64 0:4.8.5-16.el7 will be installed---> Package kernel-container.x86_64 0:3.10.0-0.0.0.2.el7 will be installed---> Package ksh.x86_64 0:20120801-34.el7 will be installed---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed---> Package libstdc++-devel.x86_64 0:4.8.5-16.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================================== Package Arch Version Repository Size===================================================================================================================================Installing: oracle-rdbms-server-11gR2-preinstall x86_64 1.0-5.el7 ol7_latest 21 kInstalling for dependencies: compat-libcap1 x86_64 1.10-7.el7 base 19 k compat-libstdc++-33 x86_64 3.2.3-72.el7 base 191 k gcc-c++ x86_64 4.8.5-16.el7 base 7.2 M kernel-container x86_64 3.10.0-0.0.0.2.el7 ol7_latest 2.6 k ksh x86_64 20120801-34.el7 base 883 k libaio-devel x86_64 0.3.109-13.el7 base 13 k libstdc++-devel x86_64 4.8.5-16.el7 base 1.5 MTransaction Summary===================================================================================================================================Install 1 Package (+7 Dependent packages)Total size: 9.8 MInstalled size: 29 MIs this ok [y/d/N]: yDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing : libstdc++-devel-4.8.5-16.el7.x86_64 1/8 Installing : gcc-c++-4.8.5-16.el7.x86_64 2/8 Installing : ksh-20120801-34.el7.x86_64 3/8 Installing : libaio-devel-0.3.109-13.el7.x86_64 4/8 Installing : kernel-container-3.10.0-0.0.0.2.el7.x86_64 5/8 Installing : compat-libcap1-1.10-7.el7.x86_64 6/8 Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64 7/8 Installing : oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64 8/8 Verifying : oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64 1/8 Verifying : gcc-c++-4.8.5-16.el7.x86_64 2/8 Verifying : libstdc++-devel-4.8.5-16.el7.x86_64 3/8 Verifying : compat-libstdc++-33-3.2.3-72.el7.x86_64 4/8 Verifying : compat-libcap1-1.10-7.el7.x86_64 5/8 Verifying : kernel-container-3.10.0-0.0.0.2.el7.x86_64 6/8 Verifying : libaio-devel-0.3.109-13.el7.x86_64 7/8 Verifying : ksh-20120801-34.el7.x86_64 8/8 Installed: oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7 Dependency Installed: compat-libcap1.x86_64 0:1.10-7.el7 compat-libstdc++-33.x86_64 0:3.2.3-72.el7 gcc-c++.x86_64 0:4.8.5-16.el7 kernel-container.x86_64 0:3.10.0-0.0.0.2.el7 ksh.x86_64 0:20120801-34.el7 libaio-devel.x86_64 0:0.3.109-13.el7 libstdc++-devel.x86_64 0:4.8.5-16.el7 Complete!
如此,便完成了oracle的预配置,查看日志文件,了解到底做了什么操作:
[root@localhost yum.repos.d]# vim /var/log/oracle-rdbms-server-11gR2-preinstall/results/orakernel.log Adding group oinstall with gid 54321Adding group dbaAdding user oracle with user id 54321, initial login group oinstall, supplementary group dba and home directory /home/oracleChanging ownership of /home/oracle to oracle:oinstallPlease set password for oracle useruid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)Creating oracle user passedSaving a copy of the initial sysctl.confVerifying kernel parameters as per Oracle recommendations...Adding fs.file-max = 6815744Adding kernel.sem = 250 32000 100 128Adding kernel.shmmni = 4096Adding kernel.shmall = 1073741824Adding kernel.shmmax = 4398046511104Adding kernel.panic_on_oops = 1Adding net.core.rmem_default = 262144Adding net.core.rmem_max = 4194304Adding net.core.wmem_default = 262144Adding net.core.wmem_max = 1048576Adding net.ipv4.conf.all.rp_filter = 2Adding net.ipv4.conf.default.rp_filter = 2Adding fs.aio-max-nr = 1048576Adding net.ipv4.ip_local_port_range = 9000 65500Setting kernel parameters as per oracle recommendations...Altered file /etc/sysctl.confSaved a copy of the current file in /etc/sysctl.d/99-oracle-rdbms-server-11gR2-preinstall-sysctl.confCheck /etc/sysctl.d for backupsVerifying & setting of kernel parameters passedSetting user limits using /etc/security/limits.confVerifying oracle user OS limits as per Oracle recommendations...Adding oracle soft nofile 1024Adding oracle hard nofile 65536Adding oracle soft nproc 16384Adding oracle hard nproc 16384Adding oracle soft stack 10240Adding oracle hard stack 32768Adding oracle hard memlock 134217728Adding oracle soft memlock 134217728Setting oracle user OS limits as per Oracle recommendations...Altered file /etc/security/limits.confOriginal file backed up at /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Oct-09-2017-18-53-12Verifying & setting of user limits passedSaving a copy of /etc/default/grub file in /etc/default/grub-initial.orabackupSaving a copy of /etc/default/grub in /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Oct-09-2017-18-53-12...Verifying kernel boot parameters as per Oracle recommendations...old boot params: "crashkernel=auto rhgb quiet"new boot params: "crashkernel=auto rhgb quiet numa=off"old boot params: "crashkernel=auto rhgb quiet numa=off"new boot params: "crashkernel=auto rhgb quiet numa=off transparent_hugepage=never"Setting kernel boot parameters as per Oracle recommendations...G_DIR=/boot/grub2Default kernel is -> 3.10.0-693.2.2.el7.x86_64Default saved_entry is -> CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core)Default saved_entry_line is -> linux16 /vmlinuz-3.10.0-693.2.2.el7.x86_64Saving a copy of grubenv... in /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Oct-09-2017-18-53-12Generating grub configuration file ...Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.imgFound linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.imgFound linux image: /boot/vmlinuz-0-rescue-358841bb4583417589c4aa102424e4fcFound initrd image: /boot/initramfs-0-rescue-358841bb4583417589c4aa102424e4fc.imgdoneThe saved kernel 3.10.0-693.2.2.el7.x86_64 is now at position - 0Boot parameters will be effected on next rebootAltered file /etc/default/grubCopy of the changed file is in - /etc/default/grub-oracle-rdbms-server-11gR2-preinstall.orabackupCopy of the original file is in - /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Oct-09-2017-18-53-12Verifying & setting of boot parameters passedTrying to add NOZEROCONF parameter...Taking a backup of existing file to /etc/sysconfig/network.orabackupSuccessfully added parameter NOZEROCONF to /etc/sysconfig/networkSetting /etc/sysconfig/network parameters passedDisabling Transparent Hugepages.Refer Oracle Note:1557478.1Disabling defrag.Refer Oracle Note:1557478.1Taking a backup of old config files under /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Oct-09-2017-18-53-12
修改oracle用户的密码:
[root@localhost yum.repos.d]# passwd oracleChanging password for user oracle.New password: BAD PASSWORD: The password is shorter than 8 charactersRetype new password: passwd: all authentication tokens updated successfully.
安装oracle数据库
新建目录OraDB11g并将下载好的oracle安装包放入其中
[root@localhost yum.repos.d]# mkdir -p /home/OraDB11g[root@localhost yum.repos.d]# cd /home/OraDB11g/[root@localhost OraDB11g]# unzip p13390677_112040_Linux-x86-64_1of7.zip[root@localhost OraDB11g]# unzip p13390677_112040_Linux-x86-64_2of7.zip
切换至oracle用户,执行安装命令
[root@localhost database]# su - oracleLast login: Mon Oct 9 18:55:10 PDT 2017 on pts/1[oracle@localhost ~]$ cd /home/OraDB11g/database/[oracle@localhost database]$ ./runInstaller Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 26804 MB PassedChecking swap space: must be greater than 150 MB. Actual 3968 MB PassedChecking 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 beforecontinuing with the installation,Continue? (y/n) [n] y>>> Ignoring required pre-requisite failures. Continuing...Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-10-09_08-23-40PM. 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 DISPLAYUse the following command to see what shell is being used: echo $SHELLUse 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
执行失败并报错DISPLAY not set. Please set the DISPLAY and try again.
这是由于未配置图形显示
根据提示进行处理:
[oracle@localhost database]$ echo $SHELL/bin/bash[oracle@localhost database]$ echo $DISPLAY
此时确认本操作系统使用的是bash,所以使用第二种配置方式
[oracle@localhost database]$ DISPLAY=192.168.1.128:0.0; export DISPLAY[oracle@localhost database]$ xhost +xhost: unable to open display "192.168.1.128:0.0"
发现依然无法使用
重置DISPLAY配置:
[oracle@localhost database]$ DISPLAY=192.168.1.128:0.0; export DISPLAY[oracle@localhost database]$ export DISPLAY=:0[oracle@localhost database]$ xhost +access control disabled, clients can connect from any host[oracle@localhost database]$ xhost + 192.168.230.141192.168.230.141 being added to access control list
配置成功,开始正式安装oracle
[oracle@localhost database]$ ./runInstaller Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 25950 MB PassedChecking swap space: must be greater than 150 MB. Actual 3968 MB PassedChecking monitor: must be configured to display at least 256 colors. Actual 16777216 PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2017-10-09_08-36-12PM. Please wait ...
弹出安装界面:
将接受oracle支持项取消,下一步
选择跳过软件自动更新服务,下一步
选择创建一个数据库系统,下一步
选择桌面系统(我只是实验环境,不是为了搭建服务器环境),下一步
配置默认数据库实例,并设置密码(我使用的是简单密码,所以会有警告),下一步
选择数据库用户分组,这里使用默认的oinstall组,下一步
自动检测数据库安装环境
这里我检测出来缺少2个包:
- elfutils-libelf-devel-0.97
- pdksh-5.2.14
打包elfutils-libelf-devel
[root@localhost yum.repos.d]# yum install elfutils-libelf-develLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package elfutils-libelf-devel.x86_64 0:0.168-8.el7 will be installed--> Processing Dependency: pkgconfig(zlib) for package: elfutils-libelf-devel-0.168-8.el7.x86_64--> Running transaction check---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================================== Package Arch Version Repository Size===================================================================================================================================Installing: elfutils-libelf-devel x86_64 0.168-8.el7 base 37 kInstalling for dependencies: zlib-devel x86_64 1.2.7-17.el7 base 50 kTransaction Summary===================================================================================================================================Install 1 Package (+1 Dependent package)Total download size: 87 kInstalled size: 163 kIs this ok [y/d/N]: yDownloading packages:(1/2): zlib-devel-1.2.7-17.el7.x86_64.rpm | 50 kB 00:00:00 (2/2): elfutils-libelf-devel-0.168-8.el7.x86_64.rpm | 37 kB 00:00:00 -----------------------------------------------------------------------------------------------------------------------------------Total 295 kB/s | 87 kB 00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing : zlib-devel-1.2.7-17.el7.x86_64 1/2 Installing : elfutils-libelf-devel-0.168-8.el7.x86_64 2/2 Verifying : zlib-devel-1.2.7-17.el7.x86_64 1/2 Verifying : elfutils-libelf-devel-0.168-8.el7.x86_64 2/2 Installed: elfutils-libelf-devel.x86_64 0:0.168-8.el7 Dependency Installed: zlib-devel.x86_64 0:1.2.7-17.el7 Complete![root@localhost yum.repos.d]# yum install pdkshLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comNo package pdksh available.Error: Nothing to do
发现elfutils-libelf-devel包成功打上,但是pdksh包无法找到。
我去centos的官网上搜索也没找到这个包。后察知这个pdksh包早已弃用,被ksh包代替。只要系统中包含了ksh包就可以忽略这个警告
检查ksh是否存在:
[root@localhost yum.repos.d]# yum install kshLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comPackage ksh-20120801-34.el7.x86_64 already installed and latest versionNothing to do
点选check again,现在只剩一个警告了,选择忽略全部,下一步
观看生成的简报,确认配置无误后,下一步
弹出信息,确认默认实例的配置情况以及em连接方式,下一步
此时弹出提示,需要打开新的窗口按指示执行sh语句
[root@localhost ~]# /home/oracle/app/oraInventory/orainstRoot.shChanging permissions of /home/oracle/app/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.Changing groupname of /home/oracle/app/oraInventory to oinstall.The execution of the script is complete.[root@localhost ~]# /home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /home/oracle/app/oracle/product/11.2.0/dbhome_1Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.
完成后点击ok,开始正式安装,完成后画面如下图,关闭窗口
配置环境变量
切换至oracle配置环境变量
[root@localhost ~]# su - oracleLast login: Mon Oct 9 23:18:12 PDT 2017 on pts/3[oracle@localhost ~]$ ls -a. .. app .bash_history .bash_logout .bash_profile .bashrc .cache .config .kshrc .mozilla[oracle@localhost ~]$ vim .bash_profile # .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATHexport ORACLE_SID=orclexport ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1export PATH=$ORACLE_HOME/bin:$PATH[oracle@localhost ~]$ source .bash_profile
验证
使用oracle自带的交互工具连接数据库
[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 9 23:26:45 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select status from v$instance;STATUS------------OPEN
参考如何简化 Oracle Linux 6 上的 Oracle Database 11g 安装
参考Oracle 公共 yum 信息库
参考Oracle 数据库11g文档
- CentOS7下使用yum快速安装配置oracle数据库
- Centos7.2下使用YUM快速安装MySQL5.7
- Centos7.2下使用YUM快速安装MySQL5.7
- centos7下快速安装mysql-yum安装
- CentOS7下使用yum在线安装Mysql和配置mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- CentOS7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- centos7下使用yum安装mysql
- linux命令之管理输入输出
- 微软灯管问题
- Android优秀开源项目
- ford: ($27$67)Security Access
- 常用实用的php函数小结
- CentOS7下使用yum快速安装配置oracle数据库
- 6.RabbitMQ特性
- ViewGroup事件分发机制源码分析
- springmvc@RequestMapping-params参数规则
- opencv+mfc搭建框架
- QNX系统BSP开发研发与应用,QNX技术解答-项目开发-软件开发
- Maven本地仓库越用越大,删除无效版本文件
- linux下PHP项目写入日志失败,fopen(xxx.log): failed to open stream: Permission denied
- Wannafly模拟赛3 题解