Before start, run:
mkdir -p /opt/resources
cd /opt/resourcesClone the BDR source, using the latest branch:
| # gera o arquivo com as instruções | |
| psql -c "SELECT * FROM fnc_apaga_auditoria('2015-01-01','auditoria')" -At > meu_arquivo.sql | |
| ## $ cat meu_arquivo.sql | |
| ## -- Table auditoria.foo | |
| ## DELETE FROM auditoria.foo WHERE dtinc <= '2015-01-01'; | |
| ## VACUUM FULL auditoria.foo; | |
| ## | |
| ## -- Table auditoria.bar | |
| ## DELETE FROM auditoria.bar WHERE dtinc <= '2015-01-01'; |
| sebastian=# CREATE TABLE notas (id serial primary key, ano smallint, semana smallint, nota numeric(5,2)); | |
| CREATE TABLE | |
| sebastian=# INSERT into notas (ano, semana, nota) VALUES(2016, 2, 83.7); | |
| INSERT 0 1 | |
| sebastian=# SELECT | |
| sebastian-# (ano || '-01-01')::DATE + (semana ||' weeks')::INTERVAL AS data_inicial, | |
| sebastian-# nota | |
| sebastian-# FROM notas; | |
| data_inicial | nota | |
| ---------------------+------- |
You can download the mod_cluster binaries on the mod_cluster website:
yum install httpd mod_ssl
| SELECT | |
| 'exec SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (' || p.pid || ', ' || p.serial# || ', true); ' AS start_trace_cmd, | |
| p.tracefile | |
| FROM v$process p, v$session s | |
| WHERE p.addr = s.paddr | |
| AND LOWER(s.username) LIKE LOWER('%user_name%'); |
| SELECT | |
| 'ALTER TABLE ' || | |
| schemaname || '.' || relname || | |
| ' OWNER TO novo_user;' | |
| FROM pg_stat_user_tables; |
| # -*- 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 |
| #!/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 |