Thursday, 9 September 2010

Perl : One liner to find files less than an hour old in a dir

 perl -e 'for ( glob "./*" ) { system "ls -l $_"  if ( -M $_ <= (1/24) ) };'

Tuesday, 7 September 2010

iTunes Error 9808

Itunes error -9808 logging into the iTunes Music Store

In Internet Explorer, go up to Tools > Internet Options.
Then go to the last tab, Advanced, and scroll down to the Security
section. It is the fifth box down and make sure "Check for server
certificate revocation (requires restart)" is unchecked. Then access the
iTunes Store.

Wednesday, 25 August 2010

Windows 7 : Show File types




  1. Open Folder Options by clicking the Start button Picture of the Start button, clicking Control Panel, clicking Appearance
    and Personalization
    , and then clicking Folder
    Options
    .



  2. Click the View tab, and
    then, under Advanced settings, do one of the
    following:



    • To hide file extensions, select the Hide extensions for known file types check box, and
      then click OK.



    • To display file extensions, clear the Hide extensions for known file types

Thursday, 19 August 2010

Oracle : Auditing object access in 9i

  • Created new audit tablespace AUDIT

     CREATE TABLESPACE "AUDIT" DATAFILE 
    '/u03/volnewlivedata02/oradata/LIVE1/AUDIT_01.dbf' SIZE 4096M REUSE ,
    '/u03/volnewlivedata02/oradata/LIVE1/AUDIT_02.dbf' SIZE 4096M REUSE
    NOLOGGING ONLINE PERMANENT BLOCKSIZE 8192
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;

  • Moved audit table - nb. original audit table is left in place

    create table audx tablespace "AUDIT" storage (initial 50k next 50k<br />pctincrease 0) as select * from aud$ where 1 = 2<br />rename AUD$ to AUD$$;<br />rename audx to aud$;<br />create index i_aud2;<br />on aud$(sessionid, ses$tid)<br />tablespace "AUDIT" storage(initial 50k next 50k pctincrease 0)<br />

  • Turned on audit of all procedural code

    AUDIT EXECUTE PROCEDURE BY SESSION;<br />-- To remove<br />--NOAUDIT EXECUTE PROCEDURE;<br />

  • Turned on audit of all table access

    AUDIT DELETE TABLE, INSERT TABLE, SELECT TABLE, UPDATE TABLE BY SESSION;<br />-- To remove<br />--NOAUDIT DELETE TABLE, INSERT TABLE, SELECT TABLE, UPDATE TABLE BY SESSION;<br />

  • Review space usage carefully





















Peter Lawes
added a comment - 19/Aug/10
11:40 AM

  • Audit query

    with base_data as <br />(<br />select  <br />nvl(rtrim(decode(substr(ses_actions, 1,1),'S','ALTER/')<br />||decode(substr(ses_actions, 2,1),'S','AUDIT/')<br />||decode(substr(ses_actions, 3,1),'S','COMMENT/')<br />||decode(substr(ses_actions, 4,1),'S','D/')<br />||decode(substr(ses_actions, 5,1),'S','GRANT/')<br />||decode(substr(ses_actions, 6,1),'S','INDEX/')<br />||decode(substr(ses_actions, 7,1),'S','I/')<br />||decode(substr(ses_actions, 8,1),'S','LOCK/')<br />||decode(substr(ses_actions, 9,1),'S','RENAME/')<br />||decode(substr(ses_actions,10,1),'S','S/')<br />||decode(substr(ses_actions,11,1),'S','U/')<br />||decode(substr(ses_actions,12,1),'S','REFERENCES/')<br />||decode(substr(ses_actions,13,1),'S','X/') <br />,'/'),'?') action<br />,a.*<br />from DBA_AUDIT_OBJECT a<br />)<br />select <br />username,os_username,timestamp,owner,obj_name,<br />b.* <br />from base_data b<br />where 1=1<br />and   (owner                not in ('SYS','ODL_DBADMIN_DBO','XDB')<br />and   username             not in ('SYS','DBSNMP')<br />and   owner||'.'||obj_name not in ('SYSTEM.SQLPLUS_PRODUCT_PROFILE','SYSTEM.PRODUCT_PRIVS'))<br />or action like '%?%'
  • <br />order by b.timestamp desc<br />







Monday, 2 August 2010

Excel : Remove all hyperlinks

In the spreadsheet
* Press Alt-F11 to open the VB macro
editor

* Select the required sheet

* Enter the following macro code

Sub ZapHyperlinks()

    Cells.Hyperlinks.Delete

End Sub




* Run the code - Green triangle or Menu->Run->Run Macro or F5
(possibly)
* This should remove all hyperlinks in the entire sheet


Monday, 26 July 2010

Oracle : Impdp - objects that can be included/excluded

-- for database level export/import: 
SELECT named, object_path, comments 

  FROM database_export_objects 
 WHERE object_path NOT LIKE '%/%'; 


-- for table schema export/import: 
SELECT named, object_path, comments 

  FROM schema_export_objects 
 WHERE object_path NOT LIKE '%/%'; 


-- for table level export/import: 
SELECT named, object_path, comments 

  FROM table_export_objects 
 WHERE object_path NOT LIKE '%/%'; 

Thursday, 22 July 2010

Oracle : Drop a temp tablespace temp file

 alter database tempfile '/u03/volnewdev7data/oradata/NEWDEV3/temp_02.dbf' drop including datafiles;