Tuesday, December 21, 2010

Flashback table

The table could be restored to using flashback table option. Before attempting it, find out how far to flash the table.

Steps :-

1. sql> select count(*) from scott.emp;

2.  export of the table 

3. flashback table

sql> alter table scott.emp enable row movement;
sql> flashback table scott.emp to timestamp
       to_timestamp('2010-12-18 12:00:00','YYYY-MM-DD HH24:MI:SS');
      
Flashback complete.

4. sql> select count(*) from scott.emp;

  COUNT(*)
----------
    784871

5. confirm with apps team

Hope this helps! Regards Rupam


Saturday, December 18, 2010

Windows - Find space usage by windows folders using diruse

Directory Disk Usage, known as diruse is a free command line tool found on Microsoft's Help . Using diruse is easy. After you have downloaded the tool, install by clicking on diruse_setup.exe.
After installing the program, open a command prompt and run:
cd "\Program Files\Resource Kit"
diruse /M /* c:\
where:
/M – reports in Magabytes
/*  – Uses the top-level directories residing in the specified directory (In the above example C:\ is the specifed directory)
Below is the results of the output:

Monday, December 13, 2010

Date function in Oracle

Date function in Oracle
 examples of date function:
   insert into mydate values (sysdate -1);
   insert into mydate values (sysdate - 6/24); #   6 hours ago
  insert into mydate values (sysdate - 720/1440); # 12 hours ago
  click read for complete example

usage
 delete noprompt archivelog until time 'sysdate - 1';
 delete archivelog all backed up 1 times to device type disk completed before 'sysdate-6/24';

Sunday, December 12, 2010

Tablespace details ( includes datafiles, type, autoextend, maxsize etc)


Summary
1. list datafiles
2. get type, auroextend, management type etc

Tablespace report




Run the following sql to get the space report in Oracle