GXCollOracle.java 28.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
package com.sitech.ismp.coll.tivoli;

import java.util.List;
import java.util.Map;

import com.sitech.util.Formater;

public class GXCollOracle implements GXCollOracleMBean{

	private boolean debug=false;
	private SoapClient soapClient =null;

	private String pre_unitid="10-11-30";
	
	public GXCollOracle()
	{
		String url=SoapParam.getString("SOAP_URL");
		soapClient = new SoapClient(url);
	}	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	/**
	 * getSystem		-10
	 */
	public java.util.Vector getSystem(java.util.HashMap params) throws Exception{
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String IP_ADDR = (String)params.get("IP_ADDR");
		String neat_sid = Formater.neatenunitid(sid);
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		
		/**
		 * CM-00-03-001-50	设备的ipaddress
		 * lianlian 2006-08-23
		 */
		collResult.addKPI(this.pre_unitid + "-10" + ":" + neat_sid + "-SYS","CM-00-03-001-50",IP_ADDR);
		
		/**
		 * CM-00-03-001-06	归档日志目录	如果采用归档方式,则列出归档日志目录	ua	得到数据	WORACLEINF00	WORACLEINFARCHIVEPATH00.ARCHIVEVALUE
		 * lianlian 2006-08-17
		 */
		//getSoap_WORACLEINFARCHIVEPATH000		-10
		String soap_WORACLEINFARCHIVEPATH000 = GXCollOracleSoapHelper.getSoap_WORACLEINFARCHIVEPATH000(host_name);
		String soap_WORACLEINFARCHIVEPATH000_res = soapClient.getSoapStringResponse(soap_WORACLEINFARCHIVEPATH000);
		List WORACLEINFARCHIVEPATH000_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_WORACLEINFARCHIVEPATH000_res);
		for(int i=0;i<WORACLEINFARCHIVEPATH000_res_results.size();i++)
		{
			Map resultMap = (Map)WORACLEINFARCHIVEPATH000_res_results.get(i);
			String ARCHIVEVALUE = (String)resultMap.get("ARCHIVEVALUE");
			
			String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			collResult.addKPI(unit_id,"CM-00-03-001-06",ARCHIVEVALUE);
		}
		
		/**
		 * CM-00-03-001-03	数据库的位数	32/64位	ua	得到数据	WORACLEINF00	WORACLEINFDBBIT00.DB_BIT
		 * lianlian 2006-08-17
		 */
		//getSoap_WORACLEINFDBBIT00		-10
		String soap_WORACLEINFDBBIT00 = GXCollOracleSoapHelper.getSoap_WORACLEINFDBBIT00(host_name);
		String soap_WORACLEINFDBBIT00_res = soapClient.getSoapStringResponse(soap_WORACLEINFDBBIT00);
		List WORACLEINFDBBIT00_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_WORACLEINFDBBIT00_res);
		for(int i=0;i<WORACLEINFDBBIT00_res_results.size();i++)
		{
			Map resultMap = (Map)WORACLEINFDBBIT00_res_results.get(i);
			String DB_BIT = (String)resultMap.get("DB_BIT");
			
			String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			collResult.addKPI(unit_id,"CM-00-03-001-03",DB_BIT);
		}
		
		//PM-00-03-008-01
		//得到soap请求
		String soap_total_Oracle_Contention_Summary = GXCollOracleSoapHelper.getSoap_total_Oracle_Contention_Summary(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Contention_Summary_res = soapClient.getSoapStringResponse(soap_total_Oracle_Contention_Summary);
		//分析返回结果,得到list
		List Oracle_Contention_Summary_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Contention_Summary_res);		
		if( Oracle_Contention_Summary_res_results == null || Oracle_Contention_Summary_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Contention_Summary_res_results info got by tivoli  "+new java.util.Date());
		}else{	
				//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
				Map row_map = (Map)Oracle_Contention_Summary_res_results.get(0);
				String Total_DML_Locks	            =  (String)row_map.get("Total_DML_Locks");
				
				String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
				collResult.addKPI(unit_id,"PM-00-03-008-01",Total_DML_Locks);
		}
		
		//CM-00-03-01-05
		//得到soap请求
		String soap_total_Oracle_Database = GXCollOracleSoapHelper.getSoap_total_Oracle_Database(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Database_res = soapClient.getSoapStringResponse(soap_total_Oracle_Database);
		//分析返回结果,得到list
		List Oracle_Database_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Database_res);		
		if( Oracle_Database_res_results == null || Oracle_Database_res_results.size()==0){
			System.out.println("@tivoli error, no soap_total_Oracle_Database_res info got by tivoli in collCpu "+new java.util.Date());
		}else{	
				//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
				Map Oracle_Database_map = (Map)Oracle_Database_res_results.get(0);
				String Archive_Log_Mode_Enabled	            =  (String)Oracle_Database_map.get("Archive_Log_Mode_Enabled");
				String Database_Name	            =  (String)Oracle_Database_map.get("Database_Name");
				
				String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
				
				collResult.addKPI(unit_id,"CM-00-03-001-01",Database_Name);
				collResult.addKPI(unit_id,"CM-00-03-001-05",Archive_Log_Mode_Enabled);
		}
		
		
//		PM-00-03-008-01
		//得到soap请求
		String soap_total_Oracle_Rollback_Segments = GXCollOracleSoapHelper.getSoap_total_Oracle_Rollback_Segments(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Rollback_Segments_res = soapClient.getSoapStringResponse(soap_total_Oracle_Rollback_Segments);
		//分析返回结果,得到list
		List Oracle_Rollback_Segments_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Rollback_Segments_res);		
		if( Oracle_Rollback_Segments_res_results == null || Oracle_Rollback_Segments_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Rollback_Segments_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			for(int i=0; i<Oracle_Rollback_Segments_res_results.size(); i++){
				Map row_map = (Map)Oracle_Rollback_Segments_res_results.get(i);
				
				String Rollback_Segment_Name	            =  (String)row_map.get("Rollback_Segment_Name");
				String Rollback_Segment_Size	            =  (String)row_map.get("Rollback_Segment_Size");
				
				String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS-"+Formater.neatenunitid(Rollback_Segment_Name);
				collResult.addKPI(unit_id,"CM-00-03-005-01",Rollback_Segment_Name);
				collResult.addKPI(unit_id,"CM-00-03-005-02",Rollback_Segment_Size);
				
			}			
				//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
				
		}
		
		
//		begin	2006-7-7 lianlian
		//得到soap请求
		String Soap_total_Oracle_Server_Options = GXCollOracleSoapHelper.getSoap_total_Oracle_Server_Options(sid,host_name);
		//发送soap请求,并返回结果
		String Soap_total_Oracle_Server_Options_res = soapClient.getSoapStringResponse(Soap_total_Oracle_Server_Options);
		//分析返回结果,得到list
		List Server_Options_res_results = GXCollOracleXmlHelper.parseSoapResponse(Soap_total_Oracle_Server_Options_res);
		
		if(Server_Options_res_results==null||Server_Options_res_results.size()==0)
		{
			System.out.println("@tivoli error, no Soap_total_Oracle_Server_Options info got by tivoli in collCpu "+new java.util.Date());
		}
		else
		{
			for(int i=0;i<Server_Options_res_results.size();i++)
			{
				Map row_map = (Map)Server_Options_res_results.get(i);
				//Oracle_Server_Options.Par-Q_Avail
				//Oracle_Server_Options.Par-S_Avail
				String Par_Q_Avail=(String)row_map.get("Par-Q_Avail");
				String Par_S_Avail=(String)row_map.get("Par-S_Avail");
				
				String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
				
				collResult.addKPI(unit_id,"CM-00-03-001-04",Par_Q_Avail);
				collResult.addKPI(unit_id,"CM-00-03-001-04",Par_S_Avail);
			}
		}
		//end
		
		//得到soap请求
		String soap_total_Oracle_Server= GXCollOracleSoapHelper.getSoap_total_Oracle_Server(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Server_res = soapClient.getSoapStringResponse(soap_total_Oracle_Server);
		//分析返回结果,得到list
		List Oracle_Server_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Server_res);		
		if( Oracle_Server_res_results == null || Oracle_Server_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Server_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_Server_res_results.get(0);
			String Server_CPU_Percent	 = (String)row_map.get("Server_CPU_Percent");	
            String Server_Status	     = (String)row_map.get("Server_Status");
            String Server_Version	     = (String)row_map.get("Server_Version"); 
            String Total_SGA_Size	     = (String)row_map.get("Total_SGA_Size"); 
            
			String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			
			collResult.addKPI(unit_id,"PM-00-03-009-01",Server_CPU_Percent);
			collResult.addKPI(unit_id,"FM-00-03-001-01",Server_Status);
			collResult.addKPI(unit_id,"CM-00-03-001-02",Server_Version);
			collResult.addKPI(unit_id,"CM-00-03-002-01",Total_SGA_Size);
					
		}		
		
		//得到soap请求
		String soap_total_Oracle_Session_Summary= GXCollOracleSoapHelper.getSoap_total_Oracle_Session_Summary(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Session_Summary_res = soapClient.getSoapStringResponse(soap_total_Oracle_Session_Summary);
		//分析返回结果,得到list
		List Oracle_Session_Summary_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Session_Summary_res);		
		if( Oracle_Session_Summary_res_results == null || Oracle_Session_Summary_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Session_Summary_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_Session_Summary_res_results.get(0);
			String Total_Sessions	 = (String)row_map.get("Total_Sessions");	
            
			String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			
			collResult.addKPI(unit_id,"PM-00-03-009-03",Total_Sessions);
		}			
		
		//得到soap请求
		String soap_total_Oracle_SGA_Memory= GXCollOracleSoapHelper.getSoap_total_Oracle_SGA_Memory(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_SGA_Memory_res = soapClient.getSoapStringResponse(soap_total_Oracle_SGA_Memory);
		//分析返回结果,得到list
		List Oracle_SGA_Memory_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_SGA_Memory_res);		
		if( Oracle_SGA_Memory_res_results == null || Oracle_SGA_Memory_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_SGA_Memory_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_SGA_Memory_res_results.get(0);
			String SGA_Percent_Free	 = (String)row_map.get("SGA_Percent_Free");	
            
			String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			
			double used_percent = 100- Double.parseDouble(SGA_Percent_Free);
			
			collResult.addKPI(unit_id,"PM-00-03-001-01",Formater.formatDecimalKpivalue(String.valueOf(used_percent)));
			collResult.addKPI(unit_id,"PM-00-03-009-02",Formater.formatDecimalKpivalue(String.valueOf(used_percent)));
		}
		
//		得到soap请求
		String soap_total_Oracle_Statistics_Summary= GXCollOracleSoapHelper.getSoap_total_Oracle_Statistics_Summary(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Statistics_Summary_res = soapClient.getSoapStringResponse(soap_total_Oracle_Statistics_Summary);
		//分析返回结果,得到list
		List Oracle_Statistics_Summary_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Statistics_Summary_res);		
		if( Oracle_Statistics_Summary_res_results == null || Oracle_Statistics_Summary_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Statistics_Summary_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_Statistics_Summary_res_results.get(0);
			String Data_Cache_Hit_Percent	 = (String)row_map.get("Data_Cache_Hit_Percent");
			String Total_Deadlocks	 = (String)row_map.get("Total_Deadlocks");
			//String Physical_Reads = (String)row_map.get("Physical_Reads");
			//String Physical_Writes = (String)row_map.get("Physical_Writes");
            
			//String unit_id=pre_unitid+"-10:"+neat_sid+"-SYS";
			
			collResult.addKPI(pre_unitid+"-10:"+neat_sid+"-SYS","PM-00-03-001-02",Data_Cache_Hit_Percent);
			//collResult.addKPI(pre_unitid+"-10:"+neat_sid+"-SYS","PM-00-03-001-03",Data_Cache_Hit_Percent);
			collResult.addKPI(pre_unitid+"-10:"+neat_sid+"-SYS","FM-00-03-002-03",Total_Deadlocks); //死锁个数
			//collResult.addKPI(pre_unitid+"-16:"+neat_sid+"-DATADEVICE","PM-00-03-005-01",Physical_Reads);
			//collResult.addKPI(pre_unitid+"-16:"+neat_sid+"-DATADEVICE","PM-00-03-005-02",Physical_Writes);
		}
		
		
		return collResult.getKPISet();

	}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////	

//	Oracle_Tablespaces	Percent_Free_Space	PM-00-03-04-01	表空间使用率	该表可用空间的百分比
//	Oracle_Tablespaces	Free_Space_Fragmentation	PM-00-03-06-01	碎片程度	该表空间的碎片程度百分比
//	Oracle_Tablespaces	Tablespace_Status	FM-00-03-01-02	表空间状态	表空间所处状态
//	Oracle_Tablespaces	Tablespace_Name	CM-00-03-03-01	表空间名	数据库内各表空间名
//	Oracle_Tablespaces	Total_Size	CM-00-03-03-01	表空间大小	数据库内各表空间大小(MB)
	//-11
	public java.util.Vector getTableSpaces(java.util.HashMap params) throws Exception{
		
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String neat_sid = Formater.neatenunitid(sid);
		
		//String KBP_ID = this.KBP_ID+"-11"+":"+NEATENSID+"-TABLESPACES";
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		//PM-00-01-004-01/03  Object=Disk
		//得到soap请求
		String soap_tbspaces_Oracle_Tablespaces = GXCollOracleSoapHelper.getSoap_tbspaces_Oracle_Tablespaces(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_tbspaces_Oracle_Tablespaces_res = soapClient.getSoapStringResponse(soap_tbspaces_Oracle_Tablespaces);
		//分析返回结果,得到list
		List tbspaces_results = GXCollOracleXmlHelper.parseSoapResponse(soap_tbspaces_Oracle_Tablespaces_res);		
		if( tbspaces_results == null || tbspaces_results.size()==0){
			System.out.println("@tivoli error, no tablespace info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			for(int i=0; i<tbspaces_results.size(); i++){
				Map rowMap = (Map)tbspaces_results.get(i);
				String Percent_Free_Space = (String)rowMap.get("Percent_Free_Space");
				String Free_Space_Fragmentation =  (String)rowMap.get("Free_Space_Fragmentation");
				String Tablespace_Status = (String)rowMap.get("Tablespace_Status");
				//String Percent_Free_Space = (String)rowMap.get("Percent_Free_Space");
				String Tablespace_Name = (String)rowMap.get("Tablespace_Name");
				String Total_Size =  (String)rowMap.get("Total_Size");
				
				String neatTablespace_Name = Formater.neatenunitid(Tablespace_Name);
				
				//String neatMount_Point = Formater.neatenunitid(Mount_Point);
				//String unit_id=pre_unitid+"-11:"+neat_sid+"-TABLESPACES"+"-"+neatTablespace_Name;
				//System.out.println(unit_id);
				
				double d_tbs_used_percent = 100- Double.parseDouble(Percent_Free_Space);
				String tbs_used_percent = Formater.getByScale(String.valueOf(d_tbs_used_percent),4);
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES"+"-"+neatTablespace_Name,"PM-00-03-004-01",String.valueOf(tbs_used_percent));
				
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES-"+neatTablespace_Name,"FM-00-03-002-04",String.valueOf(tbs_used_percent));
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES-"+neatTablespace_Name,"PM-00-03-006-01",Free_Space_Fragmentation );
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES-"+neatTablespace_Name,"FM-00-03-001-02",Tablespace_Status		);
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES-"+neatTablespace_Name,"CM-00-03-003-01",Tablespace_Name			);
				collResult.addKPI(pre_unitid+"-11:"+neat_sid+"-TABLESPACES-"+neatTablespace_Name,"CM-00-03-003-02",Total_Size				);
				
			}			
		}
		
		return collResult.getKPISet();
	}
	
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	/**
	 * getDataFile		-12
	 */
	public java.util.Vector getDataFile(java.util.HashMap params) throws Exception{
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String neat_sid = Formater.neatenunitid(sid);
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		
		//datafile
		//得到soap请求
		String soap_total_Oracle_Files = GXCollOracleSoapHelper.getSoap_total_Oracle_Files(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Files_res = soapClient.getSoapStringResponse(soap_total_Oracle_Files);
		//分析返回结果,得到list
		List Oracle_Files_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Files_res);		
		if( Oracle_Files_res_results == null || Oracle_Files_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Files_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			for(int i=0; i<Oracle_Files_res_results.size(); i++){
				Map rowMap = (Map)Oracle_Files_res_results.get(i);
				String File_Name = (String)rowMap.get("File_Name");
				String neatFile_Name = Formater.neatenunitid(File_Name);
				String unit_id=pre_unitid+"-12:"+neat_sid+"-DATAFILE"+"-"+neatFile_Name;
				//System.out.println(unit_id);
				collResult.addKPI(unit_id,"CM-00-03-006-01",File_Name);	
			}						
		}
		
		String Soap_total_Oracle_Segments = GXCollOracleSoapHelper.getSoap_total_Oracle_Tablespaces(sid,host_name);
		//发送soap请求,并返回结果
		String Soap_total_Oracle_Segments_res = soapClient.getSoapStringResponse(Soap_total_Oracle_Segments);
		//分析返回结果,得到list
		List Oracle_Segments_res_results = GXCollOracleXmlHelper.parseSoapResponse(Soap_total_Oracle_Segments_res);
		
		if(Oracle_Segments_res_results==null||Oracle_Segments_res_results.size()==0)
		{
			System.out.println("@tivoli error, no Soap_total_Oracle_Segments info got by tivoli in collCpu "+new java.util.Date());
		}
		else
		{
			for(int i=0;i<Oracle_Segments_res_results.size();i++)
			{
				Map row_map = (Map)Oracle_Segments_res_results.get(i);
				
				String Tablespace_Name = (String)row_map.get("Tablespace_Name");
				String Percent_Free_Space = (String)row_map.get("Percent_Free_Space");
				collResult.addKPI(pre_unitid+"-12:"+neat_sid+"-DATAFILE-"+Formater.neatenunitid(Tablespace_Name),"PM-00-03-007-01",Percent_Free_Space);
			}
		}
		
		return collResult.getKPISet();
	}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	/**
	 * getSpecialTable		-14
	 */
	public java.util.Vector getSpecialTable(java.util.HashMap params) throws Exception{
		String TABLENAME   = (String)params.get("TABLENAME");
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String neat_sid = Formater.neatenunitid(sid);
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		
		/**
		 * CM-00-03-004-05	是否有分区	指该表是分区表还是变通表	ua	得到数据	WORACLEINF00	WORACLEINFPARTITIONED00.PARTITIONED
		 * lianlian 2006-08-18
		 */
		
		//getSoap_WORACLEINFPARTITIONED00
		String soap_WORACLEINFPARTITIONED00 = GXCollOracleSoapHelper.getSoap_WORACLEINFPARTITIONED00(host_name);
		String soap_WORACLEINFPARTITIONED00_res = soapClient.getSoapStringResponse(soap_WORACLEINFPARTITIONED00);
		List WORACLEINFPARTITIONED00_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_WORACLEINFPARTITIONED00_res);
		for(int i=0;i<WORACLEINFPARTITIONED00_res_results.size();i++)
		{
			Map resultMap = (Map)WORACLEINFPARTITIONED00_res_results.get(i);
			String TABLE_NAME = (String)resultMap.get("TABLENAME");
			String PARTITIONED = (String)resultMap.get("PARTITIONED");
			String unit_id=pre_unitid+"-14:"+neat_sid+"-TABLES-"+Formater.neatenunitid(TABLE_NAME);
			collResult.addKPI(unit_id,"CM-00-03-004-05",PARTITIONED);
		}
		
		/**
		 * PM-00-03-003-01	读操作次数	该表空间的读操作次数	oracle ua	得到数据	tablespacewr	WORACLEINFTABSPACEWR00.PHYREAD
		 * PM-00-03-003-02	写操作次数	该表空间的写操作次数	oracle ua	得到数据	tablespacewr	WORACLEINFTABSPACEWR00.PHYWRITE
		 * lianlian 2006-08-17
		 */
		String soap_WORACLEINFTABSPACEWR00 = GXCollOracleSoapHelper.getSoap_WORACLEINFTABSPACEWR00(host_name);		
		String soap_WORACLEINFTABSPACEWR00_res = soapClient.getSoapStringResponse(soap_WORACLEINFTABSPACEWR00);
		List WORACLEINFTABSPACEWR00_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_WORACLEINFTABSPACEWR00_res);
		for(int i=0;i<WORACLEINFTABSPACEWR00_res_results.size();i++)
		{
			Map resultMap = (Map)WORACLEINFTABSPACEWR00_res_results.get(i);
			String TABSPACENAME = (String)resultMap.get("TABSPACENAME");
			String PHYREAD =(String)resultMap.get("PHYREAD");
			String PHYWRITE = (String)resultMap.get("PHYWRITE");
			
			String unit_id=pre_unitid+"-14:"+neat_sid+"-TABLESPACE-"+Formater.neatenunitid(TABSPACENAME);
			collResult.addKPI(unit_id,"PM-00-03-003-01",PHYREAD);
			collResult.addKPI(unit_id,"PM-00-03-003-02",PHYWRITE);
		}
		
//		begin 2006-7-7 lianlian
		//得到soap请求
		String Soap_total_Oracle_Segments = GXCollOracleSoapHelper.getSoap_total_Oracle_Tablespaces(sid,host_name);
		//发送soap请求,并返回结果
		String Soap_total_Oracle_Segments_res = soapClient.getSoapStringResponse(Soap_total_Oracle_Segments);
		//分析返回结果,得到list
		List Oracle_Segments_res_results = GXCollOracleXmlHelper.parseSoapResponse(Soap_total_Oracle_Segments_res);
		
		if(Oracle_Segments_res_results==null||Oracle_Segments_res_results.size()==0)
		{
			System.out.println("@tivoli error, no Soap_total_Oracle_Segments info got by tivoli in collCpu "+new java.util.Date());
		}
		else
		{
			for(int i=0;i<Oracle_Segments_res_results.size();i++)
			{
				Map row_map = (Map)Oracle_Segments_res_results.get(i);
				
				
				String Tablespace_Name = (String)row_map.get("Tablespace_Name");
				String Initial_Extent_Size = (String)row_map.get("Initial_Extent_Size");
				String Next_Extent_Size = (String)row_map.get("Next_Extent_Size");
				String Max_Extents_Specified = (String)row_map.get("Max_Extents_Specified");
				String Number_Extents = (String)row_map.get("Number_Extents");
				//String Percent_Free_Space = (String)row_map.get("Percent_Free_Space");
				String unit_id=pre_unitid+"-14:"+neat_sid+"-TABLESPACE-"+Formater.neatenunitid(Tablespace_Name);
				collResult.addKPI(unit_id,"CM-00-03-004-02",Initial_Extent_Size);
				collResult.addKPI(unit_id,"CM-00-03-004-03",Next_Extent_Size);
				collResult.addKPI(unit_id,"CM-00-03-004-04",Max_Extents_Specified);
				collResult.addKPI(unit_id,"PM-00-03-002-01",Number_Extents);
				//
				//collResult.addKPI(pre_unitid+"-12:"+neat_sid+"-DATAFILE","PM-00-03-007-01",Percent_Free_Space);
			}
		}
		//end
		
		/**
		 *CM-00-03-004-01	表名	数据库特定表名称	Table Name	得到数据	situations-oracle-Oracle Tablespaces	WORACLEINFPARTITIONED00.TABLENAME
		 *lianlian 2006-08-18 
		 */
		  String Soap_WORACLEINFPARTITIONED00 = GXCollOracleSoapHelper.getSoap_WORACLEINFPARTITIONED00_BY_TABLENAME(sid,host_name,TABLENAME);  //soap消息
		  String Soap_WORACLEINFPARTITIONED00_res = soapClient.getSoapStringResponse(Soap_WORACLEINFPARTITIONED00);
		  List WORACLEINFPARTITIONED00_res_results_by_tablename = GXCollOracleXmlHelper.parseSoapResponse(Soap_WORACLEINFPARTITIONED00_res);	
		  if( WORACLEINFPARTITIONED00_res_results_by_tablename == null || WORACLEINFPARTITIONED00_res_results_by_tablename.size()==0){
				System.out.println("@tivoli error, no getSoap_WORACLEINFPARTITIONED00_BY_TABLENAME info got by tivoli in collCpu "+new java.util.Date());
			}else
			{	
				for(int i=0; i<WORACLEINFPARTITIONED00_res_results_by_tablename.size(); i++)
				{
					Map rowMap = (Map)WORACLEINFPARTITIONED00_res_results_by_tablename.get(i);
					String TABLE_NAME = (String)rowMap.get("TABLENAME");
					
					String unit_id=pre_unitid+"-14:" + neat_sid + "-SYS";
					collResult.addKPI(unit_id,"CM-00-03-004-01",TABLE_NAME);
				}			
			}
		
		return collResult.getKPISet();

	}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	//	-16
	public java.util.Vector getDataDevice(java.util.HashMap params) throws Exception{
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String neat_sid = Formater.neatenunitid(sid);
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		
//		得到soap请求
		String soap_total_Oracle_Statistics_Summary= GXCollOracleSoapHelper.getSoap_total_Oracle_Statistics_Summary(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Statistics_Summary_res = soapClient.getSoapStringResponse(soap_total_Oracle_Statistics_Summary);
		//分析返回结果,得到list
		List Oracle_Statistics_Summary_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Statistics_Summary_res);		
		if( Oracle_Statistics_Summary_res_results == null || Oracle_Statistics_Summary_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Statistics_Summary_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_Statistics_Summary_res_results.get(0);
			
			String Physical_Reads = (String)row_map.get("Physical_Reads");
			String Physical_Writes = (String)row_map.get("Physical_Writes");
            
			collResult.addKPI(pre_unitid+"-16:"+neat_sid+"-DATADEVICE","PM-00-03-005-01",Physical_Reads);
			collResult.addKPI(pre_unitid+"-16:"+neat_sid+"-DATADEVICE","PM-00-03-005-02",Physical_Writes);
		}
		
		
		
		return collResult.getKPISet();
	}
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	public java.util.Vector getTotal(java.util.HashMap params) throws Exception{
		
		String sid=(String)params.get("SID");
		String host_name=(String)params.get("HOST_NAME");
		String neat_sid = Formater.neatenunitid(sid);
		
		com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		

		//得到soap请求
		String soap_total_Oracle_Logging_Summary= GXCollOracleSoapHelper.getSoap_total_Oracle_Logging_Summary(sid,host_name);  //soap消息
		//发送soap请求,并返回结果
		String soap_total_Oracle_Logging_Summary_res = soapClient.getSoapStringResponse(soap_total_Oracle_Logging_Summary);
		//分析返回结果,得到list
		List Oracle_Logging_Summary_res_results = GXCollOracleXmlHelper.parseSoapResponse(soap_total_Oracle_Logging_Summary_res);		
		if( Oracle_Logging_Summary_res_results == null || Oracle_Logging_Summary_res_results.size()==0){
			System.out.println("@tivoli error, no Oracle_Logging_Summary_res_results info got by tivoli in collCpu "+new java.util.Date());
		}else{	
			//该结果中,肯定只有一条记录,这是由tivoli机制所保证的
			Map row_map = (Map)Oracle_Logging_Summary_res_results.get(0);
			String Total_Header_Waits	            =  (String)row_map.get("Total_Header_Waits");
			String Total_Header_Gets	            =  (String)row_map.get("Total_Header_Gets");
			
			String unit_id=pre_unitid+"-15:"+neat_sid+"-SYS";
			int iTotal_Header_Waits =  Integer.parseInt(Total_Header_Waits);
			int iTotal_Header_Gets =  Integer.parseInt(Total_Header_Gets);
			
			collResult.addKPI(unit_id,"PM-00-03-007-02",Formater.formatDecimalKpivalue(Formater.formatDecimalKpivalue(String.valueOf(iTotal_Header_Waits*1.0/iTotal_Header_Gets))));
					
		}		
		return collResult.getKPISet();
	}
	/*public java.util.Vector getTable_Summary(java.util.HashMap params) throws Exception
	{
		  String TABLENAME   = (String)params.get("TABLENAME");
		  String sid=(String)params.get("SID");
		  String host_name=(String)params.get("HOST_NAME");
		  String neat_sid = Formater.neatenunitid(sid);
		  
		  
		  
		  com.sitech.ismp.coll.CollBase collResult = new com.sitech.ismp.coll.CollBase();
		  
		  
			
		  //return getSpecialTable(hostip,user,passwd,kbp_id,SID,TABLEOWNER,TABLENAME);
		  return collResult.getKPISet();
	}*/
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
			//String soap=GXCollOracleSoapHelper.getSoap_total_Oracle_Files(sid,host_name);
		//System.out.println(soap_total_Oracle_Files);
		//java.util.HashMap params=new java.util.HashMap();
		//params.put("SID",);
		
	}

}