Showing posts with label basis. Show all posts
Showing posts with label basis. Show all posts

Tuesday, March 27, 2012

Can I ghost an SQL server?

I have a test environment that we rebuild servers on a regular basis.
To streamline the process we use ghost. We will be installing SQL on
the servers and want to build a ghost image with that build. We have
tested it by doing the build, loading the data, and then stopping all
the services and setting them to manual. After we Ghost the machine,
we start up the services and reset them to Automatic. Seems to work.

My question is:

Are there any risks? Should I expect any adverse affects?

Thanks for all your help!(otisim@.YAHOO.COM) writes:
> I have a test environment that we rebuild servers on a regular basis.
> To streamline the process we use ghost. We will be installing SQL on
> the servers and want to build a ghost image with that build. We have
> tested it by doing the build, loading the data, and then stopping all
> the services and setting them to manual. After we Ghost the machine,
> we start up the services and reset them to Automatic. Seems to work.
> My question is:
> Are there any risks? Should I expect any adverse affects?

Well, there is one catch. I assume that you rename the machines once
the ghosting as been completed. In this case @.@.servername is likely
to retain the old name or be NULL. In the latter case, you need to do:

sp_addserver NEWNAME, local

Restart SQL Server after this. If @.@.servername retains the old name
I would try dropping it with sp_dropserver first, although I don't
know if it works.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Actually, we are keeping the same name. This is because it is just a
rebuild of the same server.

In other words, we do some testing, we reimage the machine (so we start
with a fresh standard image), and then do more testing.

So we want to keep the same name. We are not using sysprep or making
any other changes. Same hardware, same build, same everything. Just
want to clear out any changes that were made during testing.

Thanks so much for the response.

Steve

Sunday, March 25, 2012

Can I disconnect users on a timed basis?

I know SQL Server is a pretty powerful beast and I can use SQL Server Agent
Jobs to run things on a timed basis, but can anyone answer...
Is it possible to write scripts or stored procedures (or whatever is needed)
to disconnect a user from the database after a period of inactivity?
If so, can someone give me a clue how I would do this or possibly point me
in the right direction.
Thanks!Hi,
Yes it is possible to do, But please check the status of that user before
disconnecting. If it is runnable please wait for some more time and
kill the user once the status become "Sleeping"
declare @.status varchar(30)
declare @.pid int,@.sql nvarchar(100)
select @.status=status from master..sysprocesses where loginame='user_name'
if @.status = 'sleeping'
begin
select @.pid = spid from master..sysprocesses where loginame='user_name'
set @.sql= 'kill '+convert(char,@.pid)
exec sp_executesql @.sql
end
Schedule the script thru SQL Agent jobs. THe above script can take care of 1
user kill . If you have mutiple user, you have to slightly modify the script
Thanks
Hari
MCDBA
"Dave Roys" <daveroys@.xtra.co.nz> wrote in message
news:u4FeDTmAEHA.2600@.TK2MSFTNGP09.phx.gbl...
> I know SQL Server is a pretty powerful beast and I can use SQL Server
Agent
> Jobs to run things on a timed basis, but can anyone answer...
> Is it possible to write scripts or stored procedures (or whatever is
needed)
> to disconnect a user from the database after a period of inactivity?
> If so, can someone give me a clue how I would do this or possibly point me
> in the right direction.
> Thanks!
>