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

Install oracle11g database on the command line in linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Install oracle11g_R1 silently

Supplementary rhel6.0 command line to install oracle database

1. Install the linux6.0 version server

(minimum requirements for installing a database environment: lv with 10G disk, 1G memory swap partition is twice as large as memory)

two。 Debug network, firewall open port, SELINUX allow

3. Configure local hostname, domain or remote hostname, domain

4. Configure yum, both local yum and network source yum

5. Start installing the database

I. the environment required to install the database

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 oracle

ORACLE_SID=orcl

ORACLE_BASE=/oracle/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

two。 Download the installation package for the linux version of oracle (downloaded from oracle.com 's official website)

III. Create groups and users

(the following groups are habits. These groups are created in the official documentation and can be changed or not changed.)

Create the required user groups (operate under the root account):

Groupadd oinstall

Groupadd dba

Groupadd oper

Useradd-g oinstall-G dba,oper oracle; #

Passwd oracle; # set the password for the oracle account (login is required during installation)

Install oracle in the / oracle directory, so create an installation directory:

Note: it is recommended that you do not use the root partition when installing oracle in the lvm partition to avoid excessive growth of subsequent storage data and cannot be expanded. This is the common separation of data applications, and timely application service problems do not affect the data, similar to the master and slave of mysql. Oracle can be recovered from a log file archive even if it fails.

Mkdir / oracle

Chown oracle:oinstall / oracle

Chmod 755 / oracle

During installation, you also need to set up the Inventory directory to store logs, etc.:

Note: all the catalogs created are based on official habits.

Mkdir / oracle/oraInventory

Chown oracle:oinstall / oracle/oraInventory

Chmod 755 / oracle/orainventory

Four. modify environment variables for automatic reading when the database is installed

Edit the file vi / home/oracle/.bash_profile and add the following line:

ORACLE_BASE=/oracle; # installation directory

ORACLE_HOME=$ORACLE_BASE/11g; # oracle Home Directory

ORACLE_SID=orcl; # instance name

LIB_PATH=$ORACLE_HOME/lib

PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

Export ORACLE_BASE ORACLE_HOME ORACLE_SID LIB_PATH PATH

Edit the file vi / etc/pam.d/login and add the following line (required by 11gR1 but not by R2):

Session required pam_limits.so

Note: at present, most companies, governments, banks and securities use 11gR1 and 10g, which does not need to be configured.

5. Increase the shell limit for Oracle users

The resource limitation of Oracle is aimed at avoiding problems such as long time consumption and unresponse when using SQL statement files later, and the resources used during installation are very small and can be ignored.

Edit the system resource limit configuration file vi / etc/security/limits.conf and add the following line under it:

Note: if there are extra blank lines in the paste, you can remove the blank lines by using the following command

# [sed-I'/ ^\ s scratch limits.conf]

# for oracle

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Oracle soft stack 10240

Note:

Noproc represents the maximum number of processes

Nofile represents the maximum number of file openings

Soft soft control, currently using value exceeding value warning

Hard hard control, error report out of value

Soft refers to the setting for which the current system is in effect. Hard indicates the maximum value that can be set in the system

Core-limits the size of kernel files

Date-the largest size of big data

Fsize-maximum file size

Memlock-maximum locked memory address space

Nofile-maximum number of files opened

Rss-maximum persistent setting size

Stack-maximum stack size

Cpu-maximum CPU time in minutes

Noproc-maximum number of processes

As-address space restriction

Maxlogins-maximum number of logins allowed by this user

[root@loveoracle ~] # vim / etc/sysctl.conf modify parameters at the bottom of the text

# for oracle softe

# indicates the maximum number of file handles

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

# set the maximum memory shared segment size bytes

Kernel.shmall = 2097152

Kernel.shmmax = 4294967295

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100 128

# range of ports allowed to be opened by the system

Net.ipv4.ip_local_port_range = 9000 65500

# memory default value bytes for receiving buffers

Net.core.rmem_default = 262144

# maximum memory value bytes for receiving buffers

Net.core.rmem_max = 4194304

# memory default value bytes for send buffering

Net.core.wmem_default = 262144

# maximum memory bytes for send buffering

Net.core.wmem_max = 1048576

Note: you can copy and paste directly to the bottom of the file.

Note: the modification of / sbin/sysctl-p will take effect.

VI. Install oracle

Installation package related:

The installation package for Oracle 11gR2 is compressed into two files: linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip. Upload them to the installation machine and extract them using unzip linux.x64_11gR2_database_1of2.zip; unzip linux.x64_11gR2_database_2of2.zip; to get a directory called database. I put it in / oracle/database.

Chmod-R 700 / oracle/database

Chown-R oracle:oinstall / oracle/database

1. After decompression, enter into database

Note:

# install the answer configuration file, which can be used for automatic installation after modifying the configuration

Db_install.rsp

# create database reply, which is used to create database storage

Dbca.rsp

# establish network settings such as monitoring and local service name, that is, monitoring and network service name

Netca.rsp

two。 Modify the configuration file db_install.rsp and install the database silently

[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

You can configure as above.

3. Log in to the oracle user and install the database

Command

. / runInstaller-silent-force-responseFile / home/package/oracle/database/response/db_install.rsp

Note: db_install.rsp, the absolute path of the installation file is written here.

Installation log directory oraInventory/logs

Two script files are reported to need to be executed during installation

4. Login to the root user to execute the script

/ oracle/oraInventory/orainstRoot.sh

/ oracle/oracle/11g/root.sh

5. Log in to the oracle user and configure the database profile response/dbca.rsp

[root@159response] # cat dbca.rsp | grep-v ^ # | grep-v ^ $| grep-v "= $"

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

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"

Some of the main messages are explained:

6. Log in to the oracle user and install the monitor

Dbca-silent-responseFile / home/package/oracle/database/response/dbca.rsp

7. Check the oracle process status, start listening, and start the database after installation is complete

Ps-ef | grep ora_ # about more than 20 processes

View monitoring status lsnrctl status

Start snooping lsnrctl start

Stop listening to lsnrctl stop

Start the database

[oracle@159~] $sqlplus / nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 4 15:37:57 2019

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL > conn / as sysdba

Connected.

SQL > startup

You can see that the version of the database is 11.2.0.1.0

Shut down the database and use shutdown normal/immediate in the formal environment

In an informal environment, you can directly shutdown, kill or stop the listening process.

When the database cannot be closed, startup force can be used to force the shutdown of the database, and then execute the normal startup database command to start the database.

Simple View and use of 8.oracle

Connect to the database

Sqlplus test/oracle@192.168.1.159:1521/ORCL

SQL > conn system/oracle@orcl

Check to confirm that the database instance is started.

Select status from v$instance

Create a database user, which is put into the dba_ users table by default

CREATE USER test IDENTIFIED BY test; / / create a user test

Alter user test account unlock; / / unlock user test

Grant select on DEMO_INVOICE_CLOUD.FMB_INVOICE to test; / / Grant test select permissions on the table

Access to GRANT connect, resource TO test; / / connection

Grant permissions for all tables below one user to another user

1. View the tables used by the user below

Select * from dba_tables where owner='SCOTT' and status='VALID'

two。 Splice the tables below the user into authorization statements

Select 'grant select,delete,update,insert' | | table_name | |'to test; 'from dba_tables where owner='SCOTT' and status='VALID'

3. The output in step 2 is executed with dba or a user with authorization, and the current user can execute if he or she has authorization.

Note: if you need to authorize all tables in the currently logged-in user database to test users, you can use the following statement to concatenate

Select 'grant select,delete,update,insert' | | table_name | |'to test; 'from user_tables where owner='SCOTT' and status='VALID'

Silly installation, the environment is the same as the local variable configuration, the above configuration can be pasted and copied directly. If there are various errors, please leave a message.

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

Servers

Wechat

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

12
Report