Oracle Introduction
Oracle Database, also known as Oracle RDBMS, or Oracle. is a relational database management system of Oracle Corporation. It is a leading product in the field of database. It can be said that Oracle database system is currently the world's popular relational database management system, System portability, easy to use, strong function, applicable to all kinds of large, medium, small, microcomputer environment. It is a highly efficient and reliable database solution that adapts to high throughput.
Experimental environment
CentOS7 system
- Memory: 4GB and above
- SWAP:8GB (twice times the physical memory)
- CPU: Dual Core
Preparation before the experiment
Oracle installation package (: https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html)
Flash installation Package
Experimental steps to turn off firewall self-booting, as well as related features and enhanced security features
systemctl stop firewalld.service systemctl disable firewalld.service setenforce 0
Add a hard disk to make Oracle's installation disk, not less than 15G, and format in XFS format
Fdisk/dev/sdb
Press N to create a new partition
Mkfs-t XFS/DEV/SDB1
Format to XFS format
and create a/orc folder to use as a mount point
Mkdir/orc
Mount/dev/sdb1/orc #临时挂载, reboot the host to be re-mounted
Modify Host Name
vim /etc/hostname oracle #修改 vim /etc/hosts #添加一条 192.168.26.152 oracle #将本机IP主机名设为oracle #接下来重启 使之生效 init 6
Note that you need to re-mount the reboot after rebooting
Mount/dev/sdb1/orc
Environment installation packages that need to be prepared before installing Oracle
yum -y install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel#通过yum 安装环境包
Tuning Kernel Parameters
vim /etc/sysctl.conffs.aio-max-nr = 1048576 #异步IO请求数目 推荐值是:1048576 其实它等于 1024*1024 也就是 1024K 个fs.file-max = 6815744 #打开的文件句柄的最大数量,防止文件描述符耗尽的问题kernel.shmall = 2097152 #共享内存总量 页为单位,内存除以4K所得kernel.shmmax = 4294967295 kernel.shmmni = 4096kernel.sem = 250 32000 100 128 #SEMMSL: 每个信号集的最大信号数量 SEMMNS:用于控制整个 Linux 系统中信号的最大数 SEMOPM: 内核参数用于控制每个 semop 系统调用可以执行的信号操作的数量 SEMMNI :内核参数用于控制整个 Linux 系统中信号集的最大数量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 #套接字发送缓冲区大小的最大值sysctl -p #重新加载配置文件
`
Create Oracle Users and Groups
groupadd oinstall #创建基本组 oinstallgroupadd dba #创建附加组 dbauseradd -g oinstall -G dba oracle #创建 用户passwd oracle #配置密码
Create an Oracle installation directory
mkdir -p /orc/app/oracle #创建oracle安装目录chown -R oracle:oinstall /orc/app/ #分配属组属主chmod -R 755 /orc/app/oracle/ #分配权限
Oracle User Environment Configuration
vim /home/oracle/.bash_profile #oracle用户环境配置umask 022 #反掩码ORACLE_BASE=/orc/app/oracle #oracle的基本目录ORACLE_HOME=/orc/app/oracle/product/12.2.0/dbhome_1/ #oracle的家目录ORACLE_SID=orcl #实例名称NLS_LANG="SIMPLIFIED CHINESE_CHINA".UTF8 # 设置语言为中文PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin #设置系统环境LANG=zh_CN.UTF-8export PATH LANG NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID #使环境生效
Oracle User Resource Limits
Using the Pam_limits authentication module
#通过修改pam来达到控制 oracle的目的vim /etc/pam.d/login#在其中添加session required /lib/security/pam_limits.sosession required pam_limits.so
Memory limits and file limits
vim /etc/security/limits.conf#在最后添加oracle soft nproc 2047 #单用户可使用的进程数量oracle hard nproc 16384oracle soft nofile 1024 #用户可打开的文件数量oracle hard nofile 65536oracle soft stack 10240 #堆栈设置
vim /etc/profile#在其中添加if [ $USER = "oracle" ] then if [ $SHELL = "/bin/ksh" ] then ulimit -p 16384 #缓冲区大小 ulimit -p 65536 else ulimit -u 16384 -n 65536 #进程数 文件数 fifi
Installing Oracle
Mount the extracted database package in/ABC
mkdir /abcmount.cifs //192.168.26.128/linuxtools /abc
Working with the root user in a graphical interface
xhost +
Performing an Oracle Installation
su - oracle #切换到oracle用户export DISPLAY=:0.0cd /abc/Oracle/database #切换到oracle安装包目录./runInstaller #进入图形化安装界面
The next step is to install the interface
Pop-up window handling during installation
#切换 root 用户,执行以下命令/orc/app/oraInventory/orainstRoot.sh/orc/app/oracle/product/12.2.0/dbhome_1/root.sh
When the installation is complete, you will see the Web management address on the completion screen
Oracle Web Interface
Installing the Flash Plugin
rpm -ivh flash-player-npapi-26.0.0.131-release.x86_64.rpm
Oracle Command Line interface
Switching Oracle Users
Installing Oracle 12c under CentOS7