windows 静默模式部署Oracle数据库
Posted renfengjun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了windows 静默模式部署Oracle数据库相关的知识,希望对你有一定的参考价值。
windows 自动部署数据库软件相关脚本
整体思路是开启 windows 的 telnet 功能,本机 telnet 远程 windows 执行相关的数据库命令。telnet 相关服务
这三个服务是 windows telnet 相关的三个服务,需要事先开启。 sc config seclogon start= demand sc config RpcSs start= demand sc config TlntSvr start= demand net start seclogon net start RpcSs net start TlntSvr数据库软件相关服务
然后就可以使用 telnet 远程连接 windows 执行 dos 命令了。开启一下三个服务,保证数据库软件可以顺利安装。 sc config LanmanWorkstation start= auto sc config LanmanServer start= auto sc config lmhosts start= auto net start LanmanWorkstation net start LanmanServer net start lmhosts下载解压数据库相关软件
d: md oinsdir cd oinsdir ftp 10.0.80.48 renfj yongaili cd / 数据库软件 /oracle_soft/oracle11/oracle11_win/64/R2 binary get p6880880_112000_MSWIN-x86-64_170220.zip get p25590979_112040_MSWIN-x86-64.zip get p25632525_112040_MSWIN-x86-64.zip get p13390677_112040_MSWIN-x86-64_1of7.zip get p13390677_112040_MSWIN-x86-64_2of7.zip quit 由于 server 2008 没有相关的 dos 命令行解压命令,所以需要 remote server 上解压相关的 zip 文件。 都正常解压,最后 11.2.0.4 安装包解压到一个目录( database )下。安装数据库软件
d:\\oinsdir\\database\\database\\setup.exe -silent -responseFile D:\\oinsdir\\database\\database\\response\\db_install.rsp 相关示例内容如下: 重要的参数: # 只安装软件 oracle.install.option=INSTALL_DB_SWONLY # 安装语言 SELECTED_LANGUAGES=zh_CN,en # 软件安装目录 ORACLE_HOME=d:\\app\\Administrator\\product\\11.2.0\\dbhome_1 # 软件安装 base 目录 ORACLE_BASE=d:\\app\\Administrator # 安装版本( Enterprise Edition ) oracle.install.db.InstallEdition=EE #my oracle support 自动更新 false SECURITY_UPDATES_VIA_MYORACLESUPPORT=false # 拒绝安全更新 true (内网无法连接 oracle my support ) DECLINE_SECURITY_UPDATES=true下面开始打补丁
net stop OracleRemExecService net stop OracleMTSRecoveryService 关闭掉 oracle 相关的两个服务 ren d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\OPatch OPatchBK move d:\\oinsdir\\p6880880_112000_MSWIN-x86-64_170220\\OPatch d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\ 更新一下 OPatch 安装补丁(先是 db bp 然后是 ojvm psu ) d: cd d:\\oinsdir\\p25632525_112040_MSWIN-x86-64\\25632525 d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\OPatch\\opatch apply cd d:\\oinsdir\\p25590979_112040_MSWIN-x86-64\\25590979 d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\OPatch\\opatch apply安装listener
d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\bin\\netca -silent -responseFile d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\assistants\\netca\\netca.rsp安装数据库
先创建 mkdir d:\\oradata 初始化 patch.sql patch.sql echo shutdown immediate >>d:\\patch.sql echo startup upgrade >>d:\\patch.sql echo @?/sqlpatch/ 25590979 /postinstall.sql >>d:\\patch.sql echo @?/rdbms/admin/utlrp.sql >>d:\\patch.sql echo shutdown immediate >>d:\\patch.sql echo startup >>d:\\patch.sql echo quit >>d:\\patch.sql dbca.rsp [GENERAL] RESPONSEFILE_VERSION = "11.2.0" OPERATION_TYPE = "createDatabase" [CREATEDATABASE] GDBNAME = " swglt " SID = " swglt " TEMPLATENAME = "General_Purpose.dbc" SYSPASSWORD = " oracle123 " SYSTEMPASSWORD = " oracle123 " EMCONFIGURATION = "LOCAL" SYSMANPASSWORD = " oracle123 " DBSNMPPASSWORD = " oracle123 " DATAFILEDESTINATION = " d:\\oradata " CHARACTERSET = " ZHS16GBK " NATIONALCHARACTERSET= "AL16UTF16" INITPARAMS = "open_cursors=3000,processes=1500" initdb.sql ALTER DATABASE ADD LOGFILE GROUP 5 (' d:\\oradata\\ redo05.log') SIZE 20M; ALTER DATABASE ADD LOGFILE GROUP 6 (' d:\\oradata \\redo06.log') SIZE 20M; ALTER DATABASE ADD LOGFILE GROUP 7 (' d:\\oradata \\redo07.log') SIZE 20M; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM CHECKPOINT; ALTER DATABASE DROP LOGFILE GROUP 1; ALTER DATABASE DROP LOGFILE GROUP 2; ALTER DATABASE DROP LOGFILE GROUP 3; ALTER DATABASE ADD LOGFILE GROUP 1 ('d:\\oradata\\redo1.log') SIZE 500M; ALTER DATABASE ADD LOGFILE GROUP 2 ('d:\\oradata\\redo2.log') SIZE 500M; ALTER DATABASE ADD LOGFILE GROUP 3 ('d:\\oradata\\redo3.log') SIZE 500M; ALTER DATABASE ADD LOGFILE GROUP 4 ('d:\\oradata\\redo4.log') SIZE 500M; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM SWITCH LOGFILE; ALTER SYSTEM CHECKPOINT; ALTER DATABASE DROP LOGFILE GROUP 5; ALTER DATABASE DROP LOGFILE GROUP 6; ALTER DATABASE DROP LOGFILE GROUP 7; alter system set sga_max_size= 3072M scope=spfile ; alter system set sga_target= 3072M scope=spfile ; alter system set pga_aggregate_target= 1024M scope=spfile ; alter system reset memory_target scope=spfile ; alter system reset memory_max_target scope=spfile ; alter system reset db_recovery_file_dest_size ; alter system reset db_recovery_file_dest ; quit 安装数据库 d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\bin\\dbca -silent -responseFile d:\\dbca.rsp.txt 配置数据库并且打补丁 d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\bin\\sqlplus / as sysdba @d:\\initdb.sql.txt d:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\bin\\sqlplus / as sysdba @d:\\patch.sql 最后禁用服务禁用三个telnet相关的服务
最后需要 disable seclogon , TlntSvr sc config seclogon start= disabled sc config RpcSs start= disabled sc config TlntSvr start= disabled net stop seclogon net stop RpcSs net stop TlntSvr以上是关于windows 静默模式部署Oracle数据库的主要内容,如果未能解决你的问题,请参考以下文章
[oracle部署实施] 基于centos7静默安装oracle 11gr2单实例数据库
100天精通Oracle-实战系列(第7天)Linux 静默安装单机 Oracle 19C 数据库