Thursday, February 28, 2013

Good bye stupid Flash ads

A native setting of Firefox prevents any plugin from being fired automatically:

This holds for Flash plugin, Java plugin, etc.

Friday, February 15, 2013

Remove Git tag

 git tag -d EXTRANET_v2.1

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

  1. Double click a package in the Schema Browser
  2. Once the package has been opened, right click then Desktop | Navigator
  3. Right click in navigator and select "Sort and Group option
  4. 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.
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.

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

Show a user's objects grants

SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'my_user';

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
  1. Install patched ASUS BIOS v4003 so as to allow for Sleep to work
  2. Create a bootable USB flash drive with Mountain Lion like explained here: UniBeast: Install OS X Mountain Lion on Any Supported Intel-based PC
  3. Boot on USB flash drive: <TAB>, then PCIRootUID=0
  4. Format disk as Mac OS Extended (journaled), options: GUID Partition Table
  5. Install ML
  6. Upgrade to 10.8.2
  7. Download tonymacx86 MultiBeast 5.1.3
  8. Check options as shown:
  9. Reboot, no option
  10. Et voila: a fully working hackintosh with sleep capability on and no DSDT
  11. 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.

Monday, November 5, 2012

List RPM

> rpm -qa

Sunday, November 4, 2012

Install Mountain Lion from InstallESD.dmg

You won't be able to use UniBeast directly with InstallESD.dmg:
Open dmg, and move "Install OS X Mountain Lion" into Applications folder:
Then right click on "Install OS X Mountain Lion", and select "Show Package Contents".
Go into Contents folder, and create a new folder named "SharedSupport":
Then drag InstallESD.dmg into SharedFolder:
You will then be able to proceed through UniBeast: Install OS X Mountain Lion on Any Supported Intel-based PC

Saturday, November 3, 2012

FCPX: Use Disk Images to archive your work

Managing Your FCP X Events & Projects using Disk Images
Then you can move your projects to your Disk Image in order to archive them:

Monday, September 24, 2012

Discard all unstaged files in git

> git checkout -- .

Wednesday, September 12, 2012

Restoring a directory from history

> git checkout a44d627 -- .metadata/