12c windows auto installl



--config for oralce_env
set ORACLE_HOME=c:apporacleproduct12.1.0dbhome_1
set ORACLE_SID=testuat
set pdb_name1=ptestuat
set file_dest=c:apporacleoradata

set TNS_ADMIN=c:apporacleproduct12.1.0dbhome_1networkadmin
set PATH=%ORACLE_HOME%bin;%ORACLE_HOME%OPatch;%PATH%


---copy
c:appsoftwareRSPdb.rsp
修改ORACLE_HOSTNAME主机名
检查oracle.install.OracleHomeUserPassword
mkdir -p c:appsoftware
mkdir -p c:apporacleproduct12.1.0dbhome_1

cd c:appsoftware
mkdir -p c:apporaclearchivelog
mkdir -p c:appsoftware
mkdir -p c:appsoftwaredump
mkdir -p c:apporacleoradatatestuat
mkdir -p c:appsoftwarePSU_DB_20161018_winX64
mkdir -p c:appsoftwarePSU_OJVM_20161018_winX64
mkdir -p c:appsoftwareRSP
mkdir -p c:dbautility
mkdir -p C:dbachange
mkdir -p C:dbachangedb_init
mkdir -p C:dbautilityrman


net use \192.168.196.177 test@ /user:testts-dba
net view \192.168.196.177
dir \192.168.196.177OraCD
xcopy \192.168.196.177OraCDWIN64_12.1.0.2PSU_DB_20161018_winX64  c:appsoftwarePSU_DB_20161018_winX64 /D /E /Y /H /K
xcopy \192.168.196.177OraCDWIN64_12.1.0.2PSU_OJVM_20161018_winX64  c:appsoftwarePSU_OJVM_20161018_winX64 /D /E /Y /H /K
xcopy \192.168.196.177OraCDWIN64_12.1.0.2envdb_init  C:dbachangedb_init /D /E /Y /H /K

net use \192.168.196.177 /delete





--config for software  install


cd c:appsoftwarePSU_DB_20161018_winX64
unzip -o  p6880880_122010_MSWIN-x86-64.zip -d c:apporacleproduct12.1.0dbhome_1
unzip p24591642_121020_MSWIN-x86-64.zip -d .


cd c:appsoftwarePSU_OJVM_20161018_winX64
unzip p24591630_121020_MSWIN-x86-64.zip -d .
/
--begin to install software
cd c:appsoftwaredatabasedatabase
setup.exe -silent  -debug -force -waitforcompletion   -responseFile "c:appsoftwareRSPdb.rsp"


--begin to apply psu (manule create )
cd c:appsoftwareRSP
c:apporacleproduct12.1.0dbhome_1ccrbinemocmrsp.bat -no_banner -output ocm.rsp

Y
r

--
--已成功创建 OCM 配置响应文件 (ocm.rsp)。


net stop OracleOraDB12Home1MTSRecoveryService
net stop OracleOraDB12Home1TNSListener
net stop OracleRemExecServiceV2


cd c:appsoftwarePSU_DB_20161018_winX64
opatch apply  -silent 24591642 -ocmrf c:appsoftwareRSPocm.rsp
/

cd c:appsoftwarePSU_OJVM_20161018_winX64
opatch apply   -silent  24591630 -ocmrf c:appsoftwareRSPocm.rsp
/




--dbca
--demo
--check administrator 属于ora_dba组
--config gdbname/sid/pdbName/memoryPercentage/serviceUserPassword

--  -serviceUserPassword is windows only

set pdb
set ORACLE
c:>
 dbca -silent -createDatabase -templateName New_Database.dbt -gdbname %ORACLE_SID%  -sid %ORACLE_SID% -SysPassword oracle123 -systemPassword oracle123 -createAsContainerDatabase true -numberofPDBs 1  -pdbName %pdb_name1%  -pdbAdminPassword oracle123  -datafileDestination %file_dest%  -responseFile NO_VALUE -characterset AL32UTF8 -memoryPercentage 30  -emConfiguration none -storageType FS -serviceUserPassword isd.8899

清除失败的步骤
1% 已完成
正在创建并启动 Oracle 实例
2% 已完成
4% 已完成
正在创建数据库文件
7% 已完成
正在创建数据字典视图
8% 已完成


--network 关掉防火墙

cd C:apporacleproduct12.1.0dbhome_1NETWORKADMIN
mkdir -p C:apporacleproduct12.1.0dbhome_1NETWORKADMINold
move *.ora .old
move C:dbachangedb_initwindows_crontab_networknetwork* C:apporacleproduct12.1.0dbhome_1NETWORKADMIN
hostname


lsnrctl start %ORACLE_SID%

isd.8899
r


tnsping %ORACLE_SID%

conn system/oracle123@&V_CONN_STR
conn &V_CWSPUSR_UN/&V_CWSPUSR_PW@&V_CONN_STR

--clone uat to dev

cd C:dbachangedb_initclone_pdb

sqlplus / as sysdba
@pdb1_to_pdb2.sql
quit


--


-1.copy env_csmsdb_uat.sql to prod
-2.init tablespace and resize tablespace
-3.init user
-4.init archivelog
--5.exp and imp
----

cd C:dbachangeuser_initlog
del * /q


step 1:
cd C:dbachangedb_init
--modify env.sql
-按照大小写各替换一次应用用户


step 2:
cd C:dbachangeuser_init
@run.sql

step 3:
check log
ps:ORA-00911: 无效字符 can ignore






conn system/oracle123@&V_CONN_STR
conn &V_testUSR_UN/&V_testUSR_PW@&V_CONN_STR

---



--run 计算机管理,任务计划程序
--view 任务计划程序,任务计划程序库
cd c:dbautility
copy C:dbachangedb_initwindows_crontab_network*.* .

--edit housekeep.bat change line 1
C:dbautilityhousekeep.bat > C:dbautilityhousekeep.log


--if backup is not ok,manule ,change line 1 ,600M 5minute
C:dbautilityrmanrman.bat > C:dbautilityrmanrman.log
----4.47

ngtest1:/home/dba/oracle [dtaruat] >crontab -l |grep dt
0,30 * * * * find  /dtaruatdblog  -user oracle -name '*.dbf' -ctime +2 -exec rm {} ; 1>/dev/null 2>&1
0,30 * * * * find  /dtaruatdb/adump  -user oracle -name '*.aud' -ctime +2 -exec rm {} ; 1>/dev/null 2>&1
0,30 * * * * find  /dtaruatdb/diag/rdbms/dtaruat/dtaruat/trace  -user oracle -name '*.tr*' -ctime +15 -exec rm {} ; 1>/dev/null 2>&1

---for prod

加入监控体系

10,25,40,55 * * * *   /home/oracle/utility/macro/chk_conn_12c.sh 15     >> /database/log/mon_chk_conn_12c.log 2>&1

-EDIT line 26


00 8 * * * /home/oracle/monitor/segment_size/win_rep.sh > /database/log/segment_size/tbs_win_all.log 2>&1

-edit line 18

-----
新系统db 需要申请在线级别备份的话,请开srs 让管理员帮忙处理DB 在线级别备份

相关内容推荐