--config for oralce_env
log as must run in a command window that was opened As Administrator(Due to Windows security, OPatch must run in a command window that was opened As Administrator)C:\Windows\system32step 1:1.bat > 1.log###file C:\Users\Administrator\1.bat set ORACLE_HOME=c:\app\oracle\product\12.1.0\dbhome_1--need change ORACLE_SID/pdb_name1set ORACLE_SID=ivrsdev12cset pdb_name1=pivrsdevset file_dest=c:\app\oracle\oradataset TNS_ADMIN=c:\app\oracle\product\12.1.0\dbhome_1\network\adminset PATH=%ORACLE_HOME%\bin;%ORACLE_HOME%\OPatch;C:\dba\utility;%PATH%---copymkdir -p c:\app\software\mkdir -p c:\app\oracle\product\12.1.0\dbhome_1cd c:\app\software\mkdir -p c:\app\oracle\archivelogmkdir -p c:\app\softwaremkdir -p c:\app\software\dumpmkdir -p c:\app\oracle\oradata\%ORACLE_SID%mkdir -p c:\app\software\PSU_DB_20161018_winX64mkdir -p c:\app\software\PSU_OJVM_20161018_winX64mkdir -p c:\app\software\RSPmkdir -p c:\dba\utilitymkdir -p C:\dba\changemkdir -p C:\dba\change\db_initmkdir -p C:\dba\utility\rmanmkdir -p c:\app\software\databasenet use \\192.168.196.177 tklau5678@ /user:a\ts-dba net view \\192.168.196.177dir \\192.168.196.177\OraCDxcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\PSU_DB_20161018_winX64 c:\app\software\PSU_DB_20161018_winX64 /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\PSU_OJVM_20161018_winX64 c:\app\software\PSU_OJVM_20161018_winX64 /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\env\db_init C:\dba\change\db_init\ /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\env\unzip.exe C:\dba\utility\ /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\env\rsp\db.rsp c:\app\software\RSP\ /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\p21419221_121020_MSWIN-x86-64_1of10.zip c:\app\software\database\ /D /E /Y /H /K xcopy \\192.168.196.177\OraCD\WIN64_12.1.0.2\p21419221_121020_MSWIN-x86-64_2of10.zip c:\app\software\database\ /D /E /Y /H /K net use \\192.168.196.177 /delete ###file ---edithostname c:\app\software\RSP\db.rsp--修改ORACLE_HOSTNAME主机名检查oracle.install.OracleHomeUserPassword--检查ORACLE_HOME--检查ORACLE_BASE--config for software installcd C:\Users\Administrator2.bat > 2.log###2.bat cd c:\app\software\PSU_OJVM_20161018_winX64unzip p24591630_121020_MSWIN-x86-64.zip -d ./cd c:\app\software\databaseunzip p21419221_121020_MSWIN-x86-64_1of10.zip -d .unzip p21419221_121020_MSWIN-x86-64_2of10.zip -d ./cd c:\app\software\PSU_DB_20161018_winX64unzip -o p6880880_122010_MSWIN-x86-64.zip -d c:\app\oracle\product\12.1.0\dbhome_1\unzip p24591642_121020_MSWIN-x86-64.zip -d .--begin to install software ####cd C:\Users\Administrator3.bat> 3.logcd c:\app\software\database\databasesetup.exe -silent -debug -force -waitforcompletion -responseFile "c:\app\software\RSP\db.rsp"--log C:\Users\sissadmin\AppData\Local\Temp http://www.cnblogs.com/feiyun8616/p/6142179.html--begin to apply psu (manule create )-- if succussful. it will prompt Exit code of OUI process 0=#### cd c:\app\software\RSPc:\app\oracle\product\12.1.0\dbhome_1\ccr\bin\emocmrsp.bat -no_banner -output ocm.rspY\r----已成功创建 OCM 配置响应文件 (ocm.rsp)。#### cd C:\Users\Administrator4.bat > 4.lognet stop OracleOraDB12Home1MTSRecoveryServicenet stop OracleOraDB12Home1TNSListenernet stop OracleRemExecServiceV2cd c:\app\software\PSU_DB_20161018_winX64opatch rollback -silent 24591642 -ocmrf c:\app\software\RSP\ocm.rsp/echo donecd c:\app\software\PSU_DB_20161018_winX64opatch apply -silent 24591642 -ocmrf c:\app\software\RSP\ocm.rsp/echo donecd c:\app\software\PSU_OJVM_20161018_winX64opatch apply -silent 24591630 -ocmrf c:\app\software\RSP\ocm.rsp/echo done--dbca--demo--check administrator 属于ora_dba组--config gdbname/sid/pdbName/memoryPercentage/serviceUserPassword-- -serviceUserPassword is windows only--(Doc ID 1568694.1 OPatch must run in a command window that was opened As Administrator)#### 6set pdbset ORACLEc:\> 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% 已完成######7%1.give oracle with administrator privileges2.give administrator with osdba group privileges--network 关掉防火墙cd C:\app\oracle\product\12.1.0\dbhome_1\NETWORK\ADMINmkdir -p C:\app\oracle\product\12.1.0\dbhome_1\NETWORK\ADMIN\oldmove *.ora .\oldmove C:\dba\change\db_init\windows_crontab_network\network\* C:\app\oracle\product\12.1.0\dbhome_1\NETWORK\ADMIN\hostnamelsnrctl start %ORACLE_SID%isd.8899\rtnsping %ORACLE_SID%conn system/oracle123@&V_CONN_STRconn &V_CWSPUSR_UN/&V_CWSPUSR_PW@&V_CONN_STR--clone uat to dev cd C:\dba\change\db_init\clone_pdbsqlplus / as sysdba@pdb1_to_pdb2.sqlquit---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:\dba\change\user_init\logdel * /qstep 1:cd C:\dba\change\db_init--modify env.sql-按照大小写各替换一次应用用户 step 2:cd C:\dba\change\user_init@run.sqlstep 3:check log ps:ORA-00911: 无效字符 can ignoreconn system/oracle123@&V_CONN_STRconn &V_testUSR_UN/&V_testUSR_PW@&V_CONN_STR-----run 计算机管理,任务计划程序--view 任务计划程序,任务计划程序库cd c:\dba\utilitycopy C:\dba\change\db_init\windows_crontab_network\*.* .--edit housekeep.bat change line 1C:\dba\utility\housekeep.bat > C:\dba\utility\housekeep.log --if backup is not ok,manule ,change line 1 ,600M 5minuteC:\dba\utility\rman\rman.bat > C:\dba\utility\rman\rman.log----4.47ngtest1:/home/dba/oracle [dtaruat] >crontab -l |grep dt0,30 * * * * find /dtaruatdblog -user oracle -name '*.dbf' -ctime +2 -exec rm {} \; 1>/dev/null 2>&10,30 * * * * find /dtaruatdb/adump -user oracle -name '*.aud' -ctime +2 -exec rm {} \; 1>/dev/null 2>&10,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 2600 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 在线级别备份