https://my.oschina.net/xinsui1314x/blog/1933045
Environmental Science
Operating System: CentOS Linux release 7.4.1708 (Core)
Oracle Version: 12cR1
Oracle's yum: http://public-yum.oracle.com/public-yum-ol7.repo
Configuration of oracle installation environment
1. Configure yum source
wget http://public-yum.oracle.com/public-yum-ol7.repo -O /etc/yum.repos.d/public-yum-ol7.repo yum clean all yum repolist
2. Configure oracle pre-installation software
yum -y --nogpgcheck install oracle-rdbms-server-12cR1-preinstall.x86_64
3. Configure oracle user password
passwd oracle Enter a new password Enter the new password again
· View the operation of oracle pre-installed software
cat -n /var/log/oracle-rdbms-server-12cR1-preinstall/results/orakernel.log //Configure users and groups //Create group oinstall, gid54321 1 Adding group oinstall with gid 54321 //KEYPASS group dba 2 Adding group dba //Create user oracle, UID 54321, main group oinstall, additional group dba, home/oracle 3 Adding user oracle with user id 54321, initial login group oinstall, supplementary group dba and home directory /home/oracle //Change / home/oracle's ownership, ownership, and subgroup oinstall 4 Changing ownership of /home/oracle to oracle:oinstall ps: You need to set it up by yourself oracle User's password 5 Please set password for oracle user 6 uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba) 7 Creating oracle user passed 8 //Configure the kernel parameter / etc/sysctl.conf 9 Saving a copy of the initial sysctl.conf 10 Verifying kernel parameters as per Oracle recommendations... //Set the maximum number of open files 11 Adding fs.file-max = 6815744 //Setting parameters related to semaphores 12 Adding kernel.sem = 250 32000 100 128 //Set the size of the shared memory segment for the entire system 13 Adding kernel.shmmni = 4096 //Set the total amount of shared memory, 8G memory settings: 2097152*4k/1024/1024 14 Adding kernel.shmall = 1073741824 //Set the segment size of maximum shared memory 15 Adding kernel.shmmax = 4398046511104 16 Adding kernel.panic_on_oops = 1 17 Adding net.core.rmem_default = 262144 18 Adding net.core.rmem_max = 4194304 19 Adding net.core.wmem_default = 262144 20 Adding net.core.wmem_max = 1048576 21 Adding net.ipv4.conf.all.rp_filter = 2 22 Adding net.ipv4.conf.default.rp_filter = 2 23 Adding fs.aio-max-nr = 1048576 //Set the available IPv4 port range 24 Adding net.ipv4.ip_local_port_range = 9000 65500 25 Setting kernel parameters as per oracle recommendations... 26 Altered file /etc/sysctl.conf //Backup/etc/sysctl.conf 27 Saved a copy of the current file in /etc/sysctl.d/99-oracle-rdbms-server-12cR1-preinstall-sysctl.conf 28 Check /etc/sysctl.d for backups 29 Verifying & setting of kernel parameters passed 30 //Configuring process sessions 31 Setting user limits using /etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf 32 33 Verifying oracle user OS limits as per Oracle recommendations... 34 Adding oracle soft nofile 1024 35 Adding oracle hard nofile 65536 36 Adding oracle soft nproc 16384 37 Adding oracle hard nproc 16384 38 Adding oracle soft stack 10240 39 Adding oracle hard stack 32768 40 Adding oracle hard memlock 134217728 41 Adding oracle soft memlock 134217728 42 Setting oracle user OS limits as per Oracle recommendations... 43 Altered file /etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf 44 Original file backed up at /var/log/oracle-rdbms-server-12cR1-preinstall/backup/Aug-22-2018-17-11-05 45 Verifying & setting of user limits passed 46 47 Saving a copy of /etc/default/grub file in /etc/default/grub-initial.orabackup 48 Saving a copy of /etc/default/grub in /var/log/oracle-rdbms-server-12cR1-preinstall/backup/Aug-22-2018-17-11-05... 49 Verifying kernel boot parameters as per Oracle recommendations... 50 old boot params: "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet" 51 new boot params: "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off" 52 53 old boot params: "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off" 54 new boot params: "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off transparent_hugepage=never" 55 56 Setting kernel boot parameters as per Oracle recommendations... 57 G_DIR=/boot/grub2 58 Default kernel is -> 3.10.0-693.el7.x86_64 59 Default saved_entry is -> CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core) 60 Default saved_entry_line is -> linux16 /vmlinuz-3.10.0-693.el7.x86_64 61 Saving a copy of grubenv... in /var/log/oracle-rdbms-server-12cR1-preinstall/backup/Aug-22-2018-17-11-05 62 Generating grub configuration file ... 63 File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 5538: /usr/sbin/grub2-probe 64 File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 5538: /usr/sbin/grub2-probe 65 Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64 66 Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img 67 Found linux image: /boot/vmlinuz-0-rescue-aeb91e3fbec443d58729a8669460f619 68 Found initrd image: /boot/initramfs-0-rescue-aeb91e3fbec443d58729a8669460f619.img 69 File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 5754: /usr/sbin/grub2-probe 70 File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 5754: /usr/sbin/grub2-probe 71 done 72 The saved kernel 3.10.0-693.el7.x86_64 is now at position - 0 73 Boot parameters will be effected on next reboot 74 Altered file /etc/default/grub 75 Copy of the changed file is in - /etc/default/grub-oracle-rdbms-server-12cR1-preinstall.orabackup 76 Copy of the original file is in - /var/log/oracle-rdbms-server-12cR1-preinstall/backup/Aug-22-2018-17-11-05 77 Verifying & setting of boot parameters passed 78 79 Trying to add NOZEROCONF parameter... 80 Taking a backup of existing file to /etc/sysconfig/network.orabackup 81 Successfully added parameter NOZEROCONF to /etc/sysconfig/network 82 Setting /etc/sysconfig/network parameters passed 83 84 Disabling Transparent Hugepages. 85 Refer Oracle Note:1557478.1 86 87 Disabling defrag. 88 Refer Oracle Note:1557478.1 89 90 Taking a backup of old config files under /var/log/oracle-rdbms-server-12cR1-preinstall/backup/Aug-22-2018-17-11-05
Installation of oracle
1. Download the oracle package
http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/index.html
2. Create a working directory and extract it
mkdir -p /home/OracDB12c unzip linuxamd64_12102_database_se2_1of2.zip -d /home/OracDB12c/ unzip linuxamd64_12102_database_se2_2of2.zip -d /home/OracDB12c/
3. Solving Chinese scrambling
mkdir -p /usr/share/fonts/zh_CN/TrueType mv /usr/share/fonts/wqy-zenhei.ttc /usr/share/fonts/zh_CN/TrueType/wqy-zenhei.ttf
4. Install oracle and use oracle login system
ssh -X oracle@data base oracle where ip cd /home/OracDB12c/database ./runInstaller -jreLoc /usr/lib/jvm/jre-1.8.0
4.1 Configuration Security Updates
Skip it.
4.2 Installation Options
- Install only database software
Option Description:
- Create and configure databases: Users for newly installed databases.
- Install database software only: suitable for existing oracle database data for data migration.
- Upgrade existing databases: Suitable for users who upgrade old databases to new ones.
4.3 System Class
- Desktop Class: Minimizing Configuration
- Server class:
4.4 Network Installation Options
- Single Instance Database Installation
4.5 Installation Type
- Typical Installation: Easy, with few settings at the back
- Advanced Installation:
4.6 Product Language
- By default
4.5 Database Version
- Standard Edition
4.6 Installation Location
- By default, the configuration of oracle pre-installation will be read
4.7 Create Product List
- By default
4.8 Operating System Group
- The oper group was not created, and the second item was done with dba.
4.9 Prerequisite Examination
- Install missing software and modify configuration files as prompted
- Virtual memory problem, little impact, you can continue to install
4.10 Summary
- To see if there are any problems, double-click "Edit" behind.
4.11 Installation
4.12 Execute configuration scripts
Open another terminal ssh root@ip address . /home/oracle/app/oraInventory/orainstRoot.sh . /home/oracle/app/oracle/product/12.1.0/dbhome_1/root.sh
4.13 Installation Completed
5. Configure environment variables, oracle login
[oracle@oracledb ~]$ vim .bash_profile //Add in export ORACLE_SID=orcl export ORACLE_HOME=/home/oracle/app/oracle/product/12.1.0/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH [oracle@oracledb ~]$ source .bash_profile
3. Configuration monitoring
- By default
Solve netca and dbca Random code [oracle@oracledb fonts]$ mkdir $ORACLE_HOME/jdk/jre/lib/fonts/fallback/ [oracle@oracledb fonts]$ cp /usr/share/fonts/zh_CN/TrueType/zysong.ttf $ORACLE_HOME/jdk/jre/lib/fonts/fallback/ # mkdir -p /home/oracle/app/oracle/product/12.1.0/dbhome_1/jdk/jre/lib/fonts/fallback # cp /usr/share/fonts/zh_CN/TrueType/wqy-zenhei.ttf /home/oracle/app/oracle/product/12.1.0/dbhome_1/jdk/jre/lib/fonts/fallback/ //Configuration listener [oracle@oracledb fonts]$ netca Oracle Net Services To configure: //The listener is being configured: LISTENER //The listener configuration is complete. Oracle Net Listener Start: //Monitor program control is running: /home/oracle/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start LISTENER //The monitoring procedure control is completed. //The listening program has been successfully started. //Oracle Net Services configuration was successfully completed. The exit code is 0 //View the listening status [oracle@oracledb fonts]$ lsnrctl status LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 22-AUG-2018 21:25:00 Copyright (c) 1991, 2014, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracledb)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production Start Date 22-AUG-2018 21:23:44 Uptime 0 days 0 hr. 1 min. 16 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /home/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora Listener Log File /home/oracle/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully
IV. Creating Database Instances
[oracle@oracledb fonts]$ dbca
V. Verification
· Connecting databases with oracle's own interactive tools
[oracle@oracledb ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed Aug 22 20:57:30 2018 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL>
VI. Database Control
· Execute as an oracle user
1.lsnrctl start [oracle@oracledb ~]$ lsnrctl start 2.View monitor [oracle@oracledb ~]$ lsnrctl status 3.lsnrctl stop [oracle@oracledb ~]$ lsnrctl stop
· login sqlplus with sysdba
[oracle@oracledb ~]$ sqlplus / as sysdba Start the database SQL> startup close database SQL> shutdown immediate Exit sqlplus SQL> exit