Skip to content

Instantly share code, notes, and snippets.

@jzi96
jzi96 / OracleDropSchemaContent.SQL
Created April 26, 2012 06:23
Oracle SQL script to drop the entire schema content. This is very useful right before an import (restore).
SET SERVEROUTPUT ON
exec dbms_output.enable(1000000);
DECLARE
v_typ VARCHAR2(32);
v_name VARCHAR2(32);
v_constraint VARCHAR2(32);
v_sql VARCHAR2(100);
CURSOR c_objekte IS
SELECT typ, NAME
@jzi96
jzi96 / Oracle delete all tables in schema.sql
Created May 23, 2012 06:05
Oracle delete all tables in schema (data)
SET SERVEROUTPUT ON
exec dbms_output.enable(1000000);
DECLARE
v_typ VARCHAR2(32);
v_name VARCHAR2(32);
v_constraint VARCHAR2(32);
v_sql VARCHAR2(100);
CURSOR c_objekte IS
SELECT typ, NAME
@jzi96
jzi96 / OraDisableConstraints.sql
Created May 23, 2012 06:55
Oracle disable all constraints in a schema
SET SERVEROUTPUT ON
exec dbms_output.enable(1000000);
DECLARE
v_typ VARCHAR2(32);
v_name VARCHAR2(32);
v_constraint VARCHAR2(32);
v_sql VARCHAR2(100);
CURSOR c_constraints IS
@jzi96
jzi96 / ForceMediaPlayerLibraryUpdate.cmd
Last active December 13, 2015 22:28
Small batch to force media player library to be update. The script was found at: http://devmd.com/r/force-media-player-library-update
net stop WMPNetworkSvc
cd /d "%LOCALAPPDATA%\Microsoft\Media Player"
del *.* /f /q /s
rmdir "Art Cache" /s /q
rmdir "HME" /s /q
net start WMPNetworkSvc
"%ProgramFiles(x86)%\Windows Media Player\Wmpconfig.exe" HMEOn
"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" /prefetch:1
@jzi96
jzi96 / Git-commands-tmpl.txt
Last active February 15, 2016 07:32
Some usefull GIT commands * usage with SVN * configuration * alias
## patching
git format-patch -M origin/master
git am < patchfilename.patch
##Mirror an repository
for remote in `git branch -r | grep -v master `; \
do git checkout --track $remote ; done
git push --all ssh://repo.git
git push --tagsssh://repo.git
@jzi96
jzi96 / GitWithinCompanyNetwork-Remarks.txt
Created April 12, 2013 12:16
Some notes for the usage of GITHUB within a company network with msysgit.
edit C:\Program Files\Tools\GIT\etc\gitconfig
In section [http]
proxy = http://jzieschang:password@<proxy-server>:8080
add "git config --global http.sslVerify false"
on commandline:
env GIT_SSL_NO_VERIFY=true git clone ....
#display system summary
/etc/update-motd.d/50-landscape-sysinfo
#JIRA log
sudo tail /opt/atlassian/jira/logs/catalina.out -f
#START JIRA
sudo /opt/atlassian/jira/bin/start-jira.sh
sudo /opt/atlassian/jira/bin/stop-jira.sh
@jzi96
jzi96 / Oracle Get Tablespace statistics
Last active November 4, 2015 21:17
Oracle Get Tablespace statistics
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)) "% Free"
FROM
(SELECT tablespace_name,
ROUND(SUM(bytes) / 1048576) TotalSpace
FROM dba_data_files
GROUP BY tablespace_name
@jzi96
jzi96 / Oracle Get Size of Segments
Last active November 4, 2015 21:17
Oracle Get Size of Segments
SELECT * FROM (
SELECT
OWNER, SEGMENT_NAME, SEGMENT_TYPE, BYTES/1024/1024 SIZE_MB
FROM
DBA_SEGMENTS
ORDER BY
BYTES/1024/1024 DESC ) WHERE ROWNUM <= 20;
@jzi96
jzi96 / OraLongOps
Created July 11, 2014 13:38
Query Oracle long running operations
select * from v$session_longops
where last_update_time > trunc(sysdate)
order by start_time desc;
select trunc(start_time), count(*)
from v$session_longops
group by trunc(start_time)
order by trunc(start_time);