Archive for the ‘Oracle blogroll’ Category

Find out DBID !!

One can find out dbid of a database through various means :

a) Execute a query, if db is either in mount mode or open

SQL> select dbid from v$database ;


b) If the db is is nomount mode but connected to recovery catalog, then you can find out while connected to Recovery Catalog

RMAN> list incarnation;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
——- ——- ——– —————- — ———- ———-
1       18      PRIMDB   555044608        PARENT  1          09/18/2011 17:33:42
1       19      PRIMDB   555044608        PARENT  787897     05/23/2015 20:01:07
1       20      PRIMDB   555044608        PARENT  1098108    06/10/2015 18:22:30
1       2       PRIMDB   555044608        CURRENT 1115148    06/11/2015 03:44:36

Read more…

Categories: OCM, Oracle DBA Tags: ,

Connect to Oracle Linux O/S without password !!

DISCLAIMER : Do not attempt this on critical or Production System.

I run multiple VirtualBox hosting Oracle Linux with Oracle database. It’s like a playground for me to do lot of oracle stuff.

Every time I have to take a connection , It’s painful to enter id/pwd for these so called playground system.

Started doing a little search as to how other fellow DBAs are getting away with this issue. Here is a little cheat trick that can be applied on non-critical systems.

Putty doesn’t give you an option to store password, but it does give you an option to store user name. Refer to below screenshot.


Assuming user ‘neeraj’ was already created in Oracle Linux O/S , let take a connection by specifying password


Let’s create a dir .ssh into /home/neeraj

Next challenge is how to avoid entering password everytime a connection is established to OL ( Oracle Linux ) via account ‘neeraj’

Here is a little cheat trick

Download Putty Keygen software from this url andopen the same. Keep settings as show below.


Click on generate button and randomly move mouse on blank area to generate a random key. Within a min, you would see similar to this


Click “Save Private Key button” and save Private key on local drive.

Note : If anyone get hold of this Private key, they can access your Virtual Machine running within VirtualBox without the need to enter id/pwd.

Next step is to open saved Private key ( C:\Misc_Things\test.ppk ) in notepad and copy the lines that represent PUBLIC key in clipboard


Since there are 3 lines , make sure to combine all line and create sort of single line which represents Public Key.

Since your putty session via ‘neeraj’ account is still active , go into following dir /home/neeraj/.ssh/

and create a file called authorized_keys and paste that 1 line which represents public key


Notice we have to insert ” ssh-rsa ” in front of our public key. There is a space in front and end of keyword ssh-rsa. Click on above screenshot to see a large image file

Now configure existing putty connection to use Private Key as shown below


Now take a fresh connection …. Voilla as seen in below screenshot , we dint had to enter pwd , it utilized Private/Public key and authenticated our dummy account ‘neeraj’


How to find Virtual Box Guest Addition version in Oracle Linux


Recently I broke VirtualBox Guest Addition within my OracleLinux box and was not sure what version am I really running.

Here goes a simple command to check version

[root@pr ~]# modinfo vboxguest


How to enable ftp on VirtualBox

You can transfer file from your local machine to virtual box via shared folders or via ftp.

By default looks like ftp is blocked on Virtual Box

Just inside your guest O/S i.e. VirtualBox Linux go to


and modify gssftp file

Change from ‘Yes’ to ‘No’ for DISABLE column as shown in below screenshot and remove value against “server_args”







You can restart ftp service via following command

/etc/init.d/xinetd restart


Categories: Linux, Oracle blogroll, Unix Tags: ,

How to check if Linux version is 32 bit or 64 bit

You can use following methods

Use this command getconf LONG_BIT

or use this on unix prompt

uname -m

Categories: Linux, Unix Tags: , ,

Setting up swapspace for Oracle

Sometime we land up in a situation where we have to increase swap space, since Oracle installation expects a certain % of swap space depending upon how much RAM you have allocated to O/S. For example if we have allocated 64 mb of RAM, then we need to specify 128 mb of swap space… again this is not always the case that you have to specify swapsize twice of RAM. It all depends on the OS etc, generally here is a little thumb rule

If you have between 1 and 2G RAM, you need to configure 1.5x RAM for swap space.
For 2 to 8G RAM, swap space has to equal RAM.
For RAM more than 8G, swap needs to be ¾ RAM.

If we need to ad swaps pace, we can either add a new partition of type swap or else we can file which can be used by O/S to be used as swap. I am going to demostrate adding swap space via adding file

How to check how much swapsize is specified via following command ?

# swapon -s


# cat /proc/meminfo

If I need to add swap space of let’s say 2 gb, i can issue following ‘dd‘ command

# dd if=/dev/zero of=/swapfile bs=1024 count=2097152

Count 2097152 is calculated via multiplying bs or blocksize of 1024 * 2048 mb


1) if=/dev/zero : Read from /dev/zero file. /dev/zero is a special file in that provides as many null characters to build storage file called /swapfile.
of=/swapfile : Read from /dev/zero write stoage file to /swapfile.
2) bs=1024 : Read and write 1024 BYTES bytes at a time.
3) count=2097152 : Copy only 2097152 BLOCKS input blocks.

The following command will setup the swap space

# mkswap /swapfile

Activate it via

# swapon/swapfile

There is one small thing still pending, once you reboot the Linux server this information is lost, in order to make it more permanent, we need to add following in /etc/fstab file, this file is primarily responsible for telling Linux that what all devices to mount, just add following line in fstab ( File System Table )

/swapfile               swap                    swap    defaults        0 0

Announcing Oracle Enterprise Manager 12c

January 12, 2012 Leave a comment

Learn about Oracle’s unique approach to cloud management, and see how Oracle helped its customers provision applications 84% faster, reduce time-to-resolution of service requests by 50% and easily manage user experiences for millions of customers.