Tuesday, December 11, 2012

Rman / ORACLE

$rman target / nocatalog Recovery Manager: Release 10.2.0.5.0 - Production on Tue Dec 11 16:05:05 2012 Copyright (c) 1982, 2007, Oracle.  All rights reserved. connected to target database: SFT (DBID=2981456125) using target database control file instead of recovery catalog RMAN> delete noprompt archivelog until time 'sysdate-2/24...

Thursday, November 29, 2012

Wednesday, November 28, 2012

Oracle [ db_recovery_file_dest_size ]

SQL> SELECT * FROM V$RECOVERY_FILE_DEST; NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES ------------------------------------------------------------ ----------- ---------- ----------------- --------------- /u01/app/oracle/FLASH_RECOVERY_AREA 3.2212E+10          0                 0        ...

Oracle Tablespace [ Check +ASM | Add Tablespace]

Check +ASM SQL> select name, total_mb, free_mb from v$asm_diskgroup; Check Disk SQL> show parameter create Add Tablespace SQL> alter tablespace users add datafile size 1000m autoextend on next 500m maxsize 8000m; Check Tablespace autoextend SQL> desc dba_data_files; SQL> select Tablespace_name, file_name, bytes/1024/1024 mbytes, AUTOEXTENSIBLE, MAXBYTES/1024/1024...

Monday, November 12, 2012

Friday, November 9, 2012

Thursday, November 8, 2012

Windows [ Add Variables PATH ] Oracle

C:\Users\Administrador>sqlplus /nolog 'sqlplus' não é reconhecido como um comando interno ou externo, um programa operável ou um arquivo em lotes. C:\Users\Administrador>echo %PATH% C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\strawberry\c\bin;C:\s trawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Windows\System32\WindowsPowerS hell\v1.0\ C:\Users\Administrador>set PATH=%PATH%;C:\oraclexe\app\oracle\product\11.2.0\ser ver\bin C:\Users\Administrador>echo...

Thursday, November 1, 2012

Oracle [ Instance idle ]

1 - step SQL> connect sys as sysdba Enter password: Connected to an idle instance. SQL> SQL> SQL> startup ORACLE instance started. SQL> quit 2 - step SQL> connect sys as sysdba Enter password: Connected. SQL> SQL> alter system switch logfile; System altered. SQL> alter system checkpoint; System altered. SQL> quit ...

Oracle / Linux [ BASH Notify DB ]

[root@localhost notify]# cat notify.sh sqlplus /nolog << EOFconnect system/12345@names_sid.sqlquitEOF [root@localhost notify]# cat names_sid.sql spool /home/siltech/name.logselect name from v$database/spool off [root@localhost notify]# cat /home/siltech/name.log NAME                                                                           ...

Thursday, October 25, 2012

Wednesday, October 17, 2012

Monday, October 15, 2012

Monday, October 1, 2012

Makefile [ Automation modules for installation ] PERL

#CommandsCD_IN='cd'CD_OUT='cd ..'TAR='tar -xvf'PERL_MAKEFILE='perl Makefile.PL'MAKE='make'MAKE_INSTALL='make install'CHMOD='chmod +x Makefile'#ModuleM1=List-MoreUtils-0.33M2=ExtUtils-MakeMaker-6.62M3=Perl-OSType-0.005M4=Module-Metadata-1.000011M5=PathTools-3.33M6=Locale-Maketext-Simple-0.21M7=Module-CoreList-2.73M8=Module-Load-0.22M9=Params-Check-0.36M10=Module-Load-Conditional-0.54M11=IPC-Cmd-0.78M12=ExtUtils-CBuilder-0.280205M13=ExtUtils-ParseXS-3.15M14=Test-Simple-0.98M15=Perl-OSType-1.002M16=Test-Harness-3.25M17=Compress-Raw-Bzip2-2.055M18=Compress-Raw-Zlib-2.056M19=IO-Compress-2.055M20=IO-Zlib-1.10M25=ExtUtils-Install-1.54 M21=Package-Constants-0.02 M22=Algorithm-Diff-1.1902 M23=Text-Diff-1.41 M24=Archive-Tar-1.90 M25=ExtUtils-Install-1.54M26=Module-Build-0.4003M27=Config-IniFiles-2.77M28=DBD-Oracle-1.50M29=DBI-1.622#UncompressFILE_GZ=`ls...

Friday, September 28, 2012

Tuesday, September 25, 2012

Perl [ Generate executables from Perl / Binary file]

File Hello.pl --------------------------------------------- #!/usr/bin/perluse strict;use warnings;print "Hei man !!! \n"; --------------------------------------------- [root@localhost Desktop]# perlcc -o Hello Hello.pl [root@localhost Desktop]# chmod +x Hello [root@localhost Desktop]# ./HelloHei man !!! [root@localhost Desktop]# less Hello"Hello" may be a binary file.  See it anyw...

Wednesday, September 19, 2012

Install [ Oracle 11g XE on Red Hat ]

#rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm Executing post-install steps...You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.[root@localhost Disk1]# /etc/init.d/oracle-xe configureOracle Database 11g Express Edition Configuration-------------------------------------------------This will configure on-boot properties of Oracle Database 11g Express Edition. ...

Tuesday, September 18, 2012

Friday, September 14, 2012

Wednesday, September 12, 2012

Perl - [ Create | Insert - DB Oracle ]

use strict; use warnings; use DBD::Oracle qw(:ora_types); use DBI; use constant SqlOracle => 'C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe\\'; use constant User => 'system'; use constant Pass => '12345'; use constant DB => 'XE'; print "Test Show Valeu : $0\n"; my $dbh = DBI->connect("dbi:Oracle:".DB,User,Pass) or die $!; my $CreateTable = "CREATE TABLE EMPREGADO...

Perl - [ Perl DBI Oracle connect from Windows ]

use strict; use warnings; use DBD::Oracle qw(:ora_types); use DBI; use constant SqlOracle => 'C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe\\'; use constant User => 'system'; use constant Pass => '12345'; use constant DB => 'XE'; print "Create connection Oracle Database 10g Express Edition  ... 1\n"; my $dbh = DBI->connect("dbi:Oracle:".DB,User,Pass) or die $!; print...

Tuesday, September 11, 2012

Perl - USE [ Copy | Move | Constant ]

#!/usr/bin/perl use strict; use warnings; use  File::Copy; use constant WORK=>'/Users/als/'; copy(WORK."tmp.txt",WORK."tmp.txt.copy") or die "Copy failed $!"; move(WORK."tmp.txt",WORK."Desktop/tmp.txt") or die "Move failed $!"; print "Print constant\t:",WORK;                            ...

Monday, September 10, 2012

Perl - [ VIM | headers | pl ]

 less ~/.vim/headers/pl #!/usr/bin/perluse strict;use warnings;use Getopt::Long;my ($output_dir,$number,$input_dir);&Usage("Too few arguments") if $#ARGV<0;GetOptions(        'o|out_dir=s'    => \$output_dir,        'i|input_dir=s'    => \$input_dir,       ...

Perl [ Net::FTP ]

#!/usr/bin/perl use strict; use warnings; use Net::FTP; my $ftp = Net::FTP->new("ftp.suse.com", Debug => 0,  Timeout => 3) or die "Cannot connect to ftp.suse.com: $@"; if ( $ftp->login('anonymous','')){     my @dirs = $ftp->dir();     foreach my $dir (@dirs){             my ($permission,$number1,$user,$group,$number2,$months,$day,$year,$name_path)...

Thursday, September 6, 2012

Friday, August 24, 2012

Perl - Getopt::Long

#!/usr/bin/perl use strict; use warnings; use Getopt::Long; my $output_dir; my $number_base; &Usage("Too few arguments") if $#ARGV<0; GetOptions(     'o|out_dir=s'    => \$output_dir,     'b|base=i'     => \$number_base )or &Usage("Wrong arguments"); sub Usage(){     my($msg) = @_;    ...

Monday, August 20, 2012

Wednesday, August 15, 2012

Mysql - Script Load Table DataBase | Shell

#!/bin/bash DB_USER="name_user" PASS="pass_user" HOST="host_name" DB="name_dateBase" TABLE="name_table" PATH_FOLDER=`pwd` for file in `ls *.txt` do     mysql -u ${DB_USER} -h ${HOST} -p -D ${DB} -e "LOAD DATA LOCAL INFILE '${PATH_FOLDER}/${file}' INTO TABLE ${TABLE} FIELDS TERMINATED BY '\t';" do...

Wednesday, August 8, 2012

Tuesday, July 24, 2012

Friday, June 22, 2012

Perl - [FILE CONF / Config::IniFiles ]

configfile.ini --------------------------------------------------------------------------------------------------------------  [db] user = Command Line pass = 123 -------------------------------------------------------------------------------------------------------------- blog.pl --------------------------------------------------------------------------------------------------------------  #!/usr/bin/perl use...

Tuesday, June 12, 2012

PERL - Validate Palindromo

validate.pl -------------------------------------------------------------------------------------------------------------- #!/bin/bin/perl use strict; use warnings; my $palavra = shift or die $!; my @array = split(//,$palavra); my ($max,$valida) = ($#array,0); for(my $i = 0; $i <= $#array/2; $i++  ){     if($array[$i] eq $array[$max]){           ...

Perl - [ SCRIPT TO BACKUP ]

 backup.pl ------------------------------------------------------------------------------------------------------------ #!/usr/bin/perl use strict; use warnings; my $path = shift or die $!; my $dir_out = 'backup_Perl'; `mkdir $dir_out`    unless (-e "$dir_out"); print `find $path -name "*.pl" > tmp_path_backup`; open (IN,"tmp_path_backup") or die $!; while(<IN>){    ...

Sunday, June 10, 2012

Friday, June 8, 2012

Mysql && Perl / [ toGenerate_TIME | Show ]

toGenerate_TIME.pl ------------------------------------------------------------------------------------------------------------------------- #!/usr/bin/perl use strict; use warnings; my $myInterval = shift or die print "Usage : ./toGenerate_TIME.pl 30\n $!"; my $Time_start = 0; my $Time_stop = 23; my $interval = 0; print "create table horas(id int(10) primary key  auto_increment, horario...

Mysql [ if / else | DATA / TIME ]

Sintaxe : IF(<condition>, <value if true>, <value if false>) mysql> create table reserva(id int(10) primary key  auto_increment, tempo time, data date); Query OK, 0 rows affected (0.08 sec) mysql> desc reserva; +-------+---------+------+-----+---------+----------------+ | Field | Type    | Null | Key | Default | Extra        ...