Saturday, March 5, 2011

Oracle Database 11g R2 Deployment into ESXi Virtual Lab

With the infrastructure in place, the Oracle 11g R2 (non-clustered) database server is now deployed.

For instructions on how to install Oracle Database 11g in Ubuntu 10.10, please refer to this article.


Following is a summary of the server configuration.

Hardware Configuration

Server Name
IP Address
Gateway
OS
CPU #
RAM
oradb11g01.a.kein.com
eth0- 10.10.30.10
eth1 - 192.168.50.10
10.10.30.1
-
Ubuntu Linux 10.10
1
1GB

Storage Configuration

File System
Mounted On
Available Space
192.168.50.100:/mnt/sharedvol/shared/u1
/u01
1 TB

Software Configuration

Component
Application location
Data files location
Comments
Oracle Database 11g R2
(11.2.0.1.0)
/u01/app
/u01/app/oracle/oradata



Port Configuration

Type
Port and Port Range
Protocol/Application
Comments
Listener
1521
TCP/IP

Enterprise Manager DB Console
5560
HTTP



Testing the deployment

Connectivity from APP_VLAN (for TIBCO BW)

TIBCO BW Admin Server ip address. Currently DHCP, we will need to assign a static IP address later.

C:\XEClient\bin>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection 3:

        Connection-specific DNS Suffix  . : a.kein.com
        IP Address. . . . . . . . . . . . : 172.16.20.100
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 172.16.20.1

» ping test

C:\XEClient\bin>ping 10.10.30.10
Pinging 10.10.30.10 with 32 bytes of data:

Reply from 10.10.30.10: bytes=32 time=5ms TTL=63
Reply from 10.10.30.10: bytes=32 time<1ms TTL=63
Reply from 10.10.30.10: bytes=32 time<1ms TTL=63
Reply from 10.10.30.10: bytes=32 time<1ms TTL=63

Ping statistics for 10.10.30.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 5ms, Average = 1ms

C:\XEClient\bin>

» sqlplus test

C:\XEClient\bin>sqlplus system/xxxxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.30.10)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 28 22:25:19 2011

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

» jdbc connection test

Copy the JdbcCheckup.java codes from the official Oracle documentation "Oracle® Database - JDBC Developer’s Guide 11g Release 2 (11.2)". We will use this program unmodified. Compile and run to test your jdbc connection.

You will need the ojdbc6.jar libraries, and a JDK for this to compile.  ojdbc6.jar comes with the Oracle Database 11g Release 2 Client (11.2.0.1.0) for both Windows and Linux.

To compile:
javac -classpath .;[path_to_ojdbc6.jar]\ojdbc6.jar JdbcCheckup.java

To execute:
java -cp .;[path_to_ojdbc6.jar]\ojdbc6.jar JdbcCheckup

The outcome:

Please enter information to test connection to the database
user: youruserid
password: yourpassword
database(a TNSNAME entry): yourservicename
Connecting to the database...Connecting...
connected.
Hello World
Your JDBC installation is correct.

Important notes about the TNSNAME parameter:

If you encounter the following error,
Exception in thread "main" java.sql.SQLException: ORA-12154: TNS:could not resolve the connect identifier specified

        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:737)
        at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:401)
        at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:531)
        at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:148)
        at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
        at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)
        at JdbcCheckup.main(JdbcCheckup.java:45)

it usually means your tnsnames.ora cannot be located.

In order for the program to locate your tnsnames.ora, you need to specify the environment variable TNS_ADMIN to the path containing the file.

Example (Linux)

export TNS_ADMIN=$ORACLE_HOME/network/admin

If you do not have tnsnames.ora (probably because you do not use SQL*Net) file on your system, you can specify at the TNSNAME parameter input with the following format.

host:port:service_name

Example:
database(a TNSNAME entry):10.10.30.10:1521:orcl

» telnet test

bash-4.1$ telnet 10.10.30.10 1521
Trying 10.10.30.10...
Connected to 10.10.30.10.
Escape character is '^]'.
Connection closed by foreign host.
bash-4.1$ 

Connectivity from MSG_VLAN (for EMS)

» ping test

kj@tibems01:~$ ping 10.10.30.10
PING 10.10.30.10 (10.10.30.10) 56(84) bytes of data.
64 bytes from 10.10.30.10: icmp_seq=1 ttl=63 time=1.32 ms
64 bytes from 10.10.30.10: icmp_seq=2 ttl=63 time=0.596 ms
64 bytes from 10.10.30.10: icmp_seq=3 ttl=63 time=0.549 ms
^C
--- 10.10.30.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.549/0.822/1.323/0.355 ms
kj@tibems01:~$ 

» sqlplus test

kj@tibems01:~/app/kj/product/11.2.0/client_1$ ./sqlplus system/xxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.30.10)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))
SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 1 17:20:00 2011

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

» telnet test

kj@tibems01:~$ telnet 10.10.30.10 1521
Trying 10.10.30.10...
Connected to 10.10.30.10.
Escape character is '^]'.

Cheers,

No comments:

Post a Comment