News For Today

Loading...

Wednesday, November 04, 2009

view open cursor usage in Oracle

--count open cursors by username, SID
break on report
comp sum of curs on report
select user_name, SID, count(*) cursors from V$OPEN_CURSOR group by User_Name, SID order by User_Name, SID;

--displays information on cursor usage for the current session
select * from V$SESSION_CURSOR_CACHE;

--displays information on cursor usage for the system.
select * from V$SYSTEM_CURSOR_CACHE;

--displays open_cursors usage in details
select user_name,to_char(sysdate,'hh24:mi:ss') col1, sql_text from V$OPEN_CURSOR

Saturday, October 24, 2009

Linus Torvalds on Windows 7 ... nice

Sunday, October 11, 2009

Resolving Flashback Database Error: (ORA-38760: This database instance failed to turn on flashback database)

Resolving Flashback Database Error: (ORA-38760: This database instance failed to turn on flashback database)

Unable to allocate flashback log of 1634 blocks from
current recovery area of size 42949672960 bytes.
Recovery Writer (RVWR) is stuck until more space is
available in the recovery area.
Unable to write Flashback database log data because the
recovery area is full, presence of a guaranteed
restore point and no reusable flashback logs.
Use ALTER SYSTEM SET db_recovery_file_dest_size command
to add space. DO NOT manually remove flashback log files
to create space.


so I brought down the db (aborted it)

SQL:.:(.):.> startup mount;
ORACLE instance started.

Total System Global Area 1694498816 bytes
Fixed Size 2139448 bytes
Variable Size 673405640 bytes
Database Buffers 889192448 bytes
Redo Buffers 129761280 bytes
Database mounted.
SQL:.:(.):.> select estimated_flashback_size,flashback_size,oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log;

ESTIMATED_FLASHBACK_SIZE FLASHBACK_SIZE OLDEST_FLASHBACK_SCN OLDEST_FL
------------------------ -------------- -------------------- ---------
0 4.2926E+10 0

SQL:.:(.):.> SELECT NAME, SCN, TIME,
GUARANTEE_FLASHBACK_DATABASE
FROM V$RESTORE_POINT
WHERE GUARANTEE_FLASHBACK_DATABASE='YES'; 2 3 4

NAME SCN TIME GUA
------------------------------ ---------- --------------------------------------------------------------------------- ---
GRP_1 9.2118E+12 21-AUG-09 02.21.03.000000000 PM YES
GRP_2 9.2138E+12 26-AUG-09 08.29.42.000000000 AM YES

SQL:.:(.):.> SELECT OLDEST_FLASHBACK_SCN, OLDEST_FLASHBACK_TIME
FROM V$FLASHBACK_DATABASE_LOG;
2
OLDEST_FLASHBACK_SCN OLDEST_FL
-------------------- ---------
0


SQL:.:(.):.> flashback database to restore point GRP_2;

Flashback complete.

SQL:.:(.):.> select count(1) from v$datafile_header where fuzzy = 'YES';

COUNT(1)
----------
0

SQL:.:(.):.> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-38760: This database instance failed to turn on flashback database


in the log
---------------------------------------------------------------------------------------------------------------
Flashback Restore Complete
Flashback Media Recovery Start
parallel recovery started with 15 processes
Flashback Media Recovery Log /sbclocal/app/oracle/admin/TESTDB/arch/TESTDB_0001_0695484339_0000000024.arc
Fri Aug 28 10:13:39 2009
Incomplete Recovery applied until change 9213823318145
Flashback Media Recovery Complete
Completed: flashback database to restore point GRP_2
Fri Aug 28 10:24:07 2009
alter database open resetlogs
Fri Aug 28 10:25:21 2009
RESETLOGS after incomplete recovery UNTIL CHANGE 9213823318145
Resetting resetlogs activation ID 4173768512 (0xf8c6a740)
Fri Aug 28 10:27:56 2009
Setting recovery target incarnation to 3
Fri Aug 28 10:27:56 2009
ORA-38760 signalled during: alter database open resetlogs...
Fri Aug 28 10:52:29 2009
---------------------------------------------------------------------------------------------------------------



SQL:oradbhost:(TESTDB):PRIMARY> drop restore point GRP_1;

Restore point dropped.


SQL:oradbhost:(TESTDB):PRIMARY> select status from v$instance;

STATUS
------------
MOUNTED

SQL:oradbhost:(TESTDB):PRIMARY> select count(1) from v$datafile_header where fuzzy = 'YES'l
2 .
SQL:oradbhost:(TESTDB):PRIMARY> select count(1) from v$datafile_header where fuzzy = 'YES';

COUNT(1)
----------
0


SQL:oradbhost:(TESTDB):PRIMARY> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL:oradbhost:(TESTDB):PRIMARY> flashback database to restore point GRP_2;
flashback database to restore point GRP_2
*
ERROR at line 1:
ORA-38729: Not enough flashback database log data to do FLASHBACK.


SQL:oradbhost:(TESTDB):PRIMARY> recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-38760: This database instance failed to turn on flashback database


SQL:oradbhost:(TESTDB):PRIMARY> alter system set db_recovery_file_dest_size=50G;

System altered.

SQL:oradbhost:(TESTDB):PRIMARY> flashback database to restore point GRP_2;
flashback database to restore point GRP_2
*
ERROR at line 1:
ORA-38729: Not enough flashback database log data to do FLASHBACK.


SQL:oradbhost:(TESTDB):PRIMARY> recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-38760: This database instance failed to turn on flashback database


-things to do if you got these scenario-
1) turn off the flashback database
2) drop the GRP
3) open the database normally(no resetlogs)
4) create a new GRP from that point

Sunday, September 20, 2009

Check log sequece required for recovery in Oracle

select sequence# from V$log_history where 9151813979322 between first_change# and next_change#

Open cursor usage in Oracle

select a.value, s.username, s.sid, s.serial#
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid
and b.name = 'opened cursors current';

select max(a.value) as highest_open_cur, p.value as max_open_cur
from v$sesstat a, v$statname b, v$parameter p
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
and p.name= 'open_cursors'
group by p.value;

check Undo users and uncommited transactions in Oracle

set lines 300
set pages 30000
SELECT a.sid, a.username, b.xidusn, b.used_urec Num_of_records, b.used_ublk USED_BLOCKS,(b.used_ublk * ( select value from v$parameter where name = 'db_block_size'))/1024/1024 MB_USED
FROM v$session a, v$transaction b
WHERE a.saddr = b.ses_addr;


select
(select sum(bytes/1024/1024)
from dba_data_files
where tablespace_name = (select upper(value)
from V$parameter where name = 'undo_tablespace')) TOTAL_UNDO_SIZE_MB,
nvl((SELECT sum(b.used_ublk * ( select value from v$parameter where name = 'db_block_size')/1024/1024)
FROM v$session a, v$transaction b WHERE a.saddr = b.ses_addr),0) TOTAL_UNDO_USED_MB,
(select sum(bytes/1024/1024)
from dba_data_files
where tablespace_name = (select upper(value)
from V$parameter where name = 'undo_tablespace')) - nvl((SELECT sum(b.used_ublk * ( select value from v$parameter where name = 'db_block_size')/1024/1024)
FROM v$session a, v$transaction b WHERE a.saddr = b.ses_addr),0) FREE_MB_UNDO
from dual;


--#uncommited transactions

col osuser for a10
col username for a10
set lines 300
set pages 300
col sql_text for a60


select V$SESSION.OSUSER,spid,V$SESSION.status,
V$SESSION.USERNAME,V$SESSION.SID,
V$SESSION.SERIAL#,
V$SESSION.PROGRAM,
V$SESSION.MACHINE,
v$transaction.start_time,
to_number(sysdate-to_date(v$transaction.start_time,'MM/DD/YY HH24:MI:SS'))*24*60 run_time
from
V$SESSION , v$transaction,V$process
WHERE v$transaction.ses_addr = V$SESSION.saddr and V$process.addr = V$SESSION.paddr;


select OSUSER,V$SESSION.status,
USERNAME,SID,
SERIAL#,
SQL_TEXT,
v$transaction.start_time,
to_number(sysdate-to_date(v$transaction.start_time,'MM/DD/YY HH24:MI:SS'))*24*60 run_time
from v$transaction ,
V$SESSION ,
V$SQLAREA
WHERE( (V$SESSION.SQL_ADDRESS = V$SQLAREA.ADDRESS and V$SESSION.sql_hash_value = V$SQLAREA.HASH_VALUE )
OR ( V$SESSION.PREV_SQL_ADDR = V$SQLAREA.ADDRESS and V$SESSION.PREV_hash_value = V$SQLAREA.HASH_VALUE ))
and v$transaction.ses_addr = V$SESSION.saddr;

Temporary tablespace usage in Oracle

--
set lines 200
col sid_serial for a15
col osuser for a10
col module for a20
col program for a30
col tablespace for a10
-- Listing of temp segments.
--
SELECT A.tablespace_name tablespace, D.mb_total,
SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM v$sort_segment A,
(
SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
FROM v$tablespace B, v$tempfile C
WHERE B.ts#= C.ts#
GROUP BY B.name, C.block_size
) D
WHERE A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;

--
-- Temp segment usage per session.
--
SELECT S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,
P.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
COUNT(*) statements
FROM v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P
WHERE T.session_addr = S.saddr
AND S.paddr = P.addr
AND T.tablespace = TBS.tablespace_name
GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,
P.program, TBS.block_size, T.tablespace
ORDER BY sid_serial;

--
-- Temp segment usage per statement.
--
SELECT S.sid || ',' || S.serial# sid_serial, S.username, Q.hash_value, Q.sql_text,
T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace
FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS
WHERE T.session_addr = S.saddr
AND T.sqladdr = Q.address
AND T.tablespace = TBS.tablespace_name
ORDER BY S.sid;

Calculate Optimal Undo in Oracle

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
ROUND((d.undo_size / (to_number(f.value) *
g.undo_block_per_sec))) "OPTIMAL UNDO RETENTION [Sec]"
FROM (
SELECT SUM(a.bytes) undo_size
FROM v$datafile a,
v$tablespace b,
dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND b.name = c.tablespace_name
AND a.ts# = b.ts#
) d,
v$parameter e,
v$parameter f,
(
SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
undo_block_per_sec
FROM v$undostat
) g
WHERE e.name = 'undo_retention'
AND f.name = 'db_block_size'
/



SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
(TO_NUMBER(e.value) * TO_NUMBER(f.value) *
g.undo_block_per_sec) / (1024*1024)
"NEEDED UNDO SIZE [MByte]"
FROM (
SELECT SUM(a.bytes) undo_size
FROM v$datafile a,
v$tablespace b,
dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND b.name = c.tablespace_name
AND a.ts# = b.ts#
) d,
v$parameter e,
v$parameter f,
(
SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
undo_block_per_sec
FROM v$undostat
) g
WHERE e.name = 'undo_retention'
AND f.name = 'db_block_size'
/

checking long operations in Oracle RAC

#longopsrac.sql#
#--------------#
SELECT s.sid,
s.serial#,
s.machine,
TRUNC(sl.elapsed_seconds/60) || ':' || MOD(sl.elapsed_seconds,60) elapsed,
TRUNC(sl.time_remaining/60) || ':' || MOD(sl.time_remaining,60) remaining,
ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct
FROM gv$session s,
gv$session_longops sl
WHERE s.sid = sl.sid
AND s.serial# = sl.serial#
AND s.inst_id = sl.inst_id
AND sl.sofar < sl.totalwork
;

View RMAN jobs in Oracle

set lines 150 pages 30000
col ins format a10
col outs format a10
col TIME_TAKEN_DISPLAY format a10
select SESSION_KEY,
OPTIMIZED,
COMPRESSION_RATIO,input_type,
INPUT_BYTES_PER_SEC_DISPLAY ins,
OUTPUT_BYTES_PER_SEC_DISPLAY outs,
TIME_TAKEN_DISPLAY,to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,elapsed_seconds/3600 hrs
,status
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;

select output
from v$rman_output
where session_key = &session_key
order by recid;

@longopsrac

Views on Flashback Area Usage in Oracle

alter session set nls_date_format='DD-MON-YYYY HH24:MI:ss';
col OLDEST_FLASHBACK_SCN for 999999999999999
col name for a80
set lines 140 pages 3000

select name,SPACE_LIMIT/1024/1024 limit_mb,SPACE_USED/1024/1024 used_mb,round((SPACE_USED/SPACE_LIMIT)*100,2) percent_usage from V$RECOVERY_FILE_DEST;

select * from V$FLASH_RECOVERY_AREA_USAGE;

select estimated_flashback_size,flashback_size,oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log;

SELECT * FROM gv$flashback_database_stat;

set heading off

select '---------------' from dual;
select 'Flashback usage' from dual;
select '---------------' from dual;

set heading on


@/home/casenaem/flash_back_free.sql

set heading off

select '---------------' from dual;
select 'Restore Points' from dual;
select '---------------' from dual;

set heading on

select * from V$RESTORE_POINT;

check Library Cache Lock in Oracle

select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
11, 'PACKAGE BODY', 12, 'TRIGGER',
13, 'TYPE', 14, 'TYPE BODY',
19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
32, 'INDEXTYPE', 33, 'OPERATOR',
34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
42, 'MATERIALIZED VIEW',
43, 'DIMENSION',
44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
48, 'CONSUMER GROUP',
51, 'SUBSCRIPTION', 52, 'LOCATION',
55, 'XML SCHEMA', 56, 'JAVA DATA',
57, 'SECURITY PROFILE', 59, 'RULE',
62, 'EVALUATION CONTEXT',
'UNDEFINED') object_type,
lob.KGLNAOBJ object_name,
pn.KGLPNMOD lock_mode_held,
pn.KGLPNREQ lock_mode_requested,
ses.sid,
ses.serial#,
ses.username
FROM
x$kglpn pn,
v$session ses,
x$kglob lob,
v$session_wait vsw
WHERE
pn.KGLPNUSE = ses.saddr and
pn.KGLPNHDL = lob.KGLHDADR
and lob.kglhdadr = vsw.p1raw
and vsw.event = 'library cache pin'
order by lock_mode_held desc
/

Backup passwords of users in a database

select 'alter user ' || username || ' identified by values ''' || password ||''';' from dba_users order by username;

Check Session Details in Oracle

set pages 49999
set lines 300
col PID for a7
col SID for 9999999999
col ser# for a7
col box for a29
col status for a9
col username for a20
col os_user for a12
col program for a25
col LOGON_TIME for a14
col module for a14
col machine for a10
select b.status as status,sql_hash_value,prev_hash_value,module,machine,
to_char(a.spid) as pid, to_char(b.sid) as sid, to_char(b.serial#) as "ser#", substr(b.machine,1,25) as box, b.username as username,
b.osuser as os_user, b.program program, to_char(b.LOGON_TIME,'dd-mon hh24:mi') LOGON_TIME from v$session b, v$process a where
b.paddr = a.addr
and type='USER'
and b.sid in (&session_id)
order by 3;

SET LINESIZE 500
SET PAGESIZE 1000
SET VERIFY OFF
col SQL_TEXT for a100

SELECT b.sid,a.sql_text
FROM v$sqltext_with_newlines a,
v$session b
WHERE a.address = b.sql_address
AND a.hash_value = b.sql_hash_value
AND b.sid in (&session_id)
ORDER BY b.sid,a.piece;

PROMPT
SET PAGESIZE 14

Waiting sessions in Oracle database

col wait_status for a30
col event for a40
set lines 170 pages 3000
SELECT sid, serial#, spid, username, event, wait_status, wait_time_milli
FROM(
SELECT s.inst_id AS inst_id,
s.indx AS sid,
se.ksuseser AS serial#,
-- spid from v$process
p.ksuprpid AS spid,
-- columns from v$session
se.ksuudlna AS username,
decode(bitand(se.ksuseidl,11),1,'ACTIVE',0,
decode(bitand(se.ksuseflg,4096),0,'INACTIVE','CACHED'),2,'SNIPED',3,
'SNIPED', 'KILLED') AS status,
decode(ksspatyp,1,'DEDICATED',2,'SHARED',3,'PSEUDO','NONE') AS server,
se.ksuseunm AS osuser,
se.ksusepid AS process,
se.ksusemnm AS machine,
se.ksusetid AS terminal,
se.ksusepnm AS program,
decode(bitand(se.ksuseflg,19),17,'BACKGROUND',1,'USER',2,'RECURSIVE','?') AS type,
se.ksusesqh AS sql_hash_value,
se.ksusepha AS prev_hash_value,
se.ksuseapp AS module,
se.ksuseact AS action,
se.ksuseclid AS client_identifier,
se.ksuseobj AS row_wait_obj#,
se.ksusefil AS row_wait_file#,
se.ksuseblk AS row_wait_block#,
se.ksuseslt AS row_wait_row#,
se.ksuseltm AS logon_time,
se.ksusegrp AS resource_consumer_group,
s.ksussseq AS seq#,
e.kslednam AS event,
e.ksledp1 AS p1text,
s.ksussp1 AS p1,
s.ksussp1r AS p1raw,
e.ksledp2 AS p2text,
s.ksussp2 AS p2,
s.ksussp2r AS p2raw,
e.ksledp3 AS p3text,
s.ksussp3 AS p3,
s.ksussp3r AS p3raw,
decode(s.ksusstim,
-2, 'WAITED UNKNOWN TIME',
-1,'LAST WAIT < 1 microsecond', -- originally WAITED SHORT TIME
0,'CURRENTLY WAITING SINCE '|| s.ksusewtm || 's',
'LAST WAIT ' || s.ksusstim/1000 || ' ms (' ||
s.ksusewtm || 's ago)') wait_status,
to_number(decode(s.ksusstim,0,NULL,-1,NULL,-2,NULL, s.ksusstim/1000))
AS wait_time_milli
from x$ksusecst s, x$ksled e , x$ksuse se, x$ksupr p
where bitand(s.ksspaflg,1)!=0
and bitand(s.ksuseflg,1)!=0
and s.ksussseq!=0
and s.ksussopc=e.indx
and s.indx=se.indx
and se.ksusepro=p.addr
and e.kslednam != 'SQL*Net message from client'
and e.kslednam != 'Streams AQ: waiting for messages in the queue'
and e.kslednam != 'rdbms ipc message'
and e.kslednam != 'Streams AQ: waiting for time management or cleanup tasks'
and e.kslednam != 'Streams AQ: qmn coordinator idle wait'
);

Saturday, September 12, 2009

Response Time Analysis Made Easy in Oracle Database 10g

Historically, in trying to achieve maximum database performance, Oracle DBAs and performance analysts have fought an uphill battle to obtain solid response time metrics for system as well as user session activity. The problem facing DBAs has always had two facets: first, determining exactly "where" the database or user sessions have been spending their time; and second, determining the objective nature of the user experience.



Response Time Analysis Made Easy in Oracle Database 10g

Shared via AddThis

Sunday, August 23, 2009

GMANews.TV - Hello, Palace? OPS attention called over P5-M phone bill - Nation - Official Website of GMA News and Public Affairs - Latest Philippine News

GMANews.TV - Hello, Palace? OPS attention called over P5-M phone bill - Nation - Official Website of GMA News and Public Affairs - Latest Philippine News

Kung titingnan daw talaga natin, yung P5 million na cellular phone bill over a period of one year for an information and communications office like the OPS is not really big. Yung mga long distance calls…mga interviews, it really racked up costs," said Remonde in a recent interview with reporters.

Shared via AddThis

Sunday, August 09, 2009

Unix/Linux script to check Oracle standby database

#!/bin/ksh
#Author: Emmanuel Caseñas
#Note: this will give you a wealth of information for your standby database
################################################################################

$ORACLE_HOME/bin/sqlplus -s '/ as sysdba'<set lines 200 pages 2000
select * from v\$archive_gap;
select maX(sequence#),applied,registrar from V\$archived_log group by applied,registrar;
select PROCESS,PID,SEQUENCE#,BLOCK#,BLOCKS,STATUS from v\$managed_standby;
select NAME,DATABASE_ROLE,PROTECTION_MODE,PROTECTION_LEVEL,SWITCHOVER_STATUS from V\$database;
SELECT le.leseq "Current log sequence No",
100*cp.cpodr_bno/le.lesiz "Percent Full",
cp.cpodr_bno "Current Block No",
le.lesiz "Size of Log in Blocks"
FROM x\$kcccp cp, x\$kccle le
WHERE le.leseq =CP.cpodr_seq
AND bitand(le.leflg,24) = 8;
archive log list
exit
!
bd=`echo ${CLUSTER_HOME}/admin/${SID}/bdump`
ll=`grep "^Media Recovery Log" $bd/al*.log | tail -1 |awk -F"/" '{print $NF}'`
lw=`grep "^Media Recovery Waiting for" $bd/al*.log | tail -1 | awk '{print $NF}'`
echo "Latest Log Applied: $ll"
echo "Waiting for Log: $lw"

Check tablespace ts_details.sql

set lines 300
col "Data File" for a75
variable ts_name varchar2(100);
exec :ts_name := '&&tablespace_name';
SELECT /* + RULE */ df.tablespace_name "Tablespace",
df.bytes / (1024 * 1024) "Size (Mb)",max(fs.bytes) / (1024 * 1024) "Max Chunk Avail",
SUM(fs.bytes) / (1024 * 1024) "Free (Mb)",
Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used",autoextensible
FROM dba_free_space fs,
(SELECT tablespace_name,SUM(bytes) bytes,autoextensible
FROM dba_data_files
GROUP BY tablespace_name,autoextensible) df
WHERE fs.tablespace_name (+) = df.tablespace_name
and df.tablespace_name = :ts_name
GROUP BY df.tablespace_name,df.bytes,autoextensible;
select file_name "Data File",bytes/1024/1024 "Size",status from dba_data_files where tablespace_name = :ts_name;
set pages 3000
spool /tmp/tmp.sql
set heading off
set term off
select '!ls -lrt ' || file_name ||'|'|| 'awk ''{print $9,$10,$11}''' from dba_data_files where tablespace_name = :ts_name;
spool off
set heading on
set term on
@/tmp/tmp.sql

Adding a datafile after the flashback database is on

1)enable flashback database in your database

*assuming you database is no in archivelog mode else skip this task*

ENABLE ARCHIVELOG MODE
----------------------
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 671088640 bytes
Fixed Size 2043008 bytes
Variable Size 356520832 bytes
Database Buffers 310378496 bytes
Redo Buffers 2146304 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

CREATE A DIRECTORY FOR FLASHBACK AREA
-------------------------------------
UNIX> mkdir -p /sbcdump/01/oradumps/EMINUS/flashback_area


CONFIGURE FLASHBACK
-------------------

SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320 scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest='/sbcdump/01/oradumps/EMINUS/flashback_area' scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest_size=10g scope=both;

System altered.

SQL> shutdown immediate;


TURN FLASHBACK DATABASE ON
--------------------------

SQL> alter database mount;

Database altered.

SQL> alter database flashback on;

Database altered.

SQL> alter database open;

Database altered.


ADD DATAFILE
------------

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> set numwidth 30

alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';

SQL> SELECT OLDEST_FLASHBACK_SCN, OLDEST_FLASHBACK_TIME
FROM V$FLASHBACK_DATABASE_LOG;

OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TIM
------------------------------ --------------------
9205819379813 09-aug-2009 16:59:32


SQL> @/home/casenaem/ts_details -- this is my script to check on a tablespace
Enter value for tablespace_name: USERS

PL/SQL procedure successfully completed.


Tablespace Size (Mb) Max Chunk Avail Free (Mb) % Free % Used AUT
------------------------------ ---------- --------------- ---------- ---------- ---------- ---
USERS 500 499.6875 499.6875 100 0 NO


Data File Size STATUS
--------------------------------------------------------------------------- ---------- ---------
/sbcdata/04/oradata/EMINUS/EMINUS_users_01.dbf 500 AVAILABLE




SQL> alter tablespace users
2 add datafile '/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf' size 10m;

Tablespace altered.

SQL> @/home/casenaem/ts_details

PL/SQL procedure successfully completed.


Tablespace Size (Mb) Max Chunk Avail Free (Mb) % Free % Used AUT
------------------------------ ---------- --------------- ---------- ---------- ---------- ---
USERS 510 499.6875 509.375 100 0 NO


Data File Size STATUS
--------------------------------------------------------------------------- ---------- ---------
/sbcdata/04/oradata/EMINUS/EMINUS_users_01.dbf 500 AVAILABLE
/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf 10 AVAILABLE



SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> /

System altered.

SQL> SELECT CURRENT_SCN FROM V$DATABASE;

CURRENT_SCN
------------------------------
9205819381790

SQL> SELECT OLDEST_FLASHBACK_SCN, OLDEST_FLASHBACK_TIME
FROM V$FLASHBACK_DATABASE_LOG;
2
OLDEST_FLASHBACK_SCN OLDEST_FL
------------------------------ ---------
9205819379813 09-AUG-09



FLASHBACK THE DATABASE TO THE OLDEST_FLASHBACK_SCN
--------------------------------------------------


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 671088640 bytes
Fixed Size 2043008 bytes
Variable Size 356520832 bytes
Database Buffers 310378496 bytes
Redo Buffers 2146304 bytes
Database mounted.
SQL> FLASHBACK DATABASE TO SCN 9205819379813;

Flashback complete.

SQL> alter database open read only;

Database altered.

SQL> @/home/casenaem/ts_details

PL/SQL procedure successfully completed.


Tablespace Size (Mb) Max Chunk Avail Free (Mb) % Free % Used AUT
------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ---
USERS 500 499.6875 499.6875 100 0 NO


Data File Size STATUS
--------------------------------------------------------------------------- ------------------------------ ---------
/sbcdata/04/oradata/EMINUS/EMINUS_users_01.dbf 500 AVAILABLE


Note:
As you can see that oracle will delete the file from dictionary,controlfile and the physical file



*Now if you want to recover the database before you executed flashback database*


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 671088640 bytes
Fixed Size 2043008 bytes
Variable Size 356520832 bytes
Database Buffers 310378496 bytes
Redo Buffers 2146304 bytes
Database mounted.
SQL> recover database;
ORA-00279: change 9205819379814 generated at 08/09/2009 16:40:19 needed for thread 1
ORA-00289: suggestion : /sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000017_0694319678.arc
ORA-00280: change 9205819379814 for thread 1 is in sequence #17


Specify log: {=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00279: change 9205819380249 generated at 08/09/2009 17:09:55 needed for thread 1
ORA-00289: suggestion : /sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000018_0694319678.arc
ORA-00280: change 9205819380249 for thread 1 is in sequence #18
ORA-00278: log file '/sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000017_0694319678.arc' no longer needed for this recovery

.......
........
..........

ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 6: '/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf'


ORA-01112: media recovery not started


SQL> select count(1) from v$datafile_header where fuzzy = 'YES';

COUNT(1)
------------------------------
5

SQL> select name from v$datafile;

NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/sbcdata/03/oradata/EMINUS/EMINUS_system_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_undo1_01.dbf
/sbcdata/01/oradata/EMINUS/EMINUS_sysaux_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_tools_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_users_01.dbf
/sbclocal/app/oracle/product/10.2.0.4/dbs/UNNAMED00006

6 rows selected.

SQL> !ls -l /sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf: No such file or directory

SQL> !ls -l /sbclocal/app/oracle/product/10.2.0.4/dbs/UNNAMED00006
/sbclocal/app/oracle/product/10.2.0.4/dbs/UNNAMED00006: No such file or directory



SQL> alter database create datafile '/sbclocal/app/oracle/product/10.2.0.4/dbs/UNNAMED00006' as '/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf' size 10M;

Database altered.

SQL> select name from v$datafile;

NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/sbcdata/03/oradata/EMINUS/EMINUS_system_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_undo1_01.dbf
/sbcdata/01/oradata/EMINUS/EMINUS_sysaux_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_tools_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_users_01.dbf
/sbcdata/04/oradata/EMINUS/EMINUS_users_02.dbf

6 rows selected.

SQL> recover database;
ORA-00279: change 9205819381724 generated at 08/09/2009 17:41:53 needed for thread 1
ORA-00289: suggestion : /sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000022_0694319678.arc
ORA-00280: change 9205819381724 for thread 1 is in sequence #22


Specify log: {=suggested | filename | AUTO | CANCEL}
aUTO
ORA-00279: change 9205819381766 generated at 08/09/2009 17:42:51 needed for thread 1
ORA-00289: suggestion : /sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000023_0694319678.arc
ORA-00280: change 9205819381766 for thread 1 is in sequence #23
ORA-00278: log file '/sbclocal/app/oracle/admin/EMINUS/arch/EMINUS_0001_0000000022_0694319678.arc' no longer needed for this recovery

....
......
.......

Log applied.
Media recovery complete.
SQL> alter database open;

Database altered.


Note: Since Oracle has removed the physical file when I did a flashback you need to create it yourself in order for the recovery to conitnue

Wednesday, July 15, 2009

Meralco planning internet over power lines in the Philippines

While the concept of channeling the internet over power lines is far from new, it has yet to be implemented in any significant manner. If a top power distributor in the Philippines has its druthers, however, all that will change in the not-too-distant future. Manila Electric Company, better known as Meralco, is gearing up to use its power lines to bring broadband internet to more of the country, which currently sees just 20 million out of its 90 million inhabitants with access. In fact, the company has already made clear that it is "set to implement the pilot test," with the results guiding it in "determining scope and coverage of the project." Come to think of it, we've got a few dollars to spend on a rural broadband initiative here in the States. Hmm...

read more

Monday, July 13, 2009

Microsoft VP on Chrome OS: “Most of What Google Does Is Defensive"

Microsoft's Vice President of Developer and Platform Evangelism, Walid Abu-Hadba, explained in an interview what he thinks Google's real motivation for creating the Chrome OS might be, and according to him, it's not out of love for the consumer.

click me for more of this issue

Monday, April 27, 2009

Microsoft Could Be a Winner in Sun-Oracle Deal

Microsoft Could Be a Winner in Sun-Oracle Deal

Posted using ShareThis

Tuesday, February 03, 2009

Church Sayings

 
Church Parking Lot Sign: "FOR MEMBERS ONLY. Tresspassers will be baptized."
"No God-No Peace... Know God-Know Peace."
"Free Trip to Heaven... Details Inside!"
Try out Sundays.  They are better than Baskin-Robbins."
"Wanting for a new look?  Have your faith lifted here!"
An ad for one church has a picture of two hands holding stone tablets on which the Ten Commandments are inscribed and a headline that reads, "For fast, fast relief, take two tablets."
When the resturant next to a church put out a big sign with red letters that said, "Open Sundays," the church reciprocated with its own message: "We are open on Sundays, too."
A singing group called "The Resurrection" was scheduled to sing at a church.  When a big snowstorm postponed the preformance, the pastor fixed the outside sign to read, "Resurrection is postponed."
People are like tea bags-you have to put them in hot water before you know how strong they are.
"God so loved the world that He did not send a committee."
"Come in and pray today.  Beat the Christian rush!"
"When down in the mouth, remember Jonah.  He came out all right."
"Sign broken.  Message inside this Sunday."
"Right truth decay-study the Bible daily."
How will you spend eternity-Smoking or Non-smoking?"
"Dusty Bible leads to Dirty Lives."
"Come work for the Lord.  The work is hard, the hours are long and the pay is low.  But the retirement benefits are out of this world."
"It is unlikely there'll be a reduction in the wages of sin."
"Do not wait for the hearse to take you to church."
"If you're headed in the wrong direction, God allows U-turns."
"If you don't like the way you were born, try being born again."
"Looking at the way some people love, they ought to obtain eternal fire insurance soon."
"This is a Ch_ _ch.  What is missing?" (U R)
"Forbidden fruit creates many jams."
"In the dark?  Follow the Son."
"Running low on faith?  Stop in for a fill-up."
"If you can't sleep, don't count sheep.  Talk to the Shepherd."
If you pause to think-- You'll have cause to thank!
As sure as God puts his children in the furnace, He will be in the furnace with them.
God won't be looking for your medals, degrees or diplomas--, He'll be looking for your scars.
Give God what's right--, not what's left!
Trade God your pieces for His peace.
When you get tired talking to your friends about God--, talk to God about your friends.
It's hard to stumble when you're on your knees.
"Will the road you're on get you to my place?"....God
'Pray' is a four letter word that you can say anywhere (except in a public school).
Make your eternal reservations now--- 'smoking' or 'non-smoking'?
Jesus built us a bridge, with 2 boards and 3 nails.
Count your blessings! Recounts are OK---
Don't be God's weakest link!
It's not the outlook-- it's the uplook that counts!
He who sows sparingly will reap sparingly.
They see our methods, He sees our motives.
Plenty of folks give the Lord credit-- few give Him cash!
Finding hell is easy ! It's at the end of a 'Christ-less' life.
The greatest of evils is our indifference towards evil!
If you cheat on the test, don't thank the Lord for the "A".
Count your blessings, not your problems.
If you can't sleep, don't count sheep; talk to the Shepherd.
Good old knee-ology is as good as some theology.
A good place for the "buck to stop" is at the collection plate.
In this life it's not what you have but Who you have that counts!
A hypocrite is a person who's not himself on Sunday.
Money is a great servant but a terrible master!
God gives every bird its' food, but He does not throw it into its nest.
He who loses money, loses much; He who loses a friend, loses more; He who loses faith, loses all.
God made round faces; man makes 'em long.
Honesty is not only the best policy, it is the will of GOD!
What does it take for God to get our attention?
There are many things in my life for which I am ashamed, but Jesus is not one of them.
You can't walk with God and hold hands with Satan at the same time.
Faith is a journey, not a destination.
Jesus never taught how to preach--- only how to pray.
Jesus declared the truth; He never gave opinions.
When was the last time you told God you love Him? He is still listening.
We are as full of the Holy Spirit as we want to be.
We need to seek God Himself more than His gifts.
We become like what we worship.
Sin will keep you from the Bible but the Bible can keep you from sin.
Give Satan an inch and he'll be a ruler.
A good tree cannot bear bad fruit, and a bad tree cannot bear good fruit....Thus, by their fruit you will recognize them.Mat 7:18&20NIV
The Bread of life never gets stale.
Knowledge puffs you up-- Love lifts you up.
Feed your faith and your doubts will starve to death.
For all you do,  His blood's for you!
Big Bang theory-- God Spoke and "Bang!"  It happened--
Christians aren't perfect-- Just forgiven.
"I'm a fool for Christ-- Who's fool are you?"
Would you rather trust a guy who wrote a book--- or the One who wrote The Book?
Into each life a little rain must fall-- Who's your umbrella?
T.G.I.F.-- Thank God I'm Forgiven.
Forbidden fruits creates many jams.
If you're looking for a sign from God to get back to church, this is it! (seen in front of new church in Florida)
A wise child hears his Father's instruction.
GOD IS
Be quiet enough to hear God's whisper.
It's good to be saved and know it!  It's also good to be saved and show it!
Help is just a prayer away.
Be an organ donor--- give your heart to Jesus!
If you walk with the Lord, you'll never be out of step.
Jesus! Don't leave earth without Him!
Jesus Christ-- He paid the price!
Christ's return is near-- Don't miss it for the world!
Don't sway or turn away from the old commandments. They're still new today.
An early walk and talk with the Lord  will last all day.
Hate is not a family value.
Be ye fishers of  men. You catch them--   He will clean them.
Deciding not to choose is still making a choice.
Where death finds you, eternity will keep you.
PSALMS read here.
Things that are not eternal are already out of date. C.S.Lewis
The wages of sin have never been reduced.
The Bible isn't antique or modern,  it's eternal.
Seven days without prayer makes one weak.
Patience is a virtue which carries a lot of wait.
Firefighters rescue, only Jesus saves.
May we live simply so that others may simply live.
TITHE! Anyone can honk!
Don't let troubles get you down-- except on your knees.
Only God can give all of Himself to everyone.
How do you make a good day better? Make it a Godly day.
Only one life, 'twill soon be past-- Only what's done for Christ will last.
Things that please are temporary. Things that disturb are temporary. Things that are important are eternal.
Who is Jesus Christ?  Inquire within---
Jesus is returning...resistance is futile
Can't follow the stars? Follow the One who made them.
If you think you are perfect-- Try walking on water.
We are not on this earth to get rich, we are on earth to be enriched.
...it is not our culture to sin, it is our nature to sin; and only GOD will change
that nature.
If your knees are knocking-- kneel on 'em!
Give your troubles to God--- He never slumbers nor sleeps anyway.
It only take a few moments to open deep wounds-- but it takes years to heal them.
Christ traded in the comfort of the manger for the cruelty of the cross.
If you don't like the devil's fruit, stay out of his orchard.
You can't compromise and conquer sin at the same time.
WARNING! In case of rapture, this car will be unmanned.
I would rather walk with God in the dark than go alone in the light.
Without Jesus in your life you have no life.  With Jesus in your life you have eternal life......It's your choice.
When it comes time to die--- make sure all you have to do is die.
Going to church does not make you a Christian anymore than going to McDonalds makes you a hamburger.
There are two things I've learned: There is a God! And I'm not Him!
TODAY IS A GIFT FROM GOD.  THAT'S WHY IT IS CALLED "THE PRESENT"
If you're ready to die--- you're ready to live!
If you can't be an "Onward Christian Soldier", at least don't pass the ammunition to the enemy.
God doesn't call us to be successful--- only faithful.
Even Jesus had a fish story.
God's laughter is heard in the song of birds.
A beautiful day starts with a beautiful thought.
God without man is still God.   Man without God is nothing.
The key to Heaven was hung on a nail.
Hatred stirs up quarrels, but love covers all offences. Proverbs 10:12
Sow a seed of friendship, reap a bouquet of happiness.
Does your spiritual house need spring cleaning?
Service is love in overalls!
My little children, let us not love in word or in tongue, but in deed and in truth.1 John 3:18
Where will you spend eternity?
 
a) Here
b) Heaven
c) Hell
d) Not sure?
Is that your final answer?

Sunday, February 01, 2009

Engineer VS MBA

This particular joke won an award for the best joke in a competition organized in Britain...Enjoy!
An MBA and an Engineer go on a camping trip, set up their tent, and fall asleep. Some hours later, the Engineer wakes his MBA friend.
"Look up at the sky and tell me what you see?The MBA replies, "I see millions of stars."
The Engineer asks "What does that tell you?"
The MBA ponders for a minute:
"Astronomically speaking, it tells me that there are millions of galaxies and potentially billions of planets.
"Astrologically, it tells me that Saturn is in Leo.
Time wise, it appears to be approximately a quarter past three.
Theologically, it's evident the Lord is all-powerful and we are small and insignificant.
Meteorologically, it seems we will have a beautiful day tomorrow. What does it tell you?
"The Engineer friend is silent for a moment, and then speaks:
"Practically...it tells me that someone has stolen our tent

Wednesday, August 27, 2008

The Top New Features for DBAs and Developers Oracle 11g

Oracle Database 11g:
The Top New Features for DBAs and Developers
by Arup Nanda Oracle ACE Director


In this multipart series, learn how important new features such as Database Replay, Flashback Data Archive, and SecureFiles work via simple, actionable how-to's and sample code.

Change, although constantly present, is seldom risk-free. Even if the change is relatively minor (creating an index for example), your goal is probably to predict its precise impact as accurately as possible and then take appropriate action

Many new change assurance (or "Real Application Testing," as Oracle calls it) features in Oracle Database 11g bring that dream closer to reality. The Database Replay tool, for example, allows you to capture production database workload and replay it in a test (or even the same) database to assess the impact of change. Or consider SQL Performance Analyzer, which predicts the performance impact of changes to SQL before they are made. In my opinion, this Real Application Testing functionality alone justifies the upgrade.

Overall, Oracle Database 11g makes database infrastructure far more efficient, resilient, and manageable. For example, very compelling new features in the realm of partitioning ease the design and management of partitioned tables immensely.

In this series (as in the previous series focusing on Oracle Database 10g), you will learn how these new features work via simple, actionable how-to's and sample code.

Enjoy the series, and the release!


Database Replay

Explore Database Replay, the new tool that captures SQL statements and lets you replay them at will.

Partitioning

Learn about Referential, Internal, and Virtual Column partitioning; new sub-partitioning options; and more.
Transaction Management

Get an introduction to Flashback Data Archive and explore Enterprise Manager's LogMiner interface.

Schema Management

Add columns with a default value easily and explore invisible indexes, virtual columns, and read only tables.
SQL Plan Management

Use bind variables that pick the right plan every time and ensure a new execution plan is perfect before it's used.

SQL Performance Analyzer

Accurately assess the impact of rewriting of SQL statements and get suggested improvements.
SQL Access Advisor

Get advice about optimal table design based on actual use of the table, not just data.

PL/SQL: Efficient Coding

Triggers that fire several times at different events and ability to force triggers of the same type to follow a sequence are some new gems.
RMAN

Explore Data Recovery Advisor, do parallel backup of the same file, and create and manage virtual catalogs.

Security

Learn about Tablespace Encryption, case-sensitive passwords, data masking, and other features.
Automatic Storage Management

Learn about new SYSASM role, variable extent sizes, and other ASM improvements.

Manageability

Explore automatic memory management, multicolumn statistics, online patching, and more features.
Caching and Pooling

Explore SQL Result Cache, PL/SQL Function Cache, and Database Resident Connection Pooling.

SQL Operations: Pivot and Unpivot

Present information in a spreadsheet-type crosstab report from any relational table using simple SQL, and store any data from a crosstab table to a relational table.
SecureFiles

Explore next-generation LOBs: LOB encryption, compression, deduplication, and asynchronicity.

Resiliency

Explore Automatic Health Monitor, Automatic Diagnostic Repository, and other new resiliency features.
Data Guard

Query the physical standby database in real time without shutting down recovery, just for starters.

PL/SQL Performance

Explore in-lining of code, "real" native compilation, PLS timer, use of simple integer, and more.
Data Warehousing

Get a tour of some new features for data warehousing. [Coming soon]

And Don't Forget...

COPY command, Export/Imports, Data Pump improvements, and more. [Coming soon]

Premier Developer Conference for Java, SOA, Web 2.0, and SQL

Don't miss Oracle Develop, the premier developer program, at Oracle OpenWorld 2008! Hear and learn from world-leading experts and your peers about next-generation development trends and technologies for service-oriented architecture (SOA), Extreme Transaction Processing (XTP), virtualization, and Web 2.0. Advance your skills and expand your knowledge in scores of expert-led, in-depth technical sessions and advanced how-tos on Java, .Net, XML, SCA, PL/SQL, Ajax, PHP, Spring, Groovy on Rails, and more. And roll up your sleeves for in-depth, hands-on labs covering the very latest development technologies including database, SOA, Complex Event Processing (CEP), Java, and .NET.

Since its launch in 2006, Oracle Develop has grown both in size and attendance, with additional tracks on the latest development trends in the industry. Thousands of developers attend Oracle Develop each year, and 2008 promises to be the biggest program so far. Based on popular demand, we have extended the conference by adding an additional day this year to include more sessions and hands-on labs. And, as an Oracle Develop attendee, you also get access to OTN Night, Oracle OpenWorld Exhibition Halls, and keynotes.

* When: Sunday, September 21, 10:30 a.m. to 4:45 p.m.
Monday, September 22, 10:15 a.m. to 6:30 p.m.
Tuesday, September 23, 9:30 a.m. to 6:30 p.m.
* Where: San Francisco Marriott

Tuesday, August 12, 2008

Top Ten Math Major Pick-Up Lines

10. You fascinate me more than the Fundamental Theorem of Calculus.
9. Since distance equals velocity times time, let's let velocity or time approach infinity, because I want to go all the way with you.
8. My love for you is like a concave up function because it is always increasing.
7. Let's convert our potential energy to kinetic energy.
6. Wanna come back to my room....and see my 733mhz Pentium?
5. You and I would add up better than a Riemann sum.
4. Your body has the nicest arc length I've ever seen.
3. I wish I was your derivative because then I would be tangent to your curves.
2. I hope you know set theory because I want to intersect you and union you.
1. Would you like to see my log?

Top Ten Reasons to Become a Statistician

10. Deviation is considered normal.
9. We feel complete and sufficient.
8. We are mean lovers.
7. Statisticians do it discretely and continuously.
6. We are right 95% of the time.
5. We can safely comment on someone's posterior distribution.
4. We may not be normal but we are transformable.
3. We never have to say we are certain.
2. We are honestly significantly different.
1. No one wants our jobs.

Definitions of Terms Commonly Used in Math

CLEARLY: I don't want to write down all the in-between steps.

TRIVIAL: If I have to show you how to do this, you're in the wrong class.

OBVIOUSLY: I hope you weren't sleeping when we discussed this earlier, because I refuse to repeat it.

RECALL: I shouldn't have to tell you this, but for those of you who erase your memory tapes after every test, here it is again.

WITHOUT LOSS OF GENERALITY: I'm not about to do all the possible cases, so I'll do one and let you figure out the rest.

ONE MAY SHOW: One did, his name was Gauss.

IT IS WELL KNOWN: See "Mathematische Zeitschrift'', vol XXXVI, 1892.

CHECK FOR YOURSELF: This is the boring part of the proof, so you can do it on your own time.

SKETCH OF A PROOF: I couldn't verify the details, so I'll break it down into parts I couldn't prove.

HINT: The hardest of several possible ways to do a proof.

BRUTE FORCE: Four special cases, three counting arguments, two long inductions, and a partridge in a pair tree.

SOFT PROOF: One third less filling (of the page) than your regular proof, but it requires two extra years of course work just to understand the terms.

ELEGANT PROOF: Requires no previous knowledge of the subject, and is less than ten lines long.

SIMILARLY: At least one line of the proof of this case is the same as before.

CANONICAL FORM: 4 out of 5 mathematicians surveyed recommended this as the final form for the answer.

THE FOLLOWING ARE EQUIVALENT: If I say this it means that, and if I say that it means the other thing, and if I say the other thing...

BY A PREVIOUS THEOREM: I don't remember how it goes (come to think of it, I'm not really sure we did this at all), but if I stated it right, then the rest of this follows.

TWO LINE PROOF: I'll leave out everything but the conclusion.

BRIEFLY: I'm running out of time, so I'll just write and talk faster.

LET'S TALK THROUGH IT: I don't want to write it on the board because I'll make a mistake.

PROCEED FORMALLY: Manipulate symbols by the rules without any hint of their true meaning.

QUANTIFY: I can't find anything wrong with your proof except that it won't work if x is 0.

FINALLY: Only ten more steps to go...

Q.E.D. : T.G.I.F.

PROOF OMITTED: Trust me, it's true.

Top 10 Excuses for Not Turning in Math Homework

10. It's Isaac Newton's birthday.
9. I couldn't decide whether i is the square root of -1 or i are the square root of -1.
8. I accidently divided by 0 and my paper burst into flames.
7. It's stuck inside a Klein bottle.
6. I could only get arbitrarily close to my textbook.
5. I had too much pi and got sick.
4. Someone already published it, so I didn't bother to write it up.
3. A four-dimensional dog ate it.
2. I have a solar calculator and it was cloudy.
1. There wasn't enough room to write it in the margin.

Tuesday, August 05, 2008

MSSQL 2005 number 1 in what??????????????


I have seen this ad in their website and boy was I astonished...I never knew that MS SQL Server 2008 is number 1 in the enterprise database...have a look at their banner


apparently this is the article that they are saying...well...

SQL Server Still No. 1 in Databases
BZ Research study finds that 75 percent of enterprises use it
By Alan Zeichick

July 31, 2007 — Microsoft SQL Server is still No.1. According to the 2007 Database and Data Access, Integration and Reporting Study, completed by BZ Research in late June, 74.7 percent of enterprises are using SQL Server. This is slightly lower than the 76.4 percent reported in a comparable July 2006 study, but it’s still significantly higher than the other popular databases.

BZ Research, like SD Times, is a subsidiary of BZ Media. This survey, conducted during the second half of June, was completed by 686 software development managers.

The study showed that the other top databases, in terms of use, are Oracle (54.5 percent in 2007, up from 51.3 percent in 2006), Microsoft Access (54.4 percent, down from 56.1 percent), MySQL (43.4 percent, up from 38.5 percent), IBM DB2 (23.5 percent, up from 20.4 percent) and PostgreSQL (11.2 percent, down from 11.6 percent). All other databases had less than 10 percent responses.

One Microsoft user in this anonymous survey said, “SQL Server is much, much easier to use with ADO.NET than Oracle is at the moment. If Oracle ever addresses this, then we might be able to utilize Oracle more in the future.” Another commented, “Oracle is perceived as requiring a ‘Priesthood’ to program, configure and run. SQL Server is just another tool and is integrated with Visual Studio.” A third said, “SQL Server is more than adequate for our needs, easy to administer, works well with Visual Studio and runs fine on an x86 server. It is our standard for most in-house deployments. A lot of our third-party vendors use it too.”

Not everyone, of course, uses SQL Server: “We’re a major corporation and Oracle is a de facto standard for enterprise computing (along with IBM DB2). Microsoft SQL Server, though we use it, is not industrial strength.” Another added, “IBM is much easier to work with than Oracle in terms of tech support and sales.”

And sometimes it just depends: “We develop J2EE and .NET applications, SQL Server from Microsoft is everywhere in the small to mid customers, Oracle is in the large customers. When we sell applications we need to deploy apps that already mesh with existing databases.” Another said, “MySQL has been started to test as alternative to Oracle.”

Sybase had its fans and critics: “Sybase is still the de facto standard on Wall Street. It practically runs itself allowing the DBA staff to take on ‘other duties as assigned,’” said one respondent. Another said, “We wish Sybase added features as quickly as MySQL would, would extend T-SQL, and implement other features commonly found in other databases. Otherwise we’ll probably leave it.”

Not all installed databases are used for new projects, but are retained as part of legacy systems. The 2007 study also asked which databases were used for the most recently completed project. For this question, SQL Server was used by 51.0 percent of projects, followed by Oracle at 37.1 percent, MySQL at 20.7 percent, Access at 14.9 percent, DB2 at 12.5 percent and PostgreSQL at 4.2 percent. All other databases had fewer than three responses.

One respondent said, “Most [databases] are legacy, but new development is to be Oracle or SQL Server.”

Choosing Familiarity
When asked why they chose a specific database for their most recent project, nearly half of all respondents—45.9 percent—said “familiarity with the database.” The other top answers were “high availability or reliability features” (21.3 percent), “lowest development costs” (20.1 percent), “lowest deployment costs” (18.6 percent), “covered under site license” (17.1 percent) and “requested by specific applications” (15.3 percent).

The lowest responses to this question were “won competitive bidding” (1.9 percent) and “lowest memory footprint requirements” (3.1 percent).

The full study, with verbatim responses, is available for purchase from BZ Research.

The Professor Teaches About Evil and Christianity

"LET ME EXPLAIN THE problem science has with Jesus Christ." The atheist professor of philosophy pauses before his class and then asks one of his new students to stand. "You're a Christian, aren't you, son?"
"Yes, sir."
"So you believe in God?"
"Absolutely."
"Is God good?"
"Sure! God's good."
"Is God all-powerful? Can God do anything?"
"Yes."
"Are you good or evil?"
"The Bible says I'm evil."
The professor grins knowingly. "Ahh! THE BIBLE!" He considers for a moment. "Here's one for you. Let's say there's a sick person over here and you can cure him. You can do it. Would you help them? Would you try?"
"Yes sir, I would."
"So you're good...!"
"I wouldn't say that."
"Why not say that? You would help a sick and maimed person if you could...in fact most of us would if we could....God doesn't."
[No answer]
"He doesn't, does he? My brother was a Christian who died of cancer even though he prayed to Jesus to heal him. How is this Jesus good? Hmmm? Can you answer that one?"
[No answer]
The elderly man is sympathetic. "No, you can't, can you?" He takes a sip of water from a glass on his desk to give the student time to relax. "In philosophy, you have to go easy with the new ones. Let's start again, young fella. Is God good?"
"Er... Yes."
"Is Satan good?"
"No."
"Where does Satan come from?"
The student falters. "From... God..."
"That's right. God made Satan, didn't he?" The elderly man runs his bony fingers through his thinning hair and turns to the smirking student audience. "I think we're going to have a lot of fun this semester, ladies and gentlemen." He turns back to the Christian. "Tell me, son. Is there evil in this world?"
"Yes, sir."
"Evil's everywhere, isn't it? Did God make everything?"
"Yes."
"Who created evil?"
[No answer]
"Is there sickness in this world? Immorality? Hatred? Ugliness. All the terrible things - do they exist in this world? "
The student squirms on his feet. "Yes."
"Who created them?"
[No answer]
The professor suddenly shouts at his student, "WHO CREATED THEM? TELL ME, PLEASE!" The professor closes in for the kill and climbs into the Christian's face. In a still small voice, he asked, "God created all evil, didn't He, son?"
[No answer]
The student tries to hold the steady, experienced gaze and fails. Suddenly the lecturer breaks away to pace the front of the classroom like an aging panther. The class is mesmerized. "Tell me," he continues, "How is it that this God is good if He created all evil throughout all time?" The professor swishes his arms around to encompass the wickedness of the world. "All the hatred, the brutality, all the pain, all the torture, all the death and ugliness and all the suffering created by this good God is all over the world, isn't it, young man?"
[No answer]
"Don't you see it all over the place? Huh?" Pause. "Don't you?" The professor leans into the student's face again and
whispers, "Is God good?"
[No answer]
"Do you believe in Jesus Christ, son?"
The student's voice betrays him and cracks. "Yes, professor. I do."
The old man shakes his head sadly. "Science says you have five senses you use to identify and observe the world around you. Have you ever seen Jesus?"
"No, sir. I've never seen Him."
"Then tell us if you've ever heard your Jesus?"
"No, sir. I have not."
"Have you ever felt your Jesus, tasted your Jesus or smelt your Jesus... in fact, do you have any sensory perception of your God whatsoever?"
[No answer]
"Answer me, please."
"No, sir, I'm afraid I haven't."
"You're AFRAID... you haven't?"
"No, sir."
"Yet you still believe in him?"
"...yes..."
"That takes FAITH!" The professor smiles sagely at the underling. "According to the rules of empirical, testable, demonstrable protocol, science says your God doesn't exist. What do you say to that, son? Where is your God now?"
[The student doesn't answer]
"Sit down, please."
The first Christian sits...defeated.
Another Christian raises his hand. "Professor, may I address the class?"
The professor turns and smiles. "Ah, yet another Christian in the vanguard! Come, come, young man. Speak some proper wisdom to the gathering."
The Christian looks around the room. "Some interesting points you are making, sir. Now I've got a question for you. Is there such thing as heat?"
"Yes," the professor replies. "There's heat."
"Is there such a thing as cold?"
"Yes, son, there's cold too."
"No, sir, there isn't."
The professor's grin freezes. The room suddenly becomes very quiet. The second Christian continues.
"You can have lots of heat, even more heat, super-heat, mega-heat, white heat, a little heat or no heat, but we don't have anything called 'cold'. We can hit 273 degrees below zero, which is no heat, but we can't go any further after that. There is no such thing as cold, otherwise we would be able to go colder than -273°C. You see, sir, cold is only a word we use to describe the absence of heat. We cannot measure cold. Heat we can measure in thermal units because heat is energy. Cold is not the opposite of heat, sir, just the absence of it."
Silence. A pin drops somewhere in the classroom.
"Is there such a thing as darkness, professor?"
"That's a dumb question, son. What is night if it isn't darkness? What are you getting at...?"
"So you say there is such a thing as darkness?"
"Yes..."
"You're wrong again, sir. Darkness is not something, it is the absence of something. You can have low light, normal light, bright light, flashing light... but if you have no light constantly you have nothing and it's called darkness, isn't it? That's the meaning we use to define the word. In reality, Darkness isn't. If it were, you would be able to make darkness darker and give me a jar of it. Can you... give me a jar of darker darkness, professor?"
Despite himself, the professor smiles at the young effrontery before him. This will indeed be a good semester. "Would you mind telling us what your point is, young man?"
"Yes, professor. My point is, your philosophical premise is flawed to start with and so your conclusion must be in error...."
The professor goes toxic. "Flawed...? How dare you...!"
"Sir, may I explain what I mean?"
The class is all ears.
"Explain... ohhhhh, explain..." The professor makes an admirable effort to regain control. Suddenly he is affability himself. He waves his hand to silence the class, for the student to continue.
"You are working on the premise of duality," the Christian explains. "That for example there is life and then there's death; a good God and a bad God. You are viewing the concept of God as something finite, something we can measure. Sir, science cannot even explain a thought. It uses electricity and magnetism but has never seen, much less fully understood them. To view death as the opposite of life is to be ignorant of the fact that death cannot exist as a substantive thing. Death is not the opposite of life, merely the absence of it." The young man holds up a newspaper he takes from the desk of a neighbor who has been reading it. "Here is one of the most disgusting tabloids this country hosts, professor. Is there such a thing as immorality?"
"Of course there is, now look..."
"Wrong again, sir. You see, immorality is merely the absence of morality. Is there such thing as injustice? No. Injustice is the absence of justice. Is there such a thing as evil?" The Christian pauses. "Isn't evil the absence of good?"
The professor's face has turned an alarming color. He is so angry he is temporarily speechless.
The Christian continues, "If there is evil in the world, professor, and we all agree there is, then God, if He exists, must be accomplishing a work through the agency of evil.1 What is that work God is accomplishing? The Bible tells us it is to see if each one of us will, of our own free will, choose good over evil."2
The professor bridles. "As a philosophical scientist, I don't view this matter as having anything to do with any choice; as a realist, I absolutely do not recognize the concept of God or any other theological factor as being part of the world equation because God is not observable."
The Christian replies, "I would have thought that the absence of God's moral code in this world is probably one of the most observable phenomena going, Newspapers make billions of dollars reporting it every week! Tell me, professor. Do you teach your students that they evolved from a monkey?"
"If you are referring to the natural evolutionary process, young man, yes, of course I do."
"Have you ever observed evolution with your own eyes, sir?"
The professor makes a sucking sound with his teeth and gives his student a silent, stony stare.
"Professor. Since no one has ever observed the process of evolution at work and cannot even prove that this process is an on-going endeavor, are you not teaching your opinion, sir? Are you now not a scientist, but a preacher?"
"I'll overlook your impudence in the light of our philosophical discussion. Now, have you quite finished?" the professor hisses.
"So you don't accept God's moral code to do what is righteous?"
"I believe in what is - that's science!"
"Ahh! SCIENCE!" the student's face splits into a grin. "Sir, you rightly state that science is the study of observed phenomena. Science too is a premise which is flawed..."
"SCIENCE IS FLAWED..?" the professor splutters.
The class is in uproar. The Christian remains standing until the commotion has subsided. "To continue the point you were making earlier to the other student, may I give you an example of what I mean?"
The professor wisely keeps silent.
The Christian looks around the room. "Is there anyone in the class who has ever seen the professor's mind?" The class breaks out into laughter. The Christian points towards his elderly, crumbling tutor. "Is there anyone here who has ever heard the professor's mind... felt the professor's mind, touched or smelt the professor's mind? No one appears to have done so." The Christian shakes his head sadly. "It appears no one here has had any sensory perception of the professor's mind whatsoever. Well, according to the rules of empirical, stable, demonstrable protocol, science, I DECLARE that the professor has no mind."
The class is in chaos.
The Christian sits.

25 Phrases Of Wisdom

1. If you're too open minded, your brains will fall out.

2. Age is a very high price to pay for maturity.

3. Going to church doesn't make you a Christian any more than going to a garage makes you a mechanic.

4. Artificial intelligence is no match for natural stupidity.

5. If you must choose between two evils, pick the one you've never tried before.

6. My idea of housework is to sweep the room with a glance.

7. Not one shred of evidence supports the notion that life is serious.

8. It is easier to get forgiveness than permission.

9. For every action, there is an equal and opposite government program.

10. If you look like your passport picture, you probably need the trip.

11. Bills travel through the mail at twice the speed of checks.

12. A conscience is what hurts when all your other parts feel so good.

13. Eat well, stay fit, die anyway.

14. Men are from earth. Women are from earth. Deal with it.

15. No husband has ever been shot while doing the dishes.

16. A balanced diet is a cookie in each hand.

17. Middle age is when broadness of the mind and narrowness of the waist change places.

18. Opportunities always look bigger going than coming.

19. Junk is something you've kept for years and throw away three weeks before you need it.

20. There is always one more imbecile than you counted on.

21. Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.

22. By the time you can make ends meet, they move the ends.

23. Thou shalt not weigh more than thy refrigerator.

24. Someone who thinks logically provides a nice contrast to the real world.\

25. Your aren't wealthy until you posses something money can't buy.

Friday, August 01, 2008

Men strike back!! [Jokes]

Q: How many men does it take to open a beer?
A: None. It should be opened when she brings it.
---------------------------------------- -------------------------! --
Q: Why is a Laundromat a really bad place to pick up a woman?
A: Because a woman who can't even afford a washing machine will probably never be able to support you.
---------------------------------------- ---------------------------
Q: Why do women have smaller feet than men?
A: It's one of those "evolutionary things" that allows them to stand closer to the kitchen sink.
---------------------------------------- ---------------------------
Q: How do you know when a woman is about to say something smart?
A: When she starts a sentence with "A man once told me..."
---------------------------------------- ---------------------------
Q: How do you fix a woman's watch?
A: You don't. There is a clock on the oven.
---------------------------------------- ---------------------------
Q: If your dog is barking at the back door and your wife is yelling at the front door, who do you let in first?
A: The dog, of course. He'll shut up once you let him in.
---------------------------------------- ---------------------------
Q: What's worse than a Male Chauvinist Pig?
A: A woman who won't do what she's told.
---------------------------------------- ---------------------------
I married a Miss Right.
I just didn't know her first name was Always.
---------------------------------------- ---------------------------
Scientists have discovered a food that diminishes a woman's sex drive by 90%.
It's called a Wedding Cake.
---------------------------------------- ---------------------------
Why do men die before their wives?
They want to.
---------------------------------------- --------------- ------------
Women will never be equal to men until they can walk down the street with a bald head and a beer gut, and still think they are sexy.
---------------------------------------- ---------------------------
In the beginning, God created the earth and rested.
Then God created Man and rested.
Then God created Woman.
Since then, neither God nor Man has rested.
-------------- ---------------------------------------- -------------
Send this to a few good men who need a laugh and to the select few women who know this is all bull anyway !

Top Video Card as of July 2008

1. GTX 280
2. 9800GX2
3. HD4870
4. GTX 260
5. HD3870X2
6. HD4850
7. 8800Ultra
8. 9800GTX
9. 8800GTX
10. 8800GTS 512MB (G92 Revision)
11. 8800GT 512MB
12. HD3870 512MB
13. 9600GT
14. HD2900XT 1GB
15. HD2900Pro 1GB
16. HD2900XT 512MB
17. HD2900Pro 512MB
18. 8800GTS 640MB
19. HD3850 512MB
20. 8800GT 256MB
21. 8800GTS 320MB
22. 7950GX2
23. 8800GS/9600GSO
24. HD 3850 256MB
25. HD2900GT
26. X1950XTX
27. X1900XTX
28. X1950XT
29. X1900XT 512MB
30. 7900GTX
31. X1900XT 256MB
32. 7900GTO
33. 7800GTX 512MB
34. 7950GT
35. X1950Pro 512MB
36. X1950Pro 256MB
37. 7900GT 512MB
38. 8600GTS
39. X1800XT 512MB
40. 7900GT 256MB
41. X1800XT 256MB
42. X1900GT
43. X1950GT
44. 8600GT 512MB
45. 8600GT 256MB
46. X1900GT Rev2
47. 7800GTX 256MB
48. 7900GS
49. 7800GT
50. X1800XL
51. 7800GS
52. X1800GTO
53. HD2600XT
54. HD3650
55. X1650XT
56. X850XTPE
57. 7600GT
58. X850XT
59. 7600GTS
60. HD2600Pro
61. X800XT/PE
62. 6800Ultra/EE
63. 6800GT
64. 6800GS
65. X800XL
66. X850Pro
67. X800pro
68. X800GTO/GTO2
69. Chrome 440GTX
70. 8500GT
71. Chrome 430
72. X1650Pro
73. X1600XT
74. 7600GS
75. HD2400XT
76. X800
77. 6800
78. X800GT
79. 7300GT
80. X1300XT
81. X1600Pro
82. HD3450
83. 8400GS
84. 6800XT/LE
85. 6600GT
86. HD2400Pro
87. X700Pro
88. 9800XT
89. 5950Ultra
90. 9800Pro
91. 5900Ultra
92. 9700Pro
93. 5800Ultra
94. 9800
95. 9800SE 256bit
96. S3 Chrome S27
97. X700
98. 9700
99. 5900
100. 5800
101. X1300Pro
102. 6600
103. 5900XT
104. X600XT
105. TI4800
106. TI4600
107. 9600XT
108. TI4800SE
109. X1550
110. X1300
111. 5700Ultra
112. 9500Pro
113. 9800SE 128bit
114. X600
115. 9600Pro
116. TI4400
117. 9500
118. 6600LE
119. X1300SE
120. 5700
121. 7300GS
122. 9600
123. 6200
124. 6200LE
125. X550
126. TI4200
127. 5600
128. 5600XT
129. 9550
130. 9600SE
131. 7300LE
132. 5500
133. X1050
134. X300
135. 7300SE
136. 7100GS
137. 9550SE
138. 9200Pro
139. 9000Pro
140. Matrox Parhelia
141. 8500Pro
142. GeForce3 TI500
143. 8500
144. 8500LE
145. 5200Ultra
146. 9200
147. 9250
148. GeForce4 MX460
149. 5200
150. 9000
151. 9200SE
152. GeForce3
153. GeForce3 TI200
154. GeForce4 MX 440
155. 7500
156. GeForce2 Ultra
157. GeForce2 GTS
158. GeForce4 MX 420
159. Radeon (later renamed Radeon 7200)
160. GeForce 256 DDR
161. Voodoo5 5500
162. GeForce2 MX 400
163. GeForce 256
164. Savage 2000
165. GeForce2 MX
166. Radeon VE (later renamed Radeon 7000)
167. Voodoo4 4500
168. Matrox G400
169. TNT2
170. Rage128 Pro
171. Voodoo3
172. TNT
173. Rage128
174. Savage 4
175. Matrox G200
176. Riva128
177. Intel i740
178. Rage3D Pro
179. Voodoo Banshee
180. Voodoo2
181. Riva
182. Rage3D
183. VooDoo1

These rankings have come from Overclock.net.

5 Reasons Why a Developer Might Want to Become a CIO

The CIO job comes with lots of money and lots of perks. But would a software developer ever be willing to cash in his integrity and passion for programming to become a corporate wonk? Here are five compelling reasons why developers might do so.

1. It's all about the benjamins, baby.

Have you seen the money these cats make? Top information technology executives earn millions of dollars. And it's not just the cash CIOs pocket, it's the perks they get, too. Home security system to protect all their loot? Check. Personal use of the corporate jet? Check. Financial planner to funnel all that dough into off-shore, tax-free accounts?

2. It's good to be king.

Like Tom Petty and Jackie Mason say, "It's good to be king." As a CIO, you have control over the fate of an entire department. You control the priorities, salaries and indeed the future of everyone on your staff. If you want to make them come into the office on the weekend to work on their TPS reports, you can. You can also make software vendors laugh or cry with a flourish of your pen. You can spend a day on the links and call it business. And if you want to frolic in Las Vegas for a weekend, you don't have to ask anyone for permission. You just tell them you're attending a conference. Because what happens in Vegas, stays in Vegas.

3. You don't have to worry about your job getting outsourced.

Have you ever heard of a CIO's job getting shipped off to India? Either have we. CIOs are too busy managing their outsourcing contracts with Tata and IBM to worry about their positions being in jeopardy. Software developers, on the other hand, always have to worry about the axe-man hefting the hatchet over their heads.

4. Golden parachutes to the rescue.

On the off chance a company decides to part ways with its CIO, the CIO is all but guaranteed a soft landing due to the employment contract his lawyer inked for him when he joined the company. While software developers are lucky if they get a measly six weeks severance, the CIO usually skips away with a minimum of six months severance, health insurance and all vested stock options.

5. Quit bugging me.

Even software developers tire of fixing bugs. Some days, they'd much rather be the person creating all the problems than the poor slob who has to clean them up.

Want the other side of the story? Read 8 Reasons Why a Developer Would NEVER Want to Be A CIO.

Nvidia to quit chipset business

Ricky Morris, DIGITIMES, Taipei [Friday 1 August 2008]

Nvidia has decided to throw in the towel and quit the chipset business, sources close to the situation at one of Taiwan's top motherboard makers have revealed. As the story is told, Nvidia called a meeting earlier this week with its motherboard partners to gauge support for it continuing to develop chipsets in the future.

The motherboard makers' response? Silence.

It is still early days and not all the facts are known at the time of writing, but it is believed Nvidia will transfer the chipset team to working on GPU projects. On the motherboard makers' side, some makers have already canceled upcoming high-end motherboard projects based on the nForce 7-series chipset.

The loss of its chipset business is expected to have a significant impact on Nvidia's GPU business in the short-term. Reception to the nForce 200 chip (BR04) which will enable SLI technology on Intel X58 motherboards has been lukewarm at best, with many makers saying they will not bother adding the chip on their boards. This means Nvidia needs to find a way of licensing and enabling multi-GPU support on motherboards using Intel and/or AMD chipsets fast. Otherwise it will have to cede the top-end of the graphics card market to AMD, which now has the benefit of Crossfire.

The news would also debunk any recent speculation that Apple will be adopting Nvidia chipsets for its upcoming notebook products. It would be unfortunate if Apple really has poured water on the close relationship it has built with Intel over the past few years, only to have its new best friend exit the market before products are even announced.

Wednesday, July 02, 2008

Oracle will be first

This is an excerpt from an oracle book


Oracle Will Be First
If you haven’t seen the “Oracle Firsts” on oracle.com, I’ve listed them here so that I can add a couple of notes from Oracle’s past to what I believe is a compelling vision in the Oracle future. Oracle will be the leader throughout the Information Age not only because they create the “bend in the road,” but they’re also willing to turn willingly when the road bends unexpectedly. Unlike Microsoft, they include Java to its fullest extent, embracing volumes of developers. Unlike IBM, they bring in every hardware solution, driving scalability to fruition and bringing choices to their customers. They embrace Linux for the future that it will bring while driving information to the Web with relentless force. They continue to support SAP and Microsoft while courting the Open Source community. I remember building the first Oracle client-server application with Brad Brown and Joe Trezzo when we were at Oracle in 1987. We wondered why it took so long for others to follow. Now, I just look at Oracle firsts and know that others will follow (in time), but I like to be part of the leading edge. Consider these Oracle firsts and get ready for a much-accelerated future:

■ First commercial RDBMS
■ First 32-bit database
■ First database with read consistency
■ First client-server database
■ First SMP database
■ First 64-bit RDBMS
■ First Web database
■ First database with Native Java Support
■ First commercial RDBMS ported to Linux
■ First database with XML
■ First database with Real Application Clusters (RAC)
■ First True Grid database
■ Free Oracle Database (Oracle Express Edition)
■ Unbreakable Linux Support

Friday, June 06, 2008

2008 CELTICS vs. LAKERS Game 1 (Celtics 1-0 | Lakers 0-1)

The Lakers-Celtics Rivalry or Celtics-Lakers Rivalry is a rivalry between two of the most storied basketball franchises in National Basketball Association history, the Los Angeles Lakers and Boston Celtics. The rivalry has been less intense since the retirements of Magic Johnson and Larry Bird in the early 1990s. The Celtics currently lead in total championships with 16 to the Lakers' 14.



Celtics 98, Lakers 88 (F)


1st five for the lakers
Derek Fisher
Kobe Bryant
Radmanovic
Lamar Odom
Pau Gasol


1st five for the celtics


Rajon Rondo
Ray Allen
Paul Pierce
Kevin Garnett
Perkins

Wednesday, June 04, 2008

AMD rolls out new laptop chip package




SAN JOSE, California - Advanced Micro Devices Inc. rolled out a new package of chips for laptops Wednesday, a major overhaul of its mobile lineup the chip maker hopes will help it climb out of a deep financial trough.

The Sunnyvale-based company, saddled with debt and hurt by product delays, is betting consumers will gravitate toward its new Turion brand processor and related chipset — part of a package that chip makers call a "platform" and sell together — because of their focus on high-definition video playback.

This new generation of Turion laptop chips will appear at launch in twice as many different computers — from Hewlett-Packard Co., Acer Inc., Toshiba Corp. and others — as the previous generation, released two years ago, AMD said.

Chip makers AMD, Intel Corp. and Nvidia Corp. are battling harder over high-end graphics as more people watch movies and television programs on their home computers and as operating systems and Web applications require better visuals.

To that end, AMD's new chips, which were unveiled at the Computex computer show in Taiwan, rely heavily on parts from ATI Technologies, a graphics chip supplier that AMD acquired for $5.6 billion in 2006 to help it challenge Nvidia and much larger Intel.

Intel is the world's No. 1 maker of microprocessors, the brains of personal computers. AMD is a distant No. 2, and with the acquisition of ATI now makes standalone graphics chips. Nvidia is the market leader in standalone graphics chips.

AMD hopes that by infusing its general-purpose chips with more advanced graphics capabilities it can boost their appeal and help the company increase its market share.

AMD has racked up more than $4 billion in losses over the last six quarters as Intel snatched away market share with newer parts and AMD struggled to digest the pricey ATI acquisition.

AMD's new Turion X2 Ultra Dual-Core mobile processors, which come in clock speeds up to 2.4 gigahertz, are accompanied by powerful new chipsets, a separate set of chips that do most of the graphics work — absent a standalone graphics chip — and control how the processor communicates with the rest of the computer.

AMD says its chipsets deliver three times better 3-D performance and five times better high-definition image quality than competing models because of the strength of its integrated graphics. AMD also says its chips transmit high-definition videos and photos faster over wireless networks.

The company says demand for its new lineup of laptop chips has been strong. - AP

Davao to be a center for outsourcing companies

MANILA, Philippines - Davao City, the Philippines’ largest urban area in Mindanao, is expected to be a viable alternative information technology hub three years from now, a study said.

In a report, research firm XMG said organizations belonging to the business process outsourcing (BPO) industry are expected to lead the development of the area as a robust technology hub.

Citing a study it conducted between January to March 2008, the company said that outsourcing vendors who participated in the survey are very bullish about Davao City, primarily due to the area’s larger population of untapped qualified resources compared to Cebu City in the Visayas.

The study highlighted that competition in Cebu City is nearing saturation as the talent ramp-up continues.

The study also highlighted the population of Davao City as considerably higher than other Tier-2 offshoring cities globally. In the Philippine context, Davao City’s population is 71% higher than Cebu City, 499% larger than Olongapo-Subic City, 333% higher than the Angeles-Clark area, and 340% larger than Baguio City.

“The city’s estimated workforce is twice of Cebu, 9 times of Subic, and 7 times of Clark, and 6 times of Baguio. This has not even taken to account the manpower pool at the nearby cities and provinces of Davao City," the company said.

According to the study, Davao City has various educational institutions annually yielding a higher number of IT and BPO qualified graduates than Subic, Clark, and Baguio by 689%, 278%, and 40% respectively.

Telecom facilities, transportation networks, and public transport systems are already in place in Davao City, the study said. However, XMG indicated there is a need to further improve and modernize these services.

In addition, the existence of a public transport system in Davao City is noteworthy yet still needs improvement in order to expand locators’ recruitment reach and the transportation of people from various points in and out of the city.

The study said the attractiveness of Davao City is greatly affected by the negative perception about the Mindanao region as a whole.

On February 2008, a travel advisory was released by US Consular Affairs warning their citizens on the risk of traveling in Central, Western, and Southern part of Mindanao due to security and safety reasons, which includes terrorism.

XMG researcher Camille Lumbang said that although these travel warnings are empirically grounded from actual hostile incidents in Mindanao, it should be emphasized that these are only isolated incidents from specific areas.

“There is a challenge then to substantiate and prove that such occurrences do not pose a general security threat for Davao City," she said.

Lumbang admitted, however, “there is a crying need for both the government and private sector to act together in improving the overall image of Davao City to attract ICT locators."

Citing a previous study, XMG said Davao City has been upgraded to a level C2 rating from its previous level D standing as the city emerges as a viable site for captive and outsourcing services.

“While there are still a number of geopolitical, geophysical and infrastructure challenges, the large untapped manpower base in Davao City will give its allure and ‘staying power’ as a viable site in the years to come," Lumbang said

The report continues added: “Potential locators in Davao City must have a heightened awareness and should conduct their own formal and internal risks analysis rather than reacting to headlines about specific regions under consideration such as the problems happening in other parts of Mindanao."

Among the emerging alternative offshoring cities cited in the study were Montevideo in Uruguay, Jakarta in Indonesia, and Casablanca in Morocco. It focused on forecasting the global demand for offshoring and outsourcing services and the site optimization of emerging cities. - GMANews.TV

Software company warns against dangerous domains

SAN JOSE, Calif. - When surfing the Internet for safe Web sites, not all domains are equal.

Companies that assign addresses for Web sites appear to be cutting corners on security more when they assign names in certain domains than in others, according to a report to be released Wednesday by antivirus software vendor McAfee Inc.

McAfee found the most dangerous domains to navigate to are “.hk" (Hong Kong), “.cn" (China) and “.info" (information).

Of all “.hk" sites McAfee tested, it flagged 19.2 percent as dangerous or potentially dangerous to visitors; it flagged 11.8 percent of “.cn" sites and 11.7 percent of “.info" sites that way.

A little more than 5 percent of the sites under the “.com" domain—the world’s most popular—were identified as dangerous.

More spammers, malicious code writers and other cybercriminals can establish an online presence when domain name registry businesses cut requirements for registering a site in order to boost their profit and profile. The report does not identify domain name registration companies McAfee believes are responsible for those lapses.

Hundreds, perhaps thousands, of companies are in the business of registering domain names; some are large and well known, while others are small and less reputable, offering their services on the cheap and with flimsy or no background checks to lure in more customers.

The fact that Internet scam artists gravitate to domain name services with lower fees and fewer requirements isn’t new.

What McAfee’s “Mapping the Mal Web" report, now in its second year, tries to do is identify the domains that are populated with the highest concentration of risky sites.

The servers for “.hk" and “.cn" Web sites don’t have to be in China; Web site operators can register sites from anywhere to target different geographies.

Other risky domains include “.ro" (Romania), with 6.8 percent, and “.ru" (Russia), with 6 percent of sites flagged as dangerous.

Shane Keats, research analyst for McAfee and lead author of the report, said the increase in dangerous sites registered under the “.hk" and “.cn" domains over last year’s report was caused in part by better data collection on McAfee’s part on those domains and by apparent security lapses in some registrar companies’ processes for registering addresses.

“My advice about surfing behavior is that if you’re really desperate for cheap Prozac and the pharmacy ends in ‘.cn,’ don’t do it. Just don’t do it," Keats said. “Find another place to get your Prozac."

Many Internet frauds involve fake sites for pharmaceuticals.

The McAfee report is based on results from 9.9 million Web sites that were tested in 265 domains for serving malicious code, excessive pop-up ads or forms to fill out that actually are tools for harvesting e-mail addresses for sending spam.

Keats said domain name registrars that are strict about authenticating that Web site owners are operating a legitimate business see far fewer malicious Web sites using their services.

Where McAfee found some of the least-risky domain names: “.gov" (government use), with 0.05 percent flagged; “.jp" (Japan), with 0.1 percent flagged and “.au" (Australia), with 0.3 percent flagged. - AP

Saturday, May 31, 2008

Oracle: Duplicate Database using RMAN

please remove the 2 double quotes in EOF, i cant post it without the double quotes

export ORACLE_SID=TEST2
sqlplus /nolog "<<"EOF
connect / as sysdba
alter system switch logfile;
exit
EOF
rmanA.sh
export ORACLE_SID=TEST3
sqlplus /nolog "<<"EOF
connect sys/oracledba as sysdba
shutdown abort
startup nomount
exit
EOF
rm /data/oracle8/TEST3/*
rman "<<"EOF
connect target rman/rman_oracledba@test2
connect catalog rman/rman_oracledba@test1
connect auxiliary sys/oracledba@test3
run {
# set until time "to_date('2002-01-29:15:16:53','yyyy-mm-dd:hh24:mi:ss')";
# set until time "to_date('30-JAN-2002 10:50:00','dd-mon-YYYY HH24:MI:SS')";
set until time '31-JAN-2002 10:51:00';
# set until time 'sysdate-1/1000';
# set until scn = 155534;
allocate auxiliary channel d1 type disk;
allocate auxiliary channel d2 type disk;
duplicate target database to test3;
}
EOF

Thursday, May 29, 2008

Spread Firefox 3

pledge to download firefox 3

http://www.spreadfirefox.com/en-US/worldrecord/

Download Day

Wednesday, May 28, 2008

Lopez Arroyo Family Feud (century old)

The Arroyo-Lopez War
By Perry Diaz

INQUIRER.net
First Posted 14:40:00 05/23/2008

Finally, after almost 80 years of a family feud between two wealthy clans, it seems that the final battle has started. On one side of the conflict is the Arroyo clan, wealthy merchants of Chinese origin who gained political supremacy in the early 1900's when their patriarch, Jose Arroyo, was elected Senator in 1919.

With the help of his close friend -- then Senate President Manuel L. Quezon -- his younger brother, Dr. Mariano Arroyo, was appointed provincial governor in 1928.

On the other side is the Lopez clan headed by Eugenio "Eñing" Lopez who used his newspaper El Tiempo -- founded in 1901 by his father Benito Lopez, the first governor of Iloilo in 1906, who was assassinated two years later by a rival political faction -- to expose the jueteng ring that Governor Arroyo and a Chinese trader named Sualoy started in Iloilo. El Tiempo's incessant exposure of the jueteng operations finally paid off. Sualoy was charged, found guilty, imprisoned and deported to China.
That was the beginning of the Arroyo-Lopez War. As a result of the crackdown on the jueteng operations, Governor Arroyo filed a libel suit against Lopez and El Tiempo. Lopez retaliated by filing administrative charges against Governor Arroyo. Governor General Davis was also informed about the case and he sent Judge Francisco Moran to investigate. Moran discovered that Governor Arroyo was involved in the jueteng operations, including a gambling den.

Consequently, Moran dismissed the libel charges against Lopez and his newspaper. In 1930, the administrative trial found Governor Arroyo guilty of corruption and Governor General Davis relieved him from his post.

Humiliated, Jesusa Lacson Arroyo, the widow of Senator Arroyo who died in 1927, picked up the pieces and moved her entire family to Negros Occidental. One of her sons, Ignacio, would become the father of the current First Gentleman, Jose Miguel "Mike" Arroyo.

Meanwhile, Eugenio Lopez progressed in business; his brother Fernando entered politics and was elected Vice-President three times. Don Eugenio established the first airline in Asia and expanded his newspaper business. In 1962, he purchased Meralco, the country's largest electric company. His son, Eugenio "Geny" Lopez, Jr., built ABS-CBN to become the country's undisputed leader in broadcasting.

In 1972, the Lopez family suffered under the martial law regime of Ferdinand Marcos. Geny Lopez was implicated in an alleged plot to kill Marcos. Under obscure circumstances, Lopez escaped from detention and slipped out of the country. Marcos' brother-in-law, Kokoy Romualdez, then took over Meralco. When Marcos was ousted in 1986, Cory Aquino returned Meralco and ABS-CBN to the Lopezes.

For more than 20 years, the Lopezes had undisputed control of Meralco. They also diversified into new business ventures. Over the past several years, ABS-CBN became a pain in the neck of President Gloria Macapagal- Arroyo. Their coverage of the various scandals involving the First Couple have contributed much to the Arroyos' negative public image.

It is no wonder then that Meralco is now in the crosshairs of President Arroyo's sight. The joint congressional hearing chaired by Senator Miriam Defensor-Santiago and Congressman Juan Miguel "Mikey" Arroyo has stirred to life a family feud dormant for 78 years. There are speculations that the real reason for the Meralco "witch hunt" is for government to take over Meralco and break it up into smaller companies. If this should happen, guess who would take over a divested Meralco?
Let's look at one who has been at the forefront of the battle: Winston Garcia, President and General Manager of the Government Service Insurance System (GSIS). His aggressive and arrogant demeanor in the Meralco boardroom -- he is a recent member on the Meralco board, representing GSIS which has 23% ownership of Meralco -- has made a lot of people wonder what his ulterior motive might be. Many believe that Garcia is on the board to wage a "proxy war" for the Arroyos.

For one thing, Garcia is not the typical government bureaucrat. He is a scion of a powerful political dynasty in Cebu with close ties to Malacañang. His father, Pablo, is a congressman and concurrently Deputy Speaker of the House. His brother, Pablo John, is also a congressman. And his sister, Gwendolyn, is the current Governor of Cebu. She announced recently that she is a candidate for Vice President in 2010.

In addition, the Garcia family has large stockholdings in the Aboitiz-owned Visayan Electric Company (VECO), the country's second largest private electric utility. The corporate officers include three Garcias, to wit: Dennis A. Garcia, President and General Manager; Ramontito A. Garcia,Treasurer; and Jess Anthony N. Garcia, legal counsel and Assistant Corporate Secretary. Of the 11 members of the VECO Board of Directors, five are Garcias, namely, Dennis N.A. Garcia, Ramontito E. Garcia, Gil A. Garcia II, Charles Sylvester A. Garcia, and Antonio V. A. Garcia de Escaño.
The Aboitizes have five members of the Board. Recently a news account reported that Winston Garcia is serving VECO as a lawyer on retainer. The question is: What would VECO -- and Winston Garcia -- stand to gain if Meralco were broken up into smaller companies?

It is also common knowledge that the Aboitizes are business cronies of the First Couple. With the Lopezes trying hard to defend themselves from a pack of wolves, it would probably take a miracle to survive these attacks. But miracles do happen, and they happen when least expected. The last question is: What would the Arroyos stand to gain if and when Meralco breaks up?



Ruby on Rails on Oracle: A Simple Tutorial

Source: Oracle.com

Ruby on Rails on Oracle: A Simple Tutorial

by Richard Monson-Haefel

Rails is an easy framework to work with, but like any technology it takes time to master.

Published April 2006

Comments about this article? Visit the Ruby/RoR Discussion Forum

You may have already heard about Ruby on Rails, the new application framework that seems to be taking the Web development community, in particular J2EE and PHP programmers, by storm.

Rails is a capable Web application platform and has, in less than two years, gained significant traction among J2EE and PHP programmers. The attraction of both J2EE and PHP programmers makes a lot of sense when you look at the strengths of Rails. For one thing, it uses a strict model-view-controller architecture that any self-respecting design-patterns wonk would admire—this explains its attraction to J2EE developers. Second, it’s easy to build basic systems with Rails—which is attractive to PHP developers.

However, Rails has some pretty significant limitations from a database perspective. Rails makes a lot of assumptions about your database layout and application needs. For example, Rails assumes that all tables use a single, non-compound, primary key. Compound primary keys are not supported! In addition, Rails does not support two-phase commit; it supports multiple databases, but cannot coordinate transactions among them.

This article is not intended to be a booster piece for Rails nor is it an expose. It’s simply an introduction to the technology. It contains both praise and criticism. At times the criticism might appear a bit heavy handed (especially to Rails enthusiasts), but don’t be fooled. Using any Web application framework is going to be tricky, whether it’s J2EE, ASP.NET, or PHP. In the long run, you can be a lot more productive with Rails than you can be with many other Web application development platforms, but it takes time to learn the ropes.

What is Ruby? What is Rails?

Ruby is a dynamic programming language similar in many respects to Perl, Python, and Smalltalk, but it is its own animal. Java and PHP programmers seem to pick up the language pretty easily and they have been Ruby’s biggest supporters. But others have been attracted to the language, too; including Don Box, who is well known as one of the wonkiest-wonks of the Microsoft world.

Ruby is not new; it was created in 1993, making it older than Java or PHP, both of which were first introduced to the public in 1995. So while Ruby is a mature language, it’s been less popular than some other languages. As a result, the ecosystem that surrounds the Ruby programming language is not as rich as those that have grown up around Java, PHP, or Perl. Consequently, you will find fewer frameworks, libraries, books, Web sites, blogs, and other resources dedicated to the language.

The marketing impotence of the Ruby community changed recently, when David Heinemeier Hanson introduced the Rails framework, arguably the most popular application of Ruby in its history. Rails extends the Ruby programming language into a domain specific language especially well suited for web development. It also leverages ActiveRecord, another language extension that adapts Ruby to object-relational persistence. Other than Rails’ lack of support for compound primary keys and two-phase commit, its biggest obstacle to adoption has been that you need to learn a new programming language to use it. This is not something that most people can simply ignore with a lot of hand-waving; learning a new language can be a fun but daunting task.

If, however, you were interested in expanding your resume, I can think of no other language I would recommend higher than Ruby. Ruby represents the culmination of 10 years of development without the tampering of commercial interests. As a result, Ruby is a delight to work with and, in many cases, is an order of magnitude more productive than Java, C, or Microsoft .NET languages. (The exception may be IronPython, a port of the Python language to the Microsoft .NET environment. Python, like Ruby, is a dynamic and productive programming language.)

What is Rails For?

Rails is designed from the ground up to create dynamic Web sites that use a relational database backend. It adds key words to the Ruby programming language that make Web applications easier to configure. In addition, it’s designed to automatically generate a complete, if somewhat crude, Web application from an existing database schema. The latter is both Ruby’s greatest strength and its Achilles’ heel. Rails makes assumptions about database schema naming conventions that, if followed, make generating a basic Web site a matter of executing single command. But to do this may require additional configurations or in some cases may not be possible at all. You’re also likely to find that just about every database convention that Rails expects can be overridden, but the more overriding that is needed, the less productive the platform becomes. This is why Rails is great when developing “green-field” applications with new databases. Unfortunately, it’s not a great solution when dealing with legacy systems.

The best way to appreciate Rails in green-field application development is via an example. If you already have an Oracle database installed on which you can create new databases and tables, it should take less than 15 minutes to create a complete Web application. In this case, we’ll use Ruby of Rails to build a product catalog.

Example: A Simple Product Catalog

Last year I started investing in high-grade (HG) comic books, specifically old issues from as far back as 1946. I created a simple Ruby on Rails database application that allows me to insert, remove, modify and delete new comics as I buy and sell them. It’s only intended for my use, so I kept it pretty simple. The application that will be developed in this article is a trimmed down version of the Ruby on Rails application I use at home.

Although Rails and Oracle Database can be used on a variety of platforms, this article focuses on Windows XP, arguably one of the most frequently used operating systems by Oracle application developers. This example is pretty simple; it’s essentially the database equivalent of a “Hello World” programming language example. It’s designed to give you a small taste of Ruby, but it doesn’t represent the full capabilities of Rails, any more than a “Hello World” example demonstrates the full capabilities of any programming language.

If you experience problems running this example, it’s likely to be for one of three reasons: Either you downloaded the wrong code, your database is not set up to allow you to connect to it, or your Windows XP operating system is giving you problems. In developing this example, I had a number of problems related to versioning and database configuration—all of which were a result of ignorance. I leaned heavily on a friend of mine, Michael Carland, to get everything working and to make this example as simple as possible.

The fact of the matter is, getting Ruby on Rails and Oracle to work together is not trivial. In fact, it can be a bit frustrating at times. Follow the directions in this article exactly and you shouldn’t have problems. However, once you step outside the boundaries of this example, expect to have some issues. Rails can be very productive, but it’s a command-line development environment and doesn’t come with all of the “automagic” typically associated with advanced integrated development environments. If you are not a “do-it-yourself” technical person, than I wouldn’t recommend Rails to you at this time.

Step 1: Set up the Oracle database

You wouldn’t be reading this article if you were not interested in using Rails in combination with Oracle, so you’ll need to have an installed instance of the Oracle database and you’ll need to add a single table to the database. It’s important that you follow the exact naming conventions used in this article, otherwise a lot of the automatic code generation provided by Rails simply won’t work (without some tweaking). The table you need to create is described as follows:

CREATE TABLE comics ( id NUMBER(10) NOT NULL, title VARCHAR2(60), issue NUMBER(4), publisher VARCHAR2(60), PRIMARY KEY (id) ); CREATE SEQUENCE comics_seq;

There is a SQL Script file here which you can use to create the table and add some product data. I suggest that you use it so that your application is consistent with the one being developed here. The easiest way to do that is to use SQL*Plus as follows. (The assumption is that you already have an Oracle database installed and know how to use it.)

Using SQL*Plus, create a user with DBA privileges that you can use for this application.

SQL> GRANT dba TO ruby IDENTIFIED BY ruby; SQL> ALTER USER ruby DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp; SQL> EXIT

Using the SQL file, create the application table, COMICS, and insert some example data.

C:\> sqlplus ruby/ruby@rails @comics.sql

As you may have noticed, the COMICS table created for this example is plural, which may appear problematic since a common approach is to give tables singular names (e.g. COMIC). However, Rails takes the approach that tables should be named in the plural. This default can be overridden using a Rails configuration but using plural names is easier.

Step 2: Install Ruby, RubyGems, Rails, and the Rails Oracle library

There are two pieces of software you’ll need in order to use Rails on Windows XP: the Ruby programming language with RubyGems installation package, Rails 1.0 (1.1 was recently released; this articles addresses 1.0 only), and the Rails Oracle database library. To download and install Ruby with the Gems package installer, do the following.

  1. Go to http://rubyinstaller.rubyforge.org/.
  2. Download the “One-Click Ruby Installer”.
  3. Follow the installation instructions.

Once the Ruby programming platform is installed you can use RubyGems, a Ruby application that allows you to install Ruby frameworks very easily. To install the Rails application development framework, all you need to do is open a command-line prompt and type in a single command.

C:\> gem install rails -v 1.0.0 --remote

Now that you have Ruby, RubyGems, and Rails installed you can install a specialized code library that will allow your Rails applications to talk to your Oracle database server. To download and install Oracle Rails library, go to http://rubyforge.org/projects/ruby-oci8, download ruby-oci8-0.1.13-mswin.r to your C drive, and then using your command window, execute the following command.

C:\> ruby ruby-oci8-0.1.13-mswin.rb

Assuming that everything went smoothly, you have now installed Ruby, Rails, and the Rails-Oracle connection library. You are now ready to create your first Ruby on Rails Web application.

Step 3: Create the Web Application

In order to create your new Rails application, you will need to create a new Rails project as follows.

Create a new project using the rails command line application (this will automatically create a new directory).

C:\> rails comics_catalog

Change directories so you are in the new project directory created in the previous step.

C:\> cd comics_catalog C:\comics_catalog>

Now that you have a new Rails project directory, you’ll need to configure your project so that the Rails applications will use the Rails-Oracle connection library.

Within your project directory, there is a directory called config and in it is a file named database.yml. You need to edit database.yml using your favorite text editor. Initially, the file will look like this:

development:
adapter: mysql
database: rails_development
host: localhost
username: root
password:

# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: rails_test
host: localhost
username: root
password:

production:
adapter: mysql
database: rails_production
host: localhost
username: root
password:

Different databases require different connection properties. Rails is set up to work with MySQL by default, but you want to re-configure this project to use Oracle. Change the development properties as described on this Oracle on Rails wiki page. (You could change the test and production properties also, but the scope of this article doesn’t include testing or production releases.)

There are a number of approaches to creating a Web application in Rails, but the simplest by far is to use scaffold, a command line feature in Rails 1.0.0, which will build the entire application in a single command.

C:\comics_catalog> ruby script/generate scaffold Comic

Other than a cascade of output in the command window, what just happened? Well, the Rails code generator created model, view, and controller Ruby code to access the COMICS table. In this case you created the application using the Rails scaffold, which does all the work for you. If you make any changes to the database tables, you’ll need to run the scaffold command again. Otherwise, your application may not work.

Now that the web application has been generated, you can start the Ruby Web server, WEBRick.

C:\comics_catalog> ruby script/server

You can change the Ruby code for your application or the COMICS table at anytime without having to restart the web server. However, if you change the database configuration file (i.e. database.yml) you will need to restart the server.

Now you can access your Rails Comic Catalog application on your own development machine, using your favorite Web browser. Just access the following URL.

http://localhost:3000/comics/list

Your browser should show a list of comics in your Catalog like the one in Figure 1.


Figure 1: Product Catalog List

When you use the scaffold to create a Rails Web application, it will automatically create three Web components that allow you to see a list of all records in the target database table and to insert, modify, and delete records in that table. Figure 1 shows a list of all of the sample data that was inserted into your database table when you executed the SQL script at the start of this tutorial.

In addition to the Listing view, there is also a details view. Just click on any of the “Show” links to see a Web paged dedicated to displaying the data in that particular record. Figure 2 is an example of this details page.


Figure 2: The Details Page

You can also edit any record in the database table. Click on the “Back” link, or use your browser back button to get back to the Listing page, then click on the “Edit” link of any record. Figure 3 shows an example of the Editing view of one of the records in the COMICS database table.


Figure 3: The Editing View

You can also add new records to the COMICS table by going back to the Listing view and clicking on the “New Comic” link. This will present you with an insertion view similar to the one in figure 3, except the fields will all be blank.

Mastering Rails

While the Product Catalog example showed how easy it is to create a very simple application using Rails, it’s not all that useful except for tracking inventory. You can create much more complicated Web applications with Rails, but that will require that you jump into the code a bit, which would require some study. Rails is an easy framework to work with, but like any technology it takes time to master. At this point, I can only recommend Rails to technically-savvy individuals and development teams who are embarking on “green-field” application development. If you don’t fall into this rough category, I wouldn’t recommend using Rails until the tooling has matured.

In order to really master Rails, you should read a book, a number of which will be available later this year, but one that is very good and is available now is Agile Web Programming with Ruby on Rails by David Heninmier Hanson and Dave Thomas (Published by Pragmatic Bookshelf, 2005). Hanson is, of course, the guy who created Rails and Thomas is one of the authors of Programming Ruby: The Pragmatic Programmers' Guide (Pragmatic Bookshelf; 2nd edition, 2004).


Oracle: Query DB Cache Advice

select
size_for_estimate c1,
buffers_for_estimate c2,
estd_physical_read_factor c3,
estd_physical_reads c4
from
v$db_cache_advice
where
name = 'DEFAULT'
and
block_size = (SELECT value FROM V$PARAMETER
WHERE name = 'db_block_size')
and
advice_status = 'ON'

Oracle: Query Used space in Meg by segment type

rem -----------------------------------------------------------------------
rem Filename: usedsp.sql
rem Purpose: Used space in Meg by segment type
rem Author: Frank Naude, Oracle FAQ
rem -----------------------------------------------------------------------

set pagesize 50000
set line 80

col "Total Used Meg" format 999,999,990
col "Data part" format 999,999,990
col "Index part" format 999,999,990
col "LOB part" format 999,999,990
col "RBS part" format 999,999,990

tti 'Used space in Meg by segment type'

select sum(bytes)/1024/1024 "Total Used",
sum( decode( substr(segment_type,1,5), 'TABLE', bytes/1024/1024, 0))
"Data part",
sum( decode( substr(segment_type,1,5), 'INDEX', bytes/1024/1024, 0))
"Index part",
sum( decode( substr(segment_type,1,3), 'LOB', bytes/1024/1024, 0))
"LOB part",
sum( decode(segment_type, 'ROLLBACK', bytes/1024/1024, 0))
"RBS part",
sum( decode(segment_type, 'TEMPORARY', bytes/1024/1024, 0))
"TEMP part"
from sys.dba_segments
/
tti off

tti "Total database size"

select sum(bytes)/1024/1024 "Total DB size in Meg"
from sys.v_$datafile
/
tti off

Tuesday, May 27, 2008

Exporting your Printer Configuration in Linux

Have you ever encounter when you need to transfer hundreds of printer configuration from one linux box to another, well I have fortunately I have found an article on the web on how to easily you can export those configurations.

Saving the Configuration File

When you save your printer configuration using Printer Configuration Tool, it creates its own configuration file that is used to create the /etc/printcap file that the printer daemon (lpd) reads. You can use the command line options to save or restore this file. If you save your /etc/printcap file and overwrite your existing /etc/printcap file with the saved file, your printer configuration will not be restored. Each time the printer daemon is restarted, it creates a new /etc/printcap file from the special Printer Configuration Tool configuration file. If you have configured a backup system for your configuration files, you should use the following method to save your printer configuration. If you added any custom settings in the /etc/printcap.local file, you should save it as part of your backup system also.

To save your printer configuration, type this command as root:

/usr/sbin/redhat-config-printer-tui --Xexport > settings.xml

Your configuration is saved to the file settings.xml.

If you save this file, you can restore your printer settings. This is useful if your printer configuration is deleted, you reinstall Red Hat Linux and do not have your printer configuration file anymore, or you want to use the same printer configuration on multiple systems. To restore the configuration, type this command as root:

/usr/sbin/redhat-config-printer-tui --Ximport <>

If you already have a configuration file (you have configured one or more printers on the system already) and you try to import another configuration file, the existing configuration file will be overwritten. If you want to keep your existing configuration and add the configuration in the saved file, you can merge the files with the following command (as root):

/usr/sbin/redhat-config-printer-tui --Ximport --merge <>

Your printer list will then consist of the printers you configured on the system as well as the printers you imported from the saved configuration file. If the imported configuration file has a print queue with the same name as an existing print queue on the system, the print queue from the imported file will override the existing printer.

After importing the configuration file (with or without the merge command), you must restart the printer daemon with the command /sbin/service lpd restart or by starting Printer Configuration Tool and clicking Apply.

Setup Oracle Standby Database ( Data Guard )

Oracle9i Data Guard is the new name for Oracle8i Standby Server, incorporating a large number of new features. In this article I shall only focus on those relevant to the "Oracle9i Database: New Features For Administrators" OCP exam. For more detailed information read the Oracle9i Data Guard Concepts and Administration documentation.

Architecture

The Oracle9i Data Guard architecture incorporates the following items:

  • Primary Database - A production database that is used to create standby databases. The archive logs from the primary database are transfered and applied to standby databases. Each standby can only be associated with a single primary database, but a single primary database can be associated with multiple standby databases.
  • Standby Database - A replica of the primary database.
  • Log Transport Services - Control the automatic transfer of archive redo log files from the primary database to one or more standby destinations.
  • Network Configuration - The primary database is connected to one or more standby databases using Oracle Net.
  • Log Apply Services - Apply the archived redo logs to the standby database. The Managed Recovery Process (MRP) actually does the work of maintaining and applying the archived redo logs.
  • Role Management Services - Control the changing of database roles from primary to standby. The services include switchover, switchback and failover.
  • Data Guard Broker - Controls the creation and monitoring of Data Guard. It comes with a GUI and command line interface.

The services required on the primary database are:

  • Log Writer Process (LGWR) - Collects redo information and updates the online redo logs. It can also create local archived redo logs and transmit online redo to standby databases.
  • Archiver Process (ARCn) - One or more archiver processes make copies of online redo logs either locally or remotely for standby databases.
  • Fetch Archive Log (FAL) Server - Services requests for archive redo logs from FAL clients running on multiple standby databases. Multiple FAL servers can be run on a primary database, one for each FAL request. .

The services required on the standby database are:

  • Fetch Archive Log (FAL) Client - Pulls archived redo log files from the primary site. Initiates transfer of archived redo logs when it detects a gap sequence.
  • Remote File Server (RFS) - Receives archived and/or standby redo logs from the primary database.
  • Archiver (ARCn) Processes - Archives the standby redo logs applied by the managed recovery process (MRP).
  • Managed Recovery Process (MRP) - Applies archive redo log information to the standby database.

Database Synchronization Options

Data Guard can be configured to run with varying synchronization modes indicating the potential for data loss:

  • No-Data-Loss mode : This simply means that the log transport services will not acknowledge modifications to the primary database until they are available to the standby database. This doesn't mean that the modifications have been applied to the standby database, merely that the log information is available to the log apply services should failover occur. This mode is implemented using standby redo logs on the standby server.
  • No-Data-Divergence mode : This is an extension of the no-data-loss mode whereby modifications to the primary database are prevented if conectivity between the primary and at least one standby database is unavailable.
  • Minimal-Data-Loss mode : When the performance requirements of the primary database are the top priority this mode provides the optimum balance of data protection and performance.

Setup No-Data-Divergence

To setup no-data-divergence, the most extreme level of data protection, then do the following:

Setup Primary Database

  • Shutdown the database using: SHUTDOWN IMMEDIATE
  • Backup all database files.
  • Add an entry for the standby server into the tnsnames.ora file:
stby1=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myServerName)(PORT = 1512))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = stby1.world)
    )
  )
  • Assuming your database in already in ARCHIVELOG mode one of the archive destinations will be set. Add the other entires:
CONTROL_FILES=primary.ctl
COMPATIBLE=9.0.1.0.0
LOG_ARCHIVE_START=true
LOG_ARCHIVE_DEST_1='LOCATION=C:\Oracle\Oradata\TSH1\Archive MANDATORY REOPEN=30'
LOG_ARCHIVE_DEST_2='SERVICE=stby1 LGWR SYNC AFFIRM'
LOG_ARCHIVE_DEST_STATE_1=enable
LOG_ARCHIVE_DEST_STATE_2=enable
LOG_ARCHIVE_FORMAT=arc%t_%s.arc
REMOTE_ARCHIVE_ENABLE=true

The LGWR SYNC AFFIRM keywords indicate that the Logwriter should synchronously write updates to the online redo logs to this location and wait for confirmation of the write before proceeding. The remote site will process and archive these standby redo logs to keep the databases synchronized. This whole process can impact performance greatly but provides maximum data security.

  • Startup the database using: STARTUP PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
  • Create standby database controlfile using: ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'c:\stbycf.f';

Setup Standby Database

  • Copy the production backup files to the standby server.
  • Copy the standby controlfile to the standby server.
  • Alter the control_files and archive parameters of the init.ora as follows:
SERVICE_NAMES = stby1
CONTROL_FILES=standby.ctl
COMPATIBLE=9.0.1.0.0
LOG_ARCHIVE_START=true
LOCK_NAME_SPACE=stby1
FAL_SERVER=prim1
FAL_CLIENT=stby1
 
# Uncomment is filename conversion is needed
#DB_FILE_NAME_CONVERT=("/primary","/standby")
#LOG_FILE_NAME_CONVERT=("/primary","/standby")
 
STANDBY_ARCHIVE_DEST=C:\Oracle\Oradata\TSH1\Archive
LOG_ARCHIVE_DEST_1='LOCATION=C:\Oracle\Oradata\TSH1\Archive'
LOG_ARCHIVE_TRACE=127
LOG_ARCHIVE_FORMAT=arc%t_%s.arc
STANDBY_FILE_MANAGEMENT=auto
REMOTE_ARCHIVE_ENABLE=true
  • Add the following entries into the listener.ora file:
(ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1512))
)
 
STANDBY_LISTENER = (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=myHost))
)

The file should resemble the following:

# LISTENER.ORA Network Configuration File: C:\Oracle\Ora901\network\admin\listener.ora
# Generated by Oracle configuration tools.
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1512))
      )
    )
    (DESCRIPTION =
      (PROTOCOL_STACK =
        (PRESENTATION = GIOP)
        (SESSION = RAW)
      )
      (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 2481))
    )
  )
 
STANDBY_LISTENER = (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=myHost))
)
 
 
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC = (SID_NAME = PLSExtProc)(ORACLE_HOME = C:\Oracle\Ora901)(PROGRAM = extproc))
    (SID_DESC = (ORACLE_HOME = C:\Oracle\Ora901) (SID_NAME = TSH1)
    )
  )
  • Reload the listener file using lsnrctl reload from the command prompt.
  • Add the following entry into the tnsnames.ora file:
stby1=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myServerName)(PORT = 1512))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = stby1.world)
    )
  )

Create standby redo logs on the standby database to receive online redo information from the Logwriter on the primary database. The minimum number of groups required is an exact match, number and size, of the primary database, but performance may be increased by adding more:

ALTER DATABASE ADD STANDBY LOGFILE GROUP 10
  ('C:\Oracle\Oradata\TSH1\redo1a.log','C:\Oracle\Oradata\TSH1\redo1b.log') SIZE 500K;

Start Managed Standby Recovery

During managed recovery the transfer of archivelogs is controlled by the servers without user intervention.

  • Copy all archive logs from the primary to the standby server. This is the only time you should need to do this.
  • From sqlplus do the following:
SQL> CONNECT sys/password AS SYSDBA
SQL> STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Protect Primary Database

Now that Data Guard is configured and running the primary database can be prevented from applying updates unless the update has been sent to at least one standby location. Connect to the primary database and execute:

ALTER DATABASE SET STANDBY DATABASE PROTECTED;

Cancel Managed Standby Recovery

To stop managed standby recovery:

SQL> -- Cancel protected mode on primary
SQL> CONNECT sys/password@primary1 AS SYSDBA
SQL> ALTER DATABASE SET STANDBY DATABASE UNPROTECTED;
SQL> 
SQL> -- Cancel recovery if necessary
SQL> CONNECT sys/password@standby1 AS SYSDBA
SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN READ ONLY;

The database can subsequently be switched back to recovery mode as follows:

SQL> -- Startup managed recovery
SQL> CONNECT sys/password@standby1 AS SYSDBA
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
 
SQL> -- Protect primary database
SQL> CONNECT sys/password@primary1 AS SYSDBA
SQL> ALTER DATABASE SET STANDBY DATABASE PROTECTED;

Activating A Standby Database

If the primary database is not available the standby database can be activated as a primary database using the following statements:

SQL> -- Cancel recovery if necessary
SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;

Since the standby database is now the primary database it should be backed up immediately. The previous primary database can then be configured as a standby.

Backup Standby Database

Backups of the standby database can only be performed if the database is shut down or in read only mode. Read only mode is best for managed recovery systems as archive logs will still be transfered during the backup process, thus preventing gap sequences. Once the server is in the desired mode simply copy the appropriate database files.

Database Switchover

A database can be in one of two mutually exclusive modes (primary or standby). These roles can be altered at runtime without loss of data or resetting of redo logs. This process is known as a Switchover and can be performed using the following statements:

-- Convert primary database to standby
CONNECT sys/change_on_install@prim1 AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY;
 
-- Shutdown primary database
SHUTDOWN IMMEDIATE;
 
-- Mount old primary database as standby database
STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
 
 
-- Convert standby database to primary
CONNECT sys/change_on_install@stby1 AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
 
-- Shutdown standby database
SHUTDOWN IMMEDIATE;
 
-- Open old standby database as primary
STARTUP PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora

This process has no affect on alternative standby locations. The process of converting the instances back to their original roles is known as a Switchback. The switchback is accomplished by performing another switchover.

Database Failover

Graceful Database Failover occurs when database failover causes a standby database to be converted to a primary database:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE ACTIVATE STANDBY DATABASE;

This process will recovery all or some of the application data using the standby redo logs, therefore avoiding reinstantiation of other standby databases. If completed successfully, only the primary database will need to be reinstatiated as a standby database.

Forced Database Failover changes one standby database to a primary database. Application data may be lost neccessitating the reinstantiation of the primary and all standby databases.

Automatic Archive Gap Detection

Gaps in the sequence of archive logs can be created when changes are applied to the primary database while the standby database is unavailable. In Oracle8i the archive redo logs associated with these gaps had to be identified using the V$ARCHIVE_GAP view and copied manually to the standby server before managed recovery could be initiated again. In Oracle9i most of these gap sequences can be resolved automatically. The following parameters must be added to the standby init.ora file where the values indicate net services names.

FAL_SERVER = 'primary_db1'
FAL_CLIENT = 'standby_db1'

The FAL server is normally the primary database, but can be another standby database. Once the standby database is placed in managed recovery mode it will automatically check for gap sequences. If it finds any it will request the appropriate files from the primary database via the FAL server. If the gap sequences cannot be resolved the files have to be recovered manually.

Background Managed Recovery

In Oracle8i managed recovery caused the user session to hang until the process was stopped by the user. This type of recovery is still available along with a background recovery that spawns a new background process and frees the user session:

-- User session hangs
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
 
-- User session released
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Delayed Redo Application

Application of the archived redo logs to the standby database can be delayed using the DELAY keyword. If a rogue statement significantly damages the primary database the DBA can choose to switch to the standby database, which will be in a state prior to this action:

-- Delay application of archived redo logs by 30 minutes.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DELAY 30;
 
-- Return to no delay (Default).
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;

For further information see:

CUPS printer commands

More information can be found on the CUPS website: http://www.cups.org/documentation.php

Basic CUPS commands

cancel

Allows you to cancel all jobs, all jobs on a specific printer or individual jobs

lpq

show printer queue status on specific printer, or all printers

lpq -P printername

lists all queued jobs on target printer

accept

accept jobs sent to a destination

reject

reject jobs sent to a destination

lp

show printer queue status on specific printer, or all printers

lpq -P printername

lists all queued jobs on target printer

lp

submits files for printing or alters a pending job

lpadmin

configure cups printers and classes

lpadmin -x printername

deletes target printer

lpinfo

lists the available devices or drivers known to the CUPS server

lpmove

moves the specified job or all jobs from source to destination

lpoptions

display or set printer options and defaults

lprm

cancels print jobs that have been queued for printing

lpstat

displays status information about the current classes, jobs, and printers

lpstat -t

Lists all printers and all status information

lpstat -a

Lists all printers and accepting state

Printer hangs up on a job

  1. Turn off the printer
  2. Ssh into the print server
  3. lpq -P PrinterName

This will list all jobs queued on the hung printer. In most cases, deleting all submitted jobs is safest

  1. Cancel -a PrinterName

Cancels all submitted jobs on target printer

  1. Restart printer

Check that jobs are printing

Clearing Boelter Lab print queues daily

  1. cancel -a `lpstat -t | grep disabled | awk '{print $2}'`

This will list all printers that are currently disabled, and cancel queued jobs on those printers

  1. /usr/bin/enable `lpstat -t | grep disabled | awk '{print $2}'`

This will re-enable the stopped print queues

  1. lpstat -t | grep disabled | awk '{print $2}'

This checks to see that all printers are re-enabled. Should return nothing.

Remove printers from client computer

  1. lpadmin -x `lpstat -a | awk '{printf $1 " "}'`

Lists all printers on client, sorts the printer names into a string, then issues lpadmin -x (removal) command to each printer. Command only deletes a printer at a time right now.

Friday, April 04, 2008

Glory be to God

I was so amazed on how have God blessed me with so many things and that I was unaware that they do exists. I am really thankfull for the mercy,support,comfort and love that our Lord thy God gave me and to my family. I could not express the joy and happiness that I feel right now because the first operation of my new born daughter is a success. She will have another operation to be scheduled next month I know that through prayers coupled with faith nothing is impossible. I would like also to thank the people who fervently prayed for my daughters wellbeing and I will pray to God for your blessing and protection for you and your family.

My lovely daughter was diagnosed with cystic hygroma when she is still 5 months in the womb, even though the name of it is very exotic to my vocabulary I was not moved because the name of God is powerfull than any sickness that is in this world. I prayed and asked my friends,families and church members to pray for the health of my child and you know what when she was born the doctors and nurses said that she is a healthy baby even though her cystic hygroma on her neck is bigger than her head she is still healthy and I thank God for her faithfulness in me.

After she was born the doctor ordered that she take a CT-SCAN test to know how far and how or what is the status of her cystic hygroma. After we have received the results I gave it to our pediatrician and he was alarmed of the result, he was alarmed not because of the cystic hyrgroma but ther is another problem that they see in my daughter. She has what they call Diaphragmatic Hernia which is a more critical case than cystic hygroma because the cystic hygroma of my daughter is not blocking her trachea and did not reach her brain but the diaphragmatic hernia is making her hard to breathe so we need to admit her and schedule the operation. And again we prayed together with my friends and my family and indeed God is good becuase the operation is a success and she will be ready for her another operation on her cystic hygroma next month.

To all who prayed and bless my daughter I thank you and I know God is a faithfull God that will give you blessings in return for your kindness. Thanks you and God bless

Tuesday, March 18, 2008

Oracle Database 11g

Oracle Database 11g, building on Oracle's unique ability to deliver Grid Computing, gives Oracle customers the agility to respond faster to changing business conditions, gain competitive advantage through technology innovation, and reduce costs.

With Oracle Database 11g you can:

  • Adopt new technology faster with Real Application Testing
  • Manage more data for less with advanced compression and partitioning
  • Simplify systems by storing all your data in the Oracle Database with Oracle Secure Files
  • Maximize the ROI of disaster recovery resources with Oracle Active Data Guard
  • Free critical personnel for strategic tasks with management automation
  • And much, much more...

Friday, February 08, 2008

Linux : How to mount remote windows partition (windows share) under Linux

All files accessible in a Linux (and UNIX) system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree.

Use the mount command to mount remote windows partition or windows share under Linux as follows:

Procedure to mount remote windows partition (NAS share)

1) Make sure you have following information:
==> Windows username and password to access share name
==> Sharename (such as //server/share) or IP address
==> root level access on Linux

2) Login to Linux as a root user (or use su command)

3) Create the required mount point:
# mkdir -p /mnt/ntserver
4) Use the mount command as follows:
# mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver

Use following command if you are using Old version such as RHEL <=4 or Debian <= 3:
# mount -t smbfs -o username=vivek,password=D1W4x9sw //ntserver/download /mnt/ntserver

5) Access Windows 2003/2000/NT share using cd and ls command:
# cd /mnt/ntserver; ls -l
Where,

  • -t smbfs : File system type to be mount (outdated, use cifs)
  • -t cifs : File system type to be mount
  • -o : are options passed to mount command, in this example I had passed two options. First argument is password (vivek) and second argument is password to connect remote windows box
  • //ntserver/download : Windows 2000/NT share name
  • /mnt/ntserver Linux mount point (to access share after mounting)

Oracle : Oracle's In-Memory Undo

The Oracle database is extremely complex software. Part of the solution to performance optimization is Oracle Corporation itself optimizing the core database kernel code. One such optimization is the introduction of Oracle's patented In-memory undo (IMU). Essentially, instead of maintaining undo in Oracle segments, the undo is managed, as much as possible, in memory using structures optimized for in-memory operations. How Oracle does this is fascinating and foreshadows even greater things to come. But with any piece of code, there is always the possibility of a bottleneck, so this paper covers how to detect IMU performance issues and multiple ways to potentially solve the problem (in addition to just tuning it off).


Click here to download the whitepaper

Tuesday, February 05, 2008

Linux : Unbreakable Linux

I have been working as an Oracle Database Administrator for about 2 years now and one thing that really bugs me when installing a new Oracle Enterprise Database is that the configuration and the libraries that will be needed when you try to install one. I have experienced it that I have to scour the internet to find the program or the libraries needed to run this Oracle Enterprise Database in this certain Linux operating system. Thanks to Oracle they have released this Linux that is called

UNBREAKABLE LINUX


Thanks to this Linux Distro (Oracle Enterprise Linux), I can easily setup a new Oracle Database without all the hassle of having to search for libraries that are not included in some Linux Distros. One thing I have notice is that almost all of the Oracle essentials are here in this Linux Distribution. The package installer for ASM, OCFS2 and some other libraries are here so you will not have a hard time in installing or downloading those stuffs. This OEL (Oracle Enterprise Linux) is like a tailored made operating system for Oracle products. It has all the programs and securities that an Oracle product would need.

If you would like to have more info please visit the link below
Ubreakable Linux

Linux : chown: Changes the owner of a file and/or the group the file is associated with

chown [options] owner file-list

chown [options] owner:group file-list

chown [options] owner: file-list

chown [options] :group file-list

chown [options] ––reference=rfile file-list


The chown utility changes the owner of a file and/or the group the file is associated with. Only root can change the owner of a file. Only root or the owner of a file who belongs to the new group can change the group a file is associated with.

Arguments

The owner is the username or numeric user ID of the new owner. The file-list is a list of the pathnames of the files whose ownership and/or group association you want to change. The group is the group name or numeric group ID of the new group that the file is associated with. Table V-9 shows the ways you can specify the new owner and/or group.

Table V-9. Specifying the new owner and/or group

Argument

Meaning

owner

The new owner of file-list; the group is not changed

owner:group

The new owner and new group association of file-list

owner:

The new owner of file-list; the group association is changed to that of the new owner's login group

:group

The new group associated with file-list; the owner is not changed


Options

Accepts the common options described on page 587.

––changes

–c

Displays a message for each file whose ownership/group is changed.

––dereference

Changes the ownership/group of the files symbolic links point to, not the symbolic links themselves. The default is ––no-dereference.

––quiet or ––silent

–f

Prevents chown from displaying error messages when it is unable to change the ownership/group of a file.


––no-dereference

–h

Changes the ownership/group of symbolic links, not the files that the links point to (default).

––recursive

–R

When you include directories in the file-list, this option descends the directory hierarchy, setting the specified ownership/group for all files encountered.


––reference=rfile

Changes the ownership and group association of the files in the file-list to that of rfile.

––verbose

–v

Displays for each file a message saying whether its ownership/group was retained or changed.


Notes

The chown utility clears setuid and setgid bits when it changes the owner of a file.

Examples

The following command changes the owner of the chapter1 file in the manuals directory. The new owner is Jenny:

# chown jenny manuals/chapter1


The following command makes Alex the owner of, and Alex's login group the group associated with, all files in the /home/alex/literature directory and in all its subdirectories:

# chown --recursive alex: /home/alex/literature


The next command changes the ownership of the files in literature to alex and the group associated with these files to pubs:

# chown alex:pubs /home/alex/literature/*


The final example changes the group association of the files in manuals to pubs without altering their ownership. The owner of the files, who is executing this command, must belong to the pubs group.

$ chown :pubs manuals/* 

Linux : chmod: Changes the access mode (permissions) of a file

chmod [options] who operator permission file-list (symbolic)

chmod [options] mode file-list (absolute)

chmod [options] ––reference=rfile file-list (referential)


The chmod utility changes the ways in which a file can be accessed by the owner of the file, the group to which the file belongs, and/or all other users. Only the owner of a file or Superuser can change the access mode, or permissions, of a file. You can specify the new access mode absolutely, symbolically, or referentially.

Arguments

Arguments specify which files are to have their modes changed in what ways.

Symbolic

You can specify multiple sets of symbolic modes (who operator permission) by separating each set from the next with a comma.

The chmod utility changes the access permission for the class of users specified by who. The class of users is designated by one or more of the letters specified in the who column of Table V-4.

Table V-4. Symbolic mode user class specification

who

User class

Meaning

u

User

Owner of the file

g

Group

Group to which the owner belongs

o

Other

All other users

a

All

Can be used in place of ugo


Table V-5 lists the symbolic mode operators.

Table V-5. Symbolic mode operators

operator

Meaning

+

Adds permission for the specified user class

Removes permission for the specified user class

=

Sets permission for the specified user class—resets all other permissions for that user class


The access permission is specified by one or more of the letters listed in Table V-6.

Table V-6. Symbolic mode permissions

permission

Meaning

r

Sets read permission

w

Sets write permission

x

Sets execute permission

s

Sets user ID or group ID (depending on the who argument) to that of the owner of the file while the file is being executed (For more information see page 94.)

t

Sets the sticky bit (Only Superuser can set the sticky bit, and it can be used only with u; see page 903.)

X

Makes the file executable only if it is a directory or if another user class has execute permission

u

Sets specified permissions to those of the owner

g

Sets specified permissions to those of the group

o

Sets specified permissions to those of others


Absolute

You can use an octal number to specify the access mode. Construct the number by ORing the appropriate values from Table V-7. To OR two octal numbers from this table, just add them. (Refer to Table V-8 for examples.)

Table V-7. Absolute mode specifications

mode

Meaning

4000

Sets user ID when the program is executed (page 94)

2000

Sets group ID when the program is executed (page 94)

1000

Sticky bit (page 903)

0400

Owner can read the file

0200

Owner can write to the file

0100

Owner can execute the file

0040

Group can read the file

0020

Group can write to the file

0010

Group can execute the file

0004

Others can read the file

0002

Others can write to the file

0001

Others can execute the file


Table V-8. Examples of absolute mode specifications

Mode

Meaning

0777

Owner, group, and others can read, write, and execute file

0755

Owner can read, write, and execute file; group and others can read and execute file

0711

Owner can read, write, and execute file; group and others can execute file

0644

Owner can read and write file; group and others can read file

0640

Owner can read and write file, group can read file, and others cannot access file


Table V-8 lists some typical modes.

Options

––changes

–c

Displays a message giving the new permissions for each file whose mode is changed.

––quiet or ––silent

–f

Prevents the display of warning messages about files whose permissions prevent chmod from changing the permissions of the file.

––recursive

–R

Recursively descends a directory specified in file-list and changes the permissions on all files in the directory hierarchy.


––reference=rfile

Changes the permissions of the files in file-list to that of rfile.

––verbose

–v

Displays for each file a message saying that its permissions were changed (even if they were not changed) and specifying the permissions. Use ––changes to display messages only when permissions are actually changed.


Notes

When you are using symbolic arguments, you can omit the permission from the command line only when the operator is =. This omission takes away all permissions. See the second example in the next section.

Examples

The following examples show how to use the chmod utility to change the permissions of the file named temp. The initial access mode of temp is shown by ls (see "Discussion" on page 710 for information about the ls display):

$ ls -l temp

-rw-rw-r-- 1 alex pubs 57 Jul 12 16:47 temp


When you do not follow an equal sign with a permission, chmod removes all permissions for the specified user class. The following command removes all access permissions for the group and all other users so that only the owner has access to the file:

$ chmod go= temp

$ ls -l temp

-rw------- 1 alex pubs 57 Jul 12 16:47 temp


The next command changes the access modes for all users (owner, group, and others) to read and write. Now anyone can read from or write to the file.

$ chmod a=rw temp

$ ls -l temp

-rw-rw-rw- 1 alex pubs 57 Jul 12 16:47 temp


Using an absolute argument, a=rw becomes 666. The next command performs the same function as the previous one:

$ chmod 666 temp


The next command removes write access permission for other users. As a result members of the pubs group can still read from and write to the file, but other users can only read from the file:

$ chmod o-w temp

$ ls -l temp

-rw-rw-r-- 1 alex pubs 57 Jul 12 16:47 temp


The following command yields the same result, using an absolute argument:

$ chmod 664 temp


The next command adds execute access permission for all users:

$ chmod a+x temp

$ ls -l temp

-rwxrwxr-x 1 alex pubs 57 Jul 12 16:47 temp


If temp is a shell script or other executable file, all users can now execute it. (You need read and execute access to execute a shell script but only execute access to execute a binary file.) The absolute command that yields the same result is

$ chmod 775 temp


The final command uses symbolic arguments to achieve the same result as the preceding one. It sets permissions to read, write, and execute for the owner, and to read and write for the group and other users. A comma separates the sets of symbolic modes.

$ chmod u=rwx,go=rw temp

Linux : chgrp: Changes the group associated with a file

chgrp [options] group file-list

chgrp [options] ––reference=rfile file-list


The chgrp utility changes the group associated with one or more files.

Arguments

The group is the name or numeric group ID of the new group. The file-list is a list of the pathnames of the files whose group association is to be changed. The rfile is the pathname of a file whose group is to become the new group associated with file-list.

Options

––changes

–c

Displays a message for each file whose group is changed.

––dereference

Changes the group IDs of the files symbolic links point to, not the symbolic links themselves. The default is ––no-dereference.

––quiet or ––silent

–f

Prevents the display of warning messages about files whose permissions prevent you from changing their group IDs.


––no-dereference

–h

Changes the group IDs of symbolic links, not the files that the links point to (default).

––recursive

–R

Recursively descends a directory specified in file-list and changes the group ID on all files in the directory hierarchy.


––reference=rfile

Changes the group of the files in file-list to that of rfile.

––verbose

–v

Displays for each file a message saying whether its group was retained or changed.


Notes

Only the owner of a file or root can change the group association of a file. Also, unless you are root, you must belong to the specified group to change the group ID of a file to that group.

Examples

The following command changes the group that the manuals file is associated with; the new group is pubs.

$ chgrp pubs manuals 

Linux : cd: Changes to another working directory

cd [options] [directory]


The cd builtin makes directory the working directory.

Arguments

The directory is the pathname of the directory you want to be the new working directory. Without an argument, cd makes your home directory the working directory. Using a hyphen in place of directory changes to the previous working directory.

Notes

The cd command is a bash and tcsh builtin.


Without an argument, cd makes your home directory the working directory; it uses the value of the HOME (bash;) or home (tcsh) variable for this purpose.

With an argument of a hyphen, cd makes the previous working directory the working directory. It uses the value of the OLDPWD (bash) or owd (tcsh) variable for this purpose.

The CDPATH (bash;) or cdpath (tcsh; ) variable contains a colon-separated list of directories that cd searches. Within the list a null directory name (::) or a period (:.:) represents the working directory. If CDPATH or cdpath is not set, cd searches only the working directory for directory. If this variable is set and directory is not an absolute pathname (does not begin with a slash), cd searches the directories in the list; if the search fails, cd searches the working directory.

Examples

The following cd command makes Alex's home directory his working directory. The pwd builtin verifies the change:

$ pwd

/home/alex/literature

$ cd

$ pwd

/home/alex


The next command makes the /home/alex/literature directory the working directory:

$ cd /home/alex/literature

$ pwd

/home/alex/literature


Next the cd utility makes a subdirectory of the working directory the new working directory:

$ cd memos

$ pwd

/home/alex/literature/memos


Finally cd uses the . . reference to the parent of the working directory to make the parent the new working directory:

$ cd ..

$ pwd

/home/alex/literature

Linux : cat: Joins and displays files

cat [options] [file-list]


The cat utility copies files to standard output. You can use cat to display the contents of one or more text files on the screen.

Arguments

The file-list is a list of the pathnames of one or more files that cat processes. If you do not specify an argument or if you specify a hyphen () in place of a filename, cat reads from standard input.

Options

Accepts the common options described on page 587.

––show-all

–A

Same as –vET.


––number-nonblank

–b

Numbers all lines that are not blank as they are written to standard output.

–e

(end) Same as –vE.

––show-ends

–E

Marks the ends of lines with dollar signs.

––number

–n

(number) Numbers all lines as they are written to standard output.

––squeeze-blank

–s

Removes extra blank lines so there are never two or more blank lines in a row.

–t

(tab) Same as –vT.

––show-tabs

–T

Marks each TAB with ^I.


––show-nonprinting

–v

Displays CONTROL characters with the caret notation (^M) and displays characters that have the high bit set (META characters) with the M- notation. This option does not convert TABs and LINEFEEDs. Use ––show-tabs if you want to display TABs as ^I. LINEFEEDs cannot be displayed as anything but themselves; otherwise, the line would be too long.


Notes

See page 115 for a discussion of cat, standard input, and standard output.

Use the od utility (page 737) to display the contents of a file that does not contain text (for example, an executable program file).

Use the tac utility to display lines of a text file in reverse order. See the tac info page for more information.

The name cat is derived from one of the functions of this utility, catenate, which means to join together sequentially, or end to end.

caution: Set noclobber to avoid overwriting a file

Despite cat's warning message, the shell destroys the input file (letter) before invoking cat in the following example:

$ cat memo letter > letter

cat: letter: input file is output file


You can prevent overwriting a file in this situation by setting the noclobber variable (pages 119 and 367).


Examples

The following command displays the contents of the memo text file on the terminal:

$ cat memo

...


The next example catenates three text files and redirects the output to the all file:

$ cat page1 letter memo > all


You can use cat to create short text files without using an editor. Enter the following command line, type (or paste) the text you want in the file, and press CONTROL-D on a line by itself:

$ cat > new_file

...

(text)

...

CONTROL-D


In this case cat takes input from standard input (the keyboard) and the shell redirects standard output (a copy of the input) to the file you specify. The CONTROL-D signals the EOF (end of file) and causes cat to return control to the shell

In the next example, a pipe sends the output from who to standard input of cat. The shell redirects cat's output to the file named output that, after the commands have finished executing, contains the contents of the header file, the output of who, and footer. The hyphen on the command line causes cat to read standard input after reading header and before reading footer.

$ who | cat header - footer > output 

Linux : Checks a file for spelling errors

aspell check [options]filename

aspell list [options] < filename

aspell config

aspell help


The aspell utility checks the spelling of words in a document against a standard dictionary. You can use aspell interactively: It displays each misspelled word in context, together with a menu that gives you the choice of accepting the word as is, choosing one of aspell's suggested replacements for the word, inserting the word into your personal dictionary, or replacing the word with one you enter. You can also use aspell in batch mode so that it reads from standard input and writes to standard output.

tip: aspell is not like other utilities regarding its input

Unlike many other utilities, aspell does not accept input from standard input when you do not specify a filename on the command line. Instead, the action specifies where aspell gets its input.


Action

You must choose one and only one action when you run aspell.

check

–c

Runs aspell as an interactive spelling checker. Input comes from a single file named on the command line. Refer to "Discussion" on page 590.

config

Displays aspell's configuration, both default and current values. Send the output through a pipe to less for easier viewing, or use grep to find the option you are looking for (for example, aspell config | grep backup).

help

–?

Displays an extensive page of help. Send the output through a pipe to less for easier viewing.

list

–l

Runs aspell in batch mode (noninteractively) with input coming from standard input and output going to standard output.


Arguments

The filename is the name of the file you want to check. The aspell utility accepts this argument only when you use the check (–c) action. With the list (–l) action, input must come from standard input.

Options

The aspell utility has many options. A few of the more commonly used ones are listed in this section; see the manual for a complete list. Default values of many options are determined when aspell is compiled (see the config action).

You can specify options on the command line, in value of the ASPELL_CONF shell variable, or in your personal configuration file (~/.aspell.conf). Superuser can create a global configuration file (/etc/aspell.conf). Put one option per line in a configuration file; separate options with a semicolon (;) in ASPELL_CONF. Options on the command line override those in ASPELL_CONF, which override those in your personal configuration file, which override those in the global configuration file.

There are two types of options in the following list: Boolean and value. The Boolean options turn a feature on (enable the feature) or off (disable the feature). Precede a Boolean option with dont– to turn it off. For example, ––ignore-case turns the ignore-case feature on and ––dont-ignore-case turns it off.

Value options assign a value to a feature. Follow the option with an equal sign and a value—for example, ––ignore=4.

For all options in a configuration file or in the ASPELL_CONF variable, drop the leading hyphens (ignore-case or dont-ignore-case).

caution: aspell options and leading hyphens

The way you specify options differs depending on whether you are specifying them on the command line, using the ASPELL_CONF shell variable, or in a configuration file.

On the command line prefix long options with two hyphens (for example, ––ignore-case or ––dont-ignore-case). In ASPELL_CONF and configuration files, drop the leading hyphens (for example, ignore-case or dont-ignore-case).


––dont-backup

Does not create a backup file named filename.bak (default is ––backup when action is check).

––ignore=n

Ignores words with n or fewer characters (default is 1).

––ignore-case

Ignores the case of letters in words being checked (default is ––dont-ignore-case).

––lang=cc

Specifies the two-letter language code (cc). The language code defaults to the value of LC_MESSAGES (page 291).

––mode=mod

Specifies a filter to use. Select mod from url (default), none, sgml, and others. The modes work as follows: url: skips URLs, hostnames, and email addresses; none: turns off all filters; sgml: skips SGML, HTML, XHTML, and XML commands.

––strip-accents

Removes accent marks from all the words in the dictionary before checking words (default is ––dont-strip-accents).


Discussion

The aspell utility has two basic modes of operation: batch and interactive. You specify batch mode by using the list or –l action. In batch mode aspell takes the document you want to check for spelling errors as standard input and sends the list of potentially misspelled words to standard output.

You specify interactive mode by using the check or –c action. In interactive mode aspell displays a screen with the potentially misspelled word in context highlighted in the middle and a menu of choices at the bottom. See "Examples" for an illustation. The menu includes various commands (Table V-3) as well as some suggestions of similar, correctly spelled words. You either enter one of the numbers from the menu to select a suggested word to replace the word in question or enter a letter to give a command.

Table V-3. Commands

Command

Action

SPACE

Takes no action and goes on to next the misspelled word.

n

Replaces the misspelled word with suggested word number n.

a

Adds the "misspelled" word to your personal dictionary.

b

Aborts aspell; does not save changes.

i or I (letter "i")

Ignores the misspelled word. I (uppercase "I") ignores all occurrences of this word; i ignores this occurrence only and is the same as SPACE.

l (lowercase "l")

Shifts the "misspelled" word to lowercase and adds it to your personal dictionary.

r or R

Replaces the misspelled word with the word that you enter at the bottom of the screen. R replaces all occurrences of this word; r replaces this occurrence only.

x

Saves the file as corrected so far and exits from aspell.


Notes

For more information refer to the /usr/share/doc/aspell directory with manuals in the man-html and man-text subdirectories and to the aspell home page located at aspell.sourceforge.net.

The aspell utility is not a foolproof way of finding spelling errors. It also does not check for misused, properly spelled words (such as red instead of read).

Spelling from emacs

You can make it easy to use aspell from emacs by adding the following line to your ~/.emacs file. This line causes emacs' ispell functions to call aspell:

(setq-default ispell-program-name "aspell")


Spelling from vim

Similarly, you can make it easy to use aspell from vim by adding the following line to your ~/.vimrc file:

map ^T :w!:!aspell check %:e! %


When you enter this line in ~/.vimrc using vim, enter the ^T as CONTROL-V CONTROL-T (page 159). With this line in ~/.vimrc, CONTROL-T brings up aspell to spell check the file you are editing with vim.

Examples

The following examples use aspell to correct the spelling in the memo.txt file:

$ cat memo.txt

Here's a document for teh aspell utilitey

to check. It obviosly needs proofing

quiet badly.


The first example uses aspell with the check action and no options. The appearance of the screen for the first misspelled word, teh, is shown. At the bottom of the screen is the menu of commands and suggested words. The numbered words each differ slightly from the misspelled word:

$ aspell check memo.txt





Here's a document for teh aspell utilitey

to check. It obviosly needs proofing

quiet badly.



============================================================

1) the 6) th

2) Te 7) tea

3) tech 8) tee

4) Th 9) Ted

5) eh 0) tel

i) Ignore I) Ignore all

r) Replace R) Replace all

a) Add l) Add Lower

b) Abort x) Exit

============================================================

?


Enter one of the menu choices in response to the preceding display; aspell will do your bidding and move the highlight to the next misspelled word (unless you choose to abort or exit).

The next example uses the list action to display a list of misspelled words. The word quiet is not in the list—it is not properly used but is properly spelled.

$ aspell list <>

teh

aspell

utilitey

obviosly


The last example also uses the uses the list action. It shows a quick way to check the spelling of a word or two with a single command. The user gives the aspell list command and then enters seperate temperature into aspell's standard input (the keyboard). After the user enters RETURN and CONTROL-D (to mark the end of file), aspell writes the misspelled word to standard output (the screen):

$ aspell list

seperate temperatureRETURN

CONTROL-D

seperate

Linux : Very brief description of what the utility does

sample [options] arguments


Following the syntax line is a description of the utility. The syntax line shows how to run the utility from the command line. Options and arguments enclosed in brackets ( [ ] ) are not required. Type words that appear in this italic typeface as is. Words that you must substitute when you type appear in this bold italic typeface. Words listed as arguments to a command identify single arguments (for example, source-file) or groups of similar arguments (for example, directory-list ).

Arguments

This section describes the arguments that you can use when you run the utility. The argument itself, as shown in the preceding syntax line, is printed in this bold italic typeface.

Options

This section lists some of the options you can use with the command. Unless otherwise specified, you must precede options with one or two hyphens. Most commands accept a single hyphen before multiple options (page 109). Options in this section are ordered alphabetically by short (single-hyphen) options. If an option has only a long version (two hyphens), it is ordered by its long option. Following are some sample options:

––make-dirs

–d

This option has a long and a short version. You can use either option; they are equivalent.


––delimiter=dchar

–d dchar

This option includes an argument. The argument is set in a bold italic typeface in both the heading and the description. You substitute another word (filename, string of characters, or other value) for any arguments you see in this typeface. Type characters that are in bold type (such as the ––delimiter and –d) as is, letter for letter.

–t

(table of contents) This is an example of a simple option preceded by a single hyphen and not followed with any arguments. It has no long version. The table of contents appearing in parentheses at the beginning of the description is a cue, suggestive of what the option letter stands for.


Discussion

This optional section contains a discussion about how to use the utility and any quirks it may have.

Notes

This section contains miscellaneous notes—some important and others merely interesting.

Examples

This section contains examples of how to use the utility. This section is tutorial and is more casual than the preceding sections of the description.

Linux : Displays Calendar

cal [options] [[month] year]


The cal utility displays a calendar for a month or a year.

Arguments

The arguments specify the month and year for which cal displays a calendar. The month is a decimal integer from 1 to 12 and the year is a decimal integer. Without any arguments, cal displays a calendar for the current month. When you specify a single argument, it is taken to be the year.

Options

–j

(Julian) Displays a Julian calendar—a calendar that numbers the days consecutively from January 1 (1) through December 31 (365 or 366).

–m

(Monday) Makes Monday the first day of the week. Without this option, Sunday is the first day of the week.

–y

(year) Displays a calendar for the current year.

–3

(three months) Displays the previous, current, and next months.


Notes

Do not abbreviate the year. The year 05 is not the same as 2005.

Examples

The following command displays a calendar for August 2007:

$ cal 8 2007

August 2007

Su Mo Tu We Th Fr Sa

1 2 3 4

5 6 7 8 9 10 11

12 13 14 15 16 17 18

19 20 21 22 23 24 25

26 27 28 29 30 31


Next is a Julian calendar for 1949 with Monday as the first day of the week:

$ cal -jm 1949

1949

January February

Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun

1 2 32 33 34 35 36 37

3 4 5 6 7 8 9 38 39 40 41 42 43 44

10 11 12 13 14 15 16 45 46 47 48 49 50 51

17 18 19 20 21 22 23 52 53 54 55 56 57 58

24 25 26 27 28 29 30 59

31 ...

Linux : Compresses or decompresses files

bzip2 [options] [file-list]

bunzip2 [options] [file-list]

bzcat [options] [file-list]

bzip2recover [file]


The bzip2 utility compresses files; bunzip2 restores files compressed with bzip2; bzcat displays files compressed with bzip2.

Arguments

The file-list is a list of one or more files (no directories) that are to be compressed or decompressed. If file-list is empty or if the special option is present, bzip2 reads from standard input. The ––stdout option causes bzip2 to write to standard output.

Options

Accepts the common options described on page 587.

––stdout

–c

Writes the results of compression or decompression to standard output.

––decompress

–d

Decompresses a file compressed with bzip2. This option with bzip2 is equivalent to the bunzip2 command.

––fast or ––best

n

Sets the block size when compressing a file. The n is a digit from 1 to 9, where 1 (––fast) generates a block size of 100 kilobytes and 9 (––best) generates a block size of 900 kilobytes. The default level is 9. The options ––fast and ––best are provided for compatibility with gzip and do not necessarily yield the fastest or best compression.

––force

–f

Forces compression even if a file already exists, has multiple links, or comes directly from a terminal. The option has a similar effect with bunzip2.

––keep

–k

Does not delete input files while compressing or decompressing them.

––quiet

–q

Suppresses warning messages; does display critical messages.

––test

–t

Verifies the integrity of a compressed file. Displays nothing if the file is OK.

––verbose

–v

For each file being compressed displays the name of the file, the compression ratio, the percentage of space saved, and the sizes of the decompressed and compressed files.


Discussion

The bzip2 and bunzip2 utilities work similarly to gzip and gunzip; see the discussion of gzip (page 689) for more information. Normally bzip2 does not overwrite a file; you must use ––force to overwrite a file during compression or decompression.

Notes

The bzip2 home page is sources.redhat.com/bzip2.

The bzip2 utility does a better job of compressing files than gzip.

Use the ––bzip2 modifier with tar (page 788) to compress archive files with bzip2.

bzcat file-list

Works like cat except that it uses bunzip2 to decompress file-list as it copies files to standard output.

bzip2recover

Attempts to recover a damaged file that was compressed with bzip2.

Examples

In the following example, bzip2 compresses a file and gives the resulting file the same name with a .bz2 filename extension. The –v option displays statistics about the compression.

$ ls -l

total 728

-rw-r--r-- 1 sam sam 737414 Feb 20 19:05 bigfile

$ bzip2 -v bigfile

bigfile: 3.926:1, 2.037 bits/byte, 74.53% saved, 737414 in, 187806 out

$ ls -l

total 188

-rw-r--r-- 1 sam sam 187806 Feb 20 19:05 bigfile.bz2


Next touch creates a file with the same name as the original file; bunzip2 refuses to overwrite the file in the process of decompressing bigfile.bz2. The ––force option enables bunzip2 to overwrite the file.

$ touch bigfile

$ bunzip2 bigfile.bz2

bunzip2: Output file bigfile already exists.

$ bunzip2 --force bigfile.bz2

$ ls -l

total 728

-rw-r--r-- 1 sam sam 737414 Feb 20 19:05 bigfile

Linux : Executes commands at a specified time

at [options] time [date | +increment]

atq

atrm job-list

batch [options] [time]


The at and batch utilities execute commands at a specified time. They accept commands from standard input or, with the –f option, from a file. Commands are executed in the same environment as the at or batch command. Unless redirected, standard output and standard error from commands are emailed to the user who ran at or batch. A job is the group of commands that is executed by one call to at. The batch utility differs from at in that it schedules jobs so that they run when the CPU load on the system is low.

The atq utility displays a list of at jobs you have queued; atrm cancels pending at jobs.

Arguments

The time is the time of day that at runs the job. You can specify the time as a one-, two-, or four-digit number. One- and two-digit numbers specify an hour, and four-digit numbers specify an hour and minute. You can also give the time in the form hh:mm. The at utility assumes a 24-hour clock unless you place am or pm immediately after the number, in which case it uses a 12-hour clock. You can also specify time as now, midnight, noon, or teatime (4:00 PM).

The date is the day of the week or day of the month on which you want at to execute the job. When you do not specify a day, at executes the job today if the hour you specify in time is greater than the current hour. If the hour is less than the current hour, at executes the job tomorrow.

You specify a day of the week by spelling it out or abbreviating it to three letters. You can also use the words today and tomorrow. Use the name of a month followed by the number of the day in the month to specify a date. You can follow the month and day number with a year.

The increment is a number followed by one of the following (plural or singular is allowed): minutes, hours, days, or weeks. The at utility adds the increment to time. You cannot specify an increment for a date.

When using atrm, job-list is a list of one or more at job numbers. You can list job numbers by running at with the –l option or by using atq.

Options

The –l and –d options are not for use when you initiate a job with at. You can use them only to determine the status of a job or to cancel a job.

–c job-list

(cat) Displays the environment and commands specified by job-list.

–d job-list

(delete) Cancels jobs that you previously submitted with at. The job-list argument is a list of one or more at job numbers to cancel. If you do not remember the job number, use the –l option or run atq to list your jobs and their numbers. Using this option with at is the same as running atrm.

–f file

(file) Specifies that commands come from file instead of standard input. This option is useful for long lists of commands or commands that are executed repeatedly.

–l

(list) Displays a list of your at jobs. Using this option with at is the same as running atq.

–m

(mail) Sends you email after a job is run, even when nothing is sent to standard output or standard error. When a job generates output, at always emails it to you, regardless of this option.


Notes

The shell saves the environment variables and the working directory at the time you submit an at job so that they are available when at executes commands.

/etc/at.allow and /etc/at.deny

The root user can always use at. The /etc/at.allow and /etc/at.deny files, which should be read0able and writable by root only (mode 600), control which ordinary, local users can use at. When /etc/at.deny exists and is empty, all users can use at. When /etc/at.deny does not exist, only users listed in /etc/at.allow can use at. Users listed in /etc/at.deny cannot use at unless they are also listed in /etc/at.allow.

Jobs you submit using at are run by the at daemon (atd). This daemon stores jobs in /var/spool/at and output in /var/spool/at/spool, both of which should be set to mode 700 and owned by the user named daemon.

Examples

You can use any of the following techniques to paginate and print long_file tomorrow at 2:00 AM. The first example executes the command directly from the command line; the last two examples use the pr_tonight file, which contains the necessary command, and execute it using at.

$ at 2am

at> pr long_file | lpr

at>CONTROL-D

job 8 at 2005-08-17 02:00



$ cat pr_tonight

#!/bin/bash

pr long_file | lpr



$ at -f pr_tonight 2am

job 9 at 2005-08-17 02:00



$ at 2am <>

job 10 at 2005-08-17 02:00


If you execute commands directly from the command line, you must signal the end of the commands by pressing CONTROL-D at the beginning of a line. After you press CONTROL-D, at displays a line that begins with job followed by the job number and the time at will execute the job.

If you run atq after the preceding commands, it displays a list of jobs in its queue:

$ atq

8 2005-08-17 02:00 a

9 2005-08-17 02:00 a

10 2005-08-17 02:00 a


The following command removes job number 9 from the queue:

$ atrm 9

$ atq

8 2005-08-17 02:00 a

10 2005-08-17 02:00 a


The next example executes cmdfile at 3:30 PM (1530 hours) one week from today:

$ at -f cmdfile 1530 +1 week

job 12 at 2005-08-23 15:30


Next at executes a job at 7 PM on Thursday. This job uses find to create an intermediate file, redirects the output sent to standard error, and prints the file.

$ at 7pm Thursday

at> find / -name "core" -print >report.out 2>report.err

at> lpr report.out

at>CONTROL-D

job 13 at 2005-08-18 19:00


The final example shows some of the output generated by the –c option when at is queried about the preceding job. Most of the lines show the environment; only the last few lines execute the commands:

$ at -c 13

#!/bin/sh

# atrun uid=500 gid=500

# mail mark 0

umask 2

PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:.;

export PATH

PWD=/home/mark/book.examples/99/cp; export PWD

EXINIT=set\ ai\ aw; export EXINIT

LANG=C; export LANG

PS1=\\\$\ ; export PS1

...

cd /home/mark/book\.examples/99/cp || {

echo 'Execution directory inaccessible' >&2

exit 1

}

find / -name "core" -print >report.out 2>report.err

lpr report.out

Wednesday, January 30, 2008

Oracle : What Is Real Application Clusters?


The Oracle Real Application Clusters (RAC) option was first released in a blaze of publicity as part of Oracle 9.0.1 in the summer of 2001. It is considered by many within the Oracle community to be the most significant feature introduced in Oracle 9i.
Although RAC has been marketed as an entirely new feature, much of the technology was
inherited from Oracle Parallel Server (OPS), which was introduced in Oracle 6.0 and developed
steadily over the next decade.

A cluster consists of multiple interconnected servers that appear to end users and applications as if they are one single server. A RAC database allows multiple instances residing on different servers in the cluster to access a common database residing on shared storage. The combined processing power of the multiple servers in the cluster can provide greater throughput and scalability than is available from a single server. A basic RAC setup is depicted in Figure 1-1.





Oracle defines the database as being the structures that reside in files permanently on disk, including the datafiles, the control files, and the online redo logs. In the case of a RAC cluster, the database must be located on shared physical disk storage that all servers in the cluster must be able to access equally. The servers communicate with the shared storage via a storage network. The instance is defined as the structures that are created in memory within the operating system running on a server, including the Shared Global Area (SGA) and the associated background processes. An instance must be started before a database can be created. All persistent data is stored in the database files and will remain on disk when the instance or the operating system is shut down.

An instance can only mount and open a single database. In a single instance environment, as the name suggests, there is a one-to-one mapping between an instance and a database. A database, however, may be mounted by one or more instances on separate servers. The database may be accessed as long as at least one instance is started and has mounted it.

The servers in the cluster are bound together using cluster management software called Oracle
Clusterware, which enables the servers to appear as though they are a single server. Servers in the cluster communicate with each other using a dedicated private network known as the cluster
interconnect. In a RAC cluster, each instance can execute transactions concurrently because database access is coordinated to ensure data consistency and integrity. Instances exchange messages with each other across the interconnect to manage the state of individual Oracle data blocks and locks. Each server is also connected to a public network that allows the cluster to communicate with the outside world, including clients and application servers.




Internet Security : Identity Theft and Fraud

Identity theft has been an issue not onlyto those big and powerful companies but including us normal people.
Since we are now in the internet age where one information could be access and shared in an instant.
This may be a good news for us because it brings us ease of accessing our information in a breeze.
It also means that it will expedite the time our information will be processed. But this leap of technology is a double edge sword, because it will also mean that our private information is easily or can be easily accessed and stolen.
This was proven by some many hackers, more particularly by Kevin Mitnick and many more. Banks and multinational companies bend on their knees by this kind of attacks because as what those hackers say, the weakest link in IT Security are people.
We are on a paradigm shift in securing our identity and defense against fraud.

There are may kind of Identity Theft and Fraud attacks and according to
Identity Theft Resource Center dentity theft is sub-divided into four categories:
  • Financial Identity Theft (using another's identity to obtain goods and services)
  • Criminal Identity Theft (posing as another when apprehended for a crime)
  • Identity Cloning (using another's information to assume his or her identity in daily life)
  • Business/Commercial Identity Theft (using another's business name to obtain credit)
Nowadays its a must and a necessity that we should safeguard our identity and privacy and there are many companies that would do this for you.
And I have one that I see is a good way to invest in our Identity security.
Its LoudSiren this is a Place and Manage Fraud Alerts. It protects your phone number from theft and warns you of possible attacks. You can have your peace of mind that you are secured because this is powered by Debix which was selected by several States as sole ID Theft solution.

Site Operating System and Server by Candidate

Site Operating System and Server by Candidate

  • Joe Biden (Democrat) - Linux, Zope by Interlix
  • Hillary Clinton (Democrat) - Windows Server 2003, Microsoft-IIS/6.0 by Paul Holcomb
  • Christopher Dodd (Democrat) - FreeBSD, Apache by pair Networks
  • John Edwards (Democrat) - Linux, Apache by Plus Three
  • Mike Gravel (Democrat) - Linux, Apache by Voxel Dot Net, Inc.
  • Dennis Kucinich (Democrat) - Linux, Apache by New Age Consulting
  • Barack Obama (Democrat) - FreeBSD, Apache by pair Networks
  • Bill Richardson (Democrat) - Linux, Zope by Interlix
  • Wesley Clark (Democrat) - Linux, Apache by Voxel Dot Net, Inc.
  • Al Gore (Democrat) - Linux, Apache by Rackspace
  • Sam Brownback (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by RackForce Hosting, Inc.
  • Jim Gilmore (Republican) - Linux, Apache by 1&1 Internet, Inc.
  • Rudy Giuliani (Republican) - Linux, Apache by RackSpace
  • Mike Huckabee (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by LNH Inc.
  • Duncun Hunter (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Individual
  • John McCain (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Smartech Corporation
  • Ron Paul (Republican) - Linux, Apache by Rackspace
  • Mitt Romney (Republican) - Linux, Apache by Rackspace
  • Tom Tancredo (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Interland
  • Fred Thompson (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by LNH Inc.
  • Tommy Thompson (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Time Warner Telecom, Inc.
  • Chuck Hagel (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Individual
  • Newt Gingrich (Republican) - Windows Server 2003, Microsoft-IIS/6.0 by Smartech Corporation

It’s fascinating to me that the Dems are predominantly Open Source… except for Hillary Clinton and the Republicans are predominantly Microsoft with the exception of Ron Paul, Jim Gilmore, Rudy Giuliani and Mitt Romney.

I predict FreeBSD will win the election ;)

Friday, January 18, 2008

Oracle : Allocated, Used & Free space within datafiles

REM ------------------------------------------------------------------------------
REM Filename: dffree.sql
REM Purpose: Shows current size, used & freespace within the datafiles.
REM Author: Kam Muhamad Sirajdin [mdsirajdin@yahoo.com]
REM ------------------------------------------------------------------------------

TTI "Allocated, Used & Free space within datafiles"

COLUMN free_space_mb format 999999.90
COLUMN allocated_mb format 999999.90
COLUMN used_mb format 999999.90

SELECT SUBSTR (df.NAME, 1, 40) file_name, df.bytes / 1024 / 1024 allocated_mb,
((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
used_mb,
NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
FROM v$datafile df, dba_free_space dfs
WHERE df.file# = dfs.file_id(+)
GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes
ORDER BY file_name;

TTI off

How to set-up SSH and not requiring a password every time it logs into a remote machine?

How to set-up SSH and not requiring a password every time it logs into a remote machine?


It is important to note that, since the SSH protocol is a highly secure one, it does not accept just the traditional .rhosts on the users login for accepting a remote connection without password verification.

The implementation of SSH1 and SS2 are slightly different, and from OpenSSH to SSH2 vary too. Since most of the Linux machines are running OpenSSH2, we will describe here how to make the "trick" for avoiding a password every time when running openssh2 on both client and server.
For detailed information about the class of key verification and encryption that ssh uses, see the ssh and related man pages or online documentation at http://www.openssh.com/manual.html

The basic idea is, however, that in the cryptosystem that ssh uses (RSA or/and DSA) the encryption and description are done using different keys
Basically, what the user (client) needs is to generate a public/private key pair. The server will know the public key, but only the client will know the private key.
When the client connects to the server, it tells its own public key. If this key is allowed (if it is between the know public keys list on the server), the server will send a random number to the client. This encrypted number can only be decrypted if the appropriate decryption key is used, and this decryption key is the client's private one. The client then uses then its own private key and decrypt the number. If this is done correctly, the server will grant the access with no more questions. As you can see the system is safe, because the client never tells anybody about its private key; and this key cannot be inferred using the public one.

What must be done, then , is to generate a public/private key pair, and copy the public part into the appropriate place on the server side.
For doing this, on the user's home directory, on the client machine, type

local> ssh-keygen -t dsa -f .ssh/id_dsa

-t tells the type of encryption
-f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used

A password will be asked; leave this part blank, just pressing
Now, go the .ssh directory, and you will find two new files: id_dsa and id_dsa.pub. The last one is the public part. Now, copy the public key to the server machine

local> cd .ssh
local> scp id_dsa.pub user@remote:~/.ssh/id_dsa.pub

Of course, this time you will need to enter the password.
Now, login into the server machine and go to the .ssh directory on the server side

local> ssh user@remote
remote> cd .ssh

Now, add the client's public key to the know public keys on the server

remote> cat id_dsa.pub >> authorized_keys2
remote> chmod 640 authorized_keys2
remote> rm id_dsa.pub
remote> exit

and that's all.
Next time you log into the remote server, no password will be asked.
Note that this system will work while none of the machines change its IP address and for the specific user, so it is still safe.

Oracle : How to query a holding lock in your oracle database

ever wonder why can't you compile your procedure,function or package and if you look at the database for locks you could not find one, well maybe there is a holding lock in your object that you are trying to compile or edit. One way to know this is by issuing the sql statement below, you will see who is waiting(session) for that object and who is holding(session) for that object.

select /*+ ordered */ w1.sid waiting_session,
h1.sid holding_session,
w.kgllktype lock_or_pin,
w.kgllkhdl address,
decode(h.kgllkmod, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive',
'Unknown') mode_held,
decode(w.kgllkreq, 0, 'None', 1, 'Null', 2, 'Share', 3, 'Exclusive',
'Unknown') mode_requested
from dba_kgllock w, dba_kgllock h, v$session w1, v$session h1
where
(((h.kgllkmod != 0) and (h.kgllkmod != 1)
and ((h.kgllkreq = 0) or (h.kgllkreq = 1)))
and
(((w.kgllkmod = 0) or (w.kgllkmod= 1))
and ((w.kgllkreq != 0) and (w.kgllkreq != 1))))
and w.kgllktype = h.kgllktype
and w.kgllkhdl = h.kgllkhdl
and w.kgllkuse = w1.saddr
and h.kgllkuse = h1.saddr;


if this query returned some rows then it is up to you to identify which SID to kill

Oracle : How to Check free memory in your SGA

rem -----------------------------------------------------------------------
rem Filename: sga_free.sql
rem Purpose: Reports free memory available in the SGA
rem Date: 09-Jun-1998
rem Author: Frank Naude, Oracle FAQ
rem -----------------------------------------------------------------------

select f.inst_id,pool,name,
sgasize/1024/1024 "Allocated (M)",
bytes/1024 "Free (K)",
round(bytes/sgasize*100, 2) "% Free"
from (select sum(bytes) sgasize from sys.gv_$sgastat) s, sys.gv_$sgastat f
where f.name = 'free memory'
/

Thursday, January 17, 2008

Oracle : How to query row locking in oracle database

issue this sql command to see there are locking rows or object in your oracle database

set lines 160
col object_name for a20
col terminal for a20
col username for a20
col sid_serial for a20 justify left
select /* + rule */ a.inst_id, b.object_name, '''' || c.sid || ',' || c.serial# || '''' sid_serial, c.username,c.terminal, c.sql_hash_value, c.last_call_et,
decode(a.locked_mode,
0,'None',
1,'Null',
2,'Row Share',
3,'Row Excl.',
4,'Share',
5,'S/Row Excl.',
6,'Exclusive') lock_mode
from gv$locked_object a,
dba_objects b,
gv$session c
where a.object_id = b.object_id
and a.session_id = c.sid
and a.inst_id = c.inst_id
order by 7 desc
/

Oracle : How to check your undo segment

can't drop the undo then maybe one of its segment is
still being used issue this command to see the undo segments

SELECT RN.NAME,RS.STATUS
FROM V$ROLLNAME RN,V$ROLLSTAT RS
WHERE RN.NAME IN
(SELECT SEGMENT_NAME FROM DBA_SEGMENTS
WHERE TABLESPACE_NAME = 'NAME OF YOU UNDO')
AND RN.USN=RS.USN;

Oracle: How to multiply a column in oracle

do you want to multiply a column in your table one way to do it is by this

SELECT EXP (SUM (LN (ABS (x))))
* DECODE (MOD (COUNT (DECODE (SIGN (x), -1, 1, NULL)), 2), 1, -1, 1) *
nvl(max(decode(x,0,0,null)),1) prod
FROM t

Oracle : A way to optimize your statistics in oracle

Adding Index and optimizing your query is not enough if you have a very bad statistics in your database, so one way to do it is to have a statistics of your database,schema and tables and oracle is kind enough to give us a tool to use it its called DBMS_STATS. an example here is how to gather stats of a table

SQL>BEGIN
DBMS_STATS.GATHER_TABLE_STATS
( OWNNAME => 'SCOTT',
TABNAME => 'EMP',
ESTIMATE_PERCENT => 99,
METHOD_OPT => 'FOR ALL INDEXED COLUMNS SIZE AUTO',
CASCADE => TRUE
);
END;
/

Oracle: A simple way to query and copy grants from one instance to another

suppose you want to copy all the grant of an object in a database to another database the way to do it is to create a recursive query to generate an SQL grant command:

sql> select 'grant ' || privilege || ' on ' || owner||'.'||table_name || ' to ' || grantee from dba_tab_privs where grantee = "GRANTEE YOU WANT TO COPY"

Oracle: How to kill an oracle process in an Linux Operating System

The first thing you should do is to identify the process that you will kill by issuing a sql command like this

col program for a50
set lines 1000
SELECT s.inst_id,
s.sid,
p.spid,
s.osuser,
s.program,
p.inst_id,
p.addr , s.paddr
FROM gv$process p,
gv$session s
WHERE p.addr = s.paddr
and s.inst_id = p.inst_id


after issuing it will somewhat look like this

INST_ID SID SPID
---------- ---------- ------------
1 298 26066
1 299 26070
3 303 5854
1 304 26078
1 303 26082
3 125 6025
1 306 26084
3 304 6029


(please use v$ and not gv$ if you are not using a RAC configured DB and omit the column INST_ID in your query)


so choose the spid(for example you choose spid 6029) you want and go to the linux console and issue

$> kill -9 6029

that's it you have killed an oracle process through a linux command line

Oracle: How to watch parallel session in a RAC configured Database

This is the sql statement that you will issue to see your session if it did use
a parallel slaves

sql>select a.insT_id,a.sid,a.program,b.start_time,b.used_ublk,b.xidusn||'.'||b.xidslot||'.'||b.xidsqn trans_id from gv$session a, gv$transaction b where a.taddr = b.addr and a.inst_id = b.inst_id and (a.sid,a.inst_id) in (select z.sid,z.inst_id from gv$px_session z where z.qcsid = &sid) order by sid
/


please omit the sql> prompt when copying

iTunes movie rentals vs. Netflix: It’s Apples (Jobs variety) and oranges

Apple makes a big plunge into the movie rental business and almost instinctively folks dust off the “Netflix is screwed” line. However, you may want to hold off on that Netflix obituary (again).

Now it’s entirely possible that Apple’s movie rental service (gallery, blog focus, video) will be a hit for the iPod carrying masses. And I’m sure I’ll rent a movie when I travel. But Apple’s movie rental service doesn’t spell the demise of Netflix for a bevy of reasons. Here are a few:

  • Apple’s movie rental service is confined to the PC and the iPod/iPhone unless consumers buy Apple TV, a device that promises to be better the second time around but still is another box in an already cluttered living room.
  • Apple’s rental service is the same pay per view model everyone is used to, but Netflix’s model is subscription based. Some consumers will be fine with a rental that self destructs 24 hours once a movie is initiated. Other people–heavy movie watchers–appreciate the all-you-can eat approach of Netflix. They are two different audiences that can coexist. One audience cares that Netflix has a catalogue of 90,000 titles compared to Apple’s 1,000 titles. The other audience could care less.
  • iTunes movie rentals are designed to sell iPods. That’s a big distinction there. Apple’s biggest goal with its movie rental launch was to get all the studios on board so you’ll buy its devices. To do that Apple basically agreed to the same model cable companies go with. You pay $2.99 to $3.99 to view a movie for 24 hours. Netflix’s model is designed to deliver a recurring subscription revenue stream. Simply put, Apple isn’t wasting its time trying to put Netflix out of business.
  • The game is to get into set-top boxes. Apple wants you to buy a new box for movie rentals in a couple weeks. Netflix will be embedded in LG set-top boxes in the second half of the year. In the long run Netflix’s plan may make more sense, but good luck ousting the incumbent providers.
  • Netflix’s real worry is Blockbuster not Apple. Apple’s service will take time to gain mass adoption. Blockbuster has much more potential to give Netflix a headache with pricing pressure and its replica mail delivery model.

Intel Science Talent Search Semifinalists Announced

SANTA CLARA, Calif., Jan. 16, 2008 – At 194 high schools across the country today, 300 seniors were named semifinalists of the Intel® Science Talent Search (Intel STS) 2008. America's oldest and most prestigious science competition, the Intel Science Talent Search – often called the "junior Nobel Prize" – brings together the best and brightest young scientific minds in America to compete for $1.25 million in scholarships. Each of the 300 Intel STS semifinalists receives $1,000 with an additional $1,000 to their respective school, resulting in $600,000 in total awards.

This year's semifinalists were selected from 1,602 entrants hailing from 45 states, Puerto Rico and the Virgin Islands. Male and female entrants were represented equally and their research projects cover all disciplines of science including biochemistry, chemistry, physics, mathematics, engineering, behavioral science and medicine and health.

Over the past 66 years, the STS has produced winners of the world's most prestigious academic honors. Six former finalists have gone on to win the Nobel Prize. STS finalists have also been awarded the Fields Medal, the National Medal of Science and MacArthur Foundation Fellowships.

"This year marks Intel's 10th year of sponsorship of this historic competition, and we are honored to be a part of a program that is fostering the talent of America's brightest young minds," said Intel Foundation President and Director of Education Brenda Musilli. "These students are solving difficult problems that will have a real impact on generations to come."

On Jan. 30, 40 of the 300 semifinalists will be named as finalists and will receive an all-expense paid trip to Washington, D.C. for a week-long event in March. A total of $530,000 in scholarships will be provided by the Intel Foundation with each finalist receiving at least $5,000 and a new laptop run with the Intel® Core™2 Duo processor. Of these finalists, 10 students will be chosen for top honors with the grand prize winner receiving a $100,000 scholarship. These top winners will be selected based on rigorous judging sessions while in Washington, D.C. and announced at a black-tie banquet on March 11.

Society for Science & the Public (formerly Science Service), a nonprofit organization dedicated to the public engagement in scientific research and education, owns and has administered the STS since its inception in 1942. Elizabeth Marincola, president of Society for Science & the Public, said, "With their dedication and achievement in disciplines ranging from environmental science to bioengineering, the 300 Intel STS 2008 semifinalists have distinguished themselves as the nation's top young researchers. Focused on solutions to the pressing issues of our time, their work reaffirms the vision of Society for Science & the Public to inform, educate, and inspire the world around us."

Intel added sponsorship of the Science Talent Search to the extensive Intel Education Initiative portfolio in 1998 to spotlight the need to improve math and science education in the United States. Since then, Intel has increased the total annual awards and scholarships from $207,000 to $1.25 million and reinvigorated the competition by adding awards for the schools and introducing technology to the experience, through program elements such as laptop awards for all 40 finalists.

Intel's commitment to education extends far beyond Intel STS: from local schools to global universities, Intel works to help improve the quality of education around the world. Over the past decade alone, Intel has invested more than $1 billion in cash and in-kind contributions to help teachers teach, students learn and universities innovate – particularly in the areas of math, science and technology.

To learn more about Intel's commitment to education around the world, visit www.intel.com/education. To learn more about Society for Science & the Public, visit www.societyforscience.org.

Wednesday, January 16, 2008

Internet 'heroes and villains' vie for ISPA awards

The Internet Service Providers' Association has published the nomination lists for the "hero and villain" categories at its annual awards.

Every year, ISPA praises a "hero" and slams a "villain" at its U.K. Internet Industry Awards ceremony. Last year's hero was Vodafone Content Standards Manager Annie Mullins--for helping in the fight to make the Internet safer for children--while the European Commission was named top villain based on its domain registration rules for businesses.

The hero nominations this year include Facebook (for retracting its controversial Beacon tracking system), the Financial Services Authority ("for keeping a keen eye on the promotional Web sites of financial services and warning that they are not fair or clear enough"), and Stephen Timms, the U.K's minister of state for pensions reform (for pushing for faster broadband speeds through a nationwide fiber rollout). Also nominated as heroes are Peter Robbins, chief executive of the Internet Watch Foundation, and Derek Wyatt, member of Parliament, who has chaired the All Party Parliamentary Internet Group since 1997.

Much of the villain nomination list is devoted to those individuals and organizations who are trying to put limitations on Internet use. The British Phonographic Industry association is named "for its heavy-handed approach against consumers rather than engaging in constructive dialogue with the Internet industry when dealing with file-sharing," while Conservative leader David Cameron gets a mention "for buddying up with the music industry and trying to appeal to a younger audience." French President Nicolas Sarkozy also gets a drubbing for trying to tax Internet access and mobile phone use, and HM Revenue & Customs gets a mention for losing 25 million U.K. citizens' personal data.

BT Wholesale is also on the villains' list "for changing the whole engineering plan for 21CN only six months before the launch date." 21CN is the new fiber-based spine of the U.K.'s Internet connectivity, currently being rolled out to replace the old copper-based infrastructure, and ISPA's nomination is a reference to a change BT implemented in the way customers were supposed to be migrated from the old network to the new.

BT responded quickly to its nomination, claiming in a statement that BT "changed the plan in response to specific requests from industry."

"There is now a one-step, customer demand-led approach to migration, which is what industry wanted us to deliver," read Tuesday's statement. "We regret that we were not able to provide communications providers with more notice, but engineering the world's most ambitious next-generation network and the services they support is no small feat. The aim of the entire industry is to deliver next-generation broadband to as many end users as possible, and that is what we are doing."

Apple MacBook Air Is World's Thinnest Notebook, Looks Absolutely Amazing





It's real. The fabled MacBook Air actually exists. It's ultra-thin, can have a normal hard drive or a solid state one and, except for a couple ports, it's all about wireless connectivity. It's a stunning .16 inches thick at the bottom and .76 inches on the top. The black keyboard (reminds me of some of those black-over-aluminum Braun designs) is LED backlit, sightly recessed MacBook-style, with rounded edges all around. The latch is magnetic and has a gorgeous 13.3-inch screen with ambient-light sensor and, get this, multitouch trackpad.



The MacBook Air is all "green": bromide and PVR free, packaging is 56% smaller and mercury and arsenic-free glass. Looks like Al Gore will be getting one to fly in his private jet.

Tuesday, January 15, 2008

HD DVD fires back, slashes hardware & software prices

HD DVD's response to being unceremoniously jilted by Warner going into CES was ... nothing. A canceled press conference, downtrodden Toshiba press conference and rumors of further losses left great doubt that red had anything left in 2008, but now HD DVD is firing back. Leveraging its "approximately 50% market share in 2007" -- we're not sure where that number comes from either, we've contacted Toshiba for clarification -- indisputable lead in the notebook market and 100% compatibility with internet-enabled HDi features, Toshiba has announced it is not laying down yet. Effective yesterday, the HD-A3 MSRP has dropped to $149.99, the 1080p-capable HD-A30 to $199.99, and the top of the line HD-A35 to $299.99. Combined with an extended "perfect offer" of 5 free HD DVDs with every purchase, Toshiba's HD DVD Concierge service, and a sudden 50% off sale on Amazon, it seems this format will not go quietly into the dark. Fire sale to clear suddenly obsolete inventory or real chance to hang onto its remaining supporters? This could be the best -- or worst -- time to pick a side in the HD war.

Update: Amazon is also having a 50% off Blu-ray sale, so whatever your format of choice, pick up some discs and let the movie studios know who you rep.

BenQ's emaciated 8 megapixel DSC X800: just barely three-dimensional


It may not be the biggest name in consumer electronics, but when it comes to stuffing megapixels into ridiculously-skinny packages, there aren't many out there who do it better than BenQ. Case in point is the new eight megapixel DSC X800, which, at just 9.8 millimeters at its thinnest point (14mm at its fattest), is not only slimmer than the recently-announced DC X835, it even gives the company's trimmest seven megapixel shooter, the 12.5-millimeter DC X725, a run for its money.Besides its pocketability, however, this model doesn't offer much in the way of high-end features: 3x optical zoom, 3-inch LCD, digital image stabilization, VGA movie mode, and a rather non-standard microSD slot are par for the course here.

Final Macworld predictions?

Tomorrow morning the tech world will tune in as Steve gets on stage to kick off another Macworld expo -- an event Apple usually uses for only its biggest product announcements. There are all kind of crazy rumors going around, but this year there are a few picks that have seem to stuck: an ultraportable MacBook (Pro) of some kind, iTunes movie rentals, and, of course, the iPhone SDK. But what rabbit will El Jobso pull out of his hat marked one-more-thing? Find out tomorrow when we bring you our live coverage at 9AM PT

Samsung Develops Single-Chip RFID Reader for Mobile Devices

[Samsung announces new single-chip RFID reader making information retrieval from movie posters, clothing, and museums or tourist exhibits from a mobile device possible.]

Seoul -- Samsung Electronics Co., Ltd., a leader in advanced semiconductor technology, announced today the development of its new single-chip radio frequency identification (RFID) reader for mobile devices. Embedded RFID reader chips can provide consumers with product or service information retrieved from RFID tags incorporated in items such as movie posters, clothing, and museums or tourist exhibits.

According to market research firm RoA Group, the global demand for mobile RFID is expected to grow from $26.9 billion in 2007 to $701 billion by 2010, for a compound annual growth of 196 percent.

"We are enabling anytime, anywhere mobile access to information," said Dr. Chilhee Chung, senior vice president of Samsung Electronics' System LSI division. "RFID chip reader systems allow consumers to pull context-specific information into their mobile devices while on the go. Our mobile RFID single-chip technology is an important step in the evolution of ubiquitous computing environments."

While it can be embedded into devices such as mobile handsets and handheld readers used in retail stores, initially the major application for Samsung's new RFID reader chip is expected to be in card-type readers that plug into mobile handsets. This will provide consumers with immediate access to the new technology.

Designed for a UHF range of 900MHz, Samsung's new chip integrates an analog front end, a base-band modem, a processor, and a memory chip. The chip's 6.5mm x 6.5mm small form factor and ultra low power consumption level of 850mW are ideal for mobile applications.

More...

Monday, January 14, 2008

Chimps' Memories Superior to Those of Humans

Chimpanzees have an extraordinary photographic memory that is far superior to ours, research suggests.

Young chimps outperformed university students in memory tests devised by Japanese scientists. The tasks involved remembering the location of numbers on a screen, and correctly recalling the sequence.

"There are still many people, including many biologists, who believe that humans are superior to chimpanzees in all cognitive functions," said lead researcher Tetsuro Matsuzawa of Kyoto University.

"Here we show for the first time that young chimpanzees have an extraordinary working memory capability for numerical recollection - better than that of human adults tested in the same apparatus, following the same procedure."

Saturday, January 12, 2008

Hacked MySpace page serves up fake Windows update

Using a hacked MySpace profile, online criminals are trying to trick victims into downloading a malicious Trojan Horse program by disguising it as a Microsoft update, according to researchers at security vendor McAfee.

The attack is certainly not widespread -- McAfee has seen it used on only one MySpace profile -- but it does show how sites like MySpace can be abused by criminals.
Web surfers are presented with what appears to be a popup window advising them to download the latest version of Microsoft's Windows Malicious Software Removal Tool, which was just released this Tuesday. This software is distributed by Microsoft to help Windows users rid their systems of malware.

In reality, the popup window is just part of a larger image that takes up most of the computer screen. If the user clicks anywhere on this image, his computer will then begin to download the Trojan program.

The Trojan, known as TFactory, is a well-known piece of code that has been used by criminals for well over a year, according to Dave Marcus, a security research manager with McAfee.
Hackers were able to launch this attack because they either discovered a flaw in the MySpace code or found a way of taking over user accounts, Marcus said. "Our best guess is [the owner of the one MySpace profile] just got their password and user name phished," he said.
Social networking sites allow their members to use an array of powerful Web programming tools that are increasingly coming under the scrutiny of hackers looking for ways to misuse them.
In November, hackers found a way to serve up Web-based attack code from the MySpace profiles of Alicia Keys and a number of other musical artists.

Sony Ericsson's Z555



The Z555 incorporates Sony Ericsson's Gesture Control, letting you mute the phone or snooze its alarm without having to interrupt what you're doing. When a call comes in, a movement of your hand back and forth over the phone mutes the ringtone. The colors and designs that appear within the phone's themes can update automatically as the year goes by. Linked to the phone’s calendar, the Z555 knows when it's time for summer to become fall. The phone will be available in the first quarter.

Bill Gates explain the difference between Microsoft and Apple

Taken from Gizmodo.com
In the first segment of our Bill Gates CES 2008 interview, we asked the difference between Apple's approach and Microsoft's approach when it comes to product releases. Apple steers clear of products that might be iffy in their first iteration—portable music rentals; DVR—whereas Microsoft rolls out stuff that may not be quite ready. Bill's response is illuminating, direct and humble.

link for the video
bill gates video