A Good IT Certification Study Website

IT Exams is very good IT certification study website, if not the best. It links to a bunch of text books and dump tests, which are complete free. Unfortunately, it only has Java and Oracle certification information.

IT Exams' address is http://itexams.weebly.com/.

Temporarily Disable and Re-enable the Constraints in Oracle

SQL command script files to disable and enable all constraints:

Disable:

set feedback off
set verify off
set echo off
prompt Finding constraints to disable...
set termout off
set pages 80
set heading off
set linesize 120
spool tmp_disable.sql
select 'spool igen_disable.log;' from dual;
select 'ALTER TABLE '||substr(c.table_name,1,35)||' DISABLE CONSTRAINT '||constraint_name||' ;'
from user_constraints c join user_tables u on c.table_name = u.table_name;
select 'exit;' from dual;
set termout on
prompt Disabling constraints now...
set termout off
@tmp_disable.sql;
exit
/

Enable:

set feedback off
set verify off
set wrap off
set echo off
prompt Finding constraints to enable...
set termout off
set lines 120
set heading off
spool tmp_enable.sql
select 'spool igen_enable.log;' from dual;
select 'ALTER TABLE '||substr(c.table_name,1,35)||' ENABLE CONSTRAINT '||constraint_name||' ;'
from user_constraints c join user_tables u on c.table_name = u.table_name;
/
select 'exit;' from dual;
set termout on
prompt Enabling constraints now...
set termout off
@tmp_enable;
!rm -i tmp_enable.sql;
exit
/

Scripts in PL/SQL to disable and enable all constraints:

Disable:

BEGIN
FOR i IN
( SELECT c.owner
, c.table_name
, c.constraint_name
FROM user_constraints c
JOIN user_tables t ON c.table_name = t.table_name
WHERE c.status = 'ENABLED'
ORDER BY c.constraint_type DESC
)
LOOP
dbms_utility.exec_ddl_statement('alter table ' || i.owner || '.' || i.table_name || ' disable constraint ' || i.constraint_name);
END LOOP;
END;
/

Enable:

BEGIN
FOR i IN
( SELECT c.owner
, c.table_name
, c.constraint_name
FROM user_constraints c
JOIN user_tables t ON c.table_name = t.table_name
WHERE c.status = 'DISABLED'
ORDER BY c.constraint_type
)
LOOP
dbms_utility.exec_ddl_statement('alter table ' || c.owner || '.' || c.table_name || ' enable constraint ' || c.constraint_name);
END LOOP;
END;
/

Software Patch Installation Batch Files

The example here is to install an Oracle database application patch. The basic structure of patch installation scripts shall include two folders and two files:

Folder 1: Logs
Folder 2: Scripts
File 1: Readme.txt
File 2: Setup.bat (or other name)

Of course, there would be some SQL script files in Scripts folder. Log files in Logs folder would be generated by these script files in Scripts folder. The working procedure is to run installer batch file (here Setup.bat), which will call other batch files (we do not have here) and/or script files stored in Scripts folder. In there example, the batch file open sqlplus.exe followed by user id, password and the SQL scripts (in file), or package to run.

Following is the example of batch file:

@echo off
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: PLEASE REVIEW AND ADJUST ENVIRONMENT VARIABLES BETWEEN < >
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CLS
set NETALIAS=
set USERID=
set PASSWORD=
set COMMONID=
set COMPASS=
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: ORACLE_VERSION are 9.2 (for 9i) or 10.2.0 (for 10g)
:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set ORACLE_VERSION=
set ORACLE_HOME=C:\oracle\product\%ORACLE_VERSION%\db_1
set SQLUTIL=%ORACLE_HOME%\bin\sqlplus.exe
set FOLDERPATH=%cd%
echo #####################################################
echo.
echo You are just about to run SCRAMBLING SCRIPT on database
echo.
echo [**** %NETALIAS% ****]
echo.
echo Schema
echo.
echo [**** %USERID% ****]
echo.
echo If this is not correct Database/Schema then
echo.
echo press CTL + C to cancel the script.....
echo.
echo #####################################################
pause
"%SQLUTIL%" %USERID%/%PASSWORD%@%NETALIAS% @"%FOLDERPATH%\Scripts\Truncate.sql"
"%SQLUTIL%" %USERID%/%PASSWORD%@%NETALIAS% @"%FOLDERPATH%\Scripts\Create_Tables.sql"
"%SQLUTIL%" %USERID%/%PASSWORD%@%NETALIAS% @"%FOLDERPATH%\Scripts\DATA_SCRAMBLE.spec"
"%SQLUTIL%" %USERID%/%PASSWORD%@%NETALIAS% @"%FOLDERPATH%\Scripts\DATA_SCRAMBLE.body"
"%SQLUTIL%" %USERID%/%PASSWORD%@%NETALIAS% @"%FOLDERPATH%\Scripts\Cleanup.sql"
pause

Note: NETALIAS, USERID following “set” commend are variables. %...% is the way to use these variables.

Following is the Truncate.sql:

PROMPT Truncating data. Please wait...
TRUNCATE TABLE BATCH_BUF$RECON$DETAIL;
TRUNCATE TABLE BATCH_BUF$VALU$SUMMARY_PEN;
-- Enable/Disable primary, unique and foreign key constraints alter table BATCH_BUF$VALU$SUMMARY_PEN disable constraint BATCH_BUF$VALU$SUMMARY_PEN$FK1;
EXIT;

A Privacy Issue for Google AdSense

Google AdSense allows readers to gain the Publisher ID through viewing web page's source code in HTML. This may lead to privacy leaking to some degree.

Here is a case to show how people can explore such public available information. Blog site blog.dwnews.com is a popular political forum amongst overseas Chinese communities. The owner of this forum tries to create a forum without bias and welcomes people having different options to debate in the forum. As the result, the debates are always so ferocious between groups of pro-democracy and pro- Chinese Government. In aims to avoid the possible trouble with Chinese Government, many bloggers are anonymous there.

One blogger through Google AdSense' publisher ID found out several popular blogs were actually run by a same person, or presumably the same person because the AdSense Publisher IDs for these blogs are the same. He attached accordingly based on his finding, followed by a series of incidents. At the end of it, one of them declared he leaves the site permanently, and the account of the other one, ranked number one in current activities, had been cancelled by the webmaster. What lucky here is, both of them did not reside in China and we did not see someone ends up in the jail.

That was in June 2009, two months ago.

A Practical Case of Transpose Query

Let us say a pension fund wants to generate a summary consists of total contributions had been made so far for each member, by their employers. The fund does not care about exact contribution made by each employers for each member. However, the fund wants to know the three employers paid the contributions most for each member. As the result, the summary table should have 5 columns: Member_Id (unique), Total_Contributions, Employer_1, Employer_2, Employer_3. If a member has less than three employers, leave it blank. Each member should have occupied one row only.

Simple SQL query of SELECT GROUP BY won't be able to accomplish this task, since it is a transpose requirement, namely, turning the row into column. However, CASE or DECODE in PL/SQL will do. The equivalent of CASE in Microsoft Office Access is IIF. Alternatively, TRANSFORM in Access and SELECT PIVOT in PL/SQL can be used. By use CASE or DECODE, it is possible to avoid the complex programming. There are five steps:

1. To get dataset first which should consist of all necessary information. Let us use Dataset_All to describe it:

SELECT Member_Id
, Employer_Id
, SUM(Contribution) Total_Contribution
FROM Tab
GROUP BY Member_Id
, Employer_Id
ORDER BY Member_Id

ORDER BY is important since it would make sure the ROWNUM is in align with the Member_Id.

2. Get a dataset which consists of the Member_Id and their last ROWNUM in Dataset_All. Let us name it Dataset_Uni:

SELECT Member_Id
, MAX(ROWNUM) Serial_No
FROM Dataset_All
GROUP BY Member_Id

Using GROUP BY to get largest ROWNUM if same Member_Id having multiple rows.

3. To flag each employer according their rank, start from 1. Let us name it Dataset_Rank:

SELECT Dataset_Uni.Member_Id
, Total_Contribution
, (Serial_No - Dataset_All.ROWNUM + 1) Employer_Serial
, Employer_Id
FROM Dataset_Uni
JOIN Dataset_All ON Dataset_Uni.Member_Id = Dataset_All.Member_Id

4. Transpose process. We also use the numerical feather of Employer_Id which was generated from sequence:

SELECT Member_Id
, Total_Contribution
, SUM(CASE Employer_Serial (WHEN 1 Employer_Id, ELSE 0)) Employer_1
, SUM(CASE Employer_Serial (WHEN 2 Employer_Id, ELSE 0)) Employer_2
, SUM(CASE Employer_Serial (WHEN 3 Employer_Id, ELSE 0)) Employer_3
FROM Dataset_Rank
GROUP BY Member_Id
, Total_Contribution
ORDER BY Member_Id

Put everything together:

WITH Dataset_All AS
( SELECT Member_Id
, Employer_Id
, SUM(Contribution) Total_Contributio
FROM Tab
GROUP BY Member_Id
, Employer_Id
ORDER BY Member_Id
)
SELECT Member_Id
, Total_Contribution
, SUM(CASE Employer_Serial (WHEN 1 Employer_Id, ELSE 0)) Employer_1
, SUM(CASE Employer_Serial (WHEN 2 Employer_Id, ELSE 0)) Employer_2
, SUM(CASE Employer_Serial (WHEN 3 Employer_Id, ELSE 0)) Employer_3
FROM
( SELECT Dataset_Uni.Member_Id
, Total_Contribution
, (Serial_No - Dataset_All.ROWNUM + 1) Employer_Serial
, Employer_Id
FROM
( SELECT Member_Id
, MAX(ROWNUM) Serial_No
FROM Dataset_All
GROUP BY Member_Id
) Dataset_Uni
JOIN Dataset_All ON Dataset_Uni.Member_Id = Dataset_All.Member_Id
)
GROUP BY Member_Id
, Total_Contribution
ORDER BY Member_Id

Done.

Koncord Applied Excel Functions

We have uploaded some applied Excel functions. These are some basic functions, but very much useful in day-to-day working. This Excel file include some functions of string parsing, dates, telephone number parsing, and coordinates parsing.

Following is the link:
Koncord Applied Excel Functions


Following is the Terms of Services of Koncord Partners: http://koncordpartners.blogspot.com/2010/06/terms-of-services.html

Launch Koncord Homepage Online

We launched two size of Koncord Homepage online. Address is as follows:

Koncord Homepage

All you need to do is just set it as your homepage for your browsers.

Local Address Error in HTML for Firefox

If you include the address like this “C:\Documents and Settings\...” in your HTML page, it would be Ok for IE to open it. However, it would be a problem for Firefox, sometimes. Following is the error message:



There is easy way to fix it – simply add “file:\\\” in front of your local address. It would look like: "file:\\\C:\Documents and Settings\..."

http://www.codingforums.com/archive/index.php/t-53382.html

First Beta Version of Koncord Homepage Is Free to Download

We have prepared a single HTML page which can be used as a Homepage for your browsers. This page consists of popular websites, such as Gmail, Hotmail, etc. Of course, it also has built-in Koncord Private Search Engine.

This homepage is just like favourites in IE and bookmarks in Firefox.

Here is free download site:
Download from Uploading.com

The address is: http://uploading.com/files/7Z17FDD2/Koncord.html.html

About ISO Image

An ISO image is an archive file (also known as a disk image) of an CD/DVD in a format defined by the International Organization for Standardization (ISO).

So, it is a virtual CD. There are three actions in relation to ISO image file.

1. Archiving a file or a folder into an ISO image file. This some times called create an ISO image file, or burn into an ISO image. The source files can be a CD/DVD as well. Currently many software installer directly accept this kind of virtual CD. For instance, installing an Linux OS on VMware Server, the VMware Server would prefer you have .iso files.

2. Turn ISO image back to real CD/DVD. Some time this procedure called burn an ISO image, burn an ISO CD/DVD, burn ISO image into CD/DVD.

3. Using or reading ISO image file. When you use an real CD/DVD, you would need a CD/DVD ROM Drive. So, to use ISO image file, the virtual CD/DVD, you will need a virtual CD ROM too. It is also called mount an ISO image, mount ISO file, etc.

Many times, verbs Create, Burn and Mount are interchangeable. It just create confusion what they are talking about. Software of ISO Image may not having all of these three functions. Installer software of course covers the third function mentioned above. So, if you have software installation files already sit in your hard disk, and want to install it, but your installer software could only accept the ISO or CD (this process sometimes called “network installation”), what you got to do?

Option A: Burn your files into a CD.

Option B: Archive your files into a ISO image file. The best software for this purpose is Folder2Iso at http://depositfiles.com/en/files/789051.

http://en.wikipedia.org/wiki/.iso
http://www.online-tech-tips.com/computer-tips/how-to-create-mount-and-burn-iso-image-files-for-free/
http://www.petri.co.il/mount_iso_files_in_windows_vista.htm
http://en.wikipedia.org/wiki/List_of_ISO_image_software

Another Urban Legend?

Just heard a story. A guy bought a desktop of the most popular PC brand with a most popular PC operating system, a year ago. The OS’s version is that has a very bad reputation, you know. He found a “black process” or processes run on his PC, which has following features:

1. The process does not registered in Task Manager, neither in CPU nor in Memory.

2. It runs regularly every day from around 1:00 am, and stops in next morning. However, every Saturday is bad. It runs until around 1:00 pm, sometime last to 8:00 pm. It does not start or end at exactly same time everyday. You would see this speed makes the PC completely useless.

3. It occupies huge amount of CPU and Memory, which makes a noticeable and considerable slow of response from PC. For instance, Ctrl + Alt + Del may take up to five minutes to enable Task Manager appears. The total RAM is 2G. When black process running and when no other applications opens (just re-started PC), Task Manager shows total 2% being used and around 20% Memory being used, yet, the PC is as slow as any mouse movement can take 2 minutes.

4. Total amount of 50G Hard Disk space could not be accounted for, given the fact of total 110G Hard Disk space has been used including all hidden files and recycle bin. When black process runs, the Hard Disk is flashing. The total Hard Disk space if around 460G for this driver (C:\).

5. Black process running does not require the Internet connection.

6. Black process runs before user logins into OS. Restarting computer, either softly or hardly does not stop its running. It has been noticed Safe Mode could not stop it either.

7. Do not know if it was caused by the black process or system bug, when black process runs, SOMETIMES Ctrl + Alt + Del generate an error message in pop-up window: “Unable to create a security option. Login failed”.

8. It was believed as virus infection. However, he failed to find out if this contention can be confirmed after he tried much anti-virus software.

9. No harm has been noticed apart from the slow response from PC.

10. It has been confirmed this black process is not any of the scheduled system maintenance.

Based on these limited information, it is hard to make conclusion. However, it looks like a system bug or an urban legend – someone is conducting a secret SETI@home like distributed computing scheme.

http://en.wikipedia.org/wiki/SETI@home

Labels