linux 7 安裝oracle12C R2
##記憶體檢查
#Minimum: 1 GB of RAM
#Recommended: 2 GB of RAM or more
grep MemTotal /proc/meminfo | awk '{print $2/1024" MB"}'
##swap的檢查
#Available RAM,Swap Space Required
#Between 1 GB and 2 GB, 1.5 times the size of the RAM
#Between 2 GB and 16 GB, Equal to the size of the RAM
#More than 16 GB, 16 GB
grep SwapTotal /proc/meminfo | awk '{print $2/1024" MB"}'
##packages for linux6
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
yum -y install binutils compat-libcap1 compat-libstdc++ compat-libstdc++*.i686 gcc gcc-c++ glibc-2*.i686 glibc glibc-devel*.i686 glibc-devel ksh libgcc libgcc-*.i686 libstdc++*.i686 libstdc++ libstdc++-devel libstdc++devel*.i686 libaio-*.i686 libaio libaio-*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC-devel unixODBC*.i686
##packages for linux 7
rpm -qa | grep binutils-2.23.52.0.1-12.el7.x86_64
rpm -qa | grep compat-libcap1-1.10-3.el7.x86_64
rpm -qa | grep compat-libstdc++-33-3.2.3-71.el7.i686
rpm -qa | grep compat-libstdc++-33-3.2.3-71.el7.x86_64
rpm -qa | grep gcc-4.8.2-3.el7.x86_64
rpm -qa | grep gcc-c++-4.8.2-3.el7.x86_64
rpm -qa | grep glibc-2.17-36.el7.i686
rpm -qa | grep glibc-2.17-36.el7.x86_64
rpm -qa | grep glibc-devel-2.17-36.el7.i686
rpm -qa | grep glibc-devel-2.17-36.el7.x86_64
rpm -qa | grep ksh
rpm -qa | grep libaio-0.3.109-9.el7.i686
rpm -qa | grep libaio-0.3.109-9.el7.x86_64
rpm -qa | grep libaio-devel-0.3.109-9.el7.i686
rpm -qa | grep libaio-devel-0.3.109-9.el7.x86_64
rpm -qa | grep libgcc-4.8.2-3.el7.i686
rpm -qa | grep libgcc-4.8.2-3.el7.x86_64
rpm -qa | grep libstdc++-4.8.2-3.el7.i686
rpm -qa | grep libstdc++-4.8.2-3.el7.x86_64
rpm -qa | grep libstdc++-devel-4.8.2-3.el7.i686
rpm -qa | grep libstdc++-devel-4.8.2-3.el7.x86_64
rpm -qa | grep libXi-1.7.2-1.el7.i686
rpm -qa | grep libXi-1.7.2-1.el7.x86_64
rpm -qa | grep libXtst-1.2.2-1.el7.i686
rpm -qa | grep libXtst-1.2.2-1.el7.x86_64
rpm -qa | grep make-3.82-19.el7.x86_64
rpm -qa | grep sysstat-10.1.5-1.el7.x86_64
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio-*.i686 libaio-devel libaio-devel*.i686 libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++devel*.i686 libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC-devel unixODBC*.i686
yum -y localinstall compat-libstdc++-33-3.2.3-72.el7.* #單獨下載
##create user and group
groupadd -g 1000 oinstall
groupadd -g 1001 dba
groupadd -g 1002 oper
useradd -g oinstall -G dba,oper oracle
##vi /etc/sysctl.conf
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
/sbin/sysctl -p
##官方文件對shmmax的設定解釋,(文件 ID 567506.1),我一般直接使用當前設定/sbin/sysctl -a | grep shm
#Oracle Global Customer Support officially recommends a " maximum" for SHMMAX of "1/2 of physical RAM".
#The maximum size of a shared memory segment is limited by the size of the available user address space. On 64-bit systems, this is a theoretical 2^64bytes. So the "theoretical limit" for SHMMAX is the amount of physical RAM that you have. However, to actually attempt to use such a value could potentially lead to a situation where no system memory is available for anything else. Therefore a more realistic "physical limit" for SHMMAX would probably be "physical RAM - 2Gb".
#In an Oracle RDBMS application, this "physical limit" still leaves inadequate system memory for other necessary functions. Therefore, the common "Oracle maximum" for SHMMAX that you will often see is "1/2 of physical RAM". Many Oracle customers chose a higher fraction, at their discretion.
#Occasionally, Customers may erroneously think that that setting the SHMMAX as recommended in this NOTE limits the total SGA. That is not true. Setting the SHMMAX as recommended only causes a few more "shared memory segments" to be used for whatever total SGA that you subsequently configure in Oracle. For additional detail, please see
##
?vi /etc/security/limits.conf
?oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
##建立軟體安裝目錄
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
##新增本地引數
su - oracle
vi .bash_profile
umask 0022
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_HOME ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/usr/bin:/sbin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
##修改hosts檔案
ip add | grep enp0s8 | grep inet | awk '{print $2}' | awk -F"/" '{printf $1" "}{cmd="hostname";system(cmd)}' >> /etc/hosts
cat /etc/hosts
##開機啟動圖形化
[root@localhost ~]# systemctl get-default
multi-user.target
[root@localhost ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3 #多使用者模式
# graphical.target: analogous to runlevel 5 #圖形化模式
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#
[root@localhost ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.
[root@localhost ~]# systemctl get-default
graphical.target
?
##關閉防火牆和selinux
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@rhel7ora11 ~]# getenforce
Enforcing
[root@rhel7ora11 ~]# setenforce 0
[root@rhel7ora11 ~]# getenforce
Permissive
[root@rhel7ora11 ~]# vi /etc/selinux/config
SELINUX=disabled
或
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
##安裝
./runInstaller
#執行指令碼
[root@rhel7-ora12c-ip156 ~]# /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@rhel7-ora12c-ip156 ~]# /u01/app/oracle/product/12.2.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.2.0/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.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
no
Oracle Trace File Analyzer (TFA - User Mode) is available at :
/u01/app/oracle/product/12.2.0/db_1/suptools/tfa/release/tfa_home/bin/tfactl
OR
Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :
/u01/app/oracle/product/12.2.0/db_1/suptools/tfa/release/tfa_home/install/roottfa.sh
#dbca建立資料庫,assm管理最少需要1460M記憶體分配
#Minimum: 1 GB of RAM
#Recommended: 2 GB of RAM or more
grep MemTotal /proc/meminfo | awk '{print $2/1024" MB"}'
##swap的檢查
#Available RAM,Swap Space Required
#Between 1 GB and 2 GB, 1.5 times the size of the RAM
#Between 2 GB and 16 GB, Equal to the size of the RAM
#More than 16 GB, 16 GB
grep SwapTotal /proc/meminfo | awk '{print $2/1024" MB"}'
##packages for linux6
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
yum -y install binutils compat-libcap1 compat-libstdc++ compat-libstdc++*.i686 gcc gcc-c++ glibc-2*.i686 glibc glibc-devel*.i686 glibc-devel ksh libgcc libgcc-*.i686 libstdc++*.i686 libstdc++ libstdc++-devel libstdc++devel*.i686 libaio-*.i686 libaio libaio-*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC-devel unixODBC*.i686
##packages for linux 7
rpm -qa | grep binutils-2.23.52.0.1-12.el7.x86_64
rpm -qa | grep compat-libcap1-1.10-3.el7.x86_64
rpm -qa | grep compat-libstdc++-33-3.2.3-71.el7.i686
rpm -qa | grep compat-libstdc++-33-3.2.3-71.el7.x86_64
rpm -qa | grep gcc-4.8.2-3.el7.x86_64
rpm -qa | grep gcc-c++-4.8.2-3.el7.x86_64
rpm -qa | grep glibc-2.17-36.el7.i686
rpm -qa | grep glibc-2.17-36.el7.x86_64
rpm -qa | grep glibc-devel-2.17-36.el7.i686
rpm -qa | grep glibc-devel-2.17-36.el7.x86_64
rpm -qa | grep ksh
rpm -qa | grep libaio-0.3.109-9.el7.i686
rpm -qa | grep libaio-0.3.109-9.el7.x86_64
rpm -qa | grep libaio-devel-0.3.109-9.el7.i686
rpm -qa | grep libaio-devel-0.3.109-9.el7.x86_64
rpm -qa | grep libgcc-4.8.2-3.el7.i686
rpm -qa | grep libgcc-4.8.2-3.el7.x86_64
rpm -qa | grep libstdc++-4.8.2-3.el7.i686
rpm -qa | grep libstdc++-4.8.2-3.el7.x86_64
rpm -qa | grep libstdc++-devel-4.8.2-3.el7.i686
rpm -qa | grep libstdc++-devel-4.8.2-3.el7.x86_64
rpm -qa | grep libXi-1.7.2-1.el7.i686
rpm -qa | grep libXi-1.7.2-1.el7.x86_64
rpm -qa | grep libXtst-1.2.2-1.el7.i686
rpm -qa | grep libXtst-1.2.2-1.el7.x86_64
rpm -qa | grep make-3.82-19.el7.x86_64
rpm -qa | grep sysstat-10.1.5-1.el7.x86_64
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio-*.i686 libaio-devel libaio-devel*.i686 libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++devel*.i686 libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC-devel unixODBC*.i686
yum -y localinstall compat-libstdc++-33-3.2.3-72.el7.* #單獨下載
##create user and group
groupadd -g 1000 oinstall
groupadd -g 1001 dba
groupadd -g 1002 oper
useradd -g oinstall -G dba,oper oracle
##vi /etc/sysctl.conf
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
/sbin/sysctl -p
##官方文件對shmmax的設定解釋,(文件 ID 567506.1),我一般直接使用當前設定/sbin/sysctl -a | grep shm
#Oracle Global Customer Support officially recommends a " maximum" for SHMMAX of "1/2 of physical RAM".
#The maximum size of a shared memory segment is limited by the size of the available user address space. On 64-bit systems, this is a theoretical 2^64bytes. So the "theoretical limit" for SHMMAX is the amount of physical RAM that you have. However, to actually attempt to use such a value could potentially lead to a situation where no system memory is available for anything else. Therefore a more realistic "physical limit" for SHMMAX would probably be "physical RAM - 2Gb".
#In an Oracle RDBMS application, this "physical limit" still leaves inadequate system memory for other necessary functions. Therefore, the common "Oracle maximum" for SHMMAX that you will often see is "1/2 of physical RAM". Many Oracle customers chose a higher fraction, at their discretion.
#Occasionally, Customers may erroneously think that that setting the SHMMAX as recommended in this NOTE limits the total SGA. That is not true. Setting the SHMMAX as recommended only causes a few more "shared memory segments" to be used for whatever total SGA that you subsequently configure in Oracle. For additional detail, please see
##
?vi /etc/security/limits.conf
?oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
##建立軟體安裝目錄
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
##新增本地引數
su - oracle
vi .bash_profile
umask 0022
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_HOME ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/usr/bin:/sbin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
##修改hosts檔案
ip add | grep enp0s8 | grep inet | awk '{print $2}' | awk -F"/" '{printf $1" "}{cmd="hostname";system(cmd)}' >> /etc/hosts
cat /etc/hosts
##開機啟動圖形化
[root@localhost ~]# systemctl get-default
multi-user.target
[root@localhost ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3 #多使用者模式
# graphical.target: analogous to runlevel 5 #圖形化模式
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#
[root@localhost ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.
[root@localhost ~]# systemctl get-default
graphical.target
?
##關閉防火牆和selinux
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@rhel7ora11 ~]# getenforce
Enforcing
[root@rhel7ora11 ~]# setenforce 0
[root@rhel7ora11 ~]# getenforce
Permissive
[root@rhel7ora11 ~]# vi /etc/selinux/config
SELINUX=disabled
或
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
##安裝
./runInstaller
#執行指令碼
[root@rhel7-ora12c-ip156 ~]# /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@rhel7-ora12c-ip156 ~]# /u01/app/oracle/product/12.2.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.2.0/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.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
no
Oracle Trace File Analyzer (TFA - User Mode) is available at :
/u01/app/oracle/product/12.2.0/db_1/suptools/tfa/release/tfa_home/bin/tfactl
OR
Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :
/u01/app/oracle/product/12.2.0/db_1/suptools/tfa/release/tfa_home/install/roottfa.sh
#dbca建立資料庫,assm管理最少需要1460M記憶體分配
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28572479/viewspace-2144822/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 7 安裝 Oracle12CCentOSOracle
- CentOS7 安裝Oracle12c資料庫CentOSOracle資料庫
- oracle12c之 12.1.0.1.0 C 在 linux 7 上安裝報錯處理OracleLinux
- Linux 7 安裝Mysql 5.7LinuxMySql
- Linux7安裝JDKLinuxJDK
- Linux (RHEL 5.4)下安裝 Oracle 10g R2LinuxOracle 10g
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- linux(麒麟 centos7)安裝7zLinuxCentOS
- oracle12c安裝及使用要點Oracle
- Linux系統安裝01-centos7系統安裝LinuxCentOS
- Linux-Redis安裝(CentOS7)LinuxRedisCentOS
- 在Linux上安裝redis7LinuxRedis
- [Linux7] zabbix 3.2.11安裝Linux
- Linux 7安裝和配置phpmyadminLinuxPHP
- linux 7z壓縮安裝Linux
- 【Linux】Virtualbox 安裝 Oracle Linux 7 -64位LinuxOracle
- Oracle11g R2 RAC安裝Oracle
- oracle 11g R2安裝RACOracle
- Linux – CentOS 7 yum方式快速安裝MongoDBLinuxCentOSMongoDB
- (Linux)CentOS7下安裝JDK 1.8LinuxCentOSJDK
- oracle linux 7 安裝圖形化介面OracleLinux
- 達夢7在Linux平臺安裝Linux
- 【kingsql分享】RHEL7.0安裝Oracle12cSQLOracle
- Linux CentOS 7 下 Apache Tomcat 7 安裝與配置(心得)LinuxCentOSApacheTomcat
- Oracle 10G R2在Linux X86_64下的安裝Oracle 10gLinux
- centos7 解除安裝openJDK 安裝jdk7CentOSJDK
- Oraccle 11G R2 RAC解除安裝
- Linux-CentOS7環境MySQL安裝配置LinuxCentOSMySql
- Linux-RHEL7環境MySQL安裝配置LinuxMySql
- Linux Centos 7安裝MongoDB(簡單!詳細!)LinuxCentOSMongoDB
- 阿里雲centos7[linux]安裝nginx阿里CentOSLinuxNginx
- Oracle Linux 7上安裝Oracle 12cOracleLinux
- linux7上安裝RAC的問題Linux
- Linux(Centos7)安裝Docker 社群(ce)版LinuxCentOSDocker
- 手動安裝、驗證、解除安裝11g R2 oracle textOracle
- vnc安裝步驟,如何在Linux(CentOS 7)下vnc安裝步驟VNCLinuxCentOS
- Linux(以CentOS 7為例)下安裝、解除安裝、啟動OpenOfficeLinuxCentOS
- Linux 下安裝配置 JDK7 配置環境(debian 7)LinuxJDK