meine Sys/Db admin & Developper Notitzen - wer Rechtschreibfehler findet darf sie behalten ... my Sys/Db Admin and developper notes - I don't care about typos
Friday, May 29, 2015
einfaches / simple power shell script
[CmdletBinding()]
param(
[Parameter(Mandatory=$True)]
[string[]] $Computername='localhost'
)
Get-VM -ComputerName $Computername
with help:
<#
.Synopsis
short Explanation
.Description
long Explanation
.Parameter Computername
paramdesc
.Example
getVm localhost
#>
[CmdletBinding()]
param(
[Parameter(Mandatory=$True)]
[string[]] $Computername='localhost'
)
Get-VM -ComputerName $Computername
Monday, May 25, 2015
nützliche power shell cmdlets
update-help
help
alias
Import-PSSession
New-PSSession
Get-PSSession
help exit-PSSession -ShowWindow
icm
$env:PSModulePath -split ";"
's1','s2' | foreach {write-output $_}
Wednesday, May 20, 2015
vs (visual studio) shotcuts
shift Alt Enter ... Fenster groß / klein
Vs2013: Alt +Pfeiltaste: Zeile verschieben
Strg Alt Space ... toggle INtellisense Mode
Strg-Shift-V Rotate Zwischenablage
crt-shift Mausrad Zoom
crt k,s : surround with
crt F10 debug till curser
wichtige EInstellungen:
Optionen / Projekte und Solutions / Aktives Element im Projektmappen Explorer überwachen
Vs2013: Alt +Pfeiltaste: Zeile verschieben
Strg Alt Space ... toggle INtellisense Mode
Strg-Shift-V Rotate Zwischenablage
crt-shift Mausrad Zoom
crt k,s : surround with
crt F10 debug till curser
wichtige EInstellungen:
Optionen / Projekte und Solutions / Aktives Element im Projektmappen Explorer überwachen
Saturday, May 16, 2015
powershell drivesize remaining
PS C:\Windows\system32> icm hv01,hv02,hv04 {Get-Volume} | select pscomputername, driveletter,sizeremaining | Format-Table -AutoSize
Tuesday, May 12, 2015
sql disk io
short reblogged from http://www.mssqltips.com/sqlservertip/2127/benchmarking-sql-server-io-with-sqlio/
1) change param.txt to bigger testfile (10Gb) and correct drive:
param.txt
c:\testfile.dat 8 0x0 10240
#name threads cpuaffinity sizeInMB
2) create testfile: sqlio -kW -s5 -fsequential -o4 -b64 -Fparam.txt
C:\Program Files (x86)\SQLIO>sqlio -kW -s5 -fsequential -o4 -b64 -Fparam.txt
sqlio v1.5.SG
parameter file used: param.txt
file c:\testfile.dat with 8 threads (0-7) using mask 0x0 (0)
8 threads writing for 5 secs to file c:\testfile.dat
using 64KB sequential IOs
enabling multiple I/Os per thread with 4 outstanding
size of file c:\testfile.dat needs to be: 10737418240 bytes
current file size: 0 bytes
need to expand by: 10737418240 bytes
expanding c:\testfile.dat ... done.
using specified size: 10240 MB for file: c:\testfile.dat
initialization done
CUMULATIVE DATA:
throughput metrics:
IOs/sec: 1327.03
MBs/sec: 82.93
VM on HyperV on SSD Raid,other examples:
Al:
IOs/sec: 3862.24
MBs/sec: 241.39
3) RANDOM WRITE TEST: (-d ... Drive -s seconds -t threads simultan)
sqlio -dC -BH -kW -frandom -t1 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kW -frandom -t2 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kW -frandom -t4 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kW -frandom -t8 -o1 -s60 -b64 \testfile.dat
C:\Program Files (x86)\SQLIO>sqlio -dC -BH -kW -frandom -t1 -o1 -s90 -b64 \testfile.dat
sqlio v1.5.SG
1 thread writing for 90 secs to file C:\testfile.dat
using 64KB random IOs
enabling multiple I/Os per thread with 1 outstanding
buffering set to use hardware disk cache (but not file cache)
using current size: 10240 MB for file: C:\testfile.dat
initialization done
CUMULATIVE DATA:
throughput metrics:
IOs/sec: 1082.02
MBs/sec: 67.62
Al -t1:
IOs/sec: 915.90
MBs/sec: 57.24
4)RANDOM READ TEST:
sqlio -dC -BH -kR -frandom -t1 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kR -frandom -t2 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kR -frandom -t4 -o1 -s60 -b64 \testfile.dat
sqlio -dC -BH -kR -frandom -t8 -o1 -s60 -b64 \testfile.dat
C:\Program Files (x86)\SQLIO>sqlio -dC -BH -kR -frandom -t1 -o1 -s30 -b64 \testfile.dat
sqlio v1.5.SG
1 thread reading for 30 secs from file C:\testfile.dat
using 64KB random IOs
enabling multiple I/Os per thread with 1 outstanding
buffering set to use hardware disk cache (but not file cache)
using current size: 10240 MB for file: C:\testfile.dat
initialization done
CUMULATIVE DATA:
throughput metrics:
IOs/sec: 2409.36
MBs/sec: 150.58
Al:
IOs/sec: 278.00
MBs/sec: 17.37
Sunday, May 10, 2015
powershell examples
get-host
update-help
Get-ExecutionPolicy
Get-PSDrive
get-vm -ComputerName hv01,hv02,hv04 | where State -eq Off | sort name
help New-SelfSignedCertificate -Examples
New-SelfSignedCertificate -DnsName www.test.net -CertStoreLocation Cert:\LocalMachine\My
$var=read-host "Enter a Computername"
Write-Output "Test"
Write-Host "Test"
Write-Warning "Test"
's1','s2' | foreach {write-output $_}
Wednesday, May 06, 2015
kiwi syslog daily logfile
Default/Actions/Log to file
C:\Programme\Syslogd\Logs\Interfaceueberwachung\log%DateISO.txt
Tuesday, May 05, 2015
Saturday, April 25, 2015
linux :ende von dateien anschauen
Tail –f /var/log/syslog
Oder
Tail –f /var/log/messages
Anzahl der Zeilen: -n
tail filename -n
Anzahl der Zeilen: -n
tail filename -n
Wednesday, April 15, 2015
Monday, April 13, 2015
team foundation server command line remove Locks
Zurücksetzen von Locks/CheckOuts für andere Benutzer: Die Operationen können mit dem TF Kommando in einer Visual 2010 Konsole ausgeführt werden.
Checkouts von jemanden anderen rückgängig machen:
D:\TFS\TFSTestprojekt>tf undo $/Intern_Testprojekt_EP_V004 /workspace:WST08008;har
mar
Thursday, April 09, 2015
Sql Server Trigger to set Last Change Date & Last Change User
ALTER TRIGGER [dbo].[Holidays_SetModified]
ON [dbo].[Holidays]
AFTER INSERT,UPDATE AS
BEGIN
--PRINT '[sf_KISData].[sf_KISData_Cascade_Modified] BEGIN'
DECLARE @id AS int
DECLARE @mod AS DATETIME
DECLARE @LUserId as int
DECLARE curInserted CURSOR LOCAL FOR
SELECT id, DateLastModified,LUserId FROM Inserted
OPEN curInserted FETCH NEXT FROM curInserted INTO @id, @mod, @LUserId
WHILE (@@FETCH_STATUS = 0)
BEGIN
IF NOT UPDATE(DateLastModified) OR @mod IS NULL
BEGIN
UPDATE Holidays SET DateLastModified= getutcdate(), LUserId=User_Id() WHERE id= @id END
FETCH NEXT FROM curInserted INTO @id, @mod, @LUserId
END
CLOSE curInserted
--PRINT '[sf_KISData].[sf_KISData_Cascade_Modified] END'
END
AFTER INSERT,UPDATE AS
BEGIN
--PRINT '[sf_KISData].[sf_KISData_Cascade_Modified] BEGIN'
DECLARE @id AS int
DECLARE @mod AS DATETIME
DECLARE @LUserId as int
DECLARE curInserted CURSOR LOCAL FOR
SELECT id, DateLastModified,LUserId FROM Inserted
OPEN curInserted FETCH NEXT FROM curInserted INTO @id, @mod, @LUserId
WHILE (@@FETCH_STATUS = 0)
BEGIN
IF NOT UPDATE(DateLastModified) OR @mod IS NULL
BEGIN
UPDATE Holidays SET DateLastModified= getutcdate(), LUserId=User_Id() WHERE id= @id END
FETCH NEXT FROM curInserted INTO @id, @mod, @LUserId
END
CLOSE curInserted
--PRINT '[sf_KISData].[sf_KISData_Cascade_Modified] END'
END
Sql Server User Functions
SELECT USER_NAME(), SYSTEM_USER, CURRENT_USER,SESSION_USER, USER_ID();
select * from sys.sysusers
Wednesday, April 01, 2015
(freie) Antiviren software vergleich
free AVG: schnell und einfach zu bedienen, Netzlaufwerkscan möglich, im (chip test eher nicht so gut
Trend Micro im Chip test beste Erkennungsrate, kann keine Netzlaufwerke scannen (zumindest nicht in trial version) und es gibt keine freie version
free Avast: für Programmierer ungeeignet, da scannt nach jedem kompelieren, Netzlaufwerksscan ok
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
Subscribe to:
Posts (Atom)