Tuesday, February 10, 2015

[SOLVED] /httpd.conf: ServerRoot must be a valid directory

ERROR

httpd.conf: ServerRoot must be a valid directory

REASON

Actual apache server installation path not set properly.

SOLUTION

  1. Open the file httpd.conf from the apache zip extracted path, say: c:\ranjith\softies\httpd-2.4.12-x86\Apache24
  2. Change the Define SRVROOT "/Apache24"
into
Define SRVROOT "c:/ranjith/softies/httpd-2.4.12-x86/Apache24"

How to install apache http server in windows 7

Below steps can help to install and run the apache http server in windows7.


Step 1

download the latest apache http server version @ http://httpd.apache.org/download.cgi


Step 2

  • unzip the file httpd-2.4.12-x86.zip (default path would be "c:/Apache24")  

  • if you want to extract into some other folder like "c:\ranjith\softies\"

  • Change this location in httpd.conf file also (Define SRVROOT "ranjith/softies/Apache24")


Step 3

Open the command prompt (run as administrator) and execute the below command:

cd c:/ranjith/softies/Apache24


Step 4

Install apache server by executing below command:

httpd -k install


Step 5

Start apache server using below command:

httpd -k start


how to set java classpath for windows

This post is a step by step guide to set JAVA Classpath & Path in Windows.

Step 1

Go to Control Panel

Step 2

Click User Accounts -> User Accounts

Step 3

Click 'Change my environment Variables'
   There are two types:
  1. User variable,
  2. System variables (should login as admin user).

Step 4

Click New to add a new environmental variable.

Step 5

Set java home
   Variable Name: JAVA_HOME
   Variable Value: c:\Program Files\Java\jdk1.7.0_60

Step 6

Set classpath
   Variable Name: CLASSPATH
   Variable Value:
       c:\Program Files\Java\jdk1.7.0_60\lib;
       (OR) %JAVA_HOME%\lib;

Step 7

Set path
   Variable Name: PATH
   Variable Value:
       c:\Program Files\Java\jdk1.7.0_60\bin;
       (OR) %JAVA_HOME%\bin;

Note

1. classpath should always point the 'lib' folder
2. path should always point 'bin' folder

Test

To make sure whether the java path & classpath are properly set, type 'javac' & 'java' in command prompt.

[SOLVED] ORA-28001: the password has expired

ISSUE

ORA-28001: the password has expired

REASON

This error may occur if the password the for user expired.

SOLUTION

1. Login as sysdba user
2. Enter the below SQL Command
ALTER USER username IDENTIFIED BY password;

Monday, February 2, 2015

[SOLVED] SQL Error: ORA-00997: illegal use of LONG datatype


ISSUE

SQL Error: ORA-00997: illegal use of LONG datatype

SOLUTION

Consider I have a table with values as below and need to copy the values to another table.
create table test (name varchar2(30), id long);

insert into test values('ranjith', 24);
insert into test values('sekar', 25);

I was facing this error when I was trying to copy data from one table to another like below.
create table test_temp as select * from test;

Got the error
SQL Error: ORA-00997: illegal use of LONG datatype
00997. 00000 -  "illegal use of LONG datatype"

Follow below steps to resolve this error.

STEP 1

Create another temp table with CLOB column as below.
create table test_temp (name varchar2(30), id clob);

STEP 2

Copy the values to temp table from actual table.
insert into test_temp select name, to_lob(id) from test;

STEP 3

Now, truncate the actual table since we have copied all the data into temp table safely. Please double check if required.
truncate table test;

STEP 4

Copy the values back to the actual table from temp table.
insert into test select * from test_temp;

STEP 5

Drop the temp table.
drop table test_temp;