Sunday, June 29, 2014

Basic DB Admin tasks using local SQL PLUS



Connecting to SQL PLUS:


oracle> source /fmwapps/oracle/product/12.1.0/dbhome_1/bin/oraenv
Oracle_sid = ? [Enter SID of the instance you are trying  to connect] orcl

oracle> sqlplus


To Start the instance


SQL*Plus: Release 12.1.0.1.0 Production on Sun Jun 29 12:06:50 2014

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

Enter user-name: SYS as SYSDBA
Enter Password:  <Enter your DB password>

SQL> startup

To Shutdown the instance:

SQL> shutdown


To Find hostname of the Instance



SQL> select host_name from v$instance;

To find the port of the instance :


$ORACLE_HOME/11.2.0.3/network/admin

listerner.ora  file has port and SID.

tnsnames.ora  file has the cluster configuration for the database.

To fine the status of the listener:


lsnrctl status LISTENER










Saturday, June 28, 2014

Swap Space in Linux


How to check the swap file in linux:

root> swapon -s

Disk Usage :

root> df -m

Memory usage:

root> free -m

To create 1GB swap space

root> sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 
root> sudo mkswap /swapfile 
root> sudo swapon /swapfile
root> /swapfile swap swap defaults 0 0

To Add additional Swap space:

root>  dd if=/dev/zero of=/extraswap bs=1M count=6144
root>  mkswap /extraswap
root> swapon /extraswap
root> vi /etc/fstab
/extraswap   none   swap   sw   0   0
Add the above Line.

Sort Disk usage :

du -H --max-depth=1 /home/user



Linux Setup for SOA install on AWS -EC2

Create a M3-Large instance on AWS -EC2:

Create m3 large instance for SOA installation on AWS -EC2.

 1. Choose Static Elastic IP. So that you do not loose IP when server is restarted.
  
 2.  Save the KeyPair on local Machine.  Use PuttyGen to create the PPK file.

 3. Use Putty to login to the terminal using the PPK.  

      a. Hostname:  Public DNS name from AWS console.
      b. Port : 22  for ssh.  
      c.  Putty-> connection -> ssh -> Auth -> Browse for PPK file.

   4.  Default username used to login to AWS Instance is 'ec2-user'.


Change HOSTName on AWS EC2 Linux:


root>  vi /etc/sysconfig/network

Change Hostname to Fully Qualified name.

HOSTNAME=obprodb.objectprosolutions.com

Direct your custom hostname to AWS Public IP:

Create the A Record in your DNS control pointing to AWS PUBLIC IP.


Create User:


From Root user:


ec2-user> sudo useradd oracle

ec2-user> sudo su - oracle

oracle> mkdir .ssh


oracle> chmod 700 .ssh

oracle> touch .ssh/authorized_keys

oracle> chmod 600 .ssh/authorized_keys

oracle> vi .ssh/authrized_keys

Paste the public key here.  

P.S:  PuttyGEN is used to dispaly the public key 

Now login to terminal using the new user 'oracle'.


To Delete a user:



userdel -r oracle


To allow Remote access to User:

su - oracle

mkdir .ssh

chmod 700 .ssh

touch .ssh/authorized_keys

chmod 600 .ssh/authorized_keys



Run YUM Update:


root> yum update


Friday, June 27, 2014

WSM-00138: The path to the certificate is invalid



Scenario:

Oracle SOA calling secured service on Vordel Gateway.  OWSM policy used is 'oracle/wsm_username_tokoen_with_messsageprotection_client'.  Using this policy request message signed with SOA platform's certifacte along with UserNameToken.

OWSM policy expects the response message also be signed.  So we have configured the gateway the sign the response message with Root CA.

We have imported Root CA  to SOA's Keystore as trust.


Issue:


The path to the certificate is invalid. [[
Validation failed for the certificate "Subject DN:- CN=test.oprosoa.oprohome.com, OU=Information Technology, O="ObjectPro LLC.", L=Atlanta, ST=Georgia, C=US, Serial Number:- 132780370344752896279323, Issuer DN:- CN=OPRO Enterprise Certification Authority 01, DC=ObjectPro LLC, DC=com"
 Certificates in cert path used for validation are:-
"Subject DN:- CN=test.oprosoa.oprohome.com, OU=Information Technology, O="ObjectPro LLC.", L=Atlanta, ST=Georgia, C=US, Issuer DN:- CN=OPRO Enterprise Certification Authority 01, DC=ObjectPro LLC, DC=com"

]]


Solution:


According to Below Oracle Notes.  We need to import if any intermediate chain of certificates as well, in order to successfully read the response.

We have imported the dependent  ENT CA  certificate and issue is resolved





WSM-00138: The path to the certificate is invalid. Validation failed for the certificate {0} Certificates in cert path used for validation are:- {1}
Cause: The intermediate and root certificates of the certificate were not present in the keystore during verification.
Action: Make sure that the entire certificate chain is available in the keystore for verification.
Level: 1
Type: ERROR
Impact: Security