| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: using DBMS_SPACE for multiple inst.
Frank Zaum wrote:
>Dear People,
>
>
>
>I am trying to write a package that analyzes a given number of tables
>on a given number of dblinks using DBMS_SPACE and writes the
>information into a new table (stats). the names of the tables are in
>a table (tabname) and the names of the dblinks are in a separate
>table, too (at_db).i know there must be two loops, an inner for the
>number of tables and an outer for the number of dblinks. I guess i
>have to use cursors to get table and dblink names, but i dont know
>where to start. another problem is i dont know if i can use dblink in
>the segment_owner parameter of DBMS_SPACE package when executing(like
>'scott_at_dbthx').
>
>any help would be appreciated,
>
>Frank Zaum, Salzgitter, Germany
>
Here is what you can do ....
Loop For all the Db Links.
Loop for all the Tables on that DB Link [ Hope You have That relation]
Execute Immediate 'Begin DBMS_SPACE.FREE_SPACE@' || DBLink [Pass
Necessary Parameters]
End Loop
End Loop
This should Solve the problem.
DBMS_SPACE should be run on the Destination server and it will get the data from that database.
HTH
-- =================================== [Additions and Corrections Welcome] Regards, Ganesh R ===================================Received on Sun Apr 14 2002 - 07:46:05 CDT
![]() |
![]() |