Friday, 19 July 2013

LaserJet 1010 Windows 7 X64 Drivers solution

I had problems with LJ 1010 on Windows 7 x64, none of the drivers found on the internet worked.

Solution:

  1. Go to "Install new printer"
  2. In Windows control center then choose "Local printer"
  3. Then "DOT4_001 (Generic IEEE....)"
  4. Then choose "HP Jaserjet 3055 PCL5"



solution drawbacks:
The only thing I still miss is ability to print booklets. It prints only on one side and where native 1010 drivers for XP did pause before printing on the other side of paper it just stops printing... But at least I can change print options and print several pages per sheet.

Back again to my old printer. . .

Wednesday, 10 July 2013

JDeveloper Crashing


while restoring the JDeveloper to work the IDE hung giving this screen

The solution is to:
  1. End JDeveloper process
  2. Rename the system folder
  3. Re-Run JDeveloper and wait until new system folder creation done successfully
  4. Navigate to this Folder 
  5. o.ide
  6. Replace this file with the newly created one
  7. runStatus.xml
  8. Delete newly created system folder and rename the old one with its original name
  9. Run the JDeveloper
  10. Enjoy your configured IDE

Tuesday, 25 June 2013

Naming and Coding Conventions for SQL and PL/SQL

I have had a look through the document and it is mainly concerned with making code neat and maintainable and NOT with writing efficient code. Although the content is commendable and well intended, I have never actually encountered a site where such an approach succeeds in practice.




Why have standards?



Reference :
  • a discussion on the OTN forums

Monday, 17 June 2013

ORACLE - UNIQUE Constraints and NULL Values

In Oracle UNIQUE constraint allows more than one NULL values to be inserted. ORACLE considers one NULL value is not equal to another NULL value. Consider the following example.
CREATE TABLE test1 (
col1 VARCHAR2(2),
col2 VARCHAR2(2)
);
Table created
ALTER TABLE test1
ADD CONSTRAINT test_unique UNIQUE (col1);
Table altered
INSERT INTO test1 VALUES ('a', 'a');
1 row inserted 
INSERT INTO test1 VALUES ('a', 'a');
ORA-00001: unique constraint (TEST_UNIQUE) violated
INSERT INTO test1 VALUES (NULL, 'a');
1 row inserted 
INSERT INTO test1 VALUES (NULL, 'a');
1 row inserted
Now we will test the UNIQUE constraint with two columns (composite UNIQUE constraint).
ALTER TABLE test1
DROP CONSTRAINT test_unique;

TRUNCATE TABLE table1;

ALTER TABLE test1
ADD CONSTRAINT unique2 UNIQUE (col1,col2);
Insert null values to both columns.
INSERT INTO test1 VALUES (NULL, NULL);
1 row inserted 
INSERT INTO test1 VALUES (NULL, NULL);
1 row inserted
But the results changes when we have only one NULL value for this composite UNIQUE constraint.
INSERT INTO test1 VALUES (NULL, 'a');
1 row inserted
INSERT INTO test1 VALUES (NULL, 'a');
ORA-00001: unique constraint (UNIQUE2) violated
When we create a UNIQUE constraint, ORACLE creates a UNIQUE INDEX for this constraint. The NULL values are not included in the INDEX so ORACLE allows inserting many number of (NULL, NULL) value pairs to this table.

Monday, 3 June 2013

Error: ORA-01033 ORACLE initialization or shutdown in progress


First, You will have to wait until the database was shutdown or start-up properly.
Second, If not successes, I will be assuming that some how a data file was corrupted so try this steps:

SQL> shutdown abort
then
SQL> startup nomount
SQL> alter database mount;
SQL> alter database open;
If there will be some errors let me know...

Sunday, 2 June 2013

kill specific connection on Oracle Database

Once we figure out who is on the system, we will probably want to know what they are doing. In this case, we will join the v$session view we just queried with another view, the V$SQL view. This alter statement kill the selected session

ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' IMMEDIATE;
ALTER SYSTEM KILL SESSION '26,6764' IMMEDIATE;

How to list active / open connections in Oracle

There are times that you may need to issue a “SHUTDOWN IMMEDIATE” command to an Oracle Database. It is critical that you should consider checking who are the users that are currently running sessions on that Database. You don’t want to shutdown on your Boss or VP on Finance. Here’s a simple SQL to find all Active sessions in your Oracle Database:

select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,10) username,
b.server,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program
from v$session b, v$process a
where b.paddr = a.addr
and type='USER'
order by spid;