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 silently under Linux

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Operating system and Oracle version

Linux version: red_hat release6.2 (Final)

Oracle version: Oracle Database11g Release 2 (11.2.0.1.0) for Linux x86-64 (linux.x64_11gR2_database_1of2.zip, linux.x64_11gR2_database_2of2.zip)

two。 Hardware detection:

Physical memory is not less than 1G

The hard disk can have no less than 5G of space.

Swap zone space is not less than 2G

Support graphics cards with more than 256 colors

The main frequency of cpu is not less than 550mHZ

Cat / etc/issue

Uname-r (version)

Grep MemTotal / proc/meminfo (memory size)

Grep SwapTotal / proc/meminfo (switch area size)

Grep "model name" / proc/cpuinfo (CPU information)

Free (available memory)

3. The host name is confirmed

Vi / etc/hosts

IP hostname (hostname)

Service iptables stop

Setenforce=0

If there is not enough swap space:

Dd if=/dev/zero of=/test bs=1G count=4

Mkswap-f / test

Swapon / test

Free-m

I. Download and install the dependent installation package: yum install-y binutils\ compat-libcap1\ compat-libstdc++-33\ compat-libstdc++-33.i686\ gcc\ gcc-c++\ glibc.i686\ glibc\ glibc-devel\ glibc-devel.i686\ pdksh\ libgcc.i686\ libgcc\ libstdc++.i686\ libstdc++\ libstdc++-devel.i686\ libstdc++-devel\ libaio.i686\ libaio-devel.i686\ libaio-devel\ make\ sysstat\ unixODBC\ unixODBC.i686\ unixODBC-devel\ unixODBC-devel.i686\ libXext.i686\ libXext\ elfutils-libelf-devel\ unzip

II. Kernel parameter modification

Vi / etc/sysctl.conf

Add the following at the end of the file:

Fs.file-max = 6815744fs.aio-max-nr = 1048576kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250100100 128net.ipv4.ip_local_port_range = 32000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576

Execute the change immediately:

Sysctl-p

Edit the vi / etc/pam.d/login file:

Add the following at the end of the file:

Session required pam_limits.so

Fourth, modify the user's SHELL restrictions, modify the / etc/security/limits.conf file

Vi / etc/security/limits.conf

Add the following at the end of the file:

Oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536 5. Modify / etc/profile to restrict the use of other users:

Vi / etc/profile

Add the following at the end of the file:

If [$USER = "oracle"]; thenif [$SHELL = "/ bin/ksh"]; thenulimit-p 16384ulimit-n 65536elseulimit-u 16384-n 65536fifi

Make the settings take effect

Source / etc/profile

Create corresponding users and user groups:

Groupadd oinstall / / create an installation group

Groupadd dba / / create an administrative group

Useradd-g oinstall-G dba-d / opt/oracle oracle / / create a running user

Passwd oracle / / set the password of the oracle user

Modify directory permissions:

Chown-R oracle:oinstall / opt/

Chmod 755-R / opt/ directory

Switch to oracle user and decompress:

[oracle@just ~] $unzip linux.x64_11gR2_database_1of2.zip

[oracle@just ~] $unzip linux.x64_11gR2_database_2of2.zip

7. Set the oracle environment variable:

Su-oracle

Vi / .bash_profile

Add the following at the end:

Export ORACLE_BASE=/opt/oracle

Export ORACLE_SID=orcl

Note that except for ORACLE_BASE and ORACLE_SID, no oracle-related environment variables (ORACLE_HOME, PATH,LD_LIBRARY_PATH, etc.) are set (in / etc/profile and .bash _ profile)

After installation, add the following exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export TNS_ADMIN=$ORACLE_HOME/network/adminexportPATH=.:$ {PATH}: $HOME/bin:$ORACLE_HOME/binexportPATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/binexportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/libexportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/libexportLD_LIBRARY_PATH=$ { LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/libexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/JREexport CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/JRE/libexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlibexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlibexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlibexportLIBPATH=$ {CLASSPATH}: $ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport ORACLE_OWNER=oracleexport SPFILE_PATH=$ORACLE_HOME/dbsexport ORA_NLS10=$ORACLE_HOME/nls/data

Make the settings take effect

Source / opt/oracle/.bash_profile

Check the environment variables:

Env

At the same time, the settings of DISPLAY will be checked when using silent installation. If it is often said that checking DISPLAY does not work, execute "xhost + your ip:0.0" under root users.

8. Silently install software 8.1 copy response file template

# su-oracle

Mkdir etc / / create a directory

Cp / opt/oracle/database/response/* / opt/oracle/etc/

Set response file permissions

Chmod 700 / opt/oracle/etc/*.rsp (note owner, oinstall)

8.2 silently install the Oracle software

Su-oracle

Modify the response file / opt/oracle/etc/db_install.rsp for installing Oracle software

Oracle.install.option=INSTALL_DB_SWONLY / / installation type, only database software is installed

ORACLE_HOSTNAME=test / / Host name (hostname query)

UNIX_GROUP_NAME=oinstall / / installation group

INVENTORY_LOCATION=/opt/oracle/oraInventory / / INVENTORY directory (left empty is the default)

SELECTED_LANGUAGES=en,zh_CN,zh_TW / / Select language

ORACLE_HOME=/opt/oracle/product/11.2.0/db_1 / / oracle_home

ORACLE_BASE=/opt/oracle / / oracle_base

Oracle.install.db.InstallEdition=EE / / oracle version

Oracle.install.db.isCustomInstall=false / / Custom installation, No, use default components

Oracle.install.db.DBA_GROUP=dba / / dba user group

Oracle.install.db.OPER_GROUP=oinstall / / oper user group

Oracle.install.db.config.starterdb.type=GENERAL_PURPOSE / / database type

Oracle.install.db.config.starterdb.globalDBName=orcl / / globalDBName

Oracle.install.db.config.starterdb.SID=orcl / / SID

Oracle.install.db.config.starterdb.memoryLimit=81920 / / automatically manage memory (M)

Oracle.install.db.config.starterdb.password.ALL=oracle / / set all database users to use the same password

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false (false written manually)

DECLINE_SECURITY_UPDATES=true / / set security update (there seems to be bug, this must be selected true, otherwise it will infinitely remind you that there is a problem with the email address and terminate the installation. PS: no matter whether the address is correct or not)

Start silent installation

Cd database

. / runInstaller-silent-responseFile / opt/oracle/etc/db_install.rsp

During installation, if you prompt [WARNING] to ignore it, the installer is still in progress, and if [FATAL] appears, the installer has stopped.

Check the installation log information to understand the installation progress

Cd $ORACLE_BASE/oraInventory/logs

Tail-f installActions*.log

A prompt similar to the following indicates that the installation is complete:

#-

/ usr/oracle/oraInventory/orainstRoot.sh

/ usr/oracle/product/11.2.0/db_1/root.sh

To execute the configuration scripts:

1. Open a terminal window

2. Log in as "root"

3. Run the scripts

4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.

#-

Use root users to execute scripts

Here are two scripts to execute. Just run.

Su-root

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

/ opt/oracle/oraInventory/orainstRoot.sh

Vi / opt/oracle/.bash_profile

Finally, add the following above

After installation, add the following exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export TNS_ADMIN=$ORACLE_HOME/network/adminexportPATH=.:$ {PATH}: $HOME/bin:$ORACLE_HOME/binexportPATH=$ {PATH}: / usr/bin:/bin:/usr/bin/X11:/usr/local/binexportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/libexportLD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/oracm/libexportLD_LIBRARY_PATH=$ { LD_LIBRARY_PATH}: / lib:/usr/lib:/usr/local/libexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/JREexport CLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/JRE/libexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/jlibexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/rdbms/jlibexportCLASSPATH=$ {CLASSPATH}: $ORACLE_HOME/network/jlibexportLIBPATH=$ {CLASSPATH}: $ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport ORACLE_OWNER=oracleexport SPFILE_PATH=$ORACLE_HOME/dbsexport ORA_NLS10=$ORACLE_HOME/nls/data

After executing source .bash _ profile, the netca and dbca commands appear

At this point, even if the database instance software of oracle11g is installed, then configure the basic parameter files of the database instance.

Note: for related changes, please refer to a "detailed explanation of oracle silent installation file db_install.rsp".

8.3 Silent configuration snooping

Vi etc/netca.rsp

[GENERAL]

RESPONSEFILE_VERSION= "11.2"

CREATE_TYPE= "CUSTOM"

Type of INSTALL_TYPE= "" custom "installation (" typical- typical "," minimal- Min "or" custom- Custom ")

Number of LISTENER_NUMBER=1 listeners

List of names for LISTENER_NAMES= {"orcl"} listeners

List of communication protocols used by LISTENER_PROTOCOLS= {"TCP;1521"} listeners

Name started by the LISTENER_START= "" orcl "listener

Then run:

Netca / silent / responsefile / opt/oracle/etc/netca.rsp (Note: if the parameter is not executable with-silent-responseFile, there will be an error, and the following listening path must specify the absolute path)

Parsing command line arguments:

Parameter "silent" = true

Parameter "responsefile" = / etc/netca.rsp

Complete the syntax analysis of the command line parameters.

Oracle Net Services configuration:

Complete the profile configuration.

The Oracle Net listener starts:

Running listener controls:

/ opt/oracle/product/11.2.0/db_1/bin/lsnrctlstart LISTENER

Listener control complete.

The listener started successfully.

The listener configuration is complete.

Oracle Net Services configuration completed successfully. The exit code is 0

After running successfully, generate two files, sqlnet.ora and listener.ora, in the / opt/oracle/product/11.2.0/db_1/network/admin directory.

Through the netstat-tlnp command, see

Tcp 0 0: 1521: * LISTEN 5477/tnslsnr

It means that the listener is already working on port 1521.

8.4 silently create a new library (also create a corresponding instance)

Modify / etc/dbca.rsp and set it as follows:

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0" / / cannot be changed

OPERATION_TYPE = "createDatabase"

GDBNAME = "orcl.test" / / name of the global database = SID+ host domain name

SID= "orcl" / / corresponding instance name

TEMPLATENAME = "General_Purpose.dbc" / / template file for building the library

SYSPASSWORD = "123456" / / SYS administrator password

SYSTEMPASSWORD = "123456" / / SYSTEM administrator password

DATAFILEDESTINATION = / opt/oracle/oradata / / data file storage directory

RECOVERYAREADESTINATION=/opt/oracle/ flash_recovery_area / / restore the data storage directory

CHARACTERSET = "ZHS16GBK" / / character set, important! Generally speaking, it cannot be changed after the library is built, so make sure it is clear before building the library. (CHARACTERSET = "AL32UTF8"

NATIONALCHARACTERSET= "UTF8")

TOTALMEMORY = "5120" / / oracle memory 5120MB

Then run silently:

$dbca-silent-responseFile etc/dbca.rsp

Copy database files

1% completed

3% completed

11% completed

18% completed

26% completed

37% completed

Creating and starting Oracle instance

40% completed

45% completed

50% completed

55% completed

56% completed

60% completed

62% completed

Database creation in progress

66% completed

70% completed

73% completed

85% completed

96% completed

100% completed

For more information, see the log file "/ opt/oracle/cfgtoollogs/dbca/orcl/orcl.log".

View log files

$cat / opt/oracle/cfgtoollogs/dbca/wang/wang.log

Copy database files

DBCA_PROGRESS: 1%

DBCA_PROGRESS: 3%

DBCA_PROGRESS: 11%

DBCA_PROGRESS: 18%

DBCA_PROGRESS: 26%

DBCA_PROGRESS: 37%

Creating and starting Oracle instance

DBCA_PROGRESS: 40%

DBCA_PROGRESS: 45%

DBCA_PROGRESS: 50%

DBCA_PROGRESS: 55%

DBCA_PROGRESS: 56%

DBCA_PROGRESS: 60%

DBCA_PROGRESS: 62%

Database creation in progress

DBCA_PROGRESS: 66%

DBCA_PROGRESS: 70%

DBCA_PROGRESS: 73%

DBCA_PROGRESS: 85%

DBCA_PROGRESS: 96%

DBCA_PROGRESS: 100%

The database is created. For more information, review the log files at the following location:

/ opt/oracle/cfgtoollogs/dbca/orcl .

Database information:

Global database name: orcl.test

System Identifier (SID): orcl

IX. Command line mode silently deleted

1. Check the help information of dbca first.

$dbca-help

Dbca [- silent |-progressOnly |-customCreate] {} | {[[options]]-responseFile} [- continueOnNonFatalErrors]

Modify the following parameters in the dbca.rsp file, and the following three parameters are modified according to the actual situation of building the database:

OPERATION_TYPE = "deleteDatabase"

SOURCEDB = "orcl"

SYSDBAUSERNAME = "sys"

SYSDBAPASSWORD = "123456"

Then run:

$dbca-silent-responseFile / u01/app/database/response/dbca.rsp

Connecting to database

4% complete

9% complete

14% complete

19% complete

23% complete

28% complete

47% complete

Updating network configuration files

48% complete

52% complete

Deleting instance and datafiles

76% complete

100% complete

Look at the log file "/ u01/app/oracle/cfgtoollogs/dbca/orcl.log" for further details.

It is very simple that the database uninstallation is complete, please note that the database software is still there when the database is uninstalled.

The meanings of the parameters are as follows:

-silent means to delete silently

-responseFile indicates which response file to use. Absolute path is required.

Version of the RESPONSEFILE_VERSION response file template. Do not change this parameter.

OPERATION_TYPE installation type, do not change this parameter

SOURCEDB database name, which is not a global database name, that is, does not contain db_domain

2. Use DBCA to uninstall the database

Dbca-silent-delete Database-responseFile dbca.rsp

a. Option-silent means silent installation, no installation interaction, and no output of most installation information

b. Option-responseFile specifies the answer file, requiring an absolute path

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