摘要:本文主要向大家介绍了Oracle数据库之Oracle 12C R2静默安装文档,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
本文主要向大家介绍了Oracle数据库之Oracle 12C R2静默安装文档,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
环境
OS:centos7
Oracle:Oracle 12.2.0.1
Hosts file
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.119 centos7
安装准备
配置/etc/sysctl.conf
[root@centos7 ~]# vim /etc/sysctl.conf# System default settings live in /usr/lib/sysctl.d/00-system.conf.# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file## For more information, see sysctl.conf(5) and sysctl.d(5).#fs.file-max = 6815744kernel.sem = 250 32000 100 128kernel.shmmni = 4096kernel.shmall = 1073741824kernel.shmmax = 4398046511104kernel.panic_on_oops = 1net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576net.ipv4.conf.all.rp_filter = 2net.ipv4.conf.default.rp_filter = 2fs.aio-max-nr = 1048576net.ipv4.ip_local_port_range = 9000 65500
#使配置生效
[root@centos7 ~]# /sbin/sysctl -p
配置/etc/security/limits.d/20-nproc.conf
[root@centos7 ~]# vim /etc/security/limits.d/20-nproc.conf# Default limit for number of user's processes to prevent# accidental fork bombs.# See rhbz #432903 for reasoning.* soft nproc 4096root soft nproc unlimitedoracle soft nofile 1024oracle hard nofile 65536oracle soft nproc 16384oracle hard nproc 16384oracle soft stack 10240oracle hard stack 32768oracle hard memlock 134217728oracle soft memlock 134217728
安装一些包:
yum install -y binutils \compat-libcap1 \compat-libstdc++-33 \compat-libstdc++-33.i686 \glibc \glibc.i686 \glibc-devel \glibc-devel.i686 \ksh \libaio \libaio.i686 \libaio-devel \libaio-devel.i686 \libX11 \libX11.i686 \libXau \libXau.i686 \libXi \libXi.i686 \libXtst \libXtst.i686 \libgcc \libgcc.i686 \libstdc++ \libstdc++.i686 \libstdc++-devel \libstdc++-devel.i686 \libxcb \libxcb.i686 \make \nfs-utils \net-tools \smartmontools \sysstat \unixODBC \unixODBC-develgcc \gcc-c++ \libXext \libXext.i686 \zlib-devel \zlib-devel.i686
#创建用户和组
[root@centos7 ~]# unzip linuxx64_12201_database.zip ^C[root@centos7 ~]# groupadd -g 54321 oinstall[root@centos7 ~]# groupadd -g 54322 dba[root@centos7 ~]# groupadd -g 54323 oper[root@centos7 ~]# useradd -u 54321 -g oinstall -G dba,oper oracle[root@centos7 ~]# passwd oracle
#关闭selinux和防火墙:
vim /etc/selinux/configSELINUX=disabled[root@centos7 ~]# systemctl stop firewalld[root@centos7 ~]# systemctl disable firewalld
#创建目录:
[root@centos7 ~]# mkdir -p /u01/app/oracle/product/12.2.0.1/db_1[root@centos7 ~]#[root@centos7 ~]# chown -R oracle:oinstall /u01[root@centos7 ~]# chmod 775 /u01
#配置环境变量:
[root@centos7 ~]# vim /home/oracle/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATH# Oracle Settingsexport TMP=/tmpexport TMPDIR=$TMPexport ORACLE_HOSTNAME=centos7export ORACLE_UNQNAME=cdbexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1export ORACLE_SID=cdbexport PATH=/usr/sbin:$PATHexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
安装
编辑应答文件:
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0oracle.install.option=INSTALL_DB_SWONLYUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oracle/oraInventoryORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.OSDBA_GROUP=dbaoracle.install.db.OSOPER_GROUP=operoracle.install.db.OSBACKUPDBA_GROUP=dbaoracle.install.db.OSDGDBA_GROUP=dbaoracle.install.db.OSKMDBA_GROUP=dbaoracle.install.db.OSRACDBA_GROUP=dbaoracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBName=cdb1oracle.install.db.config.starterdb.SID=cdb1oracle.install.db.config.starterdb.characterSet=AL32UTF8SECURITY_UPDATES_VIA_MYORACLESUPPORT=falseDECLINE_SECURITY_UPDATES=true
开始安装:
[oracle@centos7 database]$ ./runInstaller -force -silent -noconfig -responseFile /u01/database/response/db_install.rspStarting Oracle Universal Installer...Checking Temp space: must be greater than 500 MB. Actual 11715 MB PassedChecking swap space: must be greater than 150 MB. Actual 2047 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2017-04-15_08-36-48PM. P[oracle@centos7 database]$ [WARNING] [INS-32055] 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:/u01/app/oracle/oraInventory/logs/installActions2017-04-15_08-36-48PM.logThe installation of Oracle Database 12c was successful.Please check '/u01/app/oracle/oraInventory/logs/silentInstall2017-04-15_08-36-48PM.log' for more details.As a root user, execute the following script(s):1. /u01/app/oracle/oraInventory/orainstRoot.sh2. /u01/app/oracle/product/12.2.0.1/db_1/root.shSuccessfully Setup Software.
执行两个脚本:
[root@centos7 ~]# /u01/app/oracle/oraInventory/orainstRoot.shChanging permissions of /u01/app/oracle/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.Changing groupname of /u01/app/oracle/oraInventory to oinstall.The execution of the script is complete.[root@centos7 ~]# /u01/app/oracle/product/12.2.0.1/db_1/root.shCheck /u01/app/oracle/product/12.2.0.1/db_1/install/root_centos7_2017-04-15_20-56-27-813321685.log for the output of root script[root@centos7 ~]#
配置,添加监听:
[oracle@centos7 response]$ cat netca.rsp | grep -Ev "^#|^$"[GENERAL]RESPONSEFILE_VERSION="12.2"CREATE_TYPE="CUSTOM"[oracle.net.ca]INSTALLED_COMPONENTS={"server","net8","javavm"}INSTALL_TYPE=""typical""LISTENER_NUMBER=1LISTENER_NAMES={"LISTENER"}LISTENER_PROTOCOLS={"TCP;1521"}LISTENER_START=""LISTENER""NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}NSN_NUMBER=1NSN_NAMES={"EXTPROC_CONNECTION_DATA"}NSN_SERVICE={"PLSExtProc"}NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}[oracle@centos7 response]$ netca -silent -responsefile /u01/database/response/netca.rspParsing command line arguments:Parameter "silent" = trueParameter "responsefile" = /u01/database/response/netca.rspDone parsing command line arguments.Oracle Net Services Configuration:Profile configuration complete.Oracle Net Listener Startup:Running Listener Control:/u01/app/oracle/product/12.2.0.1/db_1/bin/lsnrctl start LISTENERListener Control complete.Listener started successfully.Listener configuration complete.Oracle Net Services configuration successful. The exit code is 0[oracle@centos7 response]$ lsnrctl statusLSNRCTL for Linux: Version 12.2.0.1.0 - Production on 15-APR-2017 21:05:32Copyright (c) 1991, 2016, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=centos7)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date 15-APR-2017 21:05:24Uptime 0 days 0 hr. 0 min. 8 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/12.2.0.1/db_1/network/admin/listener.oraListener Log File /u01/app/oracle/diag/tnslsnr/centos7/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos7)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))The listener supports no servicesThe command completed successfully
创建数据库,修改相应文件,有些参数有默认值就不需要
[oracle@centos7 response]$ cat /home/oracle/dbca.rsp | grep -Ev '^#|^$'responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0gdbName=cdb1sid=cdb1databaseConfigType=SIRACOneNodeServiceName=policyManaged=falsecreateServerPool=falseserverPoolName=cardinality=force=falsepqPoolName=pqCardinality=createAsContainerDatabase=truenumberOfPDBs=1pdbName=cdb1pdbuseLocalUndoForPDBs=truepdbAdminPassword=nodelist=templateName=/u01/app/oracle/product/12.2.0.1/db_1/assistants/dbca/templates/General_Purpose.dbcsysPassword=systemPassword=serviceUserPassword=emConfiguration=emExpressPort=5500runCVUChecks=falsedbsnmpPassword=omsHost=omsPort=0emUser=emPassword=dvConfiguration=falsedvUserName=dvUserPassword=dvAccountManagerName=dvAccountManagerPassword=olsConfiguration=falsedatafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/recoveryAreaDestination={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}storageType=FSdiskGroupName=asmsnmpPassword=recoveryGroupName=characterSet=AL32UTF8nationalCharacterSet=AL16UTF16registerWithDirService=falsedirServiceUserName=dirServicePassword=walletPassword=listeners=LISTENERvariablesFile=variables=DB_UNIQUE_NAME=cdb1,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=cdb1,ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1,SID=cdb1initParams=undo_tablespace=UNDOTBS1,memory_target=796MB,processes=300,db_recovery_file_dest_size=2780MB,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=cdb1XDB),db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},db_block_size=8192BYTES,diagnostic_dest={ORACLE_BASE},audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,nls_territory=AMERICA,local_listener=LISTENER_CDB1,compatible=12.2.0,control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),db_name=cdb1,audit_trail=db,remote_login_passwordfile=EXCLUSIVE,open_cursors=300sampleSchema=falsememoryPercentage=40databaseType=MULTIPURPOSEautomaticMemoryManagement=truetotalMemory=0
创建数据库
[oracle@centos7 response]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp[WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.CAUSE: Fast Recovery Area size should at least be three times the database size (2,730 MB).ACTION: Specify Fast Recovery Area Size to be at least three times the database size.[WARNING] [DBT-11209] Current available physical memory is less than the required physical memory (796MB) for creating the database.Enter SYS user password:Enter SYSTEM user password:Enter PDBADMIN User Password:[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.CAUSE:a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as passwordACTION: Specify a strong password. If required refer Oracle documentation for guidelines.[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.CAUSE:a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as passwordACTION: Specify a strong password. If required refer Oracle documentation for guidelines.[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.CAUSE:a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as passwordACTION: Specify a strong password. If required refer Oracle documentation for guidelines.[WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.CAUSE: Fast Recovery Area size should at least be three times the database size (3,571 MB).ACTION: Specify Fast Recovery Area Size to be at least three times the database size.Copying database files1% complete13% complete25% completeCreating and starting Oracle instance26% complete30% complete31% complete35% complete38% complete39% complete41% completeCompleting Database Creation42% complete43% complete44% complete46% complete49% complete50% completeCreating Pluggable Databases55% complete75% completeExecuting Post Configuration Actions100% completeLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/cdb1.log" for further details.
查看状态
[oracle@centos7 response]$ sqlplus / as sysdbaSQL*Plus: Release 12.2.0.1.0 Production on Sat Apr 15 23:07:08 2017Copyright (c) 1982, 2016, Oracle. All rights reserved.Connected to:Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit ProductionSQL> select open_mode from v$database;OPEN_MODE--------------------READ WRITESQL> select status from v$instance;STATUS------------OPEN
本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号