Deleting records in $ServerInfo$

ODBC Connectivity, ELFs , Windows API etc.

Moderators: Phil Winkler, Graham Smith, Pete Tabord

Deleting records in $ServerInfo$

Postby KjetilUrne » Sun Jan 27, 2013 1:32 pm

What do i jeopardize performing something like this:
Code: Select all
delete records in $ServerInfo$ with EngineName = "Oledb*" and RemoteTable = "NameOfRT"
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby Adrian Jones » Sun Jan 27, 2013 2:49 pm

I don't believe those $ tables carry any significance other than as a collated snapshot of the state of your app.

So I wouldn't expect your proc to do any harm ... Or any good.

Put it another way -- what are you trying to do? :)
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Deleting records in $ServerInfo$

Postby KjetilUrne » Sun Jan 27, 2013 3:36 pm

It's related to my post "Suggestion: Database Links | Server Name", where I complain about the effort to restore broken db-links.

Part of the problem would be that I have "too many 'declared' RemoteTables".

My intention is to clean up:
a) document which RemoteTables are actually used by the application (the fact that there is an instance in $ServerInfo$ is not the same as it is being utilized)
b) delete the obsolete records
c) whenever i for some reason have to rebuild (from scratch) the db-link, it will be based upon the documentation (=saving me some time and troubleshooting)

Anyway; I will test it ...
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby KjetilUrne » Sun Jan 27, 2013 3:54 pm

In the first place, deleting them apparently works:
Code: Select all
for $ServerInfo$ with EngineName = "oled*" ;
list records      etc

and they seem to be gone.

But they're not (after checking "more info" or after doing a major reorg).

So, as you indicate, it's not possible to do it this way?
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby Adrian Jones » Mon Jan 28, 2013 10:02 am

The 'more info' routines populate the relevant tables at the point where you ask for the data, so you probably did delete info from them, but then repopulated them when you went to look.

But you can run procedures against them which by-passes this populating.

However, these $ tables really have nothing to do with your app, AFAIK. It is Application Objects that stores most of remote DB info (along with the actual TDFs built over any remote tables or views).

I have done a little direct manipulation of App Object remote DB records, but I don't have any 'safe to announce on this forum' suggestions. IOW, you will have to back up and experiment.

Did I cover how to create an aspect over App Objects at my Bristol workshop that you came to?
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Deleting records in $ServerInfo$

Postby KjetilUrne » Mon Jan 28, 2013 7:53 pm

Adrian Jones wrote:I have done a little direct manipulation of App Object remote DB records, but I don't have any 'safe to announce on this forum' suggestions. IOW, you will have to back up and experiment.


So, we do need a Kamikaze-SIG! :-)

Adrian Jones wrote:Did I cover how to create an aspect over App Objects at my Bristol workshop that you came to?


No, not as i remember. But then again, I could have forgotten (a quick search through the compendium didn't reveal any - yes: I keep it close! :-) )
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby Adrian Jones » Tue Jan 29, 2013 9:05 am

Then i must have only covered it last year.

I'll PM you.
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Deleting records in $ServerInfo$

Postby KjetilUrne » Tue Jan 29, 2013 9:57 am

Thanks Adrian! That was powerful, yet easy (IOW a dangerous combination :-)) !
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby KjetilUrne » Tue Jan 29, 2013 11:25 am

So, with my new insight in these depths; Whenever I need to force a change of the udl-file; it would be enough to perform something like this?:
Code: Select all
for Application Objects with Description = "<PathAndFileNameOfUdlfile>;<LinkName>" ;
modify records Description := "<NewPathAndFileNameOfUdlfile>;<LinkName>" .  end


(provided that the rest of the info related to this link is correct, of course)
KjetilUrne
 
Posts: 602
Joined: Mon Oct 08, 2007 8:21 am
Location: Norway
Has thanked: 4 times
Been thanked: 1 time
 

Re: Deleting records in $ServerInfo$

Postby Adrian Jones » Tue Jan 29, 2013 11:42 am

I think you're just going to have to experiment with this.

Remember, not many people are doing remote db stuff, and even fewer commenting on it/sharing their experiences.

Having said that, I think you are probably right!
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 
 

Return to Advanced

Who is online

Users browsing this forum: No registered users and 1 guest