Ready to work
1, download the installation package Oracle: linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip , can be downloaded to a local, uploaded to Linux systems (via ftp service reference CentOS7 FTP server set up ), you can use Linux system wget command to download the file package;
2, create system users and groups running oracle database:
With Root account login, run the following command to create users and groups are required, grouping reason Reference Site
groupadd oinstall # Create a user group oinstall groupadd dba # Create a user group dba useradd -g oinstall -g dba -m oracle # oracle user to create and add to the user group oinstall and dba
groups oracle # querying user group is authorized to success passwd oracle # oracle to set the user's login password, no password, the graphical login screen of not landing in CentOS id oracle # oracle user to view the new
3, create oracle database installation directory (by running the following command to create an account and assign permissions)
mkdir -p / data / oracle #oracle installation directory database mkdir -p / data / oraInventory #oracle database configuration file directory mkdir -p / data / database #oracle extract the package database directory cd /data ls # check is created chown -R oracle: oinstall / data / oracle # oracle user to set the owner of the directory user group oinstall chown -R oracle:oinstall /data/oraInventory chown -R oracle:oinstall /data/database
4, modify the system identification OS
oracle default does not support CentOS system installation, modify the file / etc / RedHat -release content RedHat-7
vi / etc / redhat-release # modify red part of the text redhat-7
5. Install the package oracle database needed
The following is an installation package in accordance with the need to rely by yum install {} package name to verify that the installation, e.g. yum install binutils
binutils-2.23.52.0.1-12.el7.x86_64 compat-libcap1-1.10-3.el7.x86_64 gcc-4.8.2-3.el7.x86_64 gcc-c++-4.8.2-3.el7.x86_64 glibc-2.17-36.el7.i686 glibc-2.17-36.el7.x86_64 glibc-devel-2.17-36.el7.i686 glibc-devel-2.17-36.el7.x86_64 ksh libaio-0.3.109-9.el7.i686 libaio-0.3.109-9.el7.x86_64 libaio-devel-0.3.109-9.el7.i686 libaio-devel-0.3.109-9.el7.x86_64 libgcc-4.8.2-3.el7.i686 libgcc-4.8.2-3.el7.x86_64 libstdc++-4.8.2-3.el7.i686 libstdc++-4.8.2-3.el7.x86_64 libstdc++-devel-4.8.2-3.el7.i686 libstdc++-devel-4.8.2-3.el7.x86_64 libXi-1.7.2-1.el7.i686 libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686 libXtst-1.2.2-1.el7.x86_64 make-3.82-19.el7.x86_64 sysstat-10.1.5-1.el7.x86_64
Use the following instruction, the package check dependencies
yum install binutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-* gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.* libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* pdksh*
6, turn off the firewall and SELinux, the specific operation may refer to blog
7, modify kernel parameters
/etc/sysctl.conf vi # red part is to add content sysctl.conf net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.conf.all.rp_filter = 1 fs.file-max = 6815744 # Set the maximum number of open files fs.aio-max-nr = 1048576 # 2097152 total shared memory kernel.shmall =, 8G memory settings: 2097152 * 4k / 1024/1024 kernel.shmmax = 2147483648 # maximum segment size shared memory kernel.shmmni = 4096 # shared memory of the entire system the maximum number of end kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 # IPv4 port range may be used net.core.rmem_default = 262144 net.core.rmem_max= 4194304 net.core.wmem_default= 262144 net.core.wmem_max= 1048576
8, set limits for the oracle user, improve the performance of the software operation (add red portion)
/etc/security/limits.conf vi # red part of the content to be added to Limits.conf
oracle soft nproc 2047 oracle hard nproc 16384 Oracle soft nofile 1024 oracle hard nofile 65536
9, the configuration of the user environment variables (red add code)
the /home/oracle/.bash_profile vi # red part is to append content section bash_profile
export ORACLE_BASE = / data / oracle #oracle installation directory database export ORACLE_HOME = $ ORACLE_BASE / product / 11.2.0 / db_1 #oracle database path export ORACLE_SID = orcl #oracle start the database instance name export ORACLE_TERM = xterm #xterm Mode Setup Window export PATH = $ ORACLE_HOME / bin: / usr / sbin: $ PATH # Add the system environment variables export LD_LIBRARY_PATH = $ ORACLE_HOME / lib: / lib: / usr / lib # Add the system environment variables export LANG = C # prevent distortion during installation export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK # Set the Oracle client character set, character set must be installed when consistent with Oracle
Configuration,: wq save and exit the configuration take effect when you run the source /home/oracle/.bash_profile!
10, after obtaining the installation package file decompression installation package
Get the installation package file manner, by ftp server , or can be downloaded wget to the specified directory, unzip follows
unzip linux.x64_11gR2_database_1of2.zip -d / data / database / # 1-extracting file unzip linux.x64_11gR2_database_2of2.zip -d / data / database / # extracting file 2 chown -R oracle: oinstall / data / database / database / # authorizing dispensing installation files Oracle
Oracle Installation
1, oracle user login system, using the command line jumps to the next data / database / database directory, call up the input ./runInstaller mounting page;
2, bring up the installation screen, click Next to install, I chose to install only the Database Services
Like window installation Oracle installation, as introduced is not repeated here.
After the installation is complete, open the listener through netca configuration page, by executing dbca command to start the installation interface oracle example, a service may correspond to multiple instances of Oracle, a corresponding number of Oracle database table space and user name, but also manage each user name table space.
安装完成实例之后,使用sqlPlus命令链接数据库的时候,提示 could not open parameter file "/data/Oracle/product/11.2/db_1/dbs/initorcl.ora",这个时候需要将刚刚安装的Oracle实例配置文件($ORACLE_BASE/admin /数据库名称/pfile目录下的init.ora.012009233838形式的文件)拷贝到/data/Oracle/product/11.2/db_1/dbs目录下
[oracle@localhost pfile]$ pwd
/data/oracle/admin/MLUCDB/pfile
[oracle@localhost pfile]$ cp init.ora.962016224738 /data/Oracle/product/11.2/db_1/dbs/initorcl.ora
#使用sqlplus命令登录Oracle,重启服务器
sqlplus /nolog
conn / as sysdba;
#再输入startup,回车.这步是启动oracle服务。
startup
重启服务器之后,打开Oracle,提示 ORA-01034: ORACLE not available ORA-27101
原因在于未启动服务,操作的方式是:
1、启动oracle监听:cmd命令行窗口下,输入lsnrctl start,回车即启动监听;
2、采用sqlplus /nolog 登录Oracle服务,连接服务conn /as sysdba,然后startup启动服务
扩展RedHat下Oracle的安装
1、RedHat系统版本尽量使用Desk版本,便于Oracle的界面安装,Oracle安装文件传输到RedHat服务器,可以通过SecureCrt远程客户端完成数据的传输。
2、记得配置用户换机下的安装编码,否则oracle安装会出现乱码:
vi /home/oracle/.bash_profile #追加配置文件
export LANG=C #防止安装过程出现乱码 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK #设置Oracle客户端字符集,必须与Oracle安装时设置的字符集保持一致
安装过程可能出现的问题
1、我已经在/etc/sysctl.conf中加入了kernel.sem = 250 32000 100 128,但是安装oracle的时候检测还是告诉我理论值128,实际值为0.
网络上解决方案关闭selinux,但是依然如此。决定忽略该告警,继续下一步安装。
解决方案:修改完/etc/sysctl.conf 必须 sysctl -p /etc/sysctl.conf生效配置文件
2、Error in invoking target 'install' of makefile '/data/oracle/product/11.2.0/db_1/ctx/lib/ins_ctx.mk'. See '/data/oraInventory/logs/installActions2019-06-12_10-53-05AM.log' for details.
解决方案:需下载安装32位版本 yum install glibc-devel.i686
3, Error in invoking target 'agent nmhs' of makefile' /data/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk '. See' / data / oraInventory / logs / installActions2019-06-12_10- . 53-05AM.log 'for details
solution: Keep the installation process, in addition to open a terminal window, change to $ (MK_EMAGENT_NMECTL) -lnnz11 ins_emagent.mk file (MK_EMAGENT_NMECTL), then you can click Retry during installation .
4, Oracle telnet port 1521 open unreasonable solution
Solution: Check Linu host name and change the hostname
View hostname hostname
hostname -i: Check your phone corresponding IP
Modify the host name
vim / etc / sysconfig / Network
vim / etc / hosts
Modify After reboot: reboot