Archive for the ‘Oracle 11g’ Category

Oracle Internet Directory (OID) and Weblogic installation on Linux

I was just recently asked to diagnose and re-install Oracle Internet Directory and I thought it might be a good idea to document the installation steps – so here goes.

We will use the latest versions available at the time of writing this (22th March 2011).

Installation manual:

http://download.oracle.com/docs/cd/E17904_01/install.1111/e12002/instps2001.htm

Basic steps:
1. Install Oracle
2. Install OID (and FMW control and ODSM)

Oracle installation is quite trivial, so let’s focus on the OID installation.
- Just remember to use the AL32UTF8 character set on the database!

You need to download:
- Oracle WebLogic Server 10.3.4.
- Oracle Identity Management 11.1.1.2.0 & 11.1.1.3.0

Actual installation:

1. Install WLS 10.3.4
- Run the installation .bin
* In 64 bit environments use: JAVA_HOME/bin/java -jar wls1034_generic.jar
* You need JDK 1.6 or later
- Create a new FMW home
- Register for security updates..
- Typical or Custom
- Change or accept the installation directories (df -h …)
- Summary => Next
- Installation…

2. Install OID 11.1.1.2.0
- unzip ../ofm_idm_linux_11.1.1.2.0_32_disk1_1of1.zip …
- ./runInstaller
- Install Software – DO NOT CONFIGURE!
- Use SAME MIDDLEWARE HOME as WLS above!
- Oracle Home Directory: This will be the directory name under Middleware Home
- Installation …
- Run root script: /middleware_home_directory/oracle_home_dir/oracleRoot.sh
- Save Summary.

3. Install OID 11.1.1.3.0 Patch Set
- unzip ../ofm_idm_linux_11.1.1.3.0_32_disk1_1of1.zip …
- ./runInstaller
- Install Software
- Use same homes !
- Next, next
- Root script
- Save Summary

OID Configuration with FMW Control and ODSM:

1. Configuration

/middleware_home_directory/oracle_home_dir/bin/config.sh
- Installer starts
- Create new domain
=> FMW Control is being configured to manage OID here
* User Name: WLS Admin user details
* Domain name
- Installation location
* Weblogic Server Directory
* Oracle Instance location, new “ASInstance” (Not actual Oracle Instance)
* Oracle Instance Name, new “ASInstance” (Not actual Oracle Instance)
- De-select others than Oracle Internet Directory
=> We will configure only that
- Auto configuration ports normally OK, you can select them if you want
- Create Schema
* Create ODS Database Schema
* Connect string, for example: myserver:1521:orcl
* SYS
* Sys_password
- OID Passwords
* ODS Schema password & confirm (all directory content)
* ODSSM Schema password & confirm (OID statistics and DIP schema)
- OID information
* Realm, for example: dc=us,dc=oracle,dc=com
* Admin user: orcladmin
* Admin password: …
- Install
- Save Summary
* Note: Weblogic Console ie: http://myhost.us.oracle.com:7001/console

Verify installation:
- …home/bin/opmnctl status -l
- Alive:
* OVD
* oidldapd
* oidldapd
* oidmon => LDAP port, LDAPS port
* EMAGENT
- ldapsearch -p LDAP_port -b “” -s base “objectclass=*” orcldirectoryversion
=> orcldirectoryversion=OID 11.1.1.3.0

Open Enterprise Manager Fusion Middleware Control 11g
* For example: http://myhost.us.oracle.com:7001/em
- Find oid1 in FMW Control
- Verify version number in FMW Control

Open Oracle Directory Services Manager
* For example: http://myhost.us.oracle.com:7005/odsm
- Connect to a directory
* OID – directory name
* User Name: cn=orcladmin
* password
- Verify OID version

After you’re done installing and configuring the OID itself, you can proceed to netca to configure the destination databases “tnsnames.ora”.
That will update sqlnet.ora and ldap.ora

Examples
LDAP.ORA:
DEFAULT_ADMIN_CONTEXT = “ou=ora,dc=company,dc=com”
DIRECTORY_SERVERS = (ldap1.company.com:389, ldap2.company.com:389)
DIRECTORY_SERVER_TYPE = OID

Oracle can “officially” only use OID or AD as LDAP servers.
The type can be OID or AD. The multiple servers are for redundancy; it will not try each one in turn. Then in SQLNET.ORA:

NAMES.DIRECTORY_PATH=(LDAP, TNSNAMES)

The means try LDAP first, then try TNSNAMES.ORA, then give up.

If you want to use a third-party LDAP server, Oracle has a product called Virtual Directory that will act as a proxy between them.

Note:
- OID is a standalone system component (no run time dependency on WLS)
- FMW Control and ODSM are J2EE apps running in WLS. These components are used for managing OID via GUI interface.

Links section

Complete tutorial:

http://www.oracle.com/technetwork/middleware/id-mgmt/overview/ods11g-use-cases-084303.html

http://download.oracle.com/otndocs/products/oid/11113-oid-fresh-installation/11113oidfreshinstallation_viewlet_swf.html

http://www.oracle.com/technetwork/middleware/id-mgmt/overview/oracleauthenticationservices-100184.html

Concepts:

http://onlineappsdba.com/index.php/2009/07/28/oracle-fusion-middleware-11g-concepts-for-apps-dbas/

Download:

http://www.oracle.com/technetwork/middleware/downloads/fmw-11-download-092893.html

http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

http://download.oracle.com/otndocs/products/oid/11113-oid-fresh-installation/11113oidfreshinstallation_viewlet_swf.html

http://www.oracle.com/technetwork/testcontent/index-092280.html

LDAP configuration:

http://serverfault.com/questions/192359/oracle-replacing-tnsnames-ora-with-ldap-lookup

http://laurentschneider.com/wordpress/2006/10/migration-of-tnsnamesora-to-ldap-sun-java-system-directory-server.html

Tnsnames.ora information from OpenLDAP:

http://oracle-cookies.blogspot.com/2007/01/get-tnsnamesora-from-openldap.html

Orafaq:

http://www.orafaq.com/wiki/Oracle_Internet_Directory

OID basics:

http://onlineappsdba.com/index.php/2006/12/04/oracle-internet-directory-oid/

Posted by pparkko on March 22nd, 2011 No Comments

Oracle 11g virtual columns

When I found out about virtual columns I just had to try it.
Just a simple example for our familiar employees table.

First I made a copy of the employees:
Create table duunarit as select * from employees;


SQL> desc duunarit
Name Null? Type
----------------------------------------- -------- ---------------------

EMPLOYEE_ID NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)

I would like to add a salgrade column to the table with some simple reasoning based on salary:
when salary is less than 3000, print ‘Poor you’
when salary is 3000 – 5000, print ‘Lucky you’
when it is above 5000, print ‘You bastard’

:)

So here is my column definition:

alter table duunarit add
(salgrade varchar2(20)
generated always as
(
case
when salary < 3000 then 'Poor you'
when salary < 5000 then 'Lucky you'
else 'You bastard'
end
)virtual
);

Table altered.

Let's try it!

SQL> l
1* select last_name, salary, salgrade from duunarit

LAST_NAME SALARY SALGRADE
------------------------- ---------- --------------------
King 24000 You bastard
Kochhar 17000 You bastard
De Haan 17000 You bastard
Hunold 9000 You bastard
Ernst 6000 You bastard
Austin 4800 Lucky you
Pataballa 4800 Lucky you
Lorentz 4200 Lucky you
Greenberg 12000 You bastard
Faviet 9000 You bastard
Chen 8200 You bastard

LAST_NAME SALARY SALGRADE
------------------------- ---------- --------------------
Sciarra 7700 You bastard
Urman 7800 You bastard
Popp 6900 You bastard
Raphaely 11000 You bastard
Khoo 3100 Lucky you
Baida 2900 Poor you
Tobias 2800 Poor you
Himuro 2600 Poor you
Colmenares 2500 Poor you
Weiss 8000 You bastard
Fripp 8200 You bastard

This looks great functionality!

Posted by pparkko on April 14th, 2010 No Comments