quinta-feira, 8 de outubro de 2015

Statspack alternative for performance monitoring Oracle XE because AWR is not licenced

1. Introduction

Unfortunatly, Oracle Express does not license "AWR - Automatic Workload Management" (see references). But performance issues  exists in any system! You can install and use an old Oracle tool called StatsPac to monitor and capture statistical data from your Oracle instance.

2. Step by Step

2.1. Install StatsPack Binary

2.2. Test StatsPack


3. References





Powershell script to read .csv file and processing each row

1. Introduction

This script shows how to process each line of a .csv file.  Put fields headers in first line.


2. Script

2.1. Sample 'services.csv' input file

servico,login,senha
Spooler,lp0795\tmp,tmp
Themes,lp0795\tmp,tmp
Spooler,lp0795\tmp,tmp


2.2. Script sample

# ##############################################################################
# filename: csv-process.ps1
# author  : josemarsilva@yahoo.com.br
# date    : 2015-10-09
# purpose : Sample script processing each row from a .csv file. First row has
#           fields titles
# pre-reqs: 
#           - Set-ExecutionPolicy Unrestricted
# remarks :
# ############################################
#
$csvFile = "C:\Users\Josemarsilva\Downloads\services.csv"
$bufferRead = Import-Csv $csvFile
foreach ( $line in $bufferRead ) {
    # println fields ...
    "servico = " + $line.servico + "; login = " + $line.login + "; senha=" + $line.senha
    # do whatever you want here! you have each field in $line.<field>
}


2.3. Script output sample

servico = Spooler; login = lp0795\tmp; senha=tmp
servico = Themes; login = lp0795\tmp; senha=tmp
servico = Spooler; login = lp0795\tmp; senha=tmp