- 关闭selinux
- 关闭防火墙
- 检查安装依赖包
yum -y install binutils compat-libcap1 vsftpd gcc gcc-c++ glibc-devel glibc elfutils-libelfdevel compat-libcap1 libaio-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC unixODBC-devel
- 修改主机名
hostname <主机名>
- 修改内核参数
# vi /etc/sysctl.conf
在最后添加(注意重复参数,不能小于以下数值)
kernel.shmall = 2097152
kernel.shmmax = 1073741824
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
- 修改用户限制
# vi /etc/security/limits.conf
在最后添加
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
- 创建oracle系统用户
groupadd -g 501 oinstall
groupadd -g 502 dba
useradd -u 501 -g oinstall -G dba oracle
passwd oracle
检查oracle用户权限
[root@jsv77-224 database]# id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
- 创建oracle安装目录
mkdir -p /DataBase/app/oracle
mkdir -p /DataBase/app/oracle/product/11.2.0/db_1
mkdir -p /DataBase/app/oracle/oraInventory
mkdir -p /DataBase/app/oracle/flash_recovery_area
- 修改配置oracle用户环境变量
# vi /home/oracle/.bash_profile
export ORACLE_BASE=/DataBase/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
source .bash_profile
- 修改hosts主机名解析
# vi /etc/hosts
<IP地址> <主机名>
- root用户登录,把数据库安装包上传至/home/oracle目录下
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
chown -R oracle:oinstall /home/oracle/database
- 切换至oracle用户安装Oracle软件,编辑oracle数据库基准应答配置文件
# vi /home/oracle/database/response/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY //【29行】 安装类型,只安装数据库软件
ORACLE_HOSTNAME=【主机名】 //【37行】 主机名称通过hostname查看
UNIX_GROUP_NAME=oinstall //【42行】 安装组
INVENTORY_LOCATION=/DataBase/oracle/app/oraInventory //【47行】INVENTORY目录
SELECTED_LANGUAGES=en,zh_CN //【78行】 选择语言
ORACLE_HOME=/DataBase/app/oracle/product/11.2.0/db_1 //【83行】oracle_home
ORACLE_BASE=/DataBase/app/oracle //【88行】oracle_base
oracle.install.db.InstallEdition=EE //【99行】oracle版本
oracle.install.db.DBA_GROUP=dba //【142行】dba用户组
oracle.install.db.OPER_GROUP=oinstall //【147行】oper用户组
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //【160行】数据库类型,一般用途
oracle.install.db.config.starterdb.globalDBName=orcl //【165行】globalDBName
oracle.install.db.config.starterdb.SID=orcl //【170行】SID
oracle.install.db.config.starterdb.memoryLimit=800 //【200行】自动管理内存的最小内存(M)
oracle.install.db.config.starterdb.password.ALL=oracle //【233行】所有数据库用户使用同一个密码
DECLINE_SECURITY_UPDATES=true //【385行】设置安全更新
【保存退出】
- 编译安装oracle
# cd /home/oracle/database
# ./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp -ignorePrereq
$ ./runInstaller -silent -responseFile /dbdata/oracle/database/response/db_install.rsp -
ignorePrereq
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 5077 MB Passed
Checking swap space: must be greater than 150 MB. Actual 504 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-03-04_01-58-59PM.
Please wait ...[oracle@jsv77-224 database]$
[oracle@jsv77-224 database]$ [WARNING] [INS-32055] The Central Inventory is located inthe Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the
Oracle base directory.
You can find the log of this install session at:
/dbdata/oracle/inventory/logs/installActions2022-03-04_01-58-59PM.log
【还在执行中。。。】
[oracle@cbov10-mysql176-31 database]$ The following configuration scripts need to be
executed as the "root" user.
#!/bin/sh
#Root scripts to run
/DataBase/oracle/app/oraInventory/orainstRoot.sh
/DataBase/app/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
【另一个窗口,以root用户执行】
# /DataBase/oracle/app/oraInventory/orainstRoot.sh
# /DataBase/app/oracle/product/11.2.0/db_1/root.sh
- 修改监听配置文件
# vim /DataBase/app/database/response/netca.rsp
INSTALL_TYPE=""typical"" 【第72行】修改为 INSTALL_TYPE=""custom""
【保存退出】执行以下命令
netca -silent -responsefile /DataBase/app/database/response/netca.rsp
- 创建数据库
$ find $ORACLE_HOME/assistants/dbca -name "*.dbc"
/DataBase/app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Data_Warehouse.dbc
/DataBase/app/oracle/product/11.2.0/db_1/assistants/dbca/templates/General_Purpose.dbc
//编辑修改General_Purpose.dbc文件
<archiveLogMode>true</archiveLogMode> //【50行】改为归档模式 false=>true
<fileSize unit="KB">51200</fileSize> //【78行】修改redo文件大小,默认值为51200
<fileSize unit="KB">51200</fileSize> //【84行】修改redo文件大小,默认值为51200
<fileSize unit="KB">51200</fileSize> //【90行】修改redo文件大小,默认值为51200
【创建数据库】
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid orcl -sysPassword oracle -systemPassword oracle -dbsnmpPassword oracle -sysmanPassword oracle -responseFile NO_VALUE -emConfiguration LOCAL -datafileDestination /DataBase/oracle/app/oradata -CHARACTERSET "ZHS16GBK"
报错处理:
$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid
orcl -sysPassword oracle -systemPassword oracle -dbsnmpPassword oracle -
sysmanPassword oracle -responseFile NO_VALUE -emConfiguration LOCAL -
datafileDestination /dbdata/oracle/app/oradata -CHARACTERSET "ZHS16GBK"
Look at the log file "/dbdata/oracle/app/cfgtoollogs/dbca/orcl.log" for further details.
$ more /dbdata/oracle/app/cfgtoollogs/dbca/orcl.log
The Oracle system identifier(SID) "orcl" already exists. Specify another SID.
解决办法:
以root用户登录
vi /etc/oratab
删除这行 orcl:/dbdata/oracle/app/product/11.2.0/db_1:N
【重新执行】
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid orcl -sysPassword oracle -systemPassword oracle -dbsnmpPassword oracle -sysmanPassword oracle -responseFile NO_VALUE -emConfiguration LOCAL -datafileDestination /DataBase/oracle/app/oradata -CHARACTERSET "ZHS16GBK"
- 配置完成
export ORACLE_SID=orcl
sqlplus / as sysdba
//查看数据库状态
SQL> select status from v$instance;
STATUS
------------
OPEN
标签:11g,DataBase,app,db,orcl,install,oracle,安装
From: https://www.cnblogs.com/baixisuozai/p/17852235.html