Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic drop database link

User341075Aug 30 2011 — edited Oct 5 2012
Hi,

As user SYS i need to Dynamically DROP all the database link in the Database.
I cant drop private database link .
For example i have few database links under APPS schema that i would like to drop.
Please note that it should be done by SYS user
SQL> declare
  2  
  3  cursor c is
  4  select * 
  5  from dba_db_links;
  6  
  7  
  8  begin
  9  for c_rec in c loop
 10  
 11      if c_rec.owner = 'PUBLIC' then
 12          execute immediate ' drop public database link '||'"'||c_rec.db_link||'"';
 13      else
 14          dbms_output.put_line (' drop database link '||'"'||c_rec.db_link||'"');
 15           execute immediate ' drop database link '||'"'||c_rec.db_link||'"';
 16      end if;      
 17  end loop;
 18  
 19  end;
 20  /

drop database link "APPS_TO_APPS"
declare
*
ERROR at line 1:
ORA-02024: database link not found
ORA-06512: at line 15
Thanks

Comments

Integration isn't rarely done and I've not looked at current mechanics. Can you utilize a custom authentication package in APEX, set the http header when you call PHP, and utilize a callback (to APEX or directly to the DB if the authentication state is stored in a table)  to verify the header token value is current?

jstem1177

Hello cj,

Yes we can utilise custom authentication. This is already the mechanic I'm using. As far as mechanics go, I thing any login system "RETURNS" the result to the calling function, whether ti be on login page of a function (aka silent logins).

I think the key is the APEX session id.

If you always pass the session id between PHP and APEX, then within PHP you could easily have a generic routines to get and set APEX session state values.

Really, you would be just writing wrappers around htmldb_util.get_session_state and htmldb_util.set_session_state.

If you wanted to store additional values from PHP, you could either use wwv_flow_preferences.get_preference and wwv_flow_preferences.set_preference, or create your own tables and api package.

Not sure how to go about the whole thing though. Need to give this some more thought.

JAn S.

It would be great to hear how you put it all together in the end.

904494

It is also importance that your apex is to be flag as sign that it is authenticated.

jstem1177

Will post an update if I ever get it to work.

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 2 2012
Added on Aug 30 2011
12 comments
4,842 views