溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么在CentOS 7上安裝Oracle數(shù)據(jù)庫12c

發(fā)布時間:2021-06-28 15:35:44 來源:億速云 閱讀:229 作者:chen 欄目:大數(shù)據(jù)

本篇內(nèi)容主要講解“怎么在CentOS 7上安裝Oracle數(shù)據(jù)庫12c”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學(xué)習(xí)“怎么在CentOS 7上安裝Oracle數(shù)據(jù)庫12c”吧!

  1. 引言 本指南介紹如何在 CentOS 7.1(64 位元)上利用快速安裝的功能部署 Oracle 數(shù)據(jù)庫 12c(12.1.0.2.0)。

參考系統(tǒng):

[root@centos7 ~]# hostnamectl Static hostname: centos7.example.com Icon name: computer Chassis: n/a Machine ID: 583b4d69eaea465ea4bb96ac3b891e15 Boot ID: 931ed1af622046ebbde071a87844a7d5 Virtualization: kvm Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-229.11.1.el7.x86_64 Architecture: x86_64 2. 先決條件 成功安裝操作系統(tǒng)后,請確認主機名稱并在你的 DNS 上登記它。你也可選擇在 /etc/hosts 內(nèi)加入你的主機名稱/IP。

[root@centos7 ~]# cat /etc/hostname centos7.example.com 將 SELinux 維持在 enforcing 模式,并啟用防火墻

[root@centos7 ~]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 28

[root@centos7 ~]# firewall-cmd --state running 把 CentOS 系統(tǒng)更新至最新組件

[root@centos7 ~]# yum update -y 下載 Oracle 數(shù)據(jù)庫 12c 的 Linux x86-64 版本:

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

  1. 安裝步驟 為 Oracle 數(shù)據(jù)庫創(chuàng)建所須的操作系統(tǒng)用戶及群組。

[root@centos7 ~]# groupadd oinstall [root@centos7 ~]# groupadd dba [root@centos7 ~]# useradd -g oinstall -G dba oracle [root@centos7 ~]# passwd oracle 在 /etc/sysctl.conf 加入下列內(nèi)核參數(shù)

fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 1987162112 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 = 1048586 檢查并運用新的數(shù)值。

[root@centos7 ~]# sysctl -p [root@centos7 ~]# sysctl -a 在 /etc/security/limits.conf 為 oracle 用戶設(shè)置上限

oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 將 Oracle 數(shù)據(jù)庫軟件的 zip 文件(linuxamd64_12102_database_1of2.zip, linuxamd64_12102_database_2of2.zip)解壓至 /stage 目錄。

[root@centos7 ~]# yum install -y zip unzip [root@centos7 ~]# unzip linuxamd64_12102_database_1of2.zip -d /stage/ [root@centos7 ~]# unzip linuxamd64_12102_database_2of2.zip -d /stage/ 修改 /stage 的權(quán)限

[root@centos7 ~]# chown -R oracle:oinstall /stage/ 為 Oracle 軟件創(chuàng)建 /u01 目錄,及為數(shù)據(jù)庫文件創(chuàng)建 /u02 目錄。

[root@centos7 ~]# mkdir /u01 [root@centos7 ~]# mkdir /u02 [root@centos7 ~]# chown -R oracle:oinstall /u01 [root@centos7 ~]# chown -R oracle:oinstall /u02 [root@centos7 ~]# chmod -R 775 /u01 [root@centos7 ~]# chmod -R 775 /u02 [root@centos7 ~]# chmod g+s /u01 [root@centos7 ~]# chmod g+s /u02 安裝所須組件:

[root@centos7 ~]# yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64
glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64
libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64
libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64 還有安裝 X Window System 組件群組。

[root@centos7 ~]# yum groupinstall -y "X Window System" 由于 Oracle 的安裝采用圖像界面,你可通過以下兩個簡單的方法進行。

方案 1

通過 SSH 從一臺圖像化 Linux 計算機遠程登錄。

ssh -X oracle@centos7.example.com 方案 2

利用一臺擁有 SSH 客戶端(PuTTY)及 X-Windows 終端機仿真器(Xming)的微軟 Windows 桌面。

以下文檔描述如何在 Windows 系統(tǒng)上安裝 Xming。

  • Xming —— 微軟 Windows 計算機下的 X-Windows 終端機仿真器

請采用上述的方案登錄為 oracle 用戶,然后執(zhí)行 Oracle 安裝程序:

[oracle@centos7 ~]$ /stage/database/runInstaller Starting Oracle Universal Installer... 4. Oracle 安裝程序畫面 第一步 —— 安全性更新

假若你不想接收來自 Oracle 支持部的電郵,請取消勾選該項目并按 Next。

在新打開的窗口按 YES。

第二步 —— 安裝選項

選擇 Create and configure a database 并按 Next

第三步 —— 系統(tǒng)級別

選擇 Desktop Class 進行缺省的簡便 Oracle 數(shù)據(jù)庫安裝。

第四步 —— 典型安裝

在 Typical Install Configuration 畫面,設(shè)置以下功能。

Oracle base

/u01/app/oracle

Software location

/u01/app/oracle/product/12.1.0/dbhome_1

Database file location

/u02

Global database name

orcl.example.com

另外請設(shè)置合適的 Database edition(數(shù)據(jù)庫版本)及 Character set(符集)。請為數(shù)據(jù)庫的管理訂立一個安全的口令,最后請取消勾選 Create as Container database 項目。

第五步 —— 創(chuàng)建庫存

接納缺省的 /u01/app/oraInventory 并按 Next。

第六步 —— 檢查先決條件

安裝程序會自動檢查所有必須的操作系統(tǒng)組件及內(nèi)核設(shè)置。

第七步 —— 摘要

這是編輯安裝特點的最后機會。請按 Install。

第八步 —— 執(zhí)行設(shè)置腳本

當詢問窗口出現(xiàn)時,請登錄成為 root 并執(zhí)行兩個腳本:

[root@centos7 ~]# /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.

[root@centos7 ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.1.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: <PRESS ENTER> 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. You can follow the installation in a separated window. 這兩個腳本都必須以 root 的身份來執(zhí)行。

第九步 —— 安裝進度

一個顯示安裝進度的窗口將會出現(xiàn)。請勿關(guān)閉這個窗口。

第十步 —— 順利完成安裝

最后一個畫面將會通知你安裝已經(jīng)完成并顯示 Oracle 企業(yè)級管理員的 URL。

https://localhost:5500/em

請按 OK 來關(guān)閉安裝程序。

  1. 安裝后的任務(wù) 5.1. 防火墻 請登錄成為 root 并檢查已引導(dǎo)的本地

[root@centos7 ~]# firewall-cmd --get-active-zones public interfaces: eth0 打開相關(guān)的端口

[root@centos7 ~]# firewall-cmd --zone=public --add-port=1521/tcp --add-port=5500/tcp --add-port=5520/tcp --add-port=3938/tcp \ --permanent success

[root@centos7 ~]# firewall-cmd --reload success

[root@centos7 ~]# firewall-cmd --list-ports 1521/tcp 3938/tcp 5500/tcp 5520/tcp 5.2. Oracle 工作環(huán)境 請登錄為 oracle 用戶并在 /home/oracle/.bash_profile 內(nèi)加入下列數(shù)值

TMPDIR=$TMP; export TMPDIR ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1; export ORACLE_HOME ORACLE_SID=orcl; export ORACLE_SID PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH 重新裝入 bash_profile 來運用新設(shè)置值:

[oracle@centos7 ~]$ . .bash_profile 5.3. 登錄數(shù)據(jù)庫 最后請登錄數(shù)據(jù)庫:

[oracle@centos7 ~]$ sqlplus system@orcl ... output omitted ... Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> 請利用 Oracle 企業(yè)級管理員來管理數(shù)據(jù)庫:

https://<主機名稱>:5500/em

到此,相信大家對“怎么在CentOS 7上安裝Oracle數(shù)據(jù)庫12c”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI