At first log in the server where oracle is installed using administrative account of the OS. Then set the ORACLE_SID user variable to the name of database service. So, if your database service name is orcl, then set the variable ORACLE_SID to value orcl. Then -
Log in sqlplus from command prompt of the server using the following command-
sqlplus "/as sysdba"
now you are connected.
Then you can change sys password by the following command-
alter user sys identified by *******;
Thus your password is reset. Now you can connect by any client s/w of oracle.
Saturday, September 12, 2009
Sunday, August 30, 2009
protocol configuration of .asmx webservice
The default protocol configuration of .asmx webservice is -
<webServices>
<protocols>
<clear />
<add name="HttpSoap12" />
<add name="HttpSoap" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />
</protocols>
</webServices>
So it supports data & payload in soap envelope and documentation for all; but supports post only for localhost. Thus if we want to test a webservice using post method, we can test it only from localhost.
If we want to allow to invoke the webservice via get & post method we have to add the following under the system.web node -
<webServices>
<protocols>
<clear />
<add name="HttpSoap12" />
<add name="HttpSoap" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
Suppose you want to invoke a webmethod(MethodName which takes a parameter param) of a webservice(SomeService.asmx) using get method, then you need to hit the following url-
http://localhost/WebXmlHttpDemo/SomeService.asmx/MethodName?param=value
<webServices>
<protocols>
<clear />
<add name="HttpSoap12" />
<add name="HttpSoap" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />
</protocols>
</webServices>
So it supports data & payload in soap envelope and documentation for all; but supports post only for localhost. Thus if we want to test a webservice using post method, we can test it only from localhost.
If we want to allow to invoke the webservice via get & post method we have to add the following under the system.web node -
<webServices>
<protocols>
<clear />
<add name="HttpSoap12" />
<add name="HttpSoap" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
Suppose you want to invoke a webmethod(MethodName which takes a parameter param) of a webservice(SomeService.asmx) using get method, then you need to hit the following url-
http://localhost/WebXmlHttpDemo/SomeService.asmx/MethodName?param=value
Wednesday, July 15, 2009
batch update on a table from another table
CREATE TABLE A
(
NAME VARCHAR2(20 BYTE),
AGE INTEGER
)
CREATE TABLE B
(
NAME VARCHAR2(20 BYTE),
AGE INTEGER
)
Suppose we need to update the age of table B with the age of table A.
For oracle the command will be -
UPDATE tmp_B b
SET age = (SELECT a.age FROM tmp_A a WHERE a.name = b.name)
where b.name in (select a.name from tmp_A a);
Oracle also support n-ordered tuple. So if you want to update all row in a single run, the following command is also valid -
UPDATE tmp_B b
SET (age,name) = (SELECT a.age, a.name FROM tmp_A a WHERE a.name = b.name);
For MS Sql Server the command will be-
update tmp_B
set tmp_B.age=tmp_A.age
from tmp_A,tmp_B where tmp_A.name=tmp_B.name;
(
NAME VARCHAR2(20 BYTE),
AGE INTEGER
)
CREATE TABLE B
(
NAME VARCHAR2(20 BYTE),
AGE INTEGER
)
Suppose we need to update the age of table B with the age of table A.
For oracle the command will be -
UPDATE tmp_B b
SET age = (SELECT a.age FROM tmp_A a WHERE a.name = b.name)
where b.name in (select a.name from tmp_A a);
Oracle also support n-ordered tuple. So if you want to update all row in a single run, the following command is also valid -
UPDATE tmp_B b
SET (age,name) = (SELECT a.age, a.name FROM tmp_A a WHERE a.name = b.name);
For MS Sql Server the command will be-
update tmp_B
set tmp_B.age=tmp_A.age
from tmp_A,tmp_B where tmp_A.name=tmp_B.name;
Friday, July 3, 2009
Tuesday, June 30, 2009
Consume webservice From JavaScript
1. Add an asp:ScriptManager in form of the aspx page.
2. Add the service that you want to access in the script manager tag.
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/ZipCodeService.asmx" />
</Services>
</asp:ScriptManager>
here ZipCodeService.asmx is the path of the web service. In this case the web service resides in the same project. If this does not reside in the same project then add web reference.
3. Ensure that the web service added can be invoked from script. In case of .net, this is ensured by adding the following attribute to the class of the web service.
In ZipCodeService, this is ensured by -
[System.Web.Script.Services.ScriptService]
public class ZipCodeService : System.Web.Services.WebService
{
. . .
}
4. Now this web service is eligible to call from JavaScript. So call the webmethod of web service with full namespace name.
For detail please visit here
2. Add the service that you want to access in the script manager tag.
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/ZipCodeService.asmx" />
</Services>
</asp:ScriptManager>
here ZipCodeService.asmx is the path of the web service. In this case the web service resides in the same project. If this does not reside in the same project then add web reference.
3. Ensure that the web service added can be invoked from script. In case of .net, this is ensured by adding the following attribute to the class of the web service.
In ZipCodeService, this is ensured by -
[System.Web.Script.Services.ScriptService]
public class ZipCodeService : System.Web.Services.WebService
{
. . .
}
4. Now this web service is eligible to call from JavaScript. So call the webmethod of web service with full namespace name.
For detail please visit here
Thursday, May 21, 2009
Sunday, February 8, 2009
Add extension to IIS to serve .sadique extension file
A very good & detail article for this will be found at here.
It describes how to http handlers & modules work.
For busy readers here is the summary of how we have to configure our application to handle .sadique extension file-
1) Create a new C# Class Library project in Visual Studio.NET and name it "MyHandler". Add NewHandler.cs class to this project which implements IHttpHandler by implementing method- public void ProcessRequest(System.Web.HttpContext context).
2) Register this handler by adding httphandlers in the web.config file:
<httpHandlers>
<add verb="*" path="*.sadique" type="MyHandler.NewHandler,MyHandler">
</add>
</httphandlers>
3) Launch the Internet Services Manager tool, right click on Web Site, select Properties, go to Home Directory tab and press Configuration button. This will popup Application Configuration dialog. Click Add button and fill the Executable field with the path to the aspnet_isapi.dll file and fill .sadique in the Extension field.
It describes how to http handlers & modules work.
For busy readers here is the summary of how we have to configure our application to handle .sadique extension file-
1) Create a new C# Class Library project in Visual Studio.NET and name it "MyHandler". Add NewHandler.cs class to this project which implements IHttpHandler by implementing method- public void ProcessRequest(System.Web.HttpContext context).
2) Register this handler by adding httphandlers in the web.config file:
<httpHandlers>
<add verb="*" path="*.sadique" type="MyHandler.NewHandler,MyHandler">
</add>
</httphandlers>
3) Launch the Internet Services Manager tool, right click on Web Site, select Properties, go to Home Directory tab and press Configuration button. This will popup Application Configuration dialog. Click Add button and fill the Executable field with the path to the aspnet_isapi.dll file and fill .sadique in the Extension field.
Subscribe to:
Posts (Atom)
