Oracle是世界领先的数据库管理系统,其11g版本受到很多企业和个人用户的青睐。然而,Oracle11g的安装过程比较繁琐,如果需要在多台机器上进行安装,则会耗费大量的时间和人力资源。为了提高安装效率,Oracle提供了静默安装的方法,可在不人为干预的情况下完成软件的自动安装。本文将介绍如何进行Oracle11g的静默安装。
一、准备工作
在进行Oracle11g的静默安装之前,需要先准备好以下工作:
1.Oracle11g安装介质,一般为光盘或ISO镜像;
2.Oracle11g安装文件的响应文件(.rsp文件),可以使用Oracle提供的模板文件进行修改;
3.安装计划表(.lst文件),用于记录安装过程和错误信息;
4.管理员权限的命令行界面或终端,以及足够的磁盘空间和内存资源。
二、创建响应文件
响应文件(.rsp文件)是Oracle11g静默安装的关键,其记录了安装过程中需要输入的各种参数信息。Oracle提供了模板文件(如db_install.rsp)可供修改,如果需要自定义安装参数,可以根据实际情况对文件内容进行修改。下面是一个典型的响应文件示例:
The response file for installing Oracle Database 11gR2
This file is generated by the Oracle Universal Installer.
[GENERAL]
Location of the Oracle base directory.
ORACLE_BASE="/u01/app/oracle"
Name of the Oracle inventory directory.
INVENTORY_LOCATION="/u01/app/oraInventory"
The location for your Oracle home.
ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1"
The name of the database. This is typically a name that
starts with a letter and contains up to 8 characters.
ORACLE_SID="orcl"
Global database name.
GDBNAME="orcl"
Character set of the database.
CHARACTERSET="AL32UTF8"
Specify whether to install the database software or create a
database. Choose "Software Only" for database software
installation.
INSTALL_OPTION="INSTALL_DB_AND_CONFIG"
Specify whether to create a database or upgrade an existing one.
Choose "Create Database" for new database creation.
Choose "Upgrade an Existing Database" to upgrade an
existing database.
CREATE_DATABASE_TYPE="CREATE_DATABASE"
Password for SYS and SYSTEM users.
SYS_PASSWORD="password"
SYSTEM_PASSWORD="password"
Database file location.
DATA_LOCATION="/u01/app/oracle/oradata"
Control file location.
DB_CONTROL_FILES_LOCATION="/u01/app/oracle/oradata"
DB_CONTROL_FILES="ora_control1, ora_control2, ora_control3"
Redo log file location.
DB_RECOVERY_FILE_DEST="/u01/app/oracle/flash_recovery_area"
DB_RECOVERY_FILE_DEST_SIZE=2G
Memory limit for database SGA and PGA.
TOTAL_MEMORY=2048
[LANGUAGE]
Language of the installation.
Valid values are: AMERICAN_AMERICA.WE8ISO8859P1,
AMERICAN_AMERICA.UTF8, or other valid character set names.
You can also supply your own language name.
SELECTED_LANGUAGES="AMERICAN_AMERICA.UTF8"
[INSO]
Installation type.
INSTALL_TYPE="Typical"
[INSTALLUPDATES]
Specify whether to check for product updates.
UPDATES_CHECK=TRUE
[SECURITY]
Activate security options
SECURITY_UPDATES_VIA_MYORACLESUPPORT=FALSE
[SYSTEMCLASS]
Enter the system class, which determines the maximum number
of memory allowed for SGA and PGA.
Valid values are: Desktop, Server, or Custom
If you choose Custom, you must specify the memory size yourself.
The following example is for a server class machine.
oracle.install.db.config.starterdb.memoryLimit=1024
[DATABASE]
Specify the template to use when creating the database.
TEMPLATE_NAME="General_Purpose.dbc"
Global database name for this database.
GDBNAME="orcl"
Password for SYS and SYSTEM users.
SYS_PASSWORD="password"
SYSTEM_PASSWORD="password"
Character set for the database.
CHARACTERSET="AL32UTF8"
National character set for the database.
NATIONAL_CHARACTERSET="UTF8"
Database file location.
DATA_LOCATION="/u01/app/oracle/oradata"
Control file location.
DB_CONTROL_FILES_LOCATION="/u01/app/oracle/oradata"
Redo log file location.
DB_RECOVERY_FILE_DEST="/u01/app/oracle/flash_recovery_area"
DB_RECOVERY_FILE_DEST_SIZE=2G
Perform database backup after installation.
Valid values are: YES or NO
DB_INSTALLATION_SLIM_CONFIG=true
[EMCONFIG]
Enter Y if you want to configure Enterprise Manager.
EM_CONFIGURATION=LOCAL
Enterprise Manager password.
EM_PASSWORD="password"
[REAL_APPLICATION_CLUSTER]
Specify whether this is a Real Application Clusters installation.
CLUSTER_NODES=a1,a2,a3
Specify the VIP name and port.
NODEVIP="orclvip"
NODEVIP_PORT=1521
Specify the SCAN name and port.
CLUSTER_SCAN_NAME="orclscan"
CLUSTER_SCAN_PORT="1521"
CLUSTER_SCAN_PORTS="1522,1523,1524"
Specify the database name and listener port.
DB_NAME="racdb"
DB_UNIQUE_NAME="racdb1"
DB_LISTENER_PORT=1521
Specify the database storage type.
DB_STORAGE_TYPE="ASM"
Configure Automatic Storage Management.
ASM_DISK_STRING="ORCL:*"
以上是响应文件示例的一部分,它包含了常用的安装参数设置,可以根据实际情况进行修改。
三、创建安装计划表
安装计划表(.lst文件)用于记录Oracle11g静默安装过程中产生的日志信息和错误信息。创建安装计划表可以方便排查安装过程中的问题。通常,安装计划表可以在响应文件中进行配置,如下所示:
[GENERIC]
The name and file location of the installer log file.
If you do not specify a log file name or directory, the log
file is created in the /tmp directory. By default, the log
file name is "installActions.log".
Example:
LOGFILE=/u01/app/oracle/installer/log/installation.log
LOG_FILE="oraInstall.log"
The name and location for storing the inventory of installed software.
If you do not specify an inventory location, the software is
installed in the default inventory directory.
Example:
INVENTORY_LOCATION=/tmp/oracleInventory
INVENTORY_LOCATION="/u01/app/oraInventory"
Specify the name and file location for the installation plan file.
The installation plan file provides a record of all the configuration
settings you selected during installation.
Example:
INSTALL_PLAN=/u01/app/oracle/installer/log/planFile.lst
I
.........................................................