Friday, March 30, 2012
Restrict number of connections to a databse.
Is there anyway I can restrict the number of connections to a SQL Server
database ?
How can we do that.?
Also what is the best way to find out number of current connections to the
database using a query ?
Thanksselect @.@.maxconnections
can be set using sp_configure
sp_who and sp_who2 show you the number of connections
--
Dandy Weyn, Belgium
MCSE, MCSA, MCDBA, MCT
http://www.dandyman.net
Check my SQL Server resource pages (currently under construction)
http://www.dandyman.net/sql
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||Hi,
Is there anyway I can restrict the number of connections to a SQL Server
database ?
You can restrict the connections only SQL Server wide not database level.
How can we do that.?
SP_configure 'user connections',numberofconnections
(By default it is 0 and allow maximum)
Also what is the best way to find out number of current connections to the
database using a query ?
select substring(db_name(dbid),1,30) as DB_name ,count(*) as Connection
from sysprocesses
group by substring(db_name(dbid),1,30)
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||bear in mind that the connections is only configurable at a server level and
not at a database level, thus sp_configure 'show advanced'
,1 must be set inorder to be able to view and set this option.
also to finding the current active connections can be done by using sp_who2
active
this shows you the active users only.
Olu Adedeji
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>
Restrict number of connections to a databse.
Is there anyway I can restrict the number of connections to a SQL Server
database ?
How can we do that.?
Also what is the best way to find out number of current connections to the
database using a query ?
Thanksselect @.@.maxconnections
can be set using sp_configure
sp_who and sp_who2 show you the number of connections
--
Dandy Weyn, Belgium
MCSE, MCSA, MCDBA, MCT
http://www.dandyman.net
Check my SQL Server resource pages (currently under construction)
http://www.dandyman.net/sql
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||Hi,
Is there anyway I can restrict the number of connections to a SQL Server
database ?
You can restrict the connections only SQL Server wide not database level.
How can we do that.?
SP_configure 'user connections',numberofconnections
(By default it is 0 and allow maximum)
Also what is the best way to find out number of current connections to the
database using a query ?
select substring(db_name(dbid),1,30) as DB_name ,count(*) as Connection
from sysprocesses
group by substring(db_name(dbid),1,30)
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>|||bear in mind that the connections is only configurable at a server level and
not at a database level, thus sp_configure 'show advanced'
,1 must be set inorder to be able to view and set this option.
also to finding the current active connections can be done by using sp_who2
active
this shows you the active users only.
--
Olu Adedeji
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:ODXIsYx#DHA.3500@.tk2msftngp13.phx.gbl...
> Hi
> Is there anyway I can restrict the number of connections to a SQL Server
> database ?
> How can we do that.?
> Also what is the best way to find out number of current connections to the
> database using a query ?
> Thanks
>
Monday, March 26, 2012
restoring table or view or sp
Actually I have very big size of databse. Also its back up is obvious that also biger size.
In case of only data loss of one table or view or sp or change then restore whole database then get back previous backup database & restore table i.e. it consuming too much time.
I want to restore only one table or view in faster way. how i can do it. plz give any suggestions
If you database was made of seperate files you could restore individual files.
To restore only a table you need a third party product such as litespeed.
I am not sure if any product can restore only schema components i.e views and sps. Standard practice is to keep the SQL scripts for Views and SPs. Do you not have these?
|||what is litespeed & how i can get it. give the idea plz
|||in sql server 2005 you can use Database snapshot as
a part of your backup and restore strategy.
A database snapshot is a readonly replica of your database
so in case a table is accidentally deleted, you can copy the deleted
data from the snapshot.
other use of the snapshot is for reporting purposes so this startegy will also
boost the database performance as well
Saturday, February 25, 2012
restoring databse
I've tried to restore my database from other computer. I have my database
backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
I've made backup on has name SKLEP\INSERTGT, the one I want to restore data
on-DOM\INSERTGT. While restoring occurs an error "The backu set holds a
backup of a database other than existing 'sklepdata' database".
Now, what should I do to restore data from this file .bak?
Thanks and regards,
Mike.Hi Mike,
This error occurs because the media (the bfk file) you want to restore
doesn't match the existing database. So you can :
1 - Delete the existing database before doing it
2 - Do it in T-SQL and use the REPLACE option of the RESTORE command
3 - Check the 'Overwrite the existing database' parameter (options)
I guess you'll use the third one...
jacek wrote :
> Hi,
> I've tried to restore my database from other computer. I have my database
> backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> I've made backup on has name SKLEP\INSERTGT, the one I want to restore data
> on-DOM\INSERTGT. While restoring occurs an error "The backu set holds a
> backup of a database other than existing 'sklepdata' database".
> Now, what should I do to restore data from this file .bak?
> Thanks and regards,
> Mike.
>|||Since the backup was taken on a different server and the target databases
exists, you need to specify the "overwrite the existing database" option.
This corresponds to the WITH REPLACE option of the RESTORE DATABASE command.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"jacek" <jacek@.o.pl> wrote in message
news:fd3cou$sg2$1@.nemesis.news.tpi.pl...
> Hi,
> I've tried to restore my database from other computer. I have my database
> backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> I've made backup on has name SKLEP\INSERTGT, the one I want to restore
> data on-DOM\INSERTGT. While restoring occurs an error "The backu set holds
> a backup of a database other than existing 'sklepdata' database".
> Now, what should I do to restore data from this file .bak?
> Thanks and regards,
> Mike.
>|||> This error occurs because the media (the bfk file) you want to restore
> doesn't match the existing database. So you can :
> 1 - Delete the existing database before doing it
> 2 - Do it in T-SQL and use the REPLACE option of the RESTORE command
> 3 - Check the 'Overwrite the existing database' parameter (options)
> I guess you'll use the third one...
Heh... I was so easy... I'm dumb;)
Thanks mate!|||Hi, I got the same problem .Here is the solution i found You have to
specify the "overwrite the existing database" option and Set the Database
files(mdf and _Log.ldf properly) by Restore as Column and click ok.
To set Mdf and _log.ldf files
1. Click Browser button provided with Columns Original File Name and Restore
as .
Regards,
Malini Jain
"Dan Guzman" wrote:
> Since the backup was taken on a different server and the target databases
> exists, you need to specify the "overwrite the existing database" option.
> This corresponds to the WITH REPLACE option of the RESTORE DATABASE command.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "jacek" <jacek@.o.pl> wrote in message
> news:fd3cou$sg2$1@.nemesis.news.tpi.pl...
> > Hi,
> > I've tried to restore my database from other computer. I have my database
> > backup made by r-clicking/task/back-up in MSQL SMSE. Comp server n1 that
> > I've made backup on has name SKLEP\INSERTGT, the one I want to restore
> > data on-DOM\INSERTGT. While restoring occurs an error "The backu set holds
> > a backup of a database other than existing 'sklepdata' database".
> > Now, what should I do to restore data from this file .bak?
> > Thanks and regards,
> > Mike.
> >
>