In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. preparation of the environment before installation
1. VMware Workstation 10 builds CentOS7 x64-bit virtual machine, minimizes installation of CentOS7 operating system, 2G memory, 20g disk space, 1 core CPU, has been configured with network IP:192.168.1.30
2. Downloaded Oracle 11gLinux installation files: linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip
3. Upload it to the virtual machine / tmp directory through XmanagerXftp.
II. Preparation of the operating system
Log in to the operating system using the root user
Yum installs the unzip software to extract the uploaded Oracle installation files.
[root@CentOS ~] # yum install unzip-y
Extract the Oracle installer
[root@CentOS~] # cd / data/oracle/oraclesetup
[root@CentOS tmp] # unziplinux.x64_11gR2_database_ 1of2.zip & & unziplinux.x64_11gR2_database_2of2.zip
After waiting for the extraction to be completed, a database folder with Oracle11g installation files will be produced in the / data/oracle/oraclesetup directory.
Yum installs vim software for editing configuration files (personal habits, do not install vim, or use vi).
[root@CentOStmp] # yum install vim-y
Add the hostname to the / etc/hosts file
[root@CentOS tmp] # vim / etc/hosts
Add 192.168.206.135 CentOS
Close selinux
[root@CentOS tmp] # vim / etc/selinux/config
Set up SELINUX=disabled
[root@CentOS tmp] # setenforce 0
Turn off the firewall
[root@CentOS tmp] # service iptables stop
[root@CentOS ~] # systemctl stop firewalld
[root@CentOS ~] # systemctl disable firewalld
Install the Oracle 11g dependency package
[root@CentOS tmp] # yum install gcc make binutils gcc-c++ compat-libstdc++-33elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel-y
Add installation users and user groups
[root@CentOS tmp] # groupadd oinstall
[root@CentOS tmp] # groupadd dba
[root@CentOS tmp] # useradd-g oinstall-G dba oracle
[root@CentOS tmp] # passwd oracle
[root@CentOS tmp] # id oracle
Uid=1001 (oracle) gid=1001 (oinstall) group = 1001 (oinstall), 1002 (dba)
Modify kernel parameter configuration file
[root@CentOS ~] # vim / etc/sysctl.conf
Add the following
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 1073741824
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
[root@CentOS] # sysctl-p
Where kernel.shmmax = 1073741824 is half of the native physical memory (2G) in byte.
Modify the user's restriction file
[root@CentOS ~] # vim / etc/security/limits.conf
Add the following
Oracle soft nproc 2047
Oracle hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Oracle soft stack 10240
Modify the / etc/pam.d/login file:
[root@CentOS ~] # vim / etc/pam.d/login
Add the following:
Session required / lib64/security/pam_limits.so
Session required pam_limits.so
Modify the / etc/profile file:
[root@CentOS ~] # vim / etc/profile
Add the following:
If [$USER = "oracle"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
Create installation directory and set file permissions
[root@CentOS] # mkdir-p / data/oracle/product/11.2.0
[root@CentOS ~] # mkdir / data/oracle/oradata
[root@CentOS ~] # mkdir / data/oracle/inventory
[root@CentOS ~] # mkdir / data/oracle/fast_recovery_area
[root@CentOS] # chown-R oracle:oinstall / data/oracle
[root@CentOS] # chmod-R 775 / data/oracle
Set oracle user environment variables
[root@CentOS ~] # su-oracle
[oracle@CentOS ~] $vim .bash _ profile
Add the following:
ORACLE_BASE=/data/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=ora11
PATH=$PATH:$ORACLE_HOME/bin
Export ORACLE_BASE ORACLE_HOME ORACLE_SIDPATH
Note that the red must match the name of the database instance created, otherwise the database cannot be accessed after startup.
Edit the silent installation response file
[oracle@CentOS] $cp-R / data/oracle/oraclesetup/database/response/.
[oracle@CentOS ~] $cd response/
[oracle@CentOS response] $vim db_install.rsp
The options to be set are as follows:
Oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=CentOS
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/data/oracle/product/11.2.0
ORACLE_BASE=/data/oracle
Oracle.install.db.InstallEdition=EE
Oracle.install.db.DBA_GROUP=dba
Oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
3. Silently install Oracle11g according to the response file
[oracle@CentOS response] $cd / data/oracle/oraclesetup/database/
[oracle@iZwz93mxkrdvotp49mmzfjZ database] $. / runInstaller-silent-responseFile/data/oracle/response/db_install.rsp-ignorePrereq
If there is an error in the execution of the above command, you will be prompted to have a parameter format, which can be modified according to the prompt parameter format. It is generally due to the inconsistency of the font and symbol format in word after being copied to the client command line, and you can modify it.
Start silent installation of Oracle in the background. During installation, if you prompt [WARNING] to ignore it, the installer is still in the background, and if [FATAL] appears, the installer has stopped.
The log for this installation session can be found at the following location:
/ data/oracle/inventory/logs/installActions2015-06-08 04-00-25PM.log
You can switch terminals and execute top commands to check that the background process has been installed, and the / U01 directory is also growing.
When the following prompt appears, the installation is successful:
Execute the script as required.
Open the terminal, log in as root, and execute the script:
[root@CentOS~] # sh / data/oracle/inventory/db_1/orainstRoot.sh
[root@CentOS~] # sh / data/oracle/product/11.2.0/db_1/root.sh
4. Configure monitoring silently
Re-use oracle user login
[oracle@iZwz93mxkrdvotp49mmzfjZ~] $netca / silent / responseFile / data/oracle/response/netca.rsp
Note here that the / silent / responseFile format must be used instead of-silent-responseFile, because it is a silent installation
After running successfully, generate listener.ora and sqlnet.ora in / data/oracle/product/11.2.0/db_1/network/admin/
You can see that port 1521 is listening through the netstat command.
Yum installs netstat software, and the package is in net-tools.
[root@CentOS~] # yum install net-tools
[root@CentOS~] # netstat-tnulp | grep 1521
Fifth, build a new library silently and a corresponding example at the same time.
[oracle@CentOS~] $vim / data/oracle/response/dbca.rsp
Set the following parameters:
GDBNAME= "ora11"
SID = "ora11"
SYSPASSWORD= "system@2016"
SYSTEMPASSWORD= "system@2016"
SYSMANPASSWORD= "system@2016"
DBSNMPPASSWORD= "system@2016"
DATAFILEDESTINATION=/data/oracle/oradata
RECOVERYAREADESTINATION=/data/oracle/fast_recovery_area
CHARACTERSET= "ZHS16GBK"
TOTALMEMORY= "1638"
Where TOTALMEMORY = "1638" is 1638MB and physical memory is 2Gbps.
Silent configuration:
[oracle@CentOS~] $dbca-silent-responseFile / data/oracle/response/dbca.rsp
Check the instance process after building the database:
[oracle@CentOS~] $ps-ef | grep ora_ | grep-v grep
View the monitoring status:
[oracle@CentOS~] $lsnrctl status
Log in to view the status of the instance:
[oracle@CentOS~] $sqlplus / as sysdba
SQL > select status from v$instance
VI. Oracle boot self-startup setting
Modify / data/oracle/product/11.2.0/bin/dbstart
[oracle@CentOS~] $vim / data/oracle/product/11.2.0/bin/dbstart
Change ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME
Modify / data/oracle/product/11.2.0/bin/dbshut
[oracle@CentOS~] $vim / data/oracle/product/11.2.0/bin/dbshut
Change ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME
Modify / etc/oratab file
[oracle@CentOS~] $vim / etc/oratab
Change the last N in orcl:/data/oracle/product/11.2.0:N to Y to become orcl:/data/oracle/product/11.2.0:Y
Enter the commands dbshut and dbstart to test
[oracle@CentOS~] $dbshut
Oracle snooping stops and the process disappears.
[oracle@CentOS~] $dbstart
Oracle snooping starts and the process starts.
Switch to root account to set up a self-startup script
[oracle@CentOS~] $su-
[root@CentOS~] # vim / etc/rc.d/init.d/oracle
Add the following (some values such as ORACLE_HOME and ORACLE_USER can be modified according to the actual situation):
#! / bin/bash
# oracle: Start/Stop Oracle Database 11g R2
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database ManagementSystem.
#
. / etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/data/oracle/product/11.2.0/db_1
ORACLE_USER=oracle
Case "$1" in
'start')
If [- f $LOCKFILE]; then
Echo $0 already running.
Else
Echo-n $"StartingOracle Database:"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/lsnrctl start"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/emctl start dbconsole"
Touch $LOCKFILE
Fi
'stop')
If [!-f $LOCKFILE]; then
Echo $0 already stopping.
Else
Echo-n $"StoppingOracle Database:"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/lsnrctl stop"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/dbshut"
Su-$ORACLE_USER-c "$ORACLE_HOME/bin/emctl stop dbconsole"
Rm-f $LOCKFILE
Fi
'restart')
$0 stop
Sleep 5
$0 start
'status')
If [- f $LOCKFILE]; then
Echo $0 started.
Else
Echo $0 stopped.
Fi
*)
Echo "Usage: $0 [start | stop | status]"
Exit 1
Esac
Exit 0
Modify / etc/init.d/oracle service file permissions
[root@CentOSinit.d] # chmod 755 / etc/init.d/oracle
Set to boot
[root@CentOS~] # chkconfig oracle on
Conduct a service oracle start/stop/restart test
Reboot restart View Oracle snooping and instance processes can be started automatically.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.