# TMhdbc.ctl: Tests Hyperion Database Connections Parsing Mechanism # $Id: TMhdbc.ctl,v 1.4 2015/05/29 06:32:05 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/BI/TMhdbc.ctl,v 1.4 2015/05/29 06:32:05 RDA Exp $ # # Change History # 20150527 KRA Improve the documentation. =head1 NAME TOOL:TMhdbc - Tests Hyperion Database Connections Parsing Mechanism =head1 DESCRIPTION This tool extracts the Hyperion JDBC connections. It generates the connection information by running the F Hyperion script unless files are passed as arguments. In that case, the file contents is parsed instead. The tool accepts a C<-t> switch to restrict the connection types returned. -vT hdbc[:] -v run hdbc [-t,...]] [ ...]] =cut options t* use Buffer section tool call unshift(@{CUR.W_NEXT},'test') section test echo tput('bold'),'Processing HDBC test module ...',tput('off') run BI:EPMlib() if @arg {# Analyze the test files loop $fil (@arg) {echo 'Parsing connections on ',basename($fil),' file' if !?$buf = new('Buffer','R',$fil) echo $fil,': File not accessible' else {var $cnt = @con = get_db_connections(parse_db_connections($buf,$opt{'t'})) echo basename($fil),' : ',$cnt,' connection(s)',\ cond($opt{'t'},concat(' matching [',join(', ',@{$opt{'t'}}),']')) dump [@con] call $buf->close } } } else {# Generate connections list when no files provided as argument if !?testDir('d',catDir(${ENV.MW_HOME},'user_projects','epmsystem1','bin')) echo 'Cannot locate script. Verify MW_HOME is defined in the environment' elsif !?testFile(cond(isWindows(),'f',\ isCygwin(), 'f',\ 'fx'),\ catFile(lastTestDir(),${AS.BAT:'epmsys_registry'})) echo 'Cannot locate epmsys_registry script at ',lastTestDir() else {var $fil = lastTestFile() var $hom = ${SET.BI.EPM.D_HOME:\ ${ENV.EPM_ORACLE_HOME:\ ${ENV.HYPERION_HOME:''}}} var $ver = get_epm_version($hom) if and(compare('SAME',$ver,'11.1.2.2'),compare('OLDER',$ver,'11.1.2.2.300')) {var $epm = createTemp('EPMPWD','.tmp',false) call derivePassword('host','BI:EPM','epmsys_registry','EPM_REGISTRY') call writeTempPassword('EPMPWD',"%s\012",'host','BI:EPM','epmsys_registry',\ 'Enter Shared Services database password:','') call closeTemp('EPMPWD') } echo 'Connections will be generated by running ',basename($fil),' script' var $jdb = extract_db_connections($fil,$epm) var $cnt = @con = cond($opt{'t'},filter_db_connections($jdb,@{$opt{'t'}}),\ get_db_connections($jdb)) echo basename($fil),' : ',$cnt,' connection(s)' dump 'Type-related connections: ',$jdb dump 'Connections: ',[@con] if ?$epm call unlinkTemp('EPMPWD') } } =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut