How To Know If Processor Is x86 Or X32 In Windows Vista

Yesterday I try some experiments in my laptop, it runs Windows Vista yet, of course, I must upgrade, but usually I work with Virtual Box and  VM Ware and it is enough for my. The problem arrive when I didn’t remember the processor architecture, I getting old. I like show in this blog entry a solution, there are some more.

First of all, Start, Run and write;

msinfo32.exe

This open a window with a report, you must look for System Type;

“System based on”

Then this give us the operating system, If is x86 you run on 32 bits and if it is x64 you are on es de 64 bits. Of course, you can installed an operating system of 32 bits on a processor of 64 bits… This is not a good idea.

Drill down in Software Enviroment and click in Enviroment Variables, and look for Processor_architecture variable. In my case (AMD64).

HTH – Antonio NAVARRO

 

 

How To Send A Email Using Power Shell

Last week I have been installing a Oracle database on Windows 2012 R2. I like to send emails when start database event, shutdown and others. Of course, you can it from the database, but in this case I have prefered to try Power Shell, It is become a powerfull tool and direct competitor of Python.

First of all. How to kown wicht version have installed ?

 
PS C:\ANR_TEMPORARY\POWER> get-host

Name             : ConsoleHost
Version          : 4.0
InstanceId       : 1938a5ba-bb39-4f77-82a5-d81bbb7dfb2f
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : es-ES
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

The Version give us the current version, in this case is PowerShell 4.0, the last version (at 27.12.2016).

The first method to send a email is valid from PowerShell 1.0, please look at this code;

 
$smtp = New-Object Net.Mail.SmtpClient("smtp.server.com")
$smtp.Send("bbdd@mdb.com","anavarror@mydomain.es","Test Email","This is a test")

The second way, valid from PowerShell 2.0, is like show below;

 
$From = "bbdd@mdb.com"
$To = "anavarror@mydomain.es"
$Subject = "prueba 1"
$Body = "C.Q.D."
$SMTPServer = "smtp.server.com"
$SMTPPort = "25"
Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort  	

For both, save it in a file with ps1 extension and excute from PS console with ./<path_and_your_file_name>, an example;

 
PS C:\ANR_TEMPORARY\POWER> .\send_email.ps1

HTH – Antonio NAVARRO

How To See Active Mviews

This is other way, more interesnting in my opinion, to see active mviews, I use it from many years, I don’t remember where I get it, maybe ML/MOS, of course, you can see it as usual by query the dba_jobs_running

 

REM
REM Active Mviews Refresh
REM 

SELECT 
   S.OBJ#,
   O.OBJ#,
   S.CONTAINEROBJ#,
   LASTREFRESHDATE,
   PFLAGS,
   XPFLAGS,
   O.NAME,
   O.OWNER#, 
   BITAND(S.MFLAGS, 8) 
FROM 
   OBJ$ O, 
   SUM$ S
WHERE 
   O.OBJ# = S.OBJ# AND 
   O.TYPE# = 42 AND 
   BITAND(S.MFLAGS, 8) = 8;                                                         
/

HTH – Antonio NAVARRO