在 CentOS Linux 上启动 Oracle 数据库,需要遵循以下详细步骤,这里以 Oracle 19c 为例进行说明。
1、安装依赖包
在开始安装 Oracle 数据库之前,需要先安装一些依赖包,可以使用以下命令安装:
sudo yum install y binutils compatlibcap1 compatlibstdc++33 gcc gccc++ glibc glibcdevel ksh libaio libaiodevel libgcc libstdc++ libstdc++devel make sysstat unixODBC unixODBCdevel
2、创建 Oracle 用户和组
为了安装和管理 Oracle 数据库,需要创建一个专用的用户和组,使用以下命令创建:
sudo groupadd oinstall sudo groupadd dba sudo useradd g oinstall G dba oracle sudo passwd oracle
3、配置内核参数
编辑 /etc/sysctl.conf
文件,添加以下内容:
kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.filemax = 6815744 net.ipv4.ip_local_port_range = 9000 65535 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
然后执行以下命令使配置生效:
sudo sysctl p
4、配置用户限制
编辑 /etc/security/limits.conf
文件,添加以下内容:
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
5、创建安装目录
创建所需的安装目录:
sudo mkdir p /u01/app/oracle/product/19.0.0/dbhome_1 sudo chown R oracle:oinstall /u01 sudo chmod R 775 /u01
6、配置环境变量
编辑 ~oracle/.bash_profile
文件,添加以下内容:
export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1 export ORACLE_SID=orcl export PATH=$ORACLE_HOME/bin:$PATH
使配置生效:
source ~oracle/.bash_profile
7、创建响应文件
根据实际需求,创建响应文件 db_install.rsp
,内容如下:
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory/orainst.loc ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 ORACLE_HOME_LIST=/u01/app/oracle/product/19.0.0/dbhome_1 ORACLE_BASE=/u01/app/oracle ORACLE_BASE_LIST=/u01/app/oracle oracle.install.db.InstallEdition=EE INSTALL_EDITION=EE oracle.install.db.OSDBA_GROUP=dba OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=dba OSOPER_GROUP=dba oracle.install.db.OSBACKUPDBA_GROUP=dba OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba OSDGDBA_GROUP=dba oracle.install.db.OSKMDBA_GROUP=dba OSKMDBA_GROUP=dba oracle.install.db.OSRACDBA_GROUP=dba OSRACDBA_GROUP=dba oracle.install.db.OSRACDBADMIN_GROUP=dba OSRACDBADMIN_GROUP=dba oracle.install.db.OSCONFIGUREADMIN_GROUP=dba OSCONFIGUREADMIN_GROUP=dba # For ASM and RAC installations, only required if you want to register the database after installation; it is not required for DBMS installations only. DECLINE if you are not installing ASM or RAC instances or if you do not want to register the database after installation but before opening it for use (optional). ASMSDBD is a special OS user that must be created by the installer when installing ASM instances and must have the same name as the ASM instance name, prefixed with "asmdbf" and followed by "asmdba" (e
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/505487.html