Oracle – Linux Instalar instantclient

tar -xzvf oci8–2.1.8.tgz cd oci8–2.1.8 phpize ./configure — with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib make sudo make install This will build and install the oci8 library which will be located (probably) in /usr/lib/php/20170718/oci8.so Now we should edit both these files… /etc/php/7.0/apache2/php.ini /etc/php/7.0/cli/php.ini Enable the oci8 extension by adding the line to each php.ini extension=/usr/lib/php/20170718/oci8.so /etc/apache2/envvars then add the following lines:
Continue reading Oracle – Linux Instalar instantclient

Oracle – Consultas para verificar as datas

ALTER SESSION SET TIME_ZONE = ‘-03:00′; select to_char(CURRENT_TIMESTAMP,’DD MM YYYY HH24:MI:SS’),1 FROM DUAL union select to_char(SYSDATE ,’DD MM YYYY HH24:MI:SS’),2 from dual; SELECT SESSIONTIMEZONE , TZ_OFFSET(SESSIONTIMEZONE) FROM DUAL; SELECT SESSIONTIMEZONE FROM DUAL; select to_char (dbms_scheduler.stime, ‘DDMonYYYY/HH24:MI:SS @ TZR (TZD) [TZH:TZM]’) from dual; select to_char(sysdate, ‘DD-MM-YYYY HH24:MI:SS’) from dual; select to_char(sysdate, ‘yyyy-mm-dd’) || ‘T’ || to_char(sysdate,
Continue reading Oracle – Consultas para verificar as datas

Solaris 11.3 – Horário de verão 2019 – Alteração manual

Comandos para alteração no horário de verão 2019 Solaris 11 # Comando para verificar o horário. /usr/sbin/zdump -v Brazil/East | grep 2019 1. Verificar o zoneinfo respectivo. O arquivo /etc/TIMEZONE # more /etc/TIMEZONE 2. Verificar se existe no diretório /usr/share/lib/zoneinfo algum arquivo em formato texto que contenha informações relativas a outros horários de verão (DICA:
Continue reading Solaris 11.3 – Horário de verão 2019 – Alteração manual

How to install pgAdmin4 in Ubuntu 16.04 with Python3

PostgreSQL 10 can’t manage with pgAdmin3. So we need to use pgAdmin4 for handling PSQL10. First of all we need to install pip3 so we need to run the command sudo apt install python3-pip Then install the virtualenv package sudo pip3 install virtualenv Then download the Python Wheel pgAdmin4 wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.9/pip/pgadmin4-4.9-py2.py3-none-any.whl Before running this command you just
Continue reading How to install pgAdmin4 in Ubuntu 16.04 with Python3

Mysql LOG

Como ativar Tracelog no mysql #Verifica o caminho do log SHOW VARIABLES LIKE “general_log%”; +——————+—————————-+ | Variable_name | Value | +——————+—————————-+ | general_log | OFF | | general_log_file | /var/run/mysqld/mysqld.log | +——————+—————————-+ #Ativa trace log mysql> SET GLOBAL general_log = ‘ON’; #Desativa trace log mysql> SET GLOBAL general_log = ‘OFF’;   #Verificar processos nos myql
Continue reading Mysql LOG

Mysql – PHP exemplo de inclusão de um registro no DB

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <?php //Variaveis $ip = "192.168.0.10"; $mac = "00:00:00:00:98:01"; $escola = "ESCOLA01"     $conexao = mysql_connect("localhost", "usuario", "senha") or die ("Conexão não efetuada"); mysql_select_db("databese"); // banco de dados exemplo $sql = "INSERT INTO estacoes (escola,mac,ip)
Continue reading Mysql – PHP exemplo de inclusão de um registro no DB

Criar usuário no MYSQL

#Criar usuário 1 2 CREATE USER ‘site’@’%’ IDENTIFIED BY ‘site’; CREATE USER ‘site’@’localhost’ IDENTIFIED BY ‘site’;CREATE USER ‘site’@’%’ IDENTIFIED BY ‘site’; CREATE USER ‘site’@’localhost’ IDENTIFIED BY ‘site’; #Liberar acesso 1 2 GRANT ALL ON site.* TO ‘site’@’%’ IDENTIFIED BY ‘site’ WITH GRANT OPTION; GRANT ALL ON site.* TO ‘site’@’localhost’ IDENTIFIED BY ‘site’ WITH GRANT OPTION;GRANT
Continue reading Criar usuário no MYSQL