经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Oracle » 查看文章
OL8.0静默安装Oracle 19C
来源:cnblogs  作者:九命猫幺  时间:2019/8/19 8:46:53  对本文有异议

首先在edelivery中下载Oracle Linux 8.0

image然后就默认安装系统

image

image

环境准备工具目前不支持OL8,所以需要手动安装,首先设置内核参数,在/etc/sysctl.conf追加

  1. [root@localhost ~]# cat /etc/sysctl.conf |grep -v ^#|grep -v ^$
  2. fs.file-max = 6815744
  3. kernel.sem = 250 32000 100 128
  4. kernel.shmmni = 4096
  5. kernel.shmall = 1073741824
  6. kernel.shmmax = 4398046511104
  7. kernel.panic_on_oops = 1
  8. net.core.rmem_default = 262144
  9. net.core.rmem_max = 4194304
  10. net.core.wmem_default = 262144
  11. net.core.wmem_max = 1048576
  12. net.ipv4.conf.all.rp_filter = 2
  13. net.ipv4.conf.default.rp_filter = 2
  14. fs.aio-max-nr = 1048576
  15. net.ipv4.ip_local_port_range = 9000 65500
  16. [root@localhost ~]#

sysctl -p使参数生效

然后/etc/security/limits.d/oracle-database-preinstall-19c.conf中添加

  1. [root@localhost limits.d]# cat /etc/security/limits.d/oracle-database-preinstall-19c.conf
  2. oracle soft nofile 1024
  3. oracle hard nofile 65536
  4. oracle soft nproc 16384
  5. oracle hard nproc 16384
  6. oracle soft stack 10240
  7. oracle hard stack 32768
  8. oracle hard memlock 134217728
  9. oracle soft memlock 134217728
  10. [root@localhost limits.d]#

安装依赖软件

  1. dnf install -y bc binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libXrender-devel libX11 libXau libXi libXtst libgcc librdmacm-devel libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python3 python3-configshell python3-rtslib python3-six targetcli smartmontools sysstat unixODBC libnsl libnsl.i686 libnsl2 libnsl2.i686

创建用户组和用户

  1. [root@localhost limits.d]# groupadd -g 1001 oinstall
  2. [root@localhost limits.d]# groupadd -g 1002 dba
  3. [root@localhost limits.d]# groupadd -g 1003 oper
  4. [root@localhost limits.d]# useradd -u 1001 -g oinstall -G dba,oper oracle
  5. [root@localhost limits.d]# passwd oracle
  6. Changing password for user oracle.
  7. New password:
  8. BAD PASSWORD: The password is shorter than 8 characters
  9. Retype new password:
  10. passwd: all authentication tokens updated successfully.
  11. [root@localhost limits.d]#

创建目录

  1. [root@localhost ~]# mkdir -p /u01/app/oraInventory
  2. [root@localhost ~]# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
  3. [root@localhost ~]# chown -R oracle: /u01/app/oraInventory
  4. [root@localhost ~]# chown -R oracle: /u01/app/oracle
  5. [root@localhost ~]# su - oracle
  6. [oracle@localhost db]$ unzip -q /stage/db/V982063-01.zip -d /u01/app/oracle/product/19.3.0/dbhome_1/
  7. [oracle@localhost db]$

开始安装,注意版本兼容问题要先设置环境变量export CV_ASSUME_DISTID=RHEL7.6

  1. [oracle@localhost ~]$ export CV_ASSUME_DISTID=RHEL7.6
  2. [oracle@localhost ~]$ /u01/app/oracle/product/19.3.0/dbhome_1/runInstaller -ignorePrereq -waitforcompletion -silent > -responseFile /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_install.rsp > oracle.install.option=INSTALL_DB_SWONLY > .ORACLE_HOSTNAME=OL8.0_19C > UNIX_GROUP_NAME=oinstall > INVENTORY_LOCATION=/u01/app/oraInventory > SELECTED_LANGUAGES=en,en_GB > ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 > ORACLE_BASE=/u01/app/oracle > oracle.install.db.InstallEdition=EE > oracle.install.db.OSDBA_GROUP=dba > oracle.install.db.OSBACKUPDBA_GROUP=dba > oracle.install.db.OSDGDBA_GROUP=dba > oracle.install.db.OSKMDBA_GROUP=dba > oracle.install.db.OSRACDBA_GROUP=dba > SECURITY_UPDATES_VIA_MYORACLESUPPORT=false > DECLINE_SECURITY_UPDATES=true
  3. Launching Oracle Database Setup Wizard...
  4.  
  5. The response file for this session can be found at:
  6. /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_2019-08-17_12-41-50PM.rsp
  7.  
  8. You can find the log of this install session at:
  9. /tmp/InstallActions2019-08-17_12-41-50PM/installActions2019-08-17_12-41-50PM.log
  10.  
  11. As a root user, execute the following script(s):
  12. 1. /u01/app/oraInventory/orainstRoot.sh
  13. 2. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
  14.  
  15. Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
  16. [localhost]
  17. Execute /u01/app/oracle/product/19.3.0/dbhome_1/root.sh on the following nodes:
  18. [localhost]
  19.  
  20.  
  21. Successfully Setup Software.
  22. Moved the install session logs to:
  23. /u01/app/oraInventory/logs/InstallActions2019-08-17_12-41-50PM
  24. [oracle@localhost ~]$ su - root
  25. Password:
  26. [root@localhost ~]# /u01/app/oraInventory/orainstRoot.sh
  27. Changing permissions of /u01/app/oraInventory.
  28. Adding read,write permissions for group.
  29. Removing read,write,execute permissions for world.
  30.  
  31. Changing groupname of /u01/app/oraInventory to oinstall.
  32. The execution of the script is complete.
  33. [root@localhost ~]# /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
  34. Check /u01/app/oracle/product/19.3.0/dbhome_1/install/root_localhost.localdomain_2019-08-17_12-44-20-885851348.log for the output of root script
  35. [root@localhost ~]#

代码是

  1. /u01/app/oracle/product/19.3.0/dbhome_1/runInstaller -ignorePrereq -waitforcompletion -silent -responseFile /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_install.rsp oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=OL8.0_19C UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory SELECTED_LANGUAGES=en,en_GB ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba oracle.install.db.OSKMDBA_GROUP=dba oracle.install.db.OSRACDBA_GROUP=dba SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true

静默安装数据库,df -h先看看内存够不够,不够就调整参数大小或者mount -o remount,size=4G /dev/shm

  1. [root@localhost ~]# mount -o remount,size=4G /dev/shm
  2. [root@localhost ~]# su - oracle
  3. [oracle@localhost ~]$ /u01/app/oracle/product/19.3.0/dbhome_1/bin/dbca -silent -createDatabase > -templateName General_Purpose.dbc > -gdbname cdb1 -sid cdb1 -responseFile NO_VALUE > -characterSet AL32UTF8 > -sysPassword oracle > -systemPassword oracle > -createAsContainerDatabase true > -numberOfPDBs 1 > -pdbName pdb1 > -pdbAdminPassword oracle > -databaseType MULTIPURPOSE > -automaticMemoryManagement false > -totalMemory 2000 > -storageType FS > -datafileDestination "/u01/app/oracle/oradata" > -redoLogFileSize 50 > -emConfiguration NONE > -ignorePreReqs
  4. [WARNING] [DBT-11209] Current available memory is less than the required available memory (2,000MB) for creating the database.
  5. CAUSE: Following nodes do not have required available memory :
  6. Node:localhost Available memory:1.8429GB (1932452.0KB)
  7.  
  8. [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
  9. CAUSE:
  10. 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].
  11. b.The password entered is a keyword that Oracle does not recommend to be used as password
  12. ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
  13. [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
  14. CAUSE:
  15. 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].
  16. b.The password entered is a keyword that Oracle does not recommend to be used as password
  17. ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
  18. [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
  19. CAUSE:
  20. 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].
  21. b.The password entered is a keyword that Oracle does not recommend to be used as password
  22. ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
  23. Prepare for db operation
  24. 8% complete
  25. Copying database files
  26. 31% complete
  27. Creating and starting Oracle instance
  28. 32% complete
  29. 36% complete
  30. 40% complete
  31. 43% complete
  32. 46% complete
  33. Completing Database Creation
  34. 51% complete
  35. 53% complete
  36. 54% complete
  37. Creating Pluggable Databases
  38. 58% complete
  39. 77% complete
  40. Executing Post Configuration Actions
  41. 100% complete
  42. Database creation complete. For details check the logfiles at:
  43. /u01/app/oracle/cfgtoollogs/dbca/cdb1.
  44. Database Information:
  45. Global Database Name:cdb1
  46. System Identifier(SID):cdb1
  47. Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/cdb1.log" for further details.
  48. [oracle@localhost ~]$

代码是

  1. /u01/app/oracle/product/19.3.0/dbhome_1/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname cdb1 -sid cdb1 -responseFile NO_VALUE -characterSet AL32UTF8 -sysPassword oracle -systemPassword oracle -createAsContainerDatabase true -numberOfPDBs 1 -pdbName pdb1 -pdbAdminPassword oracle -databaseType MULTIPURPOSE -automaticMemoryManagement false -totalMemory 2000 -storageType FS -datafileDestination "/u01/app/oracle/oradata" -redoLogFileSize 50 -emConfiguration NONE -ignorePreReqs

修改/etc/oratab中默认的N为Y,以便让数据库随系统的启动一起启动

  1. [oracle@localhost ~]$ cat /etc/oratab |grep -v ^#|grep -v ^$
  2. cdb1:/u01/app/oracle/product/19.3.0/dbhome_1:Y
  3. [oracle@localhost ~]$

查看一下

  1. [oracle@localhost ~]$ export ORACLE_SID=cdb1
  2. [oracle@localhost ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
  3. [oracle@localhost ~]$ export ORACLE_BASE=/u01/app/oracle/
  4. [oracle@localhost ~]$ export PATH=$PATH:$ORACLE_HOME/bin
  5. [oracle@localhost ~]$
  6. [oracle@localhost ~]$ sqlplus / as sysdba
  7.  
  8. SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 17 14:20:38 2019
  9. Version 19.3.0.0.0
  10.  
  11. Copyright (c) 1982, 2019, Oracle. All rights reserved.
  12.  
  13.  
  14. Connected to:
  15. Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
  16. Version 19.3.0.0.0
  17.  
  18. SQL> show pdbs;
  19.  
  20. CON_ID CON_NAME OPEN MODE RESTRICTED
  21. ---------- ------------------------------ ---------- ----------
  22. 2 PDB$SEED READ ONLY NO
  23. 3 PDB1 READ WRITE NO
  24. SQL> alter system set db_create_file_dest='/u01/app/oracle/oradata';
  25.  
  26. System altered.
  27.  
  28. SQL> alter pluggable database pdb1 save state;
  29.  
  30. Pluggable database altered.
  31.  
  32. SQL> exit;
  33. Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
  34. Version 19.3.0.0.0
  35. [oracle@localhost ~]$

ojbk,have fun!

原文链接:http://www.cnblogs.com/yongestcat/p/11364091.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号