Pages

Monday, September 19, 2011

Procedure to kill database session

应用用户用如下procedure kill session:
SQL> connect

Enter password:

Connected.

假设有TEST用户,
SQL> select sid,serial# from v$session where username='TEST';

SID SERIAL#

---------- ----------

401 209

SQL> execute kill_session(401,209);


PL/SQL procedure successfully completed.


SQL>

SQL> select sid,serial#,status from v$session where username='TEST';



SID SERIAL# STATUS

---------- ---------- --------

401 209 KILLED



SQL> /
no rows selected

如果提示没有数据,说明需要Kill的session不存在没有找到

SQL> execute kill_session(463,81);

BEGIN kill_session(463,81); END;
*

ERROR at line 1:

ORA-01403: no data found

ORA-06512: at "SYS.KILL_SESSION", line 7

ORA-06512: at line 1

Sunday, September 18, 2011

LDAP DN: CN, OU and DC

CN, OU, DC 都是 LDAP 连接服务器的端字符串中的区别名称(DN, distinguished name)

LDAP连接服务器的连接字串格式为:ldap://servername/DN


其中DN有三个属性,分别是CN, OU, DC

LDAP是一种通讯协议,如同HTTP是一种协议一样的!

在 LDAP 目录中,

DC (Domain Component)

CN (Common Name)

OU (Organizational Unit)

LDAP 目录类似于文件系统目录。

下列目录:

DC=gc,DC=asia,DC=microsoft,DC=com

如果我们类比文件系统的话,可被看作如下文件路径:

Com\Microsoft\asia\gc


例如:CN=test,OU=users,DC=domainname,DC=com

在上面的代码中 cn=test 可能代表一个用户名,ou=users代表一个 active directory 中的组织单位。这句话的含义可能就是说明 test 这个对象处在domainname.com 域的 developer 组织单元中。

Wednesday, September 7, 2011

HostnameVerifier 'oracle.jdevimpl.webservices.tcpmonitor.config.AnalyzerConfiguration$1CustomHostnameVerifier'

We have called a secured web service on SSL in our demo, which is deployed on weblogic server ansd this server is configured to one way secure on SSL .  Then we tried to call this web service by creating a web service proxy.

But when running this proxy, it threw the below error:

HostnameVerifier 'oracle.jdevimpl.webservices.tcpmonitor.config.AnalyzerConfiguration$1CustomHostnameVerifier'

By default weblogic has hostname verification enabled. This means when you are invoking a https URL , the CN name in the ssl server certificate should match with the hostname part of the url

Then we found we were using IP address to access this web service, which is not matched to the domain name used to create the SSL certificates as well.  After that we can access it successfully.

If this is a dev environment you can try disabling hostname verification in Server --> SSL --> Advanced. In production it is recommended to always turn on hostname verification.

Friday, September 2, 2011

Testing web service on SSL in JDeveloper

If you are going to test a web service on SSL in JDeveloper by creating web service proxy, you might get an error saying that no WSDL document found at this location when creating the web service proxy:





There are two approaches to solve this problem:


(1) Access that web service WSDL on SSL in browser, and then save it to local disk.

In the step 3 of creating web service proxy above, click Browse... to pick up that local WSDL file saved.

Then it will be able to go to next step to generate the proxy for this web service.


(2) Using Non-SSL web service WSDL in step 3 above as WSDL Document URL, and then in the proxy wizard, giving the endpoint as the https port.

This will let you create the proxy and you will be hitting the ssl port only in your client call.