Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I want to reuse a piece of code inside a stored procedure.
This piece of code need to be invoked multiple times inside
the procedure based on some different conditions. How to
achieve this?



I want to reuse a piece of code inside a stored procedure. This piece of code need to be invoked m..

Answer / mohapatra.gouranga@gmail.com

Best answer is:
SELECT df.tablespace_name "Tablespace",
df.bytes / (1024 * 1024) "Size (MB)",
SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "%
Free",
Round((df.bytes - SUM(fs.bytes)) * 100 /
df.bytes) "% Used"
FROM dba_free_space fs,
(SELECT tablespace_name,SUM(bytes) bytes
FROM dba_data_files
GROUP BY tablespace_name) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name,df.bytes
UNION ALL
SELECT df.tablespace_name tspace,
fs.bytes / (1024 * 1024),
SUM(df.bytes_free) / (1024 * 1024),
Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 /
fs.bytes), 1),
Round((SUM(fs.bytes) - df.bytes_free) * 100 /
fs.bytes)
FROM dba_temp_files fs,
(SELECT tablespace_name,bytes_free,bytes_used
FROM v$temp_space_header
GROUP BY tablespace_name,bytes_free,bytes_used) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY
df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
ORDER BY 4 DESC;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB Administration Interview Questions

Can you redefine a table online?

0 Answers   Oracle,


You have just had to restore from backup and do not have any control files. How would you go about bringing up this database?

3 Answers  


Explain the difference between a data block, an extent and a segment.

2 Answers  


if monday take full backup and tuesday it was cumulative backup and wednesday we taken incremental backup, thursday some disaster happen then what type of recovery and how it will take?

1 Answers  


Should you place Recovery Catalog in the Same DB? . Can you use RMAN without Recovery catalog

4 Answers  


What view would you use to look at the size of a data file?

3 Answers  


How to determine the service pack currently installed on SQL Server?

1 Answers  


how to copy(migrate) the database one server to another server without using expdp/impdp how it is possible.

4 Answers   DELL, TCS,


Give the two types of tables involved in producing a star schema and the type of data theyhold.

2 Answers  


how can you record information about current session?

0 Answers   Oracle,


How can you tell how much space is left on a given file system and how much space each of the file system's subdirectories take-up?

0 Answers  


deleted of control file how will u recover control file?

4 Answers   CTS,


Categories