MS SQL SMS Activity Monitor

MS SQL SMS – Microsoft SQL Server management Studio
U njemu je jako zgodan “Acitivity Monitor” koji daje pregled toga ko šta radi nad odabranom bazom.
Otvaranje Activity Monitor-a :
1. Kroz ikonicu :
2. Desni klik na ime SQL servera za koji ste zakačeni :
Ali treba znati šta koja kolona znači, i šta znači ono što piše u njoj.

Objašnjenja :
Session ID – A unique number that is assigned to each user connection when the connection is made.
User Process – Displays 0 for a system process and 1 for a user process. By default, the filter setting for this column is 1. This displays only user processes.
Login – The SQL Server login name under which the session is currently executing.
Database – The name of the database that is included in the connection properties of processes that are currently running.
Task State – The state of the task.
Background-The SPID is running a background task, such as deadlock detection.
Sleeping-The SPID is not currently executing. This usually indicates that the SPID is awaiting a command from the application.
Running-The SPID is currently running on a scheduler.
Runnable-The SPID is in the runnable queue of a scheduler and waiting to get scheduler time.
Sos_scheduler_yield-The SPID was running, but it has voluntarily yielded its time slice on the scheduler to allow another SPID to acquire scheduler time.
Suspended-The SPID is waiting for an event, such as a lock or a latch.
Rollback-The SPID is in rollback of a transaction.
Defwakeup-Indicates that the SPID is waiting for a resource that is in the process of being freed. The waitresource field should indicate the resource in question.
Command – The kind of command that is being processed under the task.
Application – The name of the application program that created the connection.
Wait Time (ms) – The time, in milliseconds, in which this task is waiting for a resource. When the task is not waiting, the wait time is 0.
Wait Type – The name of the last or current wait type.
Pageiolatch_sh-the latch request is in shared mode
IO_COMPLETION-is waiting for IO to complete
Wait Resource – The name of the resource that is needed.
Blocked By – If there are blocking sessions, the ID of the session that is blocking the task.
Head Blocker – If there are blocking sessions, identifies the session that causes the first blocking condition. A value of 1 represents a head blocker for other sessions.
Memory Use (KB) – The amount of memory, in kilobytes, that is being used by the task.
Host Name – The name of the computer that made the connection to the instance of SQL Server.
Workload Group – The name of the Resource Governor workload group for the session.

Dobar link.

PowerShell komande za proveru IIS-a i stanja Application Pools

PS pre početka :
Lokacija PowerShell modula na Internetu : https://www.powershellgallery.com/
Ako vam treba spisak PowerShell modula i njihovi folderi (radi dodavanja u PATH varijablu za WIN 10), to se lista iz PS-a (kao Administrator), sa komadom :
PS IIS:\> Get-Module -ListAvailable *
Kada PS moluls foldere ubacite u PATH variablu (link), onda ih možete prizvati sa bilo koje lokacije na datoj mašini.
*****
Mertod 1 : PowerShell
Za proveru stanja Application Pools na lokalnoj mašini (link) :
PS IIS:\> Get-IISAppPool
Name Status CLR Ver Pipeline Mode Start Mode
—- —— ——- ————- ———-
DefaultAppPool Started v4.0 Integrated OnDemand
*****
Stvar je u tome što meni treba da proveravam stanje Application Pools za IIS-ove na udaljenim serverima.
Evo kako to može (istina radim sa localhost, ali za početak nije loše) (link) :
PS IIS:\> enter-pssession -computername localhost
[localhost]: PS D:\Moja Dokumenta> get-iisapppool
Name Status CLR Ver Pipeline Mode Start Mode
—- —— ——- ————- ———-
DefaultAppPool Started v4.0 Integrated OnDemand
Napomena1 : moj WIN 10 je u domenu, a ja sam Admin za udaljene servere koje proveravam, tako da nema potrebe ubacivati username+pass kombinaciju.
Napomena2 : ovo naravno ne funkcioniše ako date PowerShell komande nisu instalirane na udaljenom serveru. A uglavnom nisu. Cvrc.
*****
Kako naći PID procesa za pojedinačni Application Pool, zavisi da li je u pitanju IIS 6 ili IIS 7 (link).
*****
Metod 2 : Command Line Interface (CLI)
Može se koristiti komanda appcmd (link) u kombinaciji sa PSTools setom komandi koje je napravio Microsoft i koje baš i služe za ovakve stvari (link), a appcmd komanda se nalazi ovde : C:\Windows\System32\inetsrv (to je slučaj sa manje-više svim MS serverima).
Iz komandne linije pokrenute kao AD nalog koji ima Administrativna prava nad udaljenim serverom :
c:\PSTools>psexec \\udaljeni.server c:\Windows\System32\inetsrv\appcmd list apppools
PsExec v2.2 – Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals – www.sysinternals.com
APPPOOL “DefaultAppPool” (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL “Classic .NET AppPool” (MgdVersion:v2.0,MgdMode:Classic,state:Started)
APPPOOL “ASP.NET v4.0” (MgdVersion:v4.0,MgdMode:Integrated,state:Started)
APPPOOL “ASP.NET v4.0 Classic” (MgdVersion:v4.0,MgdMode:Classic,state:Started)
c:\Windows\System32\inetsrv\appcmd exited on udaljeni.server with error code 0.
Napomena 3 : ovakav remote prostup takođe daje i mogućnost (a moj nalog ima ta prava) da se Application Pool restartuje sa moje mašine, ali o tome drugi put 😉

PowerShell za IIS administraciju – instalacija

Početno stanje : WIN 10
Da bi se koristili ovi alati, evo šta mora da se uradi :
1. Instalacija IIS Management Console (link)
Kod mene je ovo IIS 10.
Ovo se radi kroz :
Select Control Panel on the Start menu.
In Control Panel, click Programs.
Click Turn Windows features on or off.
Expand Internet Information Services.
Expand Web Management Tools.
Select IIS Management Console.
Click the OK button to initiate the installation.
2. Otvoriti PowerShell CLI ali OBAVEZNO kao Administrator!!!
(link)
2.1 Proveriti jel imate PowerShellGet modul :
PS IIS:\> Get-Module -Name PowerShellGet
ModuleType Version Name ExportedCommands
———- ——- —- —————-
Script 1.0.0.1 PowerShellGet
2.2 Instalirati i Importovati željeni modul :
PS IIS:\> Install-Module –Name IISAdministration
PS IIS:\> Import-Module –Name IISAdministration
2.3 Proveriti :
PS IIS:\> Get-Module –Name IISAdministration
ModuleType Version Name ExportedCommands
———- ——- —- —————-
Script 1.1.0.0 IISAdministration

Excel zbunjujuće ponašanje

Nešto mi se zbunjujuće desilo u Excel-u, kad pomeram strelice (levo, desno, gore i dole) na tastaturi, umesto da mi se pomera iz jedne u drugu ćeliju, pomera mi se ceo dokument u pravcu strelice, za po jednu ćeliju.
To je zato što sam (slučajno) pritisnula “Scroll Lock” taster 🙂
A on nema indikaciju “pritisnutosti” na tastaturi.
Dakle, samo ponovo klik na taj taster i sve se vratilo u normalu 😉

RAM memorija za virtuelne WIN servere

Kada se na virtuelnom serveru uradi komanda “msinfo32”, dobija se gomila podataka vezanih za memoriju.
Evo malog objašnjenja, uz konkretan primer :
*****
Installed Physical Memory (RAM) Not Available
Ovo nije definisano jer je u pitanju VM
Total Physical Memory 18.0 GB
Ukupna fizička memorija dodeljena serveru.
Available Physical Memory 2.48 GB
Fizička memorija servera koja je bila slobodna u trenutku rađenja upita
Total Virtual Memory 34.0 GB
Virtuelna memorija=fizička memorija+swap (ili kod WIN “page file space”)
Available Virtual Memory 11.8 GB
Virtuelna memorija koja je na raspolaganju u trenutku rada upita
Page File Space 16.0 GB
Swap memorija WIN servera
Page File C:\pagefile.sys
Fajl koji se koristi za swap
*****

Brisanje diskova

Kako obrisati SVE sa stare mašine?
Ima gomila raznih alata za to, i posle isprobavanja DBAN se pokazao kao dobar.
Sa njihovog sajta se skine ISO image, ali nije ga dovoljno staviti na USB!!! Image se mora “urezati” na USB da bi se (moj stari) kompjuter podigao sa njega.
To virtuelno urezivanje se može uraditi sa programčićem koji se zove Rufus. To je EXE fajl koji se samo pokrene :

Kada se ISO “ureže” na USB (paziti ovaj proces briše SVE što je na tom USB-u ranije bilo!), restartovati mašinu koju hoćete da obrišete, sa F12 podesite da se podiže sa USB-a, i pratite uputstvo.
Potpuno brisanje diska od 250G traje 2-3h.

WIN 10 podešavanje pozadine (boje) aplikacija

Na mom (sad već bivšem) WIN 7 ja sam lepo mogla da podesim da mi pozadina u aplikacijama (Word, Excel, itd) bude sivkasto-zelena, što je mnogo prijatnije za oči ako duže radite.
To podešavanje na WIN 10 NE POSTOJI!!!!!! (videti link).
TOTALNA glupost.
Ali srećom postoji rešenje, istina mora se menjati registry.
1. Run : regedit
2. Otići na stavku : HKEY_CURRENT_USER\Control Panel\Colors\Window
3. Promeniti RGB (Red Green Blue) mešavinu u željenu. Paletu boja možete naći ovde.
4. Da bi se promena “primila” uraditi log out, pa log in. Može se desiti da je čak i restart potreban 🙁
*****
Na žalost ovo NE utiče na pozadinu Office dokumenata! Uzdah.
*****
Ima još jedan dodatni korak (link) :
1. Run : regedit
2. Otići na stavku : HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Themes/DefaultColors/Standard.
3. Za stavku “Windows” izmeniti boju u željenu. Ja sam uzela istu kao na sajtu, i sasvim je OK :

4. Reset mašine i radi!!!!!

Oracle crtice – ili kako da ja to nekako sažvaćem :-)

Redo Log – The most crucial structure for recovery operations is the redo log, which consists of two or more preallocated files that store all changes made to the database as they occur. Every instance of an Oracle Database has an associated redo log to protect the database in case of an instance failure (link). The database requires a minimum of two files to guarantee that one is always available for writing while the other is being archived (if the database is in ARCHIVELOG mode). LGWR (log writer) writes to redo log files in a circular fashion. When the current redo log file fills, LGWR begins writing to the next available redo log file. When the last available redo log file is filled, LGWR returns to the first redo log file and writes to it, starting the cycle again. This enables you to restore your database to any point in time.
A Data Guard configuration involves log transfer and log apply services on individual sites to manage the standby database. Log transfer and log apply services on all the sites should be performing well enough that a redo log file should be archived and applied to the Oracle instance in near real-time.
The DBA needs to understand the redo generation rate of the primary database before the tuning objective can be quantified.

Data Guard – A data protection and availability solution for Oracle databases. The basic function of Oracle Data Guard is to keep a synchronized copy of a database as standby, in order to make provision, in case the primary database is inaccessible to end users (link).

Odlično objašnjenje o vezi redo logova i Data Guard-a : link

ODI – Oracle Data Integrator – data integration software product
*****
Oracle Schema – In Oracle, users and schemas are essentially the same thing. You can consider that a user is the account you use to connect to a database, and a schema is the set of objects (tables, views, etc.) that belong to that account.
A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links.
*A user owns a schema.
*A user and a schema have the same name.
*The CREATE USER command creates a user. It also automatically creates a schema for that user.
*The CREATE SCHEMA command does not create a “schema” as it implies, it just allows you to create multiple tables and views and perform multiple grants in your own schema in a single transaction.
*A USER can be called a SCHEMA if the “USER” owns any object, otherwise it will only remain a “USER”. Once the USER owns at least one object then by virtue of all of your definitions above… the USER can now be called a SCHEMA.
*For all intents and purposes you can consider a user to be a schema and a schema to be a user.
Dobar link.
*****
CDB$ROOT – root container, there can be only one :-). The root does not store user data. Thus, you must not add user data to the root or modify system-supplied schemas in the root. However, you can create common users and roles for database administration. A common user with the necessary privileges can switch between PDBs. The metadata for data dictionary tables and view definitions is stored only in the root.