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

How to install Oracle11g database silently

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

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to silently install the Oracle11g database. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1.1. Change passwords and create directories and permissions

1) create oracle users and groups

[root@ENMOEDU ~] # groupadd oinstall

[root@ENMOEDU ~] # groupadd dba

[root@ENMOEDU] # useradd-g oinstall-G dba-s / bin/bash oracle

[root@ENMOEDU ~] # passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based ona dictionary word

Retype new UNIX password:

Passwd: all authentication tokens updated successfully.

2) create relevant directories and empower them

[root@ENMOEDU] # chown-R oracle:oinstall / data/u01

[root@ENMOEDU] # chmod-R 755 / data/u01

1.2. Set oracle user environment variables

[root@ENMOEDU ~] # su-oracle

[oracle@ENMOEDU ~] $

[oracle@ENMOEDU ~] $vi .bash _ profile

Note: add the following at the bottom of the document

Export ORACLE_BASE=/data/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export ORACLE_SID=ENMOEDU

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

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

The modification is completed to make it effective, as follows:

[oracle@ENMOEDU] $. .bash _ profile

[oracle@ENMOEDU ~] $

Or

[oracle@ENMOEDU ~] $source .bash _ profile

[oracle@ENMOEDU ~] $

Or log out and log back in.

Note:

ORACLE_BASE:oracle product base catalogue

ORACLE_HOME: database product catalog usually the HOME directory is a subdirectory of BASE

ORACLE_SID: the link between the operating system and the oracle instance

PATH: appends the installed oracle command to the execution search path

LD_LIBRARY_PATH: location of the dynamic library

1.3. Upload oracle installation media and unzip and install database software

1) it has been uploaded successfully. After decompression, a database directory will be generated.

And there are three answer files under / meadia/database/response: db_install.rsp, dbca.rsp and netca.rsp, which are database installation files, database instance establishment and monitoring configuration installation files, respectively.

[oracle@ENMOEDU software] $unzip p13390677_112040_Linux-x86-64_1of7.zip

[oracle@ENMOEDU software] $unzip p13390677_112040_Linux-x86-64_2of7.zip

[oracle@jianguan-EAST-fanxiqian-32 media] $ll

Database

P13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip

2) install the necessary packages in advance:

Install with yum:

[root@jianguan-EAST-fanxiqian-32] yum install-y binutils*

Yum install-y compat-libstdc*

Yum install-y elfutils-libelf*

Yum install-y gcc*

Yum install-y glibc*

Yum install-y ksh*

Yum install-y libaio*

Yum install-y libgcc*

Yum install-y libstdc*

Yum install-y make*

Yum install-y sysstat*

Yum install libXp*-y

Yum install-y glibc-kernheaders

3) go to the database/response/ directory and edit the answer file db_install.rsp used to install the Oracle software

[oracle@jianguan-EAST-fanxiqian-32 database] $cd / media/database/response/

[oracle@jianguan-EAST-fanxiqian-32 database] $vi db_install.rsp

Oracle.install.option=INSTALL_DB_SWONLY / / 29 Line installation Type

ORACLE_HOSTNAME=jianguan-EAST-fanxiqian-32 / / 37 line host name

UNIX_GROUP_NAME=oinstall / / 42 Line installation Group

INVENTORY_LOCATION=/opt/oracle/inventory / / 47 line INVENTORY directory

SELECTED_LANGUAGES=zh_CN / / 78 Line selection language

ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1 / / 83 line oracle_home address

ORACLE_BASE=/data/u01/app/oracle / / 88 line oracle_base address

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

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

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

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

Oracle.install.db.config.starterdb.globalDBName=eastfxq / / 165Line globalDBName

Oracle.install.db.config.starterdb.SID=eastfxq / / 170line SID

Oracle.install.db.config.starterdb.memoryLimit=92160 / / 192 lines automatically manage the minimum memory of memory (M)

Line oracle.install.db.config.starterdb.password.ALL=oracle / / 233sets all database users to use the same password

Line DECLINE_SECURITY_UPDATES=true / / 385sets security update, which must be set or an error will be reported.

3) execute the script to create the software:

1. Need to edit / etc/hosts before executing the script

To check the current hostname, be sure to fill in the current hostname, that is, the name displayed by hostname!

[root@jianguan-EAST-fanxiqian-32 inventory] # hostname

Jianguan-EAST-fanxiqian-32.38

[root@jianguan-EAST-fanxiqian-32 inventory] # vi / etc/hosts # # add the following, otherwise an error will be reported later, saying that hostname cannot be recognized

10.1.32.38 jianguan-EAST-fanxiqian-32.38

two。 Execute the installation script!

[oracle@jianguan-EAST-fanxiqian-32 database] $. / runInstaller-silent-responseFile / media/database/response/db_install.rsp-ignorePrereq

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 86279 MB Passed

Checking swap space: must be greater than 150 MB. Actual 17999 MB Passed

Preparing to launch Oracle Universal Installer from / tmp/OraInstall2018-06-25-12-19-25PM. Please wait... [oracle@jianguan-EAST-fanxiqian-32 database] $

[oracle@jianguan-EAST-fanxiqian-32 database] $

[oracle@jianguan-EAST-fanxiqian-32 database] $

[oracle@jianguan-EAST-fanxiqian-32 database] $You can find the log of this install session at:

/ home/oracle/inventory/logs/installActions2018-06-25mm 12-19-25PM.log

3)。 You can follow up the creation process by viewing the log prompted earlier:

[oracle@jianguan-EAST-fanxiqian-32 database] $tail-f 100 / home/oracle/inventory/logs/installActions2018-06-25-12-19-25PM.log

4) finally, follow the prompts to open the new terminal, log in as root, and execute the script:

# / home/oracle/inventory/orainstRoot.sh

# / data/u01/app/oracle/product/11.2.0/dbhome_1/db_1/root.sh

So far, the Oracle software has been created successfully.

1.4. Install listening softwar

1) Edit necat.rsp file

Netca.rsp, mainly change the configuration of the following parameters:

Type of INSTALL_TYPE= "" custom "# installation

Number of LISTENER_NUMBER=1 # listeners

List of names for LISTENER_NAMES= {"LISTENER"} # listeners

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

LISTENER_START= "" LISTENER "" # name started by the listener

2) execute netca to create listening software:

[oracle@jianguan-EAST-fanxiqian-32 response] $netca / silent / responseFile / media/database/response/netca.rsp

3) try to start listening (with this command):

[oracle@jianguan-EAST-fanxiqian-32 response] $lsnrctl start

So far, the monitoring has been successfully created.

1.5. Create an Oracle database

1) Edit the answer file dbca.rsp that creates the database. The main parameters that need to be modified are as follows (other default values are fine)

RESPONSEFILE_VERSION = "11.2.0" / / cannot be changed

OPERATION_TYPE = "createDatabase"

GDBNAME = "eastfxq" / / name of the database

SID = "eastfxq" / / corresponding instance name

TEMPLATENAME = "General_Purpose.dbc" / / there are two template files for building the library, one with a new name

SYSPASSWORD = "oracle" / / SYS administrator password

SYSTEMPASSWORD = "oracle" / / SYSTEM administrator password

SYSMANPASSWORD= "oracle"

DBSNMPPASSWORD= "oracle"

DATAFILEDESTINATION = / data/u01/app/oracle/oradata

/ / data file storage directory. Default is $ORACLE_BASE/oradata.

RECOVERYAREADESTINATION=/data/u01/app/oracle/flash_recovery_area

/ / the directory of the quick recovery area. Default is $ORACLE_BASE/flash_recovery_area.

CHARACTERSET = "ZHS16GBK"

/ / character set, important! Generally speaking, it cannot be changed after the database is built, so make sure it is clear before building the database.

TOTALMEMORY = "92160" / / 92160MB, physical memory is about 80%

2) execute dbca and start creating the database

[oracle@jianguan-EAST-fanxiqian-32 response] $dbca-silent-responseFile / media/database/response/dbca.rsp

Copying database files

1% complete

3% complete

11% complete

So far, the Oracle database has been created successfully.

1.6. Adjust the parameters and configuration of Oracle:

1. About parameters related to cursors in Oracle database

1) the maximum number of cursors per session of OPEN_CURSORS (active SQL statement). It is recommended to set it to 500.

SQL > alter system set open_cursors=200 scope=spfile

2) the number of cursors cached per session in session_cached_cursors. It is recommended to set it to 200.

SQL > alter system set session_cached_cursors=200 scope=spfile

two。 About the relevant parameters of the storage:

1) the maximum number of physical files that can be created by DB_FILES database can be set to 1500 or more depending on the amount of data.

SQL > alter system set db_files=1500 scope=spfile

2) set the size of the data block (stored in a physical file or cached in SGA), which is usually set to 8192 for online trading systems and 16K or 32K for data warehouses. The default is 8192, or 8k.

3. About the memory-related settings of Oracle:

You need to resize / dev/shm first to ensure that the initialization parameters MEMORY_TARGET or MEMORY_MAX_TARGET cannot be greater than shared memory (/ dev/shm).

(1) View size

Df-h / dev/shm

(2) modify the size, (pay attention to the format, there can be no spaces after commas)

Vi / etc/fstab

Tmpfs / dev/shm tmpfs defaults,size=102400M 00

(3) remount

Umount / dev/shm

Mount / dev/shm

(4) View the modified size

Df-h / dev/shm

Do not restart to modify tmpfs size mount-o remount,size=100g / dev/shm

1) enable automatic memory management in Oracle11g: you can set memory_target and memory_max_target:

(1) memory_target: this parameter sets the amount of memory that can be used by the entire oracle database instance. The oralce database instance will automatically adjust the size of SGA and PGA according to the requirements. You can use the corresponding alter system command to dynamically modify the value of memory_target. This parameter is a dynamic initialization parameter.

(2) memory_max_target: this parameter sets the maximum amount of memory that an oracle instance can use. The following constraint relationship memory_target alter database add logfile member'/ oracle/logfile/redo1_02.log' to group 1 must be maintained when adjusting the value of memory_target

Database altered.

SQL > alter database add logfile member'/ oracle/logfile/redo2_02.log' to group 2

Database altered.

SQL > alter database add logfile member'/ oracle/logfile/redo3_02.log' to group 3

Database altered.

SQL > select member from v$logfile

MEMBER

/ data/u01/app/oracle/oradata/eastfxq/redo03.log

/ data/u01/app/oracle/oradata/eastfxq/redo02.log

/ data/u01/app/oracle/oradata/eastfxq/redo01.log

/ oracle/logfile/redo1_02.log

/ oracle/logfile/redo2_02.log

/ oracle/logfile/redo3_02.log

6 rows selected.

6. For the relevant changes to rman, please refer to the following:

RMAN > show all

Using target database control file instead of recovery catalog

RMAN configuration parameters for database with db_unique_name ACCDB are:

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS

CONFIGURE BACKUP OPTIMIZATION ON

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP ON

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO'/ caadb/backup/accdb/backup/rman/20180629/accdb_lev0_201806290230_%F'

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE' DEFAULT' OPTIMIZE FOR LOAD TRUE; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY

CONFIGURE SNAPSHOT CONTROLFILE NAME TO'/ home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_accdb.f'; # default

7. Directory modification for archiving: in case the default archive path is a quick recovery area!

SQL > alter system set log_archive_dest_1='location=/data/u01/app/oracle/archivelog'

8. You can modify the size of the quick recovery area appropriately:

SQL > alter system set db_recovery_file_dest_size=6g

1.7. Final verification

1) View the instance name:

SQL > select instance_name from v$instance

INSTANCE_NAME

-

Eastfxq

2) View the database name:

SQL > select name from v$database

NAME

-

EASTFXQ

Or

SQL > select instance_name from v$instance

INSTANCE_NAME

-

Eastfxq

3) View the monitoring status:

[oracle@jianguan-EAST-fanxiqian-32 ~] $lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0-Production on 25-JUN-2018 17:12:57

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=10.1.32.38) (PORT=1521)

STATUS of the LISTENER

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0-Production

Start Date 25-JUN-2018 14:32:17

Uptime 0 days 2 hr. 40 min. 39 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File / data/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File / data/u01/app/oracle/diag/tnslsnr/jianguan-EAST-fanxiqian-32/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=10.1.32.38) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521)

Services Summary...

Service "eastfxq" has 2 instance (s).

Instance "eastfxq", status UNKNOWN, has 3 handler (s) for this service...

Instance "eastfxq", status READY, has 1 handler (s) for this service...

Service "eastfxqXDB" has 1 instance (s).

Instance "eastfxq", status READY, has 1 handler (s) for this service...

The command completed successfully

4) check the character set of Oracle database:

SQL > select userenv ('language') nls_lang from dual

NLS_LANG

AMERICAN_AMERICA.ZHS16GBK

5) View the directory of the data file:

SQL > select name from v$datafile

NAME

/ data/u01/app/oracle/oradata/eastfxq/system01.dbf

/ data/u01/app/oracle/oradata/eastfxq/sysaux01.dbf

/ data/u01/app/oracle/oradata/eastfxq/undotbs01.dbf

/ data/u01/app/oracle/oradata/eastfxq/users01.dbf

6) View the path of the redo log:

SQL > select GROUP#,MEMBER from v$logfile

GROUP# MEMBER

-

3 / data/u01/app/oracle/oradata/eastfxq/redo03.log

2 / data/u01/app/oracle/oradata/eastfxq/redo02.log

1/ data/u01/app/oracle/oradata/eastfxq/redo01.log

1 / oracle/logfile/redo1_02.log

2 / oracle/logfile/redo2_02.log

3 / oracle/logfile/redo3_02.log

6 rows selected.

At this point the Oracle database environment is ready.

This is the end of this article on "how to silently install Oracle11g database". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

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