This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
col "Tablespace" for a22 | |
col "Used MB" for 99,999,999 | |
col "Free MB" for 99,999,999 | |
col "Total MB" for 99,999,999 | |
select df.tablespace_name "Tablespace", | |
totalusedspace "Used MB", | |
(df.totalspace - tu.totalusedspace) "Free MB", | |
df.totalspace "Total MB", | |
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select dbms_metadata.get_ddl('TABLESPACE','TD_DBCLARIDATA_AUTO') from dual; | |
set head off echo off | |
select 'select dbms_metadata.get_ddl(''TABLESPACE'',''' | |
|| tablespace_name || ''') from dual;' from dba_tablespaces; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.io.FileType | |
String targetFileName = 'someFileName' | |
String filter = 'someFilter' | |
def dir = new File(".") | |
dir.eachFileRecurse(FileType.FILES){ file -> | |
if (file.name.endsWith(filter)) { | |
def zipFile = new java.util.zip.ZipFile(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Mostra o andamento de operacoes longas no Oracle. | |
-- | |
select target, sofar, totalwork, ROUND((sofar/totalwork)*100,5) pct_done | |
from v$session_longops | |
where (sid, serial#) in (select sid, serial# | |
from v$session | |
where logon_time > trunc(sysdate)) | |
order by pct_done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- calcular centroide | |
select SDO_GEOM.SDO_CENTROID(tb.geom, '0.000005') | |
from tabela tb; | |
-- converter para outra projecao | |
EXECUTE SDO_CS.TRANSFORM_LAYER('TABLE_ORIGINAL','GEOM_COL','TABLE_DESTINATION',3857); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String commandLine= "java -version" | |
def sout = new StringBuffer(), serr = new StringBuffer() | |
def proc = commandLine.execute() | |
proc.consumeProcessOutput(sout, serr) | |
proc.waitForProcessOutput() | |
if (sout) log.info "$sout" | |
if (serr) log.info "$serr" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo ' | |
..XXX. .XXX.. | |
.XXXXY.TXXXX. | |
XXXXXYXTXXXXX | |
.VXXVYXTVXXX. | |
`.TYXTXYXTV . | |
` ,YVTXYYV ., | |
`...XXXXX`.., | |
.`...XXX...,. | |
..` V ,.' | tr '.\`, VYTX' ' ()__() ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub PasswordBreaker() | |
'Breaks worksheet password protection. | |
Dim i As Integer, j As Integer, k As Integer | |
Dim l As Integer, m As Integer, n As Integer | |
Dim i1 As Integer, i2 As Integer, i3 As Integer | |
Dim i4 As Integer, i5 As Integer, i6 As Integer | |
On Error Resume Next | |
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66 | |
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 | |
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Carregar novas features no mapa. | |
Ferramentas: (plataforma OSGEO) QGIS, Udig, JOSM, Gimp/Inkscape, Open Street Maps. | |
Técnicas: | |
1) Inkscape + Gimp: criar um raster (DFX, TIF) da feature desejada (um rio, por exemplo), deixá-la o mais simples possível, sem ruído. Vetorizar esta imagem, e salvar como SVG. Georeferenciar a imagem vetorizada, e converter para shapefile. | |
Para georeferenciar pode-se utilizar o ogr2ogr, como no exemplo abaixo: | |
ogr2ogr -progress -f "ESRI Shapefile" SAIDA.SHP -a_srs EPSG:3785 -dsco ATTRIBUTES_SKIP=YES -order 1 -gcp 285.32538 226.59571 -5429612.461 -26028.318 [-gcp X_IMG Y_IMG X_MAP Y_MAP] ENTRADA.SHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Identify and change profile life_time | |
select profile from DBA_USERS where username = '<username>'; | |
alter profile <profile_name> limit password_life_time UNLIMITED; | |
select resource_name,limit from dba_profiles where profile='<profile_name>'; | |
-- Identify which accounts are about to expire (or expired), change password and unlock | |
select username,expiry_date,account_status from dba_users ORDER BY expiry_date DESC; | |
alter user <username> identified by <new_password> account unlock; |
OlderNewer