Search This Blog

Tuesday, August 16, 2011

Oracle VM manager on Oracle 11g

How to install ORACLE VM manager using Oracle 11g as database?

By default ORACLE VM manager is using oracle express edition as a database.
But it has been observed that oracle 11g is a better alternative to XE. So here is the detailed steps of installing ORACLE VM Manager on top of ORACLE 11g.

Database Version:
Oracle Database 11g software, version 11.1.0.6.0

Step 1: Backup and Uninstall existing OVM (Oracle vm manager)

First you will need to take backup of existing OVM using script stored @ sh /opt/ovs-manager-2.2/bin/backup.sh

Next you will need to uninstall the existing OVM(Oracle vm manager) using runInstaller.sh script .

#sh runInstaller.sh
Welcome to Oracle VM Manager 2.2

Please enter the choice: [1|2|3]
1. Install Oracle VM Manager
2. Uninstall Oracle VM Manager
3. Upgrade Oracle VM Manager
2

Are you sure you want to uninstall Oracle VM Manager? [y|N] (default=N) : y
Uninstalling Oracle VM Manager.

The ovs-manager package (rpm) was not previously installed.

Removing the oc4j package(rpm) ...Done

Removing the oracle-xe-univ package(rpm) ...Done
Oracle VM Manager was removed.



Remove all existing database directories and files This is necessary to avoid any error during oracle 11g installation.

# rm -rf /etc/ora*
# rm -rf /opt/oracle/OraInventory/
#rm -rf /home/oracle/oraInventory

remove ORACLE_HOME entry from oracle user bash_profile


Step 2: Install ORACLE 11g.

export display for getting GUI for installation.

oracle@export DISPLAY=:0.0

login using oracle user .run runInstaller.sh of Oracle 11g.
oracle@sh runInstaller.sh






At this stage you will need to change some kernel parameters using root login.

#vi /etc/sysctl.conf
edit according to error
and then fire sysctl -p to commit changes.

click back and next on installation screen.
You should get output as below.








You will need to run the script mentioned in above diagram using root credentials.

# sh /home/oracle/oraInventory/orainstRoot.sh
Changing permissions of /home/oracle/oraInventory to 770.
Changing groupname of /home/oracle/oraInventory to oinstall.
The execution of the script is complete
You have new mail in /var/spool/mail/root


# sh /home/oracle/app/db_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /home/oracle/app/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.


Now login using oracle user.
edit bash profile file according to following entries.

export ORACLE_HOME=/home/oracle/app/db_1
export ORACLE_SID=XE
PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH:$HOME/bin; export PATH

Edit listener file according to below entries.
$ cat /home/oracle/app/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /home/oracle/app/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /home/oracle/app/db_1)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = IPOFTHEMACHINE)(PORT = 1522))
)
)

Now start the listener
$ lsnrctl start

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 16-AUG-2011 13:32:06

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Starting /home/oracle/app/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.1.0.6.0 - Production
System parameter file is /home/oracle/app/db_1/network/admin/listener.ora
Log messages written to /home/oracle/app/db_1/log/diag/tnslsnr/HOSTNAME/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=IPADDRESS)(PORT=1522)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 16-AUG-2011 13:32:07
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/db_1/network/admin/listener.ora
Listener Log File /home/oracle/app/db_1/log/diag/tnslsnr/HOSTNAME/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=IPADDRESS)(PORT=1522)))
Services Summary...
Service "XE" has 1 instance(s).
Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Now check the status of database it should be in READ WRITE mode otherwise you will have to make it up.

[oracle@~]$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Aug 16 13:32:19 2011

Copyright (c) 1982, 2007, Oracle. All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE



Step 3: Install OVM.

# sh runInstaller.sh
Welcome to Oracle VM Manager 2.2

Please enter the choice: [1|2|3]
1. Install Oracle VM Manager
2. Uninstall Oracle VM Manager
3. Upgrade Oracle VM Manager
1

Starting Oracle VM Manager 2.2 installation ...

Do you want to install a new database or use an existing one? [1|2]
1. Install a new Oracle XE database on localhost
2. Use an existing Oracle database in my network
2
Please enter the database hostname or ip address(Default: HOSTNAME):IPADDRESS
Specify a port that will be used for the database listener [1521]:1522
Please specify the database SID(Default: orcl):XE

Please enter the password for database account 'SYS':

Provisioning Oracle instant client ...

Checking the availability of the database ...

Set default database schema to 'OVS'.
Please enter the password for account 'OVS':
Confirm the password:

Please enter the default tablespace for user OVS(DEFAULT: USERS):
Checking the availability of the tablespace USERS ...

Creating the Oracle VM Manager database schema ...Done

Installing the ovs-manager package (rpm) ...
Done

Installing the oc4j package (rpm) ...
Done

Please enter the password for account 'oc4jadmin':
Confirm the password:

Starting OC4J ... Done.
To access the OC4J Home Page and change the password go to http://127.0.0.1:8888
/em

Deploying Oracle VM Manager application to OC4J container.
Creating connection pool ... Done
Creating data source ... Done
Deploying application help ... Done
Deploying application ... Done

Please enter the keystore password for the Web Service:
Confirm the password:

Setting keystore password for Web Service ... Done
Do you want to use HTTPS access for Oracle VM Manager (Y|n)?n

Configuring OC4J to use HTTP ... Done
Stopping OC4J ... Done
Starting OC4J ... Done

Please enter the password for the default account 'admin':
Confirm the password:

Configuring SMTP server ...
Please enter the outgoing SMTP mail server(e.g. - mail.abc.com, mail.abc.com:25): mailserver.domain.com
Mail server checking, may need some time, please wait ...
Setting the SMTP server to mailserver.domain.com ...
Done

Please enter an e-mail address for account 'admin': abc@domain.com
Confirm the e-mail address : abc@domain.com
Unable to send an email to 'abc@domain.com', would you like to change the email address(Y|n)?n
Updating e-mail address for account 'admin' to 'abc@domain.com' ...
Done

The console feature is not enabled by default.
For detailed setup, refer to Oracle VM Manager User's Guide

Installation of Oracle VM Manager completed successfully.

To access the Oracle VM Manager 2.2 home page go to:
http://IPADDRESS:8888/OVS

To access the Oracle VM Manager web services WSDL page go to:
http://IPADDRESS:8888/OVSWS/LifecycleService.wsdl
http://IPADDRESS:8888/OVSWS/ResourceService.wsdl
http://IPADDRESS:8888/OVSWS/PluginService.wsdl
http://IPADDRESS:8888/OVSWS/ServerPoolService.wsdl
http://IPADDRESS:8888/OVSWS/VirtualMachineService.wsdl
http://IPADDRESS:8888/OVSWS/AdminService.wsdl

To access the Oracle VM Manager help page go to:
http://IPADDRESS:8888/help/help

Thursday, August 11, 2011

PowerBrocker or Sudo Which one is better?


I was given a task to implement security policies with in a set of server environment.

The first thing that comes into my mind ,"Shall i go for 3rd party utility or use existing system utilities to achieve this?"

With little bit googling i come across a fine utility called powerbroker.

http://www.beyondtrust.com/Products/PowerBroker-Servers-Unix/

It had everything i was looking after but then "It was not free or open sourced"

I needed to know How effective is Power-brocker utility over SUDO? After posting my query on linux forums i got to know lot of pro/cons about using PB over SUDO.

Here is the link which helped me decide on Which one is better?

http://webcache.googleusercontent.com/search?q=cache:ANT8RddJJdIJ:forums11.itrc.hp.com/service/forums/questionanswer.do%3FthreadId%3D956140+Power+broker+sudo&cd=2&hl=en&ct=clnk&source=www.google.com

Currently looking for an open sourced utility to achieve this.

Monday, August 1, 2011

How to get Numeric representation of file/directories in linux?

Numeric representation of permission.

#stat -c %a /tmp/CPUUTILIZATION.log
644