Monday, July 8, 2013

How to start Enterprise Manager Console [EM Console] for Oracle Database

Enterprise Manager Console [EM Console] is used to monitor Database resources and performance

If you restart the Oracle database, you need to start the console separately [By default it will not be started automatically]

Login to OS as DBA user (OS user, not the SQL user)

Assuming you have set all your environment variables and PATH


"emctl status dbconsole" -> to check whether dbconsole is running or not

"emctl start dbconsole" -> to start the dbconsole

"emctl stop dbconsole" -> to stop the dbconsole


Default URL to access db console: http://<dbhost>:1158/em


How to start Linux in command line mode instead of GUI

Wanted to reduce the load on my mac CPU and Memory, so was trying to figure out how to start Linux in command line mode, below are the steps to do so

1) Login as root

2) Take a backup of /etc/inittab file
 vi /etc/inittab

Look for below line


id:5:initdefault:

3) Change id:5 to id:3, after change above line should like this
id:3:initdefault


3 - stands for Full Multiuser mode (with out x11)
5 - stands for X11 mode (GUI mode)

4) save the file and restart

Please note that, the next restart would be in command line mode


From Command line mode, any time you can switch back to GUI mode using "startx" command

After opening the GUI, logout and you will go back to CUI mode

so in short 
CUI -> GUI [startx] -> CUI [logout]




Friday, July 5, 2013

Assign Static IP Address and Hostname to Guest OS in VirtualBox

One problem I've faced after changing my Network Adapter configuration to Bridged Adapter is, the IP Address changes every time I change the network, which is kind of annoying

So my requirement was to fix either IP Address or Hostname to the Guest OS, so that I can access the server running inside vm(e.g. weblogic), based on a fixed IP Address / Hostname

After trying several options and re-installations of Linux, I figured out a way

We need to use 2 Network Adapters for Guest OS
1) Bridged Adapter
    Shares the internet from Host to Guest, so that the Guest can access internet
2) Host-only Adapter
    For assigning a static IP and hostname, so that host can access guest on fixed IP / hostname

Below are the steps

During the creation of VM Image, before installing Linux, do below changes

Select Bridged Adapter for Adapter 1


 


















Go to Adapter 2 configuration, select Host-only Adapter

If you are getting error after selecting Host-only Adapter, you need to add vboxnet0 adapter first from virtualbox preferences




















During the installation of Linux, you can configure hostname and static ip address to Adapter 2

Note: We can configure hostname and static ip address, even after the installation of Linux

Enter hostname by selecting the option "manually"





















Before proceeding with the next step, note down your Adapter IP address in host machine (Mac in my case)

Open Terminal, type "ifconfig -a" to get full ip address of all the ports

Look for vboxnet0 interface, notedown the ip address (in my case: 192.168.56.1) 

Note: This step is very important, in order to access guest from host


















Now go back to Guest installation screen, select the 2nd network device
(If you want to identify which is the network device for Host-only networking, just refer the mac address from VirtualBox settings page (Select the current guest and click settings, to to Network configuration tab)

Make sure the interface ip address from Host (Mac) is in the same subnet as Guest (Linux)

In my case, I have 192.168.56.1 for my mac interface (vboxnet0) and 192.168.56.2 for my Linux network device





















Make sure hostname, static ip is properly configured in the screen and proceed to next step of installation

I didn't want to setup ipv6, so I disabled it, this is up to you























After installation, do a ping test from host to guest and guest to host, both should work fine

If you want to ping guest from host, using hostname, you need to add the hostname to /etc/hosts file in Mac

Thats all for now, seeya

Tuesday, July 2, 2013

Access server console running in guest OS from host OS

Olleh lla

This is my first blog, this blog is to cover the technical issues which I have encountered and the solutions which i've found, this is more for future Praneeth :D

A brief background,  I am trying to install Oracle Database and Oracle Weblogic Server on Oracle Enterprise Linux which is running in Virtual Box image on top of Mac OS Mountain Lion

Host: Mac OS
Guest: Oracle Enterprise Linux 5.3
App Server: EM console of Oracle Database 11g (11.2.0.3)
                     Same for weblogic

was trying to access em console which is running in guest operating system (linux) from host operating system (mac os)

Issue was: unable to open the page from Mac

http://localhost:1158/em/console used to work inside linux, but when I tried from host, it was not working

Resolution:

1) First check your Virtual Box image settings





















Select Bridged Adapter from Network Adapter configuration
This setting will assign a new IP to guest OS (different from host) via DHCP

Select Promiscous Mode: Allow All

2) Start em console in guest OS
Obv after starting the database and listener






3) Now access em console inside linux using the ip address and port (not localhost)

















find the guest OS ip address
/sbin/ifconfig -a (you may need to login with root)

find the host OS ip address
/sbin/ifconfig -a

4) As step 1 is complete, you should be able to ping guest from host
ping <guest_ip> <port_number>
eg: ping 1.2.3.4 1158

5) Add firewall exceptions for port number 1158 (any port number on which app server is running)  in guest OS
System->Administration->Securty Level and Firewall
























Add all the port numbers which you want guest OS to allow

6) Do a telnet test from host to guest on specific port number, it should allow now

7) Access guest server url from host now, it should work :D

seeya