Before start, run:
mkdir -p /opt/resources
cd /opt/resources
Clone the BDR source, using the latest branch:
#!/bin/bash | |
## lista_ds.sh | |
## Lists datasources usage on JBoss AS 4,5 and 6 or JBoss EAP 5 | |
### SAMPLE OUTPUT: | |
### INSTANCIA | PORTA | DS | MaxConnectionsInUseCount | AvailableConnectionCount | | |
### ---------------------|----------|----------------------|---------------------------|---------------------------| | |
### jboss-server-1 | 1199 | OracleDS | 8 | 50 | |
#!/bin/bash | |
## This script download the data and clone imdb-to-sql repo on github | |
## Requirements: | |
### - Python 2.6+ | |
### - psycopg2 python lib | |
### - git client | |
### - wget |
-- tuning used: https://www.pgconfig.org/#/tuning?total_ram=10&max_connections=100&environment_name=WEB&pg_version=10&os_type=Unix&arch=x86-64&drive_type=SSD&share_link=true | |
-- mbp pro 15", 500gb ssd, 16gb ram, i7 2,9ghz processor | |
\timing on | |
\pset null ~ | |
\set max_rows 1000 | |
DROP TABLE IF EXISTS load_test; | |
create table load_test (id serial primary key, name text, birth_date date, age int); |
# select pg_xlog_location_diff('951A/EA0F8000', '9518/1ECB6000'); | |
# super_db=# select pg_xlog_location_diff('951A/EA0F8000', '9518/1ECB6000'); | |
# pg_xlog_location_diff | |
# ----------------------- | |
# 12000174080 | |
# (1 row) | |
# super_db=# select pg_xlogfile_name('951A/EA0F8000'), pg_xlogfile_name('9518/1ECB6000'); | |
# -[ RECORD 1 ]----+------------------------- | |
# pg_xlogfile_name | 000000030000951A000000EA |
SELECT e.ID_USUARIO, u.NOME_COMPLETO USUARIO, e.ID_USUARIO_SOLICITANTE , us.NOME_COMPLETO USUARIO_SOLICITANTE, e.DATA_EMPRESTIMO DATA_EMPRESTIMO, e.DATA_DEVOLUCAO DATA_DEVOLUCAO,
e.STATUS STATUS, l.TITULO
FROM emprestimo e
INNER JOIN usuario u ON e.ID_USUARIO = u.ID
INNER JOIN usuario us ON e.ID_USUARIO_SOLICITANTE = us.ID
#!/bin/bash | |
PGCONFIG_URL="https://api.pgconfig.org/v1/tuning/get-config" | |
DEFAULT_FORMAT="alter_system" | |
ENVIRONMENT="{{ postgresql_default_profile }}" | |
PG_VERSION="{{ postgresql_version }}" | |
TOTAL_RAM=$(({{ ansible_memtotal_mb }} /1024)) | |
ADMIN_USER="postgres" | |
USE_RESTORE_TUNING="{{ apply_restore_tuning | default('NO') }}" |
SELECT | |
pga_job.jobname as job_name, | |
pga_jobstep.jstdbname as database_name, | |
pgagent.pga_next_schedule( | |
pga_schedule.jscid, | |
pga_schedule.jscstart, | |
pga_schedule.jscend, | |
pga_schedule.jscminutes, | |
pga_schedule.jschours, | |
pga_schedule.jscweekdays, |
sebastian=# create schema esquema_a; | |
CREATE SCHEMA | |
sebastian=# create schema esquema_b; | |
CREATE SCHEMA | |
sebastian=# create schema esquema_c; | |
CREATE SCHEMA | |
sebastian=# create schema esquema_d; | |
CREATE SCHEMA | |
sebastian=# create schema esquema_e; | |
CREATE SCHEMA |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "centos/7" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false |