Friday, March 20, 2015

oracle sid

reblogged from http://www.bunyamindemir.com/?p=113 1) SELECT global_name FROM global_name; 2) SELECT INSTANCE_NAME FROM v$instance; 3) echo $ORACLE_SID; 4) SHOW PARAMETER INSTANCE_NAME; 5) SELECT sys_context('USERENV','INSTANCE_NAME') FROM dual; 6) SELECT ORA_DATABASE_NAME FROM dual;

Friday, March 13, 2015

Sql Server Datafile Size in MB / GB

SELECT DB_NAME(database_id) [DatabaseName], [name] AS [LogicalName], (size*8)/1024/1024 [GB] FROM sys.master_files order by size desc select (size*8)/1024 [MB],* from sys.database_files

Thursday, March 12, 2015

power shell zip

#to create a new zip file: # Set-Content $arg[0] (“PK”+ [char]5 + [char]6 + (“$([char]0)”* 18)) #copy a file to new zip file $Shell=New-Object -ComObject Shell.Application $ZipFolder=$Shell.Namespace(‘F:\backup.zip’) $ZipFolder.CopyHere(‘C:\0bat\test.txt’)

Wednesday, January 21, 2015

ISO: Windows Burn Disc Image not visible / Datenträger Abbild brennen nicht sichtbar

Windows Explorer rigth mouse button Burn Disc Image not visible / rechte Maustaste Datenträger Abbild brennen nicht sichtbar => set Windows Explorer as standard program for ISO => rigth mouse button Burn Disc Image visible => Windows Explorer als Standard Programm setzen => rechte Maustaste Datenträger Abbild brennen sichtbar

Oracle Autoextend - Autogrow of Datafiles - automatisches Datenfile vergößern

ALTER TABLESPACE USERS ADD DATAFILE 'C:\oradata\dev4\USERS02.dbf' SIZE 500M AUTOEXTEND ON NEXT 500M; wenn das USERS02.dbf voll wird wird es um 500MB vergrößert when USERS02.dbf is fll oracle increases its size by 500MB

Sunday, January 11, 2015

c# wpf fill comboox with enum

string s=cbScchVersion.SelectedValue.ToString(); object o=Enum.Parse(typeof(AppObject.ScchVersion),s); int i=(int)o; AppObject.ScchVer = (AppObject.ScchVersion) i;

Thursday, December 18, 2014

Visual Studio Find and Replace Regular Expressions / Suchen und Ersetzten mit Regulären Ausdrücken (regex)

auf gefunde Ausdrücke greift man mit z.b. \0 zu, \0 gibt den ersten gefunden Ausdruck zurück. möchte man z.b. in allen DllImport Statements ,CallingConvention=CallingConvention.Cdecl hinzufügen, bsp: [DllImport(DRIVER_DLL_NAME, EntryPoint = "is_StopLiveVideo")] suchen: EntryPoint.*" ersetzen: \0, CallingConvention=CallingConvention.Cdecl Ergebnis: [DllImport(DRIVER_DLL_NAME, EntryPoint = "is_StopLiveVideo",CallingConvention=CallingConvention.Cdecl)]

PInvokeStackImbalance was detected (c# / .net) - fix : CallingConvention.Cdecl

[DllImport(DRIVER_DLL_NAME, EntryPoint = "is_ClearSequence")] // is_ClearSequence private static extern int is_ClearSequence(int hCam); [DllImport(DRIVER_DLL_NAME, EntryPoint = "is_ClearSequence", CallingConvention = CallingConvention.Cdecl)] // is_ClearSequence private static extern int is_ClearSequence(int hCam);

Tuesday, October 28, 2014

sql server tables unused space / unbenutzer Platz in Sql Server Tabellen, filesize / filegröße

--sql server tables unused space / unbenutzer Platz in Sql Server Tabellen: SELECT t.NAME AS TableName, s.Name AS SchemaName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables t INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id LEFT OUTER JOIN sys.schemas s ON t.schema_id = s.schema_id WHERE t.NAME NOT LIKE 'dt%' AND t.is_ms_shipped = 0 AND i.OBJECT_ID > 255 GROUP BY t.Name, s.Name, p.Rows ORDER BY UnusedSpaceKB desc --filegröße / filesize SELECT DB_NAME(database_id) AS DatabaseName, Name AS Logical_Name, Physical_Name, (size*8)/1024 SizeMB FROM sys.master_files where right(physical_name,3)='mdf' order by size desc

Thursday, August 28, 2014

bootrec (windows 10)

bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd

wichtig: bios bootdevice muß harddisk sein => boot von hd einstellen und bootmenu aufrufen um dann von install disk zu booten, dann obige commandos ausführen win server braucht keine extra partition bcdboot c:\windows /s c: ... kopiert boot files von c:\windows\Boot auf C:\Boot wenn HyperV nicht automatisch startet: bcdedit /set hypervisorlaunchtype Auto

Wednesday, August 27, 2014

windows server 2012 Disk management

Server Manager unterstützt scheinbar keine MBR Initialisation, daher: power shell: Initialize-Disk 4 –PartitionStyle MBR

Thursday, August 21, 2014

TSQL if then

--simplest / einfach if 1=1 Print 'Ja-Yes' else print 'nein-no' --one begin End block if 1=0 Begin Print 'Ja-Yes' End else print 'nein-no' --two ifs if 1=0 Begin Print '1:Ja-Yes' End else if 1=1 print '1:nein-no, 2:ja-yes' else print '1:nein-no, 2:nein-no'

Friday, August 08, 2014

vs2008 ssrs: Filter in "test1,test2,test3" not working in preview

the in clause is not working in preview, but on reportserver: I have a sharepoint datasource, and a dataset, which I filter in a table with th IN clause - doesn't display any matches, but when I deploy it is working

Sunday, August 03, 2014

einfache / simple cte (common table expression)

with cte as ( select Year(GETDATE())*10000+MONTH(GetDate())*100+DAY(GetDate()) as intDate ) select * from cte

Friday, August 01, 2014

ssrs display subreport without data / Unterbericht ohne Daten anzeigen

ein Unterbericht ohne Daten wird nicht angezeigt (wenn alle Datasets in diesem Report keine Zeilen haben, wird allerdings als eigenständiger Bericht angezeigt) => um ihn dennoch anzeigen einfach ein Dummy Dataset mit select 'dummy' as dummy einfügen, das hat immer eine Zeile und damit wird der Subreport angezeigt. a subreport with all datasets having 0 rows isn't displayed (although as normal report is displayed) => add a dummy dataset which always returns a row to display (e.g. select 'dummy' as dummy )

ssrs gauge aggregate function report item

error / fehler:
The value expression for the gauge panel 'GaugePanel1' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers.

solution / lösung: change Indicator Properties / Values and States / States Measurement Unit from percentage to numeric

in Indicator Properties / Values and States / States Measurement Unit von Prozent auf numerisch ändern

Thursday, July 24, 2014

ssrs: vs2008 vorschau fehler / visual stuido 2008 preview error

sometimes gauge panels with 3 traffic light indicators shows in visual stuidio 2008 preview all three lights on, although it should only show one - when deploying, and showing same data, only one traffic light of three is on, as it should be ... manchmal werden bei einem Gauge Panel mit 3 Ampel Indikatoren in der Visual Studio Vorschau alle 3 Ampellichter zugleich angezeigt - obowhl immer nur eines "leuchten" sollte. Wenn derselbe Report deployed wird und mit denselben Daten aufgerufen wird, wird korrekt nur ein Ampellicht (rot/grün/gelb) angezeigt ...

ssrs Tabelle mit nur Gruppierungszeilen ohne Details

eine neue Tabelle hat standardmäßig nur eine Zeile, die der Detailsgruppe "Detail1" zugeordnet ist. Geht man nun auf die Eigenschaften von "Details1" und fügt eine Gruppierung hinzu, verschwinden die waagrechten Detailszeilenzeichen und eine reine Gruppierungszeile entsteht (

sql server reporting services ssrs: transformation scope for state indicator must be specified

see property page of indicater scope property: e.g.: Scope=tablix1

ssrs not showing table

some grouping trouble can lead to not showing table at all - solution: delete group or check it