Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Tuesday, March 15, 2011

Data Files free space

Create Or Replace Force View Sys.Av_db_df_free_space (Tablespace_name,
                                                      File_name,
                                                      Allocated_mb,
                                                      Used_mb,
                                                      Free_space_mb
                                                     )

As
   Select   Dfs.Tablespace_name, Substr (Df.Name, 1, 40) File_name,
            Df.Bytes / 1024 / 1024 Allocated_mb,
            ((Df.Bytes / 1024 / 1024) - Nvl (Sum (Dfs.Bytes) / 1024 / 1024, 0)
            ) Used_mb,
            Nvl (Sum (Dfs.Bytes) / 1024 / 1024, 0) Free_space_mb
       From V$datafile Df, Dba_free_space Dfs
      Where Df.File# = Dfs.File_id(+)
   Group By Dfs.Tablespace_name, Dfs.File_id, Df.Name, Df.File#, Df.Bytes
   Order By Dfs.Tablespace_name;

No comments: