Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Tuesday, March 27, 2012

Deleting old servers still listed in Query Analyzer ????????

I can use the Client Network Utility (CNU) from SQL 2000 to create/delete
aliases.
But when I 1st run Query Analyzer (QA)... it shows a list of some old
servers we used to have... long ago.
How do I delete from that list?
(The old servers have already been removed from the CNU alias list... but
they seem to stay listed in QA forever.)
They have nothing to do with each other. Any registrations you did in QA or
EM you will have to manually delete them from the registrations by right
clicking and choosing Delete.
Andrew J. Kelly SQL MVP
""A_Michigan_User"" <Michigan_RE_M0VE@.ameritech.net> wrote in message
news:%23gKQ7lwOGHA.3944@.tk2msftngp13.phx.gbl...
>I can use the Client Network Utility (CNU) from SQL 2000 to create/delete
>aliases.
> But when I 1st run Query Analyzer (QA)... it shows a list of some old
> servers we used to have... long ago.
> How do I delete from that list?
> (The old servers have already been removed from the CNU alias list... but
> they seem to stay listed in QA forever.)
>
>
|||"A_Michigan_User" wrote:
> I can use the Client Network Utility (CNU) from SQL 2000 to
> create/delete aliases.
> But when I 1st run Query Analyzer (QA)... it shows a list of some old
> servers we used to have... long ago.
> How do I delete from that list?
> (The old servers have already been removed from the CNU alias list...
> but they seem to stay listed in QA forever.)
For QA, the servers are stored here in the registration database:
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL
Server\80\Tools\Client\PrefServers
You can remove the pairs you do not need - carefully. I don't know how
to remove servers from the QA drop-down list in the connection dialog
other than by editing the regdb. I see different servers listed in QA
than I have for SQLEM, so removing the server from SQLEM does seem like
it will work in QA.
David Gugick - SQL Server MVP
Quest Software
|||> They have nothing to do with each other.
I thought I *HAD TO* add them with CNU... then they appeared as "available"
in QA and EM.
No?
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eP%237NMyOGHA.1312@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> They have nothing to do with each other. Any registrations you did in QA
> or EM you will have to manually delete them from the registrations by
> right clicking and choosing Delete.
> --
> Andrew J. Kelly SQL MVP
>
> ""A_Michigan_User"" <Michigan_RE_M0VE@.ameritech.net> wrote in message
> news:%23gKQ7lwOGHA.3944@.tk2msftngp13.phx.gbl...
|||The CNU just allowed you to alias them. Then maybe you can see them thru
the alias but that is not a requirement to register a server. You just need
the name or IP address of the server and it has to be available on the right
port, 1433 by default.
Andrew J. Kelly SQL MVP
""A_Michigan_User"" <Michigan_RE_M0VE@.ameritech.net> wrote in message
news:eqFg7jlRGHA.2156@.tk2msftngp13.phx.gbl...
> I thought I *HAD TO* add them with CNU... then they appeared as
> "available" in QA and EM.
> No?
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:eP%237NMyOGHA.1312@.TK2MSFTNGP09.phx.gbl...
>

Monday, March 19, 2012

Deleting all but top record.

Hey Guys,

I have Performance Monitor running and storing the network usage to my MsSQL database, and this is done a few times a minute. I have a page that then shows show much of my bandwidth is being used. As you can gather, the database quickly starts filling up with hundrreds of records so I could do with a script that delete these records.
I cant simply delete all records because that would cause my webpage to fail so I need a way to delete all records apart from the latest one.
Wondering if anyone would know how I could do this?delete from tableRecords where recordid < (select max(recordid) from tablerecords)

Nick|||

Thank you, that works great.
I've just however noticed a potential problem. I understand that the RecordID can only go so high then will give errors. The thing is, the PerfMon has only been running a few hours and already it has produced 1800+ records. With your script I can just keep it as one record in the table, but the RecordID will get higher and higher. Im wondering what will happening if I let this run for a week or so, eventually it will stop working.
Anyone got any ideas?

|||Dont use an auto-identity field.
insert into table
select max(recordid) + 1 from table, [rest of fields]
Since you will only have one record in there at a time, this shouldnt hurt your performance.
Nick

Friday, March 9, 2012

Deleted SQL registry keys on Passive side of Active\Passive cluster config.

Hi, one of our network technicians accidently deleted both the following
registry keys on the passive side of our Active\Passive cluster
configuration for SQL 2000:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ]
Since we haven't at this stage started backing up the Passive server, those
registry keys can't be recovered from a backup.
In trying to resolve this issue, I have exported those keys from the Active
server, and imported them onto the Passive server.
This obviously isn't working as when I try to start Enterprise Manager, I
get a dialog box saying that:
Snap-in failed to initialize.
Name: <unknown>
CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}
Query Analyzer works however.
What is recommended in this situation? How can I be guaranteed that the
cluster will failover correctly? I havent tested failover yet.
Can anyone tell me what the specific differences are between registry keys
when comparing the Active server and the Passive server?
Any help most appreciated!
Many thanks,
John
Hi, I have made some progress in this.
We have another SQL Active/Passive cluster set up (call them Active1 and
Passive1) and I exported the two keys from both these Active and Passive
servers and compared them through file comparison. This would give me clues
as to what I should be looking for on my original Active0 and Passive0
servers.
It seems that the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ] only
sets up the parameters in the client network utility i.e. tcp/ip and named
pipe alias for virtual instance. There is no difference between this key on
both Active1 and Passive1 servers. So I left that key alone on Active0 and
Passive0.
In relation to EM not opening up, I searched for the
CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}on the Active0 server and found
within it a reference to "Microsoft SQL Enterprise Manager SnapIn" details.
I searched for "Microsoft SQL Enterprise Manager SnapIn" on the Passive0
server but could not find it!!!
Why is that? When [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ] was
deleted on Passive0, did this cascade delete
CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F} ?
Well I exported the CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}key from
Active0 server and imported it into the Passive0 server, and now EM works.
In relation to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ], I
compared this key on both Active1 and Passive1. There doesnt seem to be much
of a difference. These are the differences:
Active1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
"SsrpActiveServer"="JJJ"
Passive1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
Note: Here I guess I just remove the "SsrpActiveServer" reference on
Passive0 ?
Active1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
Server\80\Registration]
"DigitalProductID"=<removed>
"ProductID"="<removed>"
Passive1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
Server\80\Registration]
"DigitalProductID"=<removed>
"ProductID"="<removed>"
Note: Will this cause issues? Licensing is different on both servers.
Active1:
"uptime_pid"=dword:00000d8c
"uptime_time_utc"=hex:b1,48,31,c7,c4,ff,c5,01
Passive1:
"uptime_pid"=dword:00000ff0
"uptime_time_utc"=hex:10,88,f5,ba,d0,ff,c5,01
Note: I guess these don't really matter so I'll leave them alone
Active1:
<nothing>
Passive1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
Server\JJJ\MSSQLServer\SuperSocketNetLib\Lpc]
"LPCVersion"=dword:080007f7
Note: What do I do here? What is this LCPVersion? I cant find a reference to
it on Google.
Any help most appreciated!
Cheers,
John
"john clarke" <jclarke@.nospam.com> wrote in message
news:uNifJp8$FHA.3568@.TK2MSFTNGP09.phx.gbl...
> Hi, one of our network technicians accidently deleted both the following
> registry keys on the passive side of our Active\Passive cluster
> configuration for SQL 2000:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ]
> Since we haven't at this stage started backing up the Passive server,
> those registry keys can't be recovered from a backup.
> In trying to resolve this issue, I have exported those keys from the
> Active server, and imported them onto the Passive server.
> This obviously isn't working as when I try to start Enterprise Manager, I
> get a dialog box saying that:
> Snap-in failed to initialize.
> Name: <unknown>
> CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}
> Query Analyzer works however.
> What is recommended in this situation? How can I be guaranteed that the
> cluster will failover correctly? I havent tested failover yet.
> Can anyone tell me what the specific differences are between registry keys
> when comparing the Active server and the Passive server?
> Any help most appreciated!
> Many thanks,
> John
>
|||Hi
You are missing the basics of clustering.
The active node of the cluster has the only set of "working" registry keys
on the cluster (subset). This gets written to the quorum drive on a regular
basis. If you were to fail the cluster over to the other node, the other
node reads the quorum drives registry settings in and starts up SQL Server.
Try failing the cluster over, but at worst case, you will need to re-install
SQL Server on the whole cluster. Might teach the technician to leave things
alone he does not understand.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"john clarke" <jclarke@.nospam.com> wrote in message
news:ephevV9$FHA.140@.TK2MSFTNGP12.phx.gbl...
> Hi, I have made some progress in this.
> We have another SQL Active/Passive cluster set up (call them Active1 and
> Passive1) and I exported the two keys from both these Active and Passive
> servers and compared them through file comparison. This would give me
> clues as to what I should be looking for on my original Active0 and
> Passive0 servers.
> It seems that the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ] only
> sets up the parameters in the client network utility i.e. tcp/ip and named
> pipe alias for virtual instance. There is no difference between this key
> on both Active1 and Passive1 servers. So I left that key alone on Active0
> and Passive0.
> In relation to EM not opening up, I searched for the
> CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}on the Active0 server and
> found within it a reference to "Microsoft SQL Enterprise Manager SnapIn"
> details. I searched for "Microsoft SQL Enterprise Manager SnapIn" on the
> Passive0 server but could not find it!!!
> Why is that? When [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ]
> was deleted on Passive0, did this cascade delete
> CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F} ?
> Well I exported the CLSID:{00100100-1816-11D0-8EF5-00AA0062C58F}key from
> Active0 server and imported it into the Passive0 server, and now EM works.
> In relation to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer ], I
> compared this key on both Active1 and Passive1. There doesnt seem to be
> much of a difference. These are the differences:
> --
> Active1:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
> "SsrpActiveServer"="JJJ"
> Passive1:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL Server]
> Note: Here I guess I just remove the "SsrpActiveServer" reference on
> Passive0 ?
> --
> Active1:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
> Server\80\Registration]
> "DigitalProductID"=<removed>
> "ProductID"="<removed>"
> Passive1:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
> Server\80\Registration]
> "DigitalProductID"=<removed>
> "ProductID"="<removed>"
> Note: Will this cause issues? Licensing is different on both servers.
> --
> Active1:
> "uptime_pid"=dword:00000d8c
> "uptime_time_utc"=hex:b1,48,31,c7,c4,ff,c5,01
> Passive1:
> "uptime_pid"=dword:00000ff0
> "uptime_time_utc"=hex:10,88,f5,ba,d0,ff,c5,01
> Note: I guess these don't really matter so I'll leave them alone
> --
> Active1:
> <nothing>
> Passive1:
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsof t SQL
> Server\JJJ\MSSQLServer\SuperSocketNetLib\Lpc]
> "LPCVersion"=dword:080007f7
> Note: What do I do here? What is this LCPVersion? I cant find a reference
> to it on Google.
> --
> Any help most appreciated!
> Cheers,
> John
> "john clarke" <jclarke@.nospam.com> wrote in message
> news:uNifJp8$FHA.3568@.TK2MSFTNGP09.phx.gbl...
>