CentOS命令行下装oracle 12c的方法(命令行模式安装)
Oracle 12c是一款非常强大的数据库管理系统,广泛应用于各种企业级应用中,在CentOS系统中,我们可以通过命令行模式来安装Oracle 12c,本文将详细介绍如何在CentOS命令行下安装Oracle 12c。
准备工作
1、确保系统已经安装了Oracle 12c所需的依赖包,如unzip、tar、wget等,如果没有安装,可以使用以下命令进行安装:
sudo yum install -y unzip tar wget
2、下载Oracle 12c的安装包,访问Oracle官方网站(https://www.oracle.com/database/technologies/oracle-database-software-downloads.html),找到Oracle 12c的下载链接,使用wget命令下载到本地。
wget https://download.oracle.com/otn_software/linux/x86_64/oracle-database-12c-r2-release-el7-3.2.0-1.tar.gz
解压安装包
1、将下载好的Oracle 12c安装包解压到一个目录,例如/opt
:
sudo tar -zxvf oracle-database-12c-r2-release-el7-3.2.0-1.tar.gz -C /opt
创建Oracle用户和组
1、为了确保Oracle 12c的正常运行,我们需要创建一个专门的用户和组来运行Oracle服务,首先创建一个新的用户和组:
sudo groupadd oinstall sudo groupadd dba sudo useradd -g oinstall -G dba oracle
2、为新创建的用户设置密码:
passwd oracle
配置环境变量
1、切换到oracle用户:
su oracle
2、配置Oracle的环境变量,编辑~/.bash_profile
文件,添加以下内容:
export ORACLE_BASE=/opt/oracle/product/12.2.0/dbhome_1 export ORACLE_HOME=$ORACLE_BASE/bin export ORACLE_SID=orcl export PATH=$ORACLE_HOME:$PATH
3、使配置的环境变量生效:
source ~/.bash_profile
创建Oracle实例和数据库
1、使用dbca
工具创建Oracle实例:
dbca -silent -responseFile /tmp/dbca.rsp -createDatabase -characterSet AL32UTF8 -gdbname orcl -syspassword Oradoc_db1 -systemPassword Oradoc_db1 -owner oracle -instanceName orcl -sampleSchema false -sampleData false
注意:请根据实际情况修改响应文件的内容,例如数据库名、用户名、密码等,响应文件可以自定义,但需要包含以下内容:
[GENERAL] RESPONSEFILE_VERSION = "12.0" OPERATION_TYPE = "createDatabase" [CREATEDATABASE] GDBNAME = "orcl" SID = "orcl" TEMPLATENAME = "General_Purpose.dbc" SYSPASSWORD = "Oradoc_db1" System password for the database owner (optional) SYS as ID "dba" with password "Oradoc_db1" and without profile "DEFAULT" (optional) OPER sysdba identified by "Oradoc_db1" with password "Oradoc_db1" (optional) [DEFAULT] IGNORE_SECURITY = true Only needed if you want to ignore the security settings in the template DB_DOMAIN = "" Only needed if you want to change the default domain SUPPORTED_PLATFORMS = "Linux x86-64, Linux x86, Windows x64, Windows x86" Only needed if you want to change the supported platforms [CONFIGUREDATABASE] INSTANCE_NAME = "orcl" The name of the instance to be created SCOPE = "SPFILE" The location of the configuration files to be created CHARACTERSET = "AL32UTF8" The character set to be used for creating the database AUDIT_TARGET = "NONE" The auditing option for the database DB_UNIQUE_NAME = "orcl" The unique name of the database GSMALLFILECLOBSIZE = "50m" The small file CLOB size GROWTHFACTOR = "10%" The growth factor for the small file tablespaces DEVICE_TYPE = "DISK" The storage type for the database files EXTENT_MANAGEMENT = "AUTO" The extent management option for the database NEXT_LOGGING_KEY = "<br> The next value for the redo log sequence number SEQUENCE_MAXVALUE = "99999999999999999999" The maximum value for the sequence numbers COMPATIBILITY = "12.0" The compatibility level of the database NUMBER_OF_PROCESSES = "0" The number of processes to be created PROCESSES = "0" The process options for the database ARCHIVELOG_MODE = "NONE" The archivelog mode for the database FLASHBACK_ARCHIVE_DEST_STATE_ONLY = "false" The flashback archive destination state only option FLASHBACK_ARCHIVE_DEST = "" The flashback archive destination UNDO_TABLESPACE = "" The undo tablespace for the database UNDO_RETENTION = "" The retention period for the undo data MEMORY_TARGET = "" The memory target for the database MEMORY_MAXIMUM = "" The maximum memory limit for the database MEMORY_PERCENTAGE = "" The memory percentage limit for the database CPU_COUNT = "" The number of CPUs to be used by the database SGA_TARGET = "" The SGA target for the database SGA_MAXIMUM = "" The maximum SGA limit for the database DEADLOCK_DETECTION = "false" Whether to enable deadlock detection or not PLUGGABLE_DATABASE = "false" Whether to enable pluggable database or not [DATABASE] DBFILESREADONLY = "/dev/null" The readonly option for the database DBFILESREADWRITE = "/dev/null" The readwrite option for the database ONLINELOGFILESREADONLY = "/dev/null" The readonly option for the online redo log files ONLINELOGFILESREADWRITE = "/dev/null" The readwrite option for the online redo log files [SECURITY] OS_AUTHENT_PREFIX = "" The authentication prefix for the operating system OS_PRIVS_PREFIX = "" The privileges prefix for the operating system OS_PROFILES="DEFAULT,ORCL" The profiles to be used by the operating system OS_SHRINKOPT="FALSE" Whether to shrink the operating system files or not [STORAGE] INITIALEXTERNALSTORAGE="FALSE" Whether to initialize external storage or not EXTENTSIZE="512M" The extent size EXTENTMANAGEMENT="AUTO" The extent management option for the external storage AUXILIARYMEMORYSIZE="50M" The size of the auxiliary memory LOCALREDOLOGDEST="LOCALREDOLOGDIRECTORY=/u01/app/oracle/oradata/orcl/redolog;DBUNIQUENAME=orcl;LOGFILEGROUP=/u01/app/oracle/oradata/orcl/redolog;FASTSTARTMTTR=0;MAXLOGHISTORY=30;MAXLOGFILES=5;MAXLOGMEMBERS=5;MAXLOGARCHIVELOGLIFE=30;MAXLOGARCHIVEDESTINATION=LOCAL;MAXLOGARCHIVEDESTSTATEMENTS=50;MAXLOGARCHIVEDESTSIZE=50G;ENABLED=TRUE;ENABLEARCHIVING=TRUE;TIMER=OFF;APPENDER="ASYNC";NEXTLOGGINGKEY="<value>";SEQUENCEMAXVALUE="<value>";COMPATIBILITY="12.0";DBFSRECLAIMPOLICY="AUTO";DBFSUSEDEVICETYPE="AUTO";DBFSFILESYSTEMID="AUTO";DBFSRECLAIMPOLICY="AUTO";DBFSUSEDEV
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/369999.html