Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS7 terminal silently installs Oracle 11g R2

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. Environmental preparation

Install the package:

Linux.x64_11gR2_database_1of2.zip

Linux.x64_11gR2_database_2of2.zip

Download address:

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

II. Environmental configuration

1. System environment

(1) disable selinux service

# sed-I'/ ^ SELINUX=/cSELINUX=disabled' / etc/selinux/config

(2) turn off the firewall

# systemctl disable firewalld.service

# systemctl stop firewalld.service

(3) disable NetworkManager

# systemctl disable NetworkManager

# systemctl stop NetworkManager.service

(5) Local parsing

# vim / etc/hosts

172.160.20.129 oracle

(5) restart the service

# reboot

2. Dependent package

(1) tools

# yum install epel-release

# yum clean all

# yum repolist

# yum makecache fast-y

# yum install vim unzip rlwrap-y

(2) install the packages required by oracle

# yum 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 libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686-y

3. Configure the installation environment

(1) create an oracle user

# groupadd oinstall

# groupadd dba

# useradd-g oinstall-G dba oracle

(2) create an oracle installation directory

[root@oracle] # mkdir-p / opt/oracle/app/product/11.2.0

[root@oracle] # mkdir-p / opt/oracle/app/oradata

[root@oracle] # mkdir-p / opt/oracle/app/fast_recovery_area

[root@oracle] # mkdir-p / opt/oracle/inventory

[root@oracle] # chown-R oracle:oinstall / opt/oracle

[root@oracle] # chmod-R 775 / opt/oracle

(3) modify sysctl.conf

Cat > / etc/sysctl.conf

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

# half of physical memory and the larger of 4G

# kernel.shmmax = 4294967296

# shmmax / 4k (getconf PAGESIZE)

# kernel.shmall = 1048576

Kernel.shmmni = 4096

Kernel.sem = 250 32000 200 200

Net.ipv4.ip_local_port_range = 9000 65500

Net.core.rmem_default = 262144

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048586

Net.core.rmem_max = 4194304

EOF

Sysctl-p

# sysctl-p

(4) modify limits.conf

Cat > / etc/security/limits.conf

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

EOF

(5) modify login

Cat > / etc/pam.d/login

Session required / lib64/security/pam_limits.so

Session required pam_limits.so

EOF

(6) modify profile

Cat > / etc/profile

If [\ $USER = "oracle"]; then

If [\ $SHELL = "/ bin/ksh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Umask 022

Fi

EOF

(7) modify the .bash _ profile of oracle users

Cat > / home/oracle/.bash_profile

Export ORACLE_BASE=/opt/oracle/app

Export ORACLE_HOME=\ $ORACLE_BASE/product/11.2.0

Export ORACLE_SID=orcl

Export PATH=\ $PATH:\ $ORACLE_HOME/bin

# export NLS_LANG= "SIMPLIFIED CHINESE_CHINA.AL32UTF8"

# export NLS_LANG= "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

EOF

Third, install the database

1. Decompress the file

# unzip linux.x64_11gR2_database_1of2.zip-d / home/oracle/

# unzip linux.x64_11gR2_database_2of2.zip-d / home/oracle/

# chown-R oracle.oinstall / home/oracle/database

2. Switch to oracle user, and all subsequent operations will be performed under this oracle user.

# su-oracle

3. Create a respon file

$cp database/response/*.rsp. /

4. Modify db_install.rsp

Sed-I\

-e'/ ^ oracle.install.option=/s#=.*$#=INSTALL_DB_SWONLY#'\

-e'/ ^ UNIX_GROUP_NAME=/s#=.*$#=oinstall#'\

-e'/ ^ INVENTORY_LOCATION=/s#=.*$#=/opt/oracle/inventory#'\

-e'/ ^ SELECTED_LANGUAGES=/s#=.*$#=en,zh_CN#'\

-e'/ ^ ORACLE_HOME=/s#=.*$#=/opt/oracle/app/product/11.2.0#'\

-e'/ ^ ORACLE_BASE=/s#=.*$#=/opt/oracle/app#'\

-e'/ ^ oracle.install.db.InstallEdition=/s#=.*$#=EE#'\

-e'/ ^ oracle.install.db.DBA_GROUP=/s#=.*$#=dba#'\

-e'/ ^ oracle.install.db.OPER_GROUP=/s#=.*$#=dba#'\

-e'/ ^ oracle.install.db.config.starterdb.type=/s#=.*$#=GENERAL_PURPOSE#'\

-e'/ ^ DECLINE_SECURITY_UPDATES=/s#=.*$#=true#'\

/ home/oracle/db_install.rsp

# No need to modify netca.rsp

5. Modify dbca.rsp

$/ home/oracle/dbca.rsp

GDBNAME = "orcl"

SID = "orcl"

SYSPASSWORD = "123456"

SYSTEMPASSWORD = "123456"

CHARACTERSET = "AL32UTF8"

6. Install oracle software

$cd / home/oracle/database/

$. / runInstaller-silent-responseFile / home/oracle/db_install.rsp-ignorePrereq

# after successful installation, the system prompts you to execute two scripts under root

/ opt/oracle/inventory/orainstRoot.sh

/ opt/oracle/app/product/11.2.0/root.sh

Switch to the root user to execute two scripts

7. Configure monitoring

Switch to oracle user

$netca / silent / responseFile / home/oracle/netca.rsp

# start

$lsnrctl start

# restart

$lsnrctl reload

# status

$lsnrctl status

Cause of problem: database instance is not registered to listener or there is no database instance

1.sys and system users

(1) oracle automatically generates sys and system users

(2) sys Super Admin, with the highest permissions, sysdba role, and create database permissions. The default password is change_on_install.

(3) system ordinary administrator, with high authority, sysoper role, no create database permission. The default password is manager.

two。 Generally speaking, for database maintenance, you can log in using the system user.

The biggest difference between 3.sys and system is whether they have the right to create database or not.

4. Create a database

$dbca-silent-responseFile / home/oracle/dbca.rsp

Check the oracle status:

8. Log in to the database

Open the cmd window, enter sqlplus / as sysdba, enter, and log in as a Super Admin, as shown in the figure (you can see that the version information is displayed after the login of oracle 11g 64-bit, but not 32-bit)

$sqlplus / as sysdba

Enter sqlplus to start the instance

Startup

The above figure indicates that the instance has been set up and there is no need to start it again.

After shutdown, you can use startup.

9. Login to the database:

Method 1: $sqlplus; then authenticate the user's password

Method 2: $sqlplus sys/123456 as sysdba

Note: sys users must log in as sysdba.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report