Wednesday, May 4, 2016

ORA-00845: MEMORY_TARGET not supported on this system

ORA-00845: MEMORY_TARGET not supported on this system

-----------------------------------------------------------------------------------------

SQL> show parameter memory

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address     integer 0
inmemory_clause_default     string
inmemory_force     string DEFAULT
inmemory_max_populate_servers     integer 0
inmemory_query     string ENABLE
inmemory_size     big integer 0
inmemory_trickle_repopulate_servers_ integer 1
percent
memory_max_target     big integer 1488M
memory_target     big integer 1488M
optimizer_inmemory_aware     boolean TRUE
shared_memory_address     integer 0


Thursday, March 3, 2016

CentOS | Red Hat - Virtualization - Using KVM

Terminology I used.

Host - The hypervisor or physical server where all VMs are installed.
VMs (Virtual Machines) - Virtual servers that are installed on top of a physical server

What is Virtualization

Type of Virtualization

Virtualization Advantange

What is KVM

KVM stands for Kernel-based  Virtual Machine , it  is Full Virtualization solution for Linux.

 KVM is part of Linux , You may not need to install anything - the 2.6.20 kernel version (and higher) includes KVM  kernel modules as part of the mainline kernel.

It support AMD 64 | Intel X86 Hardware

It support Common GUESTs e.g.  a. Linux  b. BSD  c. Windows etc

KVM convert Linux into Type 1 Hypervisor, it used other tools to provide complete set of virtualization. for example if you want to GUI for managing machine then you need to install other packages like virt-manager(Virtual machine manager).


Working of kvm.ko (Source Wikipedia)

KVM Hypervisor allocate more CPU or memory than the available resources on the system, but it is risky.

KVM Hypervisor uses KSM ( kernel same-page Merging) , it allow GUESTs to share identical memory pages.

KVM Hypervisor support nested virtualization.



Checking KVM Requirement

You can use KVM in pretty much any Linux distro. In general, RedHat flavors favor KVM. RHEL  ships with KVM enabled in the operating system, so you can also find it in RedHat-based distros like CentOS Scientific Linux, or Fedora.

1. Hardware Support

For full Virtualization KVM hypervisor required processor with virtualization extension. i.e. Intel VT -X(vmx) | AMD-V(SVM)

Verify CPU Virtualization extension is available

[root@server ~]# egrep 'svm|vmx' /proc/cpuinfo

flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d




[root@server ~]# lscpu | grep Virtualization

Virtualization:      VT-x
Virtualization type: full
Note :- It may be necessary to enable hardware virtualization via System BIOS(possibly disable by default)
Note :- KVM can also be executed without the CPU extensions, but then, it will run in a pure emulation mode using QEMU, resulting in a significant performance penalty.


2. Kernel Support

KVM require two kernel module to support Full Virtualization
  1. kvm.ko
  2. kvm_intel.ko(for intel processor) | kvm_amd.ko(for amd processor)
Verify these kernel module available 


[root@server ~]# lsmod | grep -i kvm

kvm_intel             245760  0
kvm                   745472  1 kvm_intel
irqbypass              16384  1 kvm



Installing KVM


QEMU

KVM uses QEMU for I/O hardware emulation. QEMU is a user-space emulator that can emulate a variety of guest processors on host processors with decent performance. Using the KVM kernel module allows it to approach native speeds. KVM is managed via the libvirt API and tools.

Managing KVM Hypervisor

libvirt and libvirt tools

The libvirt package is a hypervisor-independent virtualization API.
It is able to interact with the different Hypervisor.
The libvirt package is available as free software under the GNU Lesser General Public License. 











ibvirt supports:
The KVM/QEMU Linux hypervisor
The Xen hypervisor on Linux and Solaris hosts.
The LXC Linux container system
The OpenVZ Linux container system
The User Mode Linux paravirtualized kernel
The VirtualBox hypervisor
The VMware ESX and GSX hypervisors
The VMware Workstation and Player hypervisors
The Microsoft Hyper-V hypervisor
The IBM PowerVM hypervisor
The Virtuozzo hypervisor
The Bhyve hypervisor
Virtual networks using bridging, NAT, VEPA and VN-LINK.
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems

libvirt provides:
Remote management using TLS encryption and x509 certificates
Remote management authenticating with Kerberos and SASL
Local access control using PolicyKit
Zero-conf discovery using Avahi multicast-DNS
Management of virtual machines, virtual networks and storage
Portable client API for Linux, Solaris and Windows


virsh

The vi rsh command-line tool is built on the libvirt management API and operates as an alternative to the graphical virt-manager application. The virsh command can be used in read-only mode by unprivileged users or, with root access, full administration functionality. The virsh command is ideal for scripting virtualization administration and provides many functions such as installing, listing, starting, and stopping virtual machines.

virt-manager 

virt-manager is a graphical desktop tool for managing virtual machines. It allows access to graphical guest consoles and can be used to perform virtualization administration,virtual machine creation, migration, and configuration tasks. The ability to view virtual machines, host statistics, device information and performance graphs is also provided. The local hypervisor and remote hypervisors can be managed through a single interface.





Friday, January 15, 2016

CentOS - Become System Administrator- Installation

What is CentOS ?

C - Community 
ENT - Enterprise
O - Operating 
S - System

  • CentOS Stand for Community ENTerprise Operating System.
  • RPM Based distribution, All the package management is done by RPM. A tool YUM is also used.
  • CentOS source code is based on Red Hat Linux.
  • No Specific Certification is available.

CentOS Release and Support 

 Major Releases
Major CentOS Version 2,3,4,5,6,and 7. Major 7 is current Version.

 

Minor/Point Releases

 There are Minor release usually twice a year, A point release is something like 7.1, 7.2 etc.

Point Release basically update kernel ,Software Packages,Security Update etc.

No Extended Support is provided by CentOS after expiration of Support period.

Installation

Configuration after installation

CentOS-Become System Administrator- Basic Bash Command- I/O Redirection

Basic  BASH Command

I/O Redirection

1. Input/Output Redirection in BASH( Again Shell) - Most command in Linux reads input and write output.By default input is given by Keyboard and output is given  to  terminal(monitor).

Every command has three file descriptor : STDIN, STDOUT, STDERR.
STDIN : 0    - Comes from keyboard
STDOUT  : 1 - goes to console
STDERR  : 2 - goes to console


Not all command listen for STDIN(standard Input) some of them only have argument. for example ls command , it is not waiting for input, it optionally work with argument




Redirection operator

it is possible to redirect STDIN, STDOUT, and STDERR to other places.

Input Redirection  with  0< or <  - for redirect STDIN

Redirection is done using 0< or <(less than symbol) operator. 0 is optional.

[yogesh@lap ~]$ read fromkb
hello i am reading from keyboard and save it fromkb variable, use echo $fromkb to view my content
[yogesh@lap ~]$ echo $fromkb
hello i am reading from keyboard and save it fromkb variable, use echo $fromkb to view my content
Now we use < or 0< for redirect STDIN, I create a message file message.txt using vi editor
$ vi message.txt
Previously we saw that read command read from KEYBOARD we use STDIN redirect , now it read from message.txt file and store it into variable fromfile, we can see the value of fromfile variable using echo command.
[yogesh@lap ~]$ cat message.txt
read command by default read from keyboard now < or 0< is used for redirect STDIN, now it read content form file and store it into variable tempfile
[yogesh@lap ~]$ read fromfile < message.txt
[yogesh@lap ~]$ echo $fromfile
read command by default read from keyboard now < or 0< is used for redirect STDIN, now it read content form file and store it into variable tempfile
[yogesh@lap ~]$

Output Redirection with 1> or > - for redirect STDOUT


> or 1> is used to redirect STDOUT, For example ls command list the content of directory at terminal but if we want to redirect it to a file the we use > or 1>.  In 1> ,No need to type 1 , it is presumed.

[yogesh@lap test]$ ls
file1,  file2  message.txt

[yogesh@lap test]$ ls > ls.out
[yogesh@lap test]$ cat ls.out
file1,
file2
ls.out
message.txt

/*****we can use 1>  produce same result******/

[yogesh@lap test]$ ls 1>ls.out
[yogesh@lap test]$ ls
file1,  file2  ls.out  message.txt
[yogesh@lap test]$ cat ls.out
file1,
file2
ls.out
message.txt
[yogesh@lap test]$ 

Output Redirection 2> - for redirect STDERR

By default all Error message  also shown at Terminal, it is possible to redirect error message to another place like a log file for latter analysis. Following Example show how ls command redirect Error message to file.

[yogesh@lap test]$ ls
file1  file2  ls.out  message.txt
[yogesh@lap test]$ ls file1 file3
ls: cannot access file3: No such file or directory
file1
[yogesh@lap test]$ ls file1 file3 2>errorlog.out
file1
[yogesh@lap test]$ cat errorlog.out 
ls: cannot access file3: No such file or directory


& - Ampersand is  an indication that the number that follows is not a file name, but rather a location that the data stream is pointed to.
[yogesh@lap test]$ ls
file1  file2  message.txt
[yogesh@lap test]$ ls 1>test.out 2>&1
[yogesh@lap test]$ ls
file1  file2  message.txt  test.out
[yogesh@lap test]$ cat test.out
file1
file2
message.txt
test.out
[yogesh@lap test]$ 


>> Operator - >> operator append text to a file instead of overwriting it.

[yogesh@lap test]$ ls
file1  file2  message.txt  test.out
[yogesh@lap test]$ echo hello test file1 > file1
[yogesh@lap test]$ cat file1
hello test file1
[yogesh@lap test]$ echo hello i am test file2 > file2
[yogesh@lap test]$ cat file2
hello i am test file2
[yogesh@lap test]$ echo i am write some content to file1 > file1
[yogesh@lap test]$ cat file1
i am write some content to file1
[yogesh@lap test]$ echo i am append some content to file2 using append operator >> file2
[yogesh@lap test]$ cat file2
hello i am test file2
i am append some content to file2 using append operator
[yogesh@lap test]$ 

By default | (pipe symbol above Enter Key US Keyboard) - Pipe the result of one command to other command. i.e. output of one command become input of another command. for example
[yogesh@lap test]$ cat itemlist
1
2
4
5
6
7
19
3
8
12
9
[yogesh@lap test]$ cat itemlist | sort -n
1
2
3
4
5
6
7
8
9
12
19
[yogesh@lap test]$ 

Writing to STDOUT and File simultaneously

tee command is used in this case, tee command send output to one or more file in one move.

tee - a is used to append.

for example.
[yogesh@lap test]$ date | tee f1 f2 f3
Fri Jan 15 14:21:17 IST 2016
[yogesh@lap test]$ cat f1
Fri Jan 15 14:21:17 IST 2016
[yogesh@lap test]$ cat f2
Fri Jan 15 14:21:17 IST 2016
[yogesh@lap test]$ cat f3
Fri Jan 15 14:21:17 IST 2016
[yogesh@lap test]$ cat teetest | tee -a f1 f2 f3
cat: teetest: No such file or directory
[yogesh@lap test]$ echo content added to f1 f2 and f3 | tee -a f1 f2 f3 
content added to f1 f2 and f3
[yogesh@lap test]$ cat f1 && cat f2 && cat f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3
[yogesh@lap test]$ cat f1 f2 f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3
Fri Jan 15 14:21:17 IST 2016
content added to f1 f2 and f3

Saturday, January 9, 2016

Google Cloud Platform(GCP)-Google Cloud SQL

What is Google Cloud SQL

It is part of Google Cloud Platform(GCP), GCP have lot of software for different type of problem

Google Cloud Platform

CentOS 7- Monitoring and Controlling Laptop Heat / Temperature

I was facing Laptop Heating problem from first day when I have decided to switch CentOS Linux Operating System. I will  help you figure out what’s causing the heat and how to keep your laptop functioning at a lower temperature in Linux.

 

Problem Introduction:

We all know when process  execute at a higher clock speeds, CPU consume more power,resulted CPU temperature increased, for stability of our laptop it's fan running fast for reducing increased temperature.
So laptop heat problem is related to Hardware as well as Software

 

Wednesday, January 6, 2016

Single Row Function - NULL Related Function

NULL has special meaning , we can't compare null with other null value.
Can't use NULL value in any calculation,but sometimes we need null valued column in our calculation.

For this we have some special function that change null value with some other value.
  1. NVL Function
  2. NVL2 Function
  3. COALESCE Function
  4. NULLIF Function
  5. LNNVL Function
  6. NANVL Function

1. Oracle SQL/PLSQL : NVL Function

Syntax :  NVL(column|expr|null,default_value)
Purpose:    
 NVL Function  is used to replace null with some default value.
Example:


 

 

Single Row Function - Conversion Function


Single Row Function - General Comparision Function


Single Row Function - DATE TIME Function


Monday, January 4, 2016

Single Row Function-Numeric Function

All Numeric Function accept numeric value and return numeric value.

Some Important Numeric Function are 
1. ABS function
2. POWER function
3. SQRT function
4. SIGN function
5. ROUND function
6. TRUNC function
7. FLOOR function

Sunday, January 3, 2016

Single Row Function-Character Function

Accept one or more argument that can be column name ,expression,Variable value or User Supplied Constant and return one value for each row.

Can be used in SELECT, WHERE and ORDER BY clause and can be nested.

Type of Single Row function

  1. Character  function