SELECT TO_CHAR(TO_DATE('19700101','YYYYMMDD') + (1364986608/(60*60*24)),'DD:MM:YYYY HH24:MI:SS') my_date FROM dual;
Tuesday, April 30, 2013
PL/SQL: epoch to date
Monday, April 15, 2013
Git: How to retrieve a single file from specific revision?
> git show $REV:$FILE
E.g.
> git show 4b286e8:./src/com/mobiquithings/gprstrial/ConnectivityService.java
NB: use a ./ syntax or an absolute path
Friday, April 12, 2013
PL / SQL UPDATE + JOIN
MERGE INTO T1 USING T2 ON (T1.PK = T2.PK) WHEN MATCHED THEN UPDATE SET T1.VAL = T2.VAL;
Monday, April 1, 2013
Monday, March 4, 2013
Thursday, February 28, 2013
Good bye stupid Flash ads
Friday, February 15, 2013
Friday, January 25, 2013
Check invalid packages
SELECT * FROM ALL_OBJECTS WHERE STATUS!='VALID' and owner not in ('SYS', 'PUBLIC', 'SYSTEM', 'WMSYS', 'SYSMAN', 'APEX_030200', 'VAS_P2P_DB', 'VAS_INDICATOR_DB', 'VAS_MULTIMSI_DB', 'VAS_PROPERTY_DB', 'VAS_ACK_DB', 'VAS_LOG_DB', 'VAS_TOEMAIL_DB');
Then to recompile invalid packages:
EXEC UTL_RECOMP.recomp_serial('CRM_DB');
EXEC UTL_RECOMP.recomp_serial('PROV_DB');
EXEC UTL_RECOMP.recomp_serial('RAF_CONS_DB');
EXEC UTL_RECOMP.recomp_serial('RATING_DB');
EXEC UTL_RECOMP.recomp_serial('RESOURCE_DB');
EXEC UTL_RECOMP.recomp_serial('SHARED_DB');
Or to perform the same task in parallel using the specified number of threads
EXEC UTL_RECOMP.recomp_parallel(4, 'PROV_DB');or at database level:
EXEC UTL_RECOMP.recomp_parallel(4);See http://www.oracle-base.com/articles/misc/recompiling-invalid-schema-objects.php for more details
Friday, January 18, 2013
Toad: Find Backward does not work, the Direction Forward and Backward are greyed out
Toad For Oracle 11
Description
In Find dialog, the Direction Forward and Backward are greyed out.
Only the Forward option is selected.
Thus, only F3 works but not Shift+F3.
-
Cause
User Setting file may have been corrupted. -
Resolution
As a test to localize and confirm the issue, doing the following will give you a clean User Files.
Here are steps to get a clean User Files folder…
1) Select Utilities | Copy User Settings.
2) Select “Create a clean set of User Files from the base installation” and click OK.
3) Toad will automatically restart. Once restarted, test issue.
You will temporarily lose your connections settings.
(If error no longer persist, with Toad for Oracle closed: The user can copy their connections.ini, connectionpwds.ini and savedsql.dat files from the 11.5_bak folder into their newly created User Files Folder.)
Here are steps to get old settings back…
1) Close Toad.
2) Delete the 11.5 folder in the C:\Users\<User>\AppData\Roaming\Quest Software\Toad for Oracle directory.
3) Rename the 11.5_bak folder, in the same directory, to 11.5.
4) Launch Toad.
Toad: Objects within Package Body or Spec are not sorted alphabetically in Schema Browser
Toad For Oracle 11
- Double click a package in the Schema Browser
- Once the package has been opened, right click then Desktop | Navigator
- Right click in navigator and select "Sort and Group option
- Come back to the Schema Browser and refresh
Thursday, January 10, 2013
Check last PL/SQL package compile time
SELECT OWNER, OBJECT_NAME, LAST_DDL_TIME FROM ALL_OBJECTS WHERE OBJECT_TYPE='PACKAGE' AND OWNER LIKE '%_DB';
PL/SQL function: raise exceptions and fill in output variables
If we use "x_out_param OUT VARCHAR2", and an exception is raised in the function, the parameter won't be filled in.
The trick consists in using the NOCOPY keyword to pass variables by reference and not by copy.
The trick consists in using the NOCOPY keyword to pass variables by reference and not by copy.
PROCEDURE PROC(x_out_param OUT NOCOPY VARCHAR2) IS
BEGIN
...
x_out_param := 'some value';
RAISE MY_ERROR_EXCEPTION;
END PROC;
PROCEDURE MAIN(x_out_param OUT VARCHAR2) IS
BEGIN
...
PROC(x_out_param);
EXCEPTION
WHEN MY_ERROR_EXCEPTION THEN RETURN 1;
WHEN OTHERS THEN RETURN 2;
END MAIN;
Tuesday, December 18, 2012
Force statistics computation
For the whole table:
analyze table unrated_usage.ft_unrated_usage_o compute statistics;For one given partition:
analyze table unrated_usage.ft_unrated_usage_o partition(P0) compute statistics;
Saturday, December 15, 2012
Install a QNAP network HP C5280 printer on Mountain Lion
First of all, install the 3 packages to be found here: macosx/hpijs
This will install the HP Photosmart C5200 series drivers.
Then proceed as usual to add a printer: System Preferences, then Print & Scan, then (+) in the Printers list, and pick the correct model from the proposed list.
Then proceed as usual to add a printer: System Preferences, then Print & Scan, then (+) in the Printers list, and pick the correct model from the proposed list.
Friday, December 14, 2012
Count number of rows in partitions
SELECT table_name, partition_name, high_value, num_rows FROM SYS.ALL_TAB_PARTITIONS where table_name = 'SMSC_CDR_MT' and num_rows != 0 ORDER BY partition_name;
Thursday, December 6, 2012
Tuesday, November 13, 2012
PL/SQL SELECT into array
DECLARE
TYPE ARRAY_TYPE IS TABLE OF VARCHAR2(20);
mno_array ARRAY_TYPE;
mno_id VARCHAR2(20);
BEGIN
SELECT *
BULK COLLECT
INTO mno_array
FROM (SELECT DT_PARTY.HOST_MNO_ID FROM RESOURCE_DB.HT_SIM_PARTY, RESOURCE_DB.DT_PARTY
WHERE HT_SIM_PARTY.PARTY_ID = DT_PARTY.PARTY_ID
AND HT_SIM_PARTY.SIM_ID = 'SIM_0000000000000184');
DBMS_OUTPUT.PUT_LINE('count='||mno_array.COUNT);
FOR i in 1 .. mno_array.COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(mno_array(i));
END LOOP;
END;
PL/SQL SELECT into hash array
DECLARE
TYPE HASH_TYPE IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
mno_array HASH_TYPE;
mno_id VARCHAR2(20);
BEGIN
FOR r IN (SELECT DT_PARTY.HOST_MNO_ID FROM RESOURCE_DB.HT_SIM_PARTY, RESOURCE_DB.DT_PARTY
WHERE HT_SIM_PARTY.PARTY_ID = DT_PARTY.PARTY_ID
AND HT_SIM_PARTY.SIM_ID = 'SIM_0000000000000184') LOOP
MNO_ARRAY(R.HOST_MNO_ID) := 1;
END LOOP;
IF mno_array.EXISTS('BT') THEN
DBMS_OUTPUT.PUT_LINE('BT=YES');
END IF;
END;
Monday, November 12, 2012
Install Mountain Lion
Conf.: Asus P8Z68V LX + Intel Core i5 2500K + RAM Patriot PC3-12800 1600MHz 8GB (2x4GB) + nVidia GT240 512MB GDDR5
- Install patched ASUS BIOS v4003 so as to allow for Sleep to work
- Create a bootable USB flash drive with Mountain Lion like explained here: UniBeast: Install OS X Mountain Lion on Any Supported Intel-based PC
- Boot on USB flash drive: <TAB>, then PCIRootUID=0
- Format disk as Mac OS Extended (journaled), options: GUID Partition Table
- Install ML
- Upgrade to 10.8.2
- Download tonymacx86 MultiBeast 5.1.3
- Check options as shown:
- Reboot, no option
- Et voila: a fully working hackintosh with sleep capability on and no DSDT
- Keyboard: In order to map my Dell keyboard w/ GB layout, used the wonderful Ukelele w/ Logitech GB layout
Sunday, November 11, 2012
Install a QNAP network HP C5280 printer on Windows 8
Thank you Mr MS for not including the HP C52xx driver into W8.
Download the mostly useless HP software for this printer (362MB!): you will find it easily with Google on the HP website.
Open the HP .exe in WinRAR, and uncompress it.
Goto Panneau de configuration
Then goto Materiel et audio, then "Peripheriques et imprimantes"
Then click on "Ajouter une imprimante"
Then don't let the search finish and click the "L'imprimante que je veux n'est pas repertoriee" link
Enter the name of the QNAP printer:
http://192.168.1.102:631/printers/qnapPR3
then click on "Suivant"
Then select the driver from disk. For this, in HP directory, go into prn_x86 (prn_x64) and select prnhp003.inf
Throw away all the HP bloatware.
Download the mostly useless HP software for this printer (362MB!): you will find it easily with Google on the HP website.
Open the HP .exe in WinRAR, and uncompress it.
Goto Panneau de configuration
Then goto Materiel et audio, then "Peripheriques et imprimantes"
Then click on "Ajouter une imprimante"
Then don't let the search finish and click the "L'imprimante que je veux n'est pas repertoriee" link
Enter the name of the QNAP printer:
http://192.168.1.102:631/printers/qnapPR3
then click on "Suivant"
Then select the driver from disk. For this, in HP directory, go into prn_x86 (prn_x64) and select prnhp003.inf
Throw away all the HP bloatware.
Subscribe to:
Posts (Atom)






