oracle单实例数据库版本升级(二)--环境调研

当前数据库版本10.2.0.4,已打补丁patch45(补丁号:12429521)

通过CMD,进入到opatch工具目录(位于ORACLE_HOME/OPatch目录下方)

windows系统,需用命令set一下ORACLE_HOME,ORACLE_SID,这是前提

通过命令--会列出一系列PSU的信息,还有opatch工具的版本信息
E:\oracle\product\10.2.0\db_1\OPatch>opatch lsinventory
Invoking OPatch 10.2.0.4.3

Oracle Interim Patch Installer version 10.2.0.4.3
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle 主目录       : E:\oracle\product\10.2.0\db_1
主产品清单: C:\Program Files\Oracle\Inventory
   从           : n/a
OPatch 版本    : 10.2.0.4.3
OUI 版本       : 10.2.0.4.0
OUI 位置      : E:\oracle\product\10.2.0\db_1\oui
日志文件位置 : E:\oracle\product\10.2.0\db_1\cfgtoollogs\opatch\opatch2012-06-08_

Lsinventory Output file location : E:\oracle\product\10.2.0\db_1\cfgtoollogs\opat
y2012-06-08_14-34-08下午.txt

--------------------------------------------------------------------------------
已安装的顶级产品 (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
此 Oracle 主目录中已安装 2 个产品。


中间补丁程序 (2) :

Patch  12429521     : applied on Wed Dec 14 15:02:40 CST 2011
   Created on 03 Jul 2011, 00:36:22 hrs PST8PDT
   Bugs fixed:
     12429521, 9386687, 9545597, 12363485, 9545617, 10139235, 8211733, 7622561
     9447780, 12328503, 11731126, 6157713, 9532911, 9032322, 8847439, 8554980
     10054513, 8488233, 9240685, 10224187, 9702850, 10230932, 9705984, 6503543
     7660028, 6011045, 9499302, 10637621, 11875701, 10349200, 8228796, 10114856
     5575218, 7595789, 10156303, 7568350, 6277160, 10155684, 7453988, 10019194
     10245345, 10212642, 10126301, 10134677, 10157402, 10173775, 5281255
     6196748, 6874858, 7000346, 7031622, 7482069, 7447300, 7413260, 7323353
     6431266, 6431167, 7293345, 6774317, 7414919, 7414975, 7109404, 7602207
     8371884, 8412426, 8434467, 9668086, 9699654, 9767674, 10084982, 9189070
     9747153, 7497640, 7361418, 9758199, 9850419, 9393222, 9770451, 9548269
     5133107, 7574237, 7282509, 9735237, 7265342, 8240762, 6488060, 5519322
     9387574, 8840959, 9110642, 6641104, 9793452, 10080775, 10008104, 6080041
     5612233, 9381444, 6979801, 7286159, 8803363, 8462894, 9243893, 5323844
     9628444, 9792919, 6530801, 7447883, 9232418, 9049725, 7145973, 9329652
     9659614, 9309735, 8284272, 9109487, 8292162, 9539556, 9715664, 9620711
     9526679, 8499490, 9299894, 8692094, 9230988, 8855352, 6011024, 8661278
     8554687, 8787205, 8758818, 8773211, 8733029, 8718259, 8571690, 8518433
     8451038, 7640951, 7511942, 7553851, 7434709, 6956194, 7327515, 7276032
     7479985, 6504890, 7307918, 7265215, 9095217, 8968867, 8988101, 4752090
     7023781, 9772171, 6123694, 9577583, 5957325, 6412622, 9777078, 9572766
     8830147, 9714832, 9713537, 6990305, 9196440, 9663844, 7452759, 7410816
     9573054, 9751398, 9740721, 9414079, 6741218, 9067955, 9350527, 9431650
     8974352, 9683602, 5374797, 5843975, 6004916, 6137690, 6730429, 6785547
     6933955, 7282418, 7430596, 8488629, 8540258, 8546356, 8714580, 8771556
     8976928, 9081686, 9170254, 9205565, 9215341, 9279524, 9308296, 9320130
     9337325, 9362218, 9371275, 9405528, 9450134, 9459032, 9464535, 9495669
     9544104, 9586877, 9711859, 9544023, 9270802, 6315003, 7172348, 6086930
     8663644, 9024737, 9147587, 9320786, 9355794, 6494745, 6939669, 8262786
     8816404, 9079939, 8406545, 9232118, 5927435, 9182144, 9399532, 8666117
     9272549, 8818895, 9481771, 7282773, 9210221, 7324495, 7383579, 7143299
     7519406, 8763959, 6267310, 8198189, 7360390, 9022470, 8239313, 6750296
     6059131, 9390484, 9187546, 8430592, 5970280, 6994194, 5208837, 8441769
     6450228, 7352022, 7556672, 8373758, 8595233, 8717138, 9393550, 6705822
     7022234, 7028176, 7299153, 7306915, 7393292, 7535152, 7587008, 7589862
     7801939, 8481935, 8815639, 8866013, 9119194, 5929055, 7291739, 9377578
     8763433, 8880163, 6794377, 5220672, 9085081, 7526851, 7242151, 6798650
     7273988, 5723912, 9280746, 8416111, 5500099, 9358800, 6051734, 4996778
     7135135, 7685199, 7510032, 8562769, 7022700, 4447712, 6720712, 5893079
     5695112, 9195741, 7113363, 8984021, 9264668, 5561244, 8914779, 6971433
     6852598, 6786022, 6783812, 6756739, 6647480, 6445948, 6355586, 6258480
     6005347, 5910650, 5902053, 5695562, 5497338, 5377242, 5085288, 4726401
     9303473, 8845144, 9015983, 8794693, 7665573, 8664189, 9011088, 6359199
     7131656, 8519457, 7375360, 7429090, 6262107, 8977287, 8544696, 4611578
     6344475, 5932196, 6459358, 7460291, 6765819, 8591147, 6312112, 9227868
     8886819, 9233832, 9118845, 8323407, 7345484, 8467123, 8602185, 8855396
     6826769, 7329252, 6784747, 4493447, 3753873, 8259791, 9115939, 9060098
     4899297, 6075430, 6332478, 7641601, 7856080, 9024729, 9161512, 6620988
     6526468, 9048185, 8579188, 7272227, 8619140, 8665718, 6964659, 6674075
     7116314, 7357554, 6749470, 9022377, 9169460, 5679561, 7581770, 6975402
     7111196, 6694370, 6817844, 6084656, 7652827, 6142549, 9047975, 7378625
     6804815, 7385090, 8767442, 8818668, 4723109, 5991038, 6052169, 6768251
     7197637, 7280764, 7326645, 7588384, 8310931, 8886674, 9093300, 8909984
     8217795, 9061005, 8225948, 9103403, 6761624, 9020172, 5976901, 6029179
     7710931, 4768353, 9038070, 8431487, 7154579, 7581220, 8471310, 8972087
     6951953, 5072211, 5395146, 8694230, 6844866, 8811710, 8467825, 7716356
     6748449, 6912678, 7830810, 9141737, 9148391, 9000211, 8990796, 9009877
     6432377, 7011453, 8200527, 7350806, 6403258, 6768213, 6864908, 6899183
     8889930, 8934457, 8674694, 8686801, 6912026, 6931689, 7174111, 6609623
     6868751, 2227223, 6887602, 7238681, 8823789, 8556586, 7706062, 6772911
     6756089, 7359326, 6022709, 4742344, 8367313, 8932176, 6866145, 8317698
     8575528, 6970283, 6928035, 8354686, 8479537, 5936366, 8212742, 7253302
     7450629, 7610362, 5866410, 6065582, 5609854, 8544896, 8330783, 7329946
     6512622, 8437213, 8315482, 8490879, 6472265, 6249879, 5851267, 7294044
     8775584, 6655241, 7684804, 8213977, 6443402, 8880861, 7270434, 7597354
     6945157, 4966512, 6827260, 8426816, 7172752, 8702276, 7196863, 6857917
     8217011, 8433026, 8409848, 8341623, 5727166, 8199266, 6687381, 6271590
     6749617, 5630796, 5457450, 8301952, 7442260, 8628970, 6460304, 6919709
     6282944, 8205205, 6765855, 4627274, 8236723, 7315521, 8232056, 8762356
     7452373, 8220734, 8537544, 8599814, 4598439, 6808012, 7370410, 7585472
     8247017, 8357689, 6642751, 8355120, 8366255, 8780445, 8660243, 6394861
     7298987, 6126439, 6005525, 7556778, 6009358, 8512015, 5345978, 5598333
     7440973, 8339055, 8750358, 8537075, 5926510, 8753157, 5258914, 8640813
     6165874, 7670135, 7268438, 5743318, 6784671, 6034609, 8242879, 8708078
     8308278, 6730567, 8244734, 7041059, 8556340, 6521934, 7185460, 8268348
     8506458, 8542772, 7189984, 8547175, 5452113, 8295094, 6825866, 6915767
     5933656, 7207654, 7662491, 6988971, 5224794, 8566266, 6134664, 7487294
     7382225, 6004127, 7434148, 5726433, 8348028, 8420551, 6932504, 6643194
     7145531, 8586236, 6755419, 8609347, 6029786, 7126504, 8423950, 7225204
     7551539, 5643036, 6997042, 6814502, 5399699, 5231155, 8209514, 5702433
     8309791, 6338068, 7695070, 8526100, 8467800, 8348514, 8318020, 7891471
     7657126, 6399168, 5394888, 8284633, 8284438, 7716219, 8471715, 8256539
     7291157, 8407546, 6401347, 8234504, 7698349, 7520091, 7411265, 7524768
     7480997, 8569254, 6996030, 8510218, 6655588, 4740049, 4085593, 6340297
     6023472, 6940487, 6964283, 6726958, 6954407, 8559467, 7033630, 7039896
     7446153, 4871892, 8247215, 6954722, 6053134, 8198906, 7591985, 6975521
     8274994, 7615454, 7521164, 6745682, 7598781, 7639914, 6153930, 6408317
     7658224, 8541781, 8373035, 7659217, 7258065, 6035809, 6162731, 5852921
     7434973, 5745084, 5247029, 6155919, 5872943, 5939230, 6073325, 7722575
     8273910, 7423771, 6628122, 8216754, 7836441, 8282743, 7704827, 8347139
     7687937, 8324665, 7293466, 7512909, 8439221, 7023147, 8303388, 7695742
     6512811, 6021687, 5847453, 6522654, 8281791, 7207921, 3320140, 6960874
     6392076, 7475294, 7381308, 8373286, 6800507, 6858062, 7330909, 7477934
     7661251, 7835247, 8247855, 8342923, 8299095, 6741425, 7272039, 7441785
     7692248, 6526370, 7116357, 7463138, 7600746, 6331062, 7830001, 8331807
     8392341, 7688581, 6824129, 5259835, 8199533, 7639602, 5705385, 5764671
     6052226, 4693355, 7710538, 7575925, 5868598, 7686186, 7219752, 8267348
     6919819, 7257770, 8230457, 7257461, 7263842, 7332423, 7307821, 7514969
     7581964, 7032684, 5879114, 8299199, 6404447, 7527908, 6014513, 7378661
     6145177, 7552067, 6799205, 6352003, 7502837, 6069409, 6371909, 8227091
     6952701, 7298688, 7396409, 8227106, 6343150, 6403091, 6610218, 6681695
     6724797, 6802650, 6804746, 6817593, 6833965, 6960489, 7136866, 7173005
     7238230, 7457766, 7600026, 7599944, 8251247, 8268054, 8324577, 8331466
     8287504, 6711853, 6976005, 7460818, 7276960, 5126719, 7044551, 6882739
     7568556, 7159505, 6840740, 7593835, 6941717, 7569205, 6955744, 5404871
     7013124, 6345573, 6070225, 7432601, 6490140, 6074620, 7140204, 7136489
     7494333, 5476236, 6980597, 7643632, 7197445, 6469211, 8287155, 8304589
     8283650, 3934160, 8292378, 7331867, 6599920, 7036453, 7363767, 6265559
     7341598, 6987790, 6926448, 6181488, 6615740, 7125408, 6596564, 6903051
     6120004, 6988017, 6851438, 7527650, 7432514, 7553884, 7499353, 7175513
     6452375, 7393804, 7523787, 7189645, 8239142, 7043989, 6268409, 7693128
     7345904, 7149004, 6683178, 6413089, 6650256, 8340379, 8328954, 6378112
     7710551, 6778714, 6919764, 7254987, 6752765, 6418420, 6733655, 7247217
     7691766, 7552042, 4637902, 6219529, 8347704, 7552082, 7424804, 6658484
     8340383, 7378735, 6509115, 5863926, 8340387, 7528105, 6673834, 7243184
     7291029, 8223467, 7237687, 7665893, 7519531, 7293244, 5262526, 8282992
     7501836, 7027038, 7320726, 8307238, 8208765, 8208643, 7319691, 7505535
     7489862, 7688543, 5945060, 7238163, 4459936, 7172531, 5147386, 6500033
     6908967, 7459192, 7694979, 4736319, 8210889, 8223481, 5893331, 7704811
     6143420, 7193068, 6367360, 8214576, 7162704, 6869712, 6999955, 5705196
     6642692, 8362683, 6638558, 7340448, 7172912, 7452165, 8258840, 5730603
     5399610, 6370967, 7439465, 7585970, 7378401, 7043173, 7159451, 6122696
     5697354, 6981690, 5256703, 8216864, 7697802, 7523475, 6838714, 8225198
     7592450, 5099019, 6319761, 7664560, 7509689, 7229351, 7278117, 7654407
     7690331, 7828479, 7003718, 6491175, 6737765, 6991626, 7634610, 7519687
     6896371, 5686407, 6379441, 6313035, 5849687, 6894671, 7170213, 8201796
     6656309, 6155146, 7516867, 7296258, 7700871, 7715057, 7486155, 7450460
     6113018, 7447345, 7305703, 7513673, 6640411, 7558379, 7597059, 7372337
     7484102, 6730125, 6936368, 7648406, 6047490, 6270137, 6452035, 4902697
     7677781, 6661393, 7501180, 7592168, 7007924, 7295298, 7361423, 7453155
     6282093, 5701723, 7318276, 6652767, 7458976, 7241059, 7385253, 6759910
     7375077, 7272297, 7008262, 6870047, 6896554, 7263061, 7395972, 6939835
     7515898, 6454634, 7314091, 7439689, 6811031, 5229627, 5586604, 7196532
     7573151, 7254367, 7606362, 6083292, 6994490, 5718815, 7207932, 6013981
     7592319, 7415038, 6144426, 6145687, 7509964, 6629890, 7444320, 7579079
     6350579, 7584867, 7522608, 5648287, 5709135, 6430500, 6833602, 7211965
     7236148, 7257160, 7325597, 7429070, 7430474, 7439957, 7454131, 7522909
     7515828, 7462072, 6904068, 7145872, 7190477, 7498506, 6519198, 6770417
     6395755, 6782437, 6452766, 6775231, 7189447, 7330258, 7144872, 7395472
     6216149, 7477691, 5951091, 7448543, 7522474, 6967923, 6742924, 4695511
     7413928, 6054929, 7129643, 5879865, 7430745, 6923450, 6685261, 6415531
     6359490, 7196894, 6924458, 6627593, 6766884, 6766956, 7521336, 7523839
     7121074, 7154052, 7165026, 7372915, 7494877, 7336032, 6368000, 7037203
     6955040, 5945647, 5573896, 7246117, 7433792, 6670740, 7388606, 7118478
     6768289, 7002207, 5883691, 7251909, 7366749, 7280289, 7273832, 7155655
     7138405, 6845871, 7331569, 7480786, 7359366, 6874522, 5343559, 7356443
     7144891, 6375150, 5059447, 7038750, 6877038, 6193945, 7309458, 6854919
     5490816, 6605106, 6472286, 6606749, 6067825, 6932206, 6455412, 6674196
     7362653, 6746196, 6774830, 6451626, 7364935, 4561087, 4440589, 7315642
     7411865, 5348308, 6865378, 7331929, 7191744, 7342082, 6506818, 5944239
     7271619, 6619922, 5926711, 5996457, 7326738, 5638228, 7386321, 5131180
     7046751, 6672737, 7237571, 7269450, 6782276, 7113299, 7190270, 4235212
     7348412, 5712781, 7313130, 6978876, 7287289, 7162648, 6635214, 6844739
     7046187, 6962622, 6797677, 7154415, 7142215, 7300599, 6399597, 7013768
     6875111, 6959964, 6133008, 7123643, 6122097, 6678845, 7210296, 7216535
     6594005, 6527074, 6262792, 7340474, 6504899, 5095023, 6134368, 6725634
     7210921, 6870937, 7014646, 7017637, 6805009, 6876196, 6972343, 6897966
     6809093, 6736159, 7244238, 7127618, 7195088, 6607486, 6822672, 6687129
     6655657, 6355282, 6489332, 6789923, 6454468, 7005671, 7140644, 7039080
     6695247, 6689334, 6936964, 6445329, 6862248, 6082292, 7004914, 5690152
     6374297, 6653934, 5208177, 6119017, 6679303, 6600051, 7228971, 6988848
     7149751, 6221403, 6440977, 6972291, 7188932, 6344497, 6724838, 7218677
     7036589, 4033868, 5883585, 6944036, 6327692, 6163785, 6913090, 7027551
     6130317, 5868257, 5190885, 6798910, 6934892, 7022905, 6795880, 6935367
     6667800, 5386874, 6925163, 6076414, 6432837, 6956212, 6714608, 6336234
     6471770, 6771400, 6511850, 7003151, 6952800, 6656630, 6898054, 5688060
     7150609, 6660648, 6954829, 6207468, 6455659, 5970301, 6530171, 6607505
     5213488, 5944121, 5843814, 6163771, 6896701, 6833159, 6759032, 5900004
     4393920, 6645719, 5251842, 7019835, 6826661, 6883418, 7011807, 6241222
     6956461, 6193802, 6986658, 5410059, 6626018, 5704108, 5890312, 5934363
     6760697, 6121357, 6110752, 6725855, 5923486, 6705635, 5234947, 5902962
     6143047, 5895190, 6917874, 6151380, 6456530, 5368296, 5386204, 6369463
     6768114, 6200820, 6972843, 5880921, 6506617, 6994160, 6345197, 6506816
     6670579, 6688740, 5961436, 6823287, 6604020, 6372848, 6414616, 6195891
     6822995, 6595426, 5747462, 6120483, 6082832, 5623467, 4551675, 6329318
     6324944, 6376928, 6783426, 6051177, 6024730, 5935935, 6778404, 4169479
     5756769, 5714944, 6670551, 6607676, 6084232, 6815733

Patch  8350262      : applied on Wed Dec 14 14:59:31 CST 2011
   Created on 14 Sep 2010, 04:59:44 hrs PST8PDT
   Bugs fixed:
     8350262

 

--------------------------------------------------------------------------------

OPatch succeeded.

目前升级计划为升级到10.2.0.5(补丁号:8202632),再打patch14(补丁号:13460968),因为patch14依赖于10.2.0.5,所以必须把数据库软件升级到10.2.0.5再打小补丁patch14


环境调研,因为每次升级之前,都需要写实施方案,固然环境调研的结果很重要


SET LINE 200 pagesize 9999
col comp_name for a40
col file_name for a60
col owner for a15
col object_name for a40
col member for a60
col host_name for a14

--查询当前实例
select INSTANCE_NAME,STATUS,DATABASE_STATUS,HOST_NAME from v$instance;

--是否归档
archive log list

--会话连接状况
select * from v$version;

col version for a10
col status for a8
col schema for a15

--查看是否在更新之前有失效对象,别揽祸上身
SELECT OBJECT_NAME FROM DBA_OBJECTS WHERE STATUS = 'INVALID';
select comp_name,version,status,schema from dba_registry;

col name for a60
select * from v$controlfile;
select * from v$log;
select * from v$logfile;
col tablespace_name for a10
select tablespace_name,file_name,bytes/1024/1024 mb from dba_data_files;
select tablespace_name,file_name,bytes/1024/1024 mb from dba_temp_files;
select sum(bytes)/1024/1024/1024 gb from dba_segments;
select sum(bytes)/1024/1024/1024 gb from dba_data_files;
select owner,object_name,object_type,status from dba_objects where status='INVALID' order by 1,3,2;
select * from dba_db_links;
select distinct status from v$datafile;
select distinct status from v$tempfile;
select * from v$recover_file;
show parameter sga
show parameter db_cache_size
show parameter shared_pool_size
show parameter java_pool_size
show parameter streams_pool_size
show parameter pga_aggregate_target
show parameter spfile

--检查数据库表空间使用情况,这点很重要
select b.tablespace_name,round(sum(b.bytes)/1024/1024,0) sum_MB, round(sum(nvl(a.bytes,0))/1024/1024,0) free_MB,round((sum(b.bytes)-sum(nvl(a.bytes,0)))/sum(b.bytes),4)*100 use_precent
from (select tablespace_name,file_id,sum(bytes) bytes from dba_free_space group by tablespace_name,file_id ) a,
    dba_data_files b
where a.file_id(+)=b.file_id and a.tablespace_name(+)=b.tablespace_name
group by b.tablespace_name
order by use_precent;
SELECT d.status  "Status", d.tablespace_name "Name", d.contents "Type", d.extent_management "Extent", 
 TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99,999,999') "Size (M)", 
 TO_CHAR(NVL(t.bytes,0)/1024/1024,'999,999,999') "Used (M)", 
 TO_CHAR(NVL(t.bytes / a.bytes * 100, 0), '990.00') "Used %" FROM sys.dba_tablespaces d, 
 (select tablespace_name, sum(bytes) bytes from dba_temp_files group by tablespace_name) a, (select 
 tablespace_name, sum(bytes_cached) bytes from v$temp_extent_pool group by tablespace_name) t WHERE 
 d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = t.tablespace_name(+) AND 
 d.extent_management like 'LOCAL' AND d.contents like 'TEMPORARY'
 ORDER BY 2;


oracle视频教程请关注: http://home.51cto.com/apps/download/index.php?s=/Index/index/uid/4202939

你可能感兴趣的:(oracle,单实例数据库版本升级,oracle单实例数据库,环境调研)