Results 1 to 4 of 4

Thread: monitor of TableSpaces in PHP

  1. #1
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default monitor of TableSpaces in PHP

    hi!
    i would like to monitoring the size of tablaspaces in my oracle.
    I have the query to show this values but i don't know to show in my web.
    The query is:

    Code:
    $query =   "select    fs.tablespace_name, (df.totalspace - fs.freespace),fs.freespace, df.totalspace,
             round(100 * (fs.freespace / df.totalspace))
            from (select tablespace_name, round(sum(bytes) / 1048576) TotalSpace
               from dba_data_files
            group by tablespace_name) df, (select    tablespace_name, round(sum(bytes) / 1048576) FreeSpace from dba_free_space
            group by tablespace_name) fs where df.tablespace_name = fs.tablespace_name";
    I see the function "oci_connect" in php to establishes a connection to the Oracle server but my level of php is very low.

    Any body help me??? I would like to show in a different rows and columns my values for example:

    name_tamblespace | total_size | Used_% | free_size | free_size_%

    very thanks!

  2. #2
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    13
    Thanked 4 Times in 4 Posts

    Default

    1. Create an oracle connection
    2. Use the oracle query function on the query statement
    3. Echo out the output

    May this be of help to you.

  3. #3
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know to create a oracle connection but i don't know tho make a Echo out the output...

  4. #4
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i have a bucle to know all my information.

    Code:
      $s = OCIParse($c, $query); 
      OCIExecute($s, OCI_DEFAULT);
        while (OCIFetch($s)) {
    	echo ociresult($s, 1) . " ";
    	echo ociresult($s, 2) . " ";
    	echo ociresult($s, 3) . " ";
    	echo ociresult($s, 4) . " ";
    	echo ociresult($s, 5) . " ";
    	echo ociresult($s, 6) . " ";
    	$size =  ociresult($s, 6);
    	echo ociresult($s, 7);
    	echo "<br>";
        } 
    OCILogoff($c);
    in this line: $size = ociresult($s, 6); I give the free % of my tablespace.
    How can i give in different echo the values???

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •