Friday, September 25, 2015

ADD Swap to ORACLE LINUX

Add Swap file on ORACLE LINUX

fdisk /dev/sdb

create partition

-create swap file
mkswap /dev/sdb1

-add swap
swapon -a /dev/sdb1


-add in /etc/fstab

/dev/sdb1    swap swap    deafults 0 0

Thursday, September 10, 2015

ORACLE ASM not start (ORA-01078, ORA-29701)

ORACLE ASM not start

SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service


(+ASM) /export/home/oracle $ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    devdb01
ora.FRA.dg     ora....up.type ONLINE    ONLINE    devdb01
ora....ER.lsnr ora....er.type ONLINE    ONLINE    devdb01
ora.asm        ora.asm.type   ONLINE    ONLINE    devdb01
ora.cssd       ora.cssd.type  ONLINE    ONLINE    devdb01
ora.diskmon    ora....on.type ONLINE    ONLINE    devdb01
ora.evmd       ora.evm.type   ONLINE    ONLINE    devdb01
ora.meis.db    ora....se.type ONLINE    ONLINE    devdb01
ora.ons        ora.ons.type   OFFLINE   OFFLINE


ENABLE HAS

(+ASM) /export/home/oracle $ crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

(+ASM) /export/home/oracle $ crsctl start has
CRS-4123: Oracle High Availability Services has been started.



Connect ORACLE +ASM instance

sqlplus / as sysasm
startup

esxi update patch error ( thumbprint, not trusted)

Error:
Connect to esxi.mydomain.com failed. Server SHA-1 thumbprint 5D:01:06:63:55:9D:DF:FE:38:81:6E:2C:FA:71:BC:63:82:C5:16:51 <not trusted>

- install VMware Vsphere CLI


C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\apps\general>
credstore_admin.pl add --server esxi.mydomain.com --username my_user --password my_password
credstore_admin.pl add --server esxi.mydomain.com --thumbprint 5D:01:06:63:55:9D:DF:FE:38:81:6E:2C:FA:71:BC:63:82:C5:16:51

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>
esxcli --server esxi.mydomain.com --username my_user software vib update --depot=/vmfs/volumes/Data_Store_name/Path_file/ESXi550-201412001.zip

Tuesday, September 1, 2015

VMware PowerCLI export ova

#Set ENV
$VM = Get-Content .\vmhost_list.txt
$BackupvCenter = "vCenter.domain.local"
$BackupHost = "esxi-01.Domain.local"
$backupDate = Get-Date -Format yyyyMMdd
$backupDatastore = "vmd-01:LocalStorage"

Connect-VIServer -Server $BackupvCenter -User user_name@domain.local -Password user_password

#Dynamically create a folder
$BackupDir = "E:\vMware-backup\$BackupDate"
mkdir $BackupDir

foreach ($line in $VM) {

    Get-VM -Server $BackupvCenter  | where { $_.PowerState -like 'PoweredOn' -and $_.name -like $line } | select name, vmhost, usedspacegb

    $VM_TMP = $line+'-ova_backup-'+$backupDate

#Clone New VM
New-VM -Name $VM_TMP -VM $line -VMHost $BackupHost -Datastore $backupDatastore

#Export OVA file
Export-VApp -Destination $BackupDir -VM $VM_TMP -Format OVA

#Remove-VM $TMP -DeleteFromDisk -Confirm:$true
}

Tuesday, August 18, 2015

Microsoft Office365 PowerShell

MSol Connect
===========
Import-Module MSOnline
Connect-MsolService -Credential $cred
Get-MsolAccountSku

#ADD User No License on Office365

$upn = Get-Content .\upn-nolic.txt

foreach ($line in $upn) {

#ADD by sAMAccountName

#Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { samaccountname -eq $line } |Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
#Set-MsolUserLicense -UserPrincipalName $line@domain.com -AddLicenses domain365:STANDARDWOFFPACK_FACULTY
#Set-MsolUser -UserPrincipalName $line@domain.com -UsageLocation "TH"


#ADD by UserPrincipalName

#Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { UserPrincipalName -eq $line } |Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
#Set-MsolUser -UserPrincipalName $line -UsageLocation "TH"
#Set-MsolUserLicense -UserPrincipalName $line -AddLicenses domain365:STANDARDWOFFPACK_FACULTY

#Get-MsolUser -DomainName domain.com -SearchString $line | Select Displayname, UserPrincipalName, Licenses, LastDirSyncTime, UsageLocation
   
}


ActiveDirectory Connect
==================
$UN="test."
Get-ADUser -SearchBase "dc=domain,dc=local" -Filter { samaccountname -eq $UN } | Select-Object DistinguishedName, GivenName, Surname, UserPrincipalName
Get-ADUser $UN -Properties *
Get-ADUser $UN -Properties * | Select-Object UserPrincipalName
Get-ADUser -SearchBase "ou=itc,ou=nida,dc=domain,dc=local" -Filter { samaccountname -eq $UN } -Properties * | Select-Object UserPrincipalName, optionalEmail, mail,DistinguishedName
Get-ADUser -SearchBase "ou=itc,ou=users,dc=domain,dc=local" -Filter * -Properties * | Select-Object SamaccountName, mail, optionalEmail


Set Attribute ADuser
===============
Get-ADUser -SearchBase "ou=subouname,ou=ouname,dc=domain,dc=local" -Properties * -Filter {samaccountname -like "su*"} | Set-ADUser -MobilePhone " "

Friday, August 14, 2015

Oracle AMM

memory_max_target >= memory_target>=sga_max_size>=sga_target

example:

ALTER SYSTEM SET memory_max_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET memory_target='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET db_cache_size='4194304' SCOPE=SPFILE;
ALTER SYSTEM SET java_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target='0' SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size='0' SCOPE=SPFILE;
ALTER SYSTEM SET sga_max_size='2147483648' SCOPE=SPFILE;
ALTER SYSTEM SET sga_target='0' SCOPE=SPFILE;

 '0 = auto'

Thursday, July 23, 2015

Decommissioning the vCenter Server or a Platform Services Controller

shell.set –enabled True
shell

cd /usr/lib/vmware-vmdir/bin

run

./vdcrepadmin -f showpartners -h vc-psc.example.com -u administrator -w password


./vdcrepadmin -f showservers -h vc-psc.example.com -u administrator -w password


./vdcleavefed -h vc02.nida.local -u administrator -w password


cmsso-util unregister --node-pnid vcenter.example.com --username administrator@vsphere.local --passwd password

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout