linux command line database install oracle11g

Silent installation oracle11g_R1

Supplementary rhel6.0 command-line installation oracle database
1. Install linux6.0 version of the server
(for installing database environment Minimum Requirements: lv 10G of disk, memory 1G, swap partition is 2 times the memory)
2. Set up the network, the firewall open ports , allowing the SELINUX
configuration local host name, the domain name of the remote host or domain
4 arranged yum, yum, and the local network can be a source yum
5. start the installation database
a. Installation database the required environment
yum -y install binutils compat-libstdc ++ - 33 elfutils-libelf elfutils-libelf-devel gcc gcc-c ++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc ++ libstdc ++ - devel make numactl sysstat libXp unixODBC unixODBC- devel compat-libstdc ++
environment variable settings:
[root @ 159 ~] # env | grep -i the Oracle
the ORACLE_SID = orcl
ORACLE_BASE = / the Oracle / the Oracle
PATH=/BOSSSOFT_BLOCKCHAIN_GENESIS/soft/node/bin:/usr/local/home/java/jdk1.8.0_11/bin:/usr/local/home/java/jdk1.8.0_11/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/apache-maven-3.5.2/bin:/root/bin:/root/bin:/oracle/oracle/11g/bin:/root/bin
LIB_PATH=/oracle/oracle/11g/lib
ORACLE_HOME=/oracle/oracle/11g

II. Download the oracle linux version installation package (oracle.com official website to download)
linux command line database install oracle11g
III. Creating groups and users
(below these groups are accustomed to official documents is to create these groups, you can change or may not change)
to create the required user groups (operating under the root account):
groupadd oinstall;
groupadd dba;
groupadd Oper;
useradd oinstall -G dba -g, Oper oracle; #
passwd oracle; # set a password for the oracle account (installed when the need to log in)

The oracle is installed in the / oracle directory, so you need to create the installation directory:
Note: It is recommended not to use oracle installation root partition lvm partitions to avoid subsequent increase in data storage is too large, it can not be extended. This is the common application data separation, timely application service problem does not affect the data, similar to the master-slave mysql. Oracle even failure can be recovered by a log file archive.
mkdir / the Oracle;
chown the Oracle: oinstall / the Oracle;
chmod 755 / the Oracle;
Shihai need to set the Inventory installation directory for storing logs:
Note: The directory you create is created by habit, according to official
mkdir / the Oracle / oraInventory;
chown the Oracle: oinstall / the Oracle / oraInventory;
chmod 755 / the Oracle / oraInventory;

four. Modify environment variables, automatic meter reading being used to install the database
to edit files vi /home/oracle/.bash_profile, add the following line:
ORACLE_BASE = / the Oracle; # installation directory
ORACLE_HOME = $ ORACLE_BASE / 11g; #oracle home directory
ORACLE_SID = orcl; # examples of names
LIB_PATH = $ ORACLE_HOME / lib;
the PATH the PATH = $: $ ORACLE_HOME / bin: $ the HOME / bin;
Export the ORACLE_BASE ORACLE_HOME the ORACLE_SID LIB_PATH the PATH;

Edit the file vi /etc/pam.d/login, add the following lines (11gR1 have requested, R2 is not required):
the session required pam_limits.so
Note: At present, most government companies, banks, securities are used in 11gR1 and 10g, this requires no configuration.

Fives. Oracle to improve the user's shell to limit
Oracle resource constraints to avoid resource prolonged occupation, no response to other questions, the resources used to install a small negligible for later use when sql statement file.
The editing system resource limitations profile vi /etc/security/limits.conf, add the following line in the file:
Note: If the paste in extra blank line unsightly, can be removed using the following command line blank
# [sed -i ' / ^ \ s * $ / d 'limits.conf ]
#for the Oracle
the Oracle Soft nproc 2047
the Oracle 16384 Hard nproc
the Oracle Soft nofile 1024
the Oracle 65536 Hard nofile
the Oracle Stack Soft 10240
Note:
noproc is representing the maximum number of processes
nofile represent the largest file open the number of
soft soft control, the current value exceeds the value of the use of warning
hard hard to control, exceeding the value given
soft refers to the set value of the current system in effect. It indicates the maximum amount that can be hard to set the system
core - core file size limit
date - the maximum data size
fsize - the maximum file size
memlock - the maximum locking memory address space
nofile - the maximum number of open files
rss - maximum size setting persistent
stack - The maximum stack size
cpu - in minutes of the most CPU time
noproc - the maximum number of processes
as - address space limit
maxlogins - This allows the user to log the maximum number of

[root @ loveoracle ~] # vim /etc/sysctl.conf lowermost modifying parameters in the text
#for Oracle Softe
# represents the maximum number of file handles
fs.aio-NR-max = 1048576
fs.file-max = 6815744
# Set the maximum shared memory segment size bytes
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 32000 250 100 128
# allows the system to open the port range
net.ipv4.ip_local_port_range 9000 = 65500
# memory buffer for receiving a default bytes
net.core.rmem_default = 262144
# memory buffer for receiving a maximum bytes
net.core.rmem_max = 4194304
# transmit buffer memory for the default value of bytes
net.core.wmem_default = 262144
# for transmitting buffered maximum memory bytes
net.core.wmem_max = 1048576
NOTE: can directly copy the file attached to the bottom
NOTE: / sbin / sysctl -p changed after commencement

six. Install oracle
installation package Related:

Oracle 11g R2 installation package is compressed into two files: linux.x64_11gR2_database_1of2.zip, linux.x64_11gR2_database_2of2.zip, upload them to the mounting machine, using unzip linux.x64_11gR2_database_1of2.zip; unzip linux.x64_11gR2_database_2of2.zip; for decompression, will get a name for the directory database. I put it in / home / oracle / database in.
-R & lt 700 the chmod / Oracle / Database;
chown -R & lt Oracle: the oinstall / Oracle / Database;

linux command line database install oracle11g
1. Unzip into the database
linux command line database install oracle11g
Note:
# Setup answer configuration file, modified configured for automatic installation
db_install.rsp
# Create a database response, is used to create a database to store
dbca.rsp
# establish monitoring, network settings such as the name of a local service response is listening, network service name
netca.rsp

2.修改配置文件db_install.rsp,静默安装数据库
[root@159response]# cat db_install.rsp|grep -v ^#|grep -v ^$|grep -v "=$"
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/oracle/oracle/11g
ORACLE_BASE=/oracle/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=ORCL
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=70240
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=oracle
oracle.install.db.config.starterdb.password.SYSTEM=oracle
oracle.install.db.config.starterdb.password.SYSMAN=oracle
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.automatedBackup.enable=false
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
按照如上配置即可
linux command line database install oracle11g
3. Log oracle user, install the database
command
./runInstaller -silent -force -responseFile /home/package/oracle/database/response/db_install.rsp
installation log directory oraInventory / logs
installation process will report the need to perform two script files
4. Log in as root execute scripts
/oracle/oraInventory/orainstRoot.sh
/oracle/oracle/11g/root.sh
5. oracle user login and configure the listening configuration file the Response / netca.rsp
[root @ 159response] # CAT dbca.rsp | grep -v ^ # | grep -v ^ $ | grep -v "= $"
[the GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATE DATABASE]
GDBNAME = "orcl.us.oracle.com"
SID = "ORCL"
TEMPLATENAME = "General_Purpose.dbc"
[createTemplateFromDB]
SOURCEDB = "myhost: 1521: ORCL"
SYSDBAUSERNAME = "system"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl11.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl.us.oracle.com"
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl.us.oracle.com"
INSTANCENAME = "orcl"
SYSDBAUSERNAME = "sys"
linux command line database install oracle11g
6.登录oracle用户,安装监听
dbca -silent -responseFile /home/package/oracle/database/response/dbca.rsp
7.After installation is complete check the oracle process status, start listening, start the database view monitor status lsnrctl status
ps -ef | grep ora_ # probably more than 20 processes

Start the listener lsnrctl start
stop listening lsnrctl stop

Start the database
[the Oracle @ 159 ~] $ sqlplus / nolog
SQL * Plus: Release 11.2.0.1.0 Production's ON Wed Sep 4 15:37:57 2019
Copyright (c) 1982, 2009, the Oracle All Rights Reserved..

SQL> conn / AS sysdba
Connected.
SQL> the Startup
can be seen version of the database is 11.2.0.1.0
with shutdown normal / immediate closure of the database under formal environment
informal environment, can directly kill shutdown can also be parked directly monitor the process
when when not close the database, you can use startup force to force the complete closure of the database, and then perform a normal startup database command to start the database.
8.oracle simple to view and use the
connection to the database
sqlplus test/[email protected]: 1521 / ORCL
SQL> conn system / oracle @ orcl
check that the database instance is started.
select status from v $ instance;
create a database user, the default into dba_users table
CREATE USER test IDENTIFIED BY test; // create the user the Test
the ALTER the Test the Account the User UNLOCK; // unlock the user the Test
Grant the SELECT ON DEMO_INVOICE_CLOUD.FMB_INVOICE to the Test; // given permission to test select the table
GRANT connect, resource tO test; // permission to connect access

Fool installation, environment and local variables the same configuration, the configuration can copy and paste directly, such as the emergence of various error above, please leave a message

Guess you like

Origin blog.51cto.com/7794482/2435681