Thursday, May 16, 2013

Portal 11G: wwv_context.sync() job broken

WWW_context is a package in the XXX_Portal schema. This www_contex.sync() job is created when Portal is installed. This particular job is used to sync the content users creates so that content management component can get it.

How to fix it when this job is broken?
Refer to Oracle doc:   Note [ID 1346255.1]
https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=468237572974133&_afrWindowMode=0&_adf.ctrl-state=100zpvdb9u_21

First find the job # of the broken job by execute the following in the database:

select * from dba_jobs;
select job, broken, what from dba_jobs;

Applies to:

Portal - Version: 10.1.2.2 and later   [Release: 10gR2 and later ]
Information in this document applies to any platform.

Symptoms



Search does not show result for new content added.

Cause

The Portal's  job synchronization  was not working properly.

Try  to run manually the job  from sqlplus got error:


16:37:54 SQL> exec dbms_job.run(181);
BEGIN dbms_job.run(181); END;
*
ERROR at line 1:
ORA-12011: execution of 1 jobs failed
ORA-06512: at "SYS.DBMS_IJOB", line 406
ORA-06512: at "SYS.DBMS_JOB", line 275
ORA-06512: at line 1



Solution



1.- Remove the job fro the queue.

Login as Portal from sqlplus


execute dbms_job.remove(181);


To check the jobid use the following query

select * from dba_jobs order by 1;
Then check for the job sync jobid

2.- Delete the job reference from Portal

Login as Portal from sqlplus and execute:


exec WWPRE_API_NAME.DELETE_NAME(p_path => 'oracle.portal.search',
p_name => 'text_sync_jobid');
commit;


3.- Recreate the job: Login as Portal user from sqlplus  and run:




cd E:\oracle\portal\portal_home\portal\admin\plsql\wws
set TNS_ADMIN=e:\oracle\portal\portal_instance\config
sqlplus xxx_portal@portal
@textjsub.sql START 16-05-13 60


$ORACLE_HOME/portal/admin/plsql/wws/textjsub.sql START DD-MM-YY 60


Replace : DD-MM-YY for the current day.
This job will run every 60

Oracle HTTP Server: How do I change port #s?

Reference: http://onlineappsdba.com/index.php/2010/06/10/changingstarting-ohs-oracle-http-server-11g-on-port-80-on-unix/


Change httpd.conf(using user owning OHS – awebtier in my case)
Change value against Listen to 80

Start OHS using OPMN (using user owning OHS – awebtier in my case)
cd    Oracle/web/web_instance /bin
 /opmnctl startall (stopall and startall if opmn is already running)
 Test OHS via URL
 Check if port 80 is listening on that machine “netstat -an | grep 80″
Type URL http://servername:80 (If you don’t specify port with http by default it takes port 80)


Tuesday, May 14, 2013

How to debug ORA-31203: DBMS_LDAP: PL/SQL - Init Failed error?

Reference link: https://forums.oracle.com/forums/thread.jspa?threadID=946119

We got into this problem when installing 10G OIM. DBMS_LDAP is a package in the 10g Metadata repository. The following is observed in logs:

SQL> Creating OID entries for SSO
Error code   : 1
Error message: User-Defined Exception
LDAP error    : ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.
ERROR: deleting application entry
Error code: 1
Error message: User-Defined Exception
ERROR: creating SSO users and groups in OID

PL/SQL procedure successfully completed.

*** Refreshing WWC OID cache....***
declare
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "ORASSO.WWSEC_OID", line 1199
ORA-06512: at "ORASSO.WWSEC_OID", line 1328
ORA-06512: at "ORASSO.WWSEC_OID", line 2498
ORA-06512: at "ORASSO.WWSEC_OID", line 2528
ORA-06512: at "ORASSO.WWSEC_OID", line 1606
ORA-06512: at "ORASSO.WWSEC_OID", line 1755
ORA-06512: at "ORASSO.WWSEC_OID", line 2133
ORA-06512: at line 8

Following is what we did:
1. find out whether Ldap server is running or not.
netstat -ano|findstr 363

or do a ldapbind:
ldapbind -h hostname -p 363
bind successful

2.Go to the database to ensure that the package DBMS_LDAP is present.
3.Then run the following from the database SQL:

If it fails, it means database server is unable to connect to the server where OID resides via that port 363.
Further to confirm this, we asked the DBA to telnet to the server using the following:

Telnet <server name where OID resides> 363
And he confirmed that an access problem does exist. The access problem needs to be fixed first before OIM installation can continue.
 -------------------------------------------------

1. Connect to your repository db and run the following code:

sqlplus sys/<password>
set serverout on
DECLARE
retval PLS_INTEGER;
my_session DBMS_LDAP.session;
BEGIN
my_session := DBMS_LDAP.init('host address where the oid resides','636');
retval := DBMS_LDAP.open_ssl(my_session, null, null, 1);
dbms_output.put_line('open_ssl returns: '|| to_char(retval));
retval := DBMS_LDAP.simple_bind_s(my_session,'cn=orcladmin','');
dbms_output.put_line('simple_bind_s returns: '|| to_char(retval));
retval := DBMS_LDAP.unbind_s(my_session);
dbms_output.put_line('unbind_s returns: '|| to_char(retval));
END;
/

2. This should fail...

DECLARE
*
ERROR at line 1:
ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_LDAP", line 50
ORA-06512: at line 5

Wednesday, May 8, 2013

Oracle HTTP Server SSL Configuration


Reference:
http://docs.oracle.com/cd/E23943_01/web.1111/e10144/getstart.htm


Configuring Secure Sockets Layer

Secure Sockets Layer (SSL) is an encrypted communication protocol that is designed to securely send messages across the Internet. It resides between Oracle HTTP Server on the application layer and the TCP/IP layer, transparently handling encryption and decryption when a secure connection is made by a client.
One common use of SSL is to secure Web HTTP communication between a browser and a Web server. This case does not preclude the use of non-secured HTTP. The secure version is simply HTTP over SSL (HTTPS). The differences are that HTTPS uses the URL scheme https:// rather than http://.

By default, an SSL listen port is configured and enabled using a default wallet during installation. Wallets store your credentials, such as certificate requests, certificates, and private keys.
The default wallet that is automatically installed with Oracle HTTP Server is for testing purposes only. A real wallet must be created for your production server. The default wallet is located in the ORACLE_INSTANCE/config/OHS/component_name/keystores/default directory. You can either place the new wallet in this location, or change the SSLWallet directive in ORACLE_INSTANCE/config/OHS/component_name/ssl.conf to point to the location of your real wallet.

Tuesday, May 7, 2013

Identity Keystore and Trust Keystore

Reference:
http://one-size-doesnt-fit-all.blogspot.ca/2009/09/weblogic-server-identity-vs-trust.html

http://download.oracle.com/docs/cd/E12839_01/web.1111/e13707/identity_trust.htm#i1170342
http://mynotes.wordpress.com/2009/08/04/difference-between-keystore-truststore/

In short,
Identity Keystore  contains   private keys
Trust KeyStore    contains    CA's public key (or certificates)

sometimes, people refer Identify Keystore to be Keystore
Trust Keystore to be Truststore.

SSL provides you with encryption, integrity, and authentication. That is,
the messages are encrypted, and come from an authenticated identity. 

"The public key is embedded in a digital certificate with additional information describing the owner of the public key, such as name, street address, and e-mail address *as well as the hostname*. *Along with this the digital certificate containing the public key, and the separate related private key, provide identity for the server*."

...ultimately to identify the server, to assert the server is who the server says it is.


The digital certificate containing the public key is also referred to as the "server certificate".

Thus the "identity" of the server is established by what's stored in the "identity" keystore, and its contents are what are farmed out to clients establishing secure connections with the server, who then verify the supplied digital certificate's CA against the clients own list of trusted CAs. The "identity keystore" is also referred to as the "server keystore", because it establishes the server's identity (ie. I am who I say I am).

The trust keystore is typically used for storing CA digital certificates, essentially the CAs who will be used to check any digital certificates that are given to the server at runtime (just the same as the client did above).



Oracle 11g: install node manager as a windows service



About Installing Node Manager as a Windows Service

reference

When installing your software on a Windows platform, you can optionally install WebLogic Server Node Manager as a Windows service. The WebLogic Server Node Manager is used to:

·        Start and stop server instances—both Administration Servers and Managed Servers—remotely.

·        Monitor the self-reported health of servers and automatically kill server instances whose health state is FAILED.

·        Migrate servers in a WebLogic Server cluster.

·        Automatically restart servers that have the "failed" health state, or have shut down unexpectedly due to a system crash or reboot.

In a multi-machine environment, you must install Node Manager on each machine that hosts Managed Server and Administration Server instances of WebLogic Server.

Note:

You must have Administrator privileges to install Node Manager as a Windows service.

Node Manager is installed as part of Weblogic Server installation. 
 
To install the Node Manager Windows Service during an initial installation, you must select a Custom installation.

Wednesday, May 1, 2013

OID 11g how to recover from a bad realm configuration in a clustered environment

Node 1 is our main node, Node2 is our secondary node. We are using IDM 11.1.1.6.
(1) used "setup.exe -deinstall" to remove OID installation.  Following the following instructions:
http://www.idmworks.com/blog/entry/uninstalling-oracle-fusion-middleware-products

We kept the admin server running.
We then deinstalled ASInstance on node 1 using "setup.exe -deinstall".
We then deinstalled Oracle IDM_home on node 1 using "setup.exe -deinstall".
We did not deinstall the remote instance on node2.
We then went to file system to remove idmdomain manually. It did not allow.

We disabled node manager  and AS instance control in Windows Servers. We restarted node 1, then we are able to successfully remove idmdomain.
We then deleted the remaining of AsInstance folder in the file system.

(2) We revert the 11g RAC database back to before we started the 11g OID install and configuration.

(3)We run "setup.exe" to Install and Configure node1.
   Thing went well. Admin server up, ... odsm works.

(4) On Node2, we tried to reconfigure by running "config.exe" but it is complaining about AS instance being existed.

we disabled both node manager and Oracle Instance Control (I think this is opmn control) in windows service.
 We then removed Oracle Instance Control windows service by issuing the following in an administrative command prompt:
      sc delete "Oracle ...Instance Control".
rerun "config.exe" succeeded.

(5) We want to http:<node1>:port/em to ensure that both oid1 and oid2 are up.
We then stopped the existing  wls_ods1 on node1. and restarted wls_ods1 so that it is aware of the 2nd node in the cluster.