Showing posts with label isql. Show all posts
Showing posts with label isql. Show all posts

Wednesday, March 28, 2012

restore using isql

I have problems when trying to restore a database using the command line
isql program. I use a trusted connection and it says the database is in use
when no one is connected to it. Is there a problem trying to do this?
What is the default database for your trusted connection? If the default
database of your trusted connection is the database you trying to restore it
will v=be problem.
Also make sure no automated jobs periodically connecting the database.
Thanks
Ravi
"Tom Reis" wrote:

> I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in use
> when no one is connected to it. Is there a problem trying to do this?
>
>
|||The default database is master. Not the one I am trying to restore.
"Ravi" <ravishankart@.hotmail.com> wrote in message
news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> What is the default database for your trusted connection? If the default
> database of your trusted connection is the database you trying to restore
it[vbcol=seagreen]
> will v=be problem.
> Also make sure no automated jobs periodically connecting the database.
> --
> Thanks
> Ravi
>
> "Tom Reis" wrote:
use[vbcol=seagreen]
|||try EXEC sp_who2 and see there are any connections to the database
Thanks
Ravi
"Tom Reis" wrote:

> The default database is master. Not the one I am trying to restore.
> "Ravi" <ravishankart@.hotmail.com> wrote in message
> news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> it
> use
>
>
|||Tom,
From ISQL first go to SQL prompt using:-
ISQL -Usa -Ppassword (ENTER)
Now execute the below commands in sequence:-
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE Command
GO
ALTER DATABASE <dbname> SET MULTI_USER
Note:
If the SQL Server version is 2000 then use OSQL instead of ISQL.
Thanks
Hari
SQL Server MVP
"Tom Reis" <reistom@.cdnet.cod.edu> wrote in message
news:%23Y8VXZbfFHA.3988@.TK2MSFTNGP10.phx.gbl...
>I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in
> use
> when no one is connected to it. Is there a problem trying to do this?
>
sql

restore using isql

I have problems when trying to restore a database using the command line
isql program. I use a trusted connection and it says the database is in use
when no one is connected to it. Is there a problem trying to do this?What is the default database for your trusted connection? If the default
database of your trusted connection is the database you trying to restore it
will v=be problem.
Also make sure no automated jobs periodically connecting the database.
--
Thanks
Ravi
"Tom Reis" wrote:
> I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in use
> when no one is connected to it. Is there a problem trying to do this?
>
>|||The default database is master. Not the one I am trying to restore.
"Ravi" <ravishankart@.hotmail.com> wrote in message
news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> What is the default database for your trusted connection? If the default
> database of your trusted connection is the database you trying to restore
it
> will v=be problem.
> Also make sure no automated jobs periodically connecting the database.
> --
> Thanks
> Ravi
>
> "Tom Reis" wrote:
> > I have problems when trying to restore a database using the command line
> > isql program. I use a trusted connection and it says the database is in
use
> > when no one is connected to it. Is there a problem trying to do this?
> >
> >
> >|||try EXEC sp_who2 and see there are any connections to the database
--
Thanks
Ravi
"Tom Reis" wrote:
> The default database is master. Not the one I am trying to restore.
> "Ravi" <ravishankart@.hotmail.com> wrote in message
> news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> > What is the default database for your trusted connection? If the default
> > database of your trusted connection is the database you trying to restore
> it
> > will v=be problem.
> >
> > Also make sure no automated jobs periodically connecting the database.
> >
> > --
> > Thanks
> > Ravi
> >
> >
> > "Tom Reis" wrote:
> >
> > > I have problems when trying to restore a database using the command line
> > > isql program. I use a trusted connection and it says the database is in
> use
> > > when no one is connected to it. Is there a problem trying to do this?
> > >
> > >
> > >
>
>|||Tom,
From ISQL first go to SQL prompt using:-
ISQL -Usa -Ppassword (ENTER)
Now execute the below commands in sequence:-
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE Command
GO
ALTER DATABASE <dbname> SET MULTI_USER
Note:
If the SQL Server version is 2000 then use OSQL instead of ISQL.
Thanks
Hari
SQL Server MVP
"Tom Reis" <reistom@.cdnet.cod.edu> wrote in message
news:%23Y8VXZbfFHA.3988@.TK2MSFTNGP10.phx.gbl...
>I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in
> use
> when no one is connected to it. Is there a problem trying to do this?
>

restore using isql

I have problems when trying to restore a database using the command line
isql program. I use a trusted connection and it says the database is in use
when no one is connected to it. Is there a problem trying to do this?What is the default database for your trusted connection? If the default
database of your trusted connection is the database you trying to restore it
will v=be problem.
Also make sure no automated jobs periodically connecting the database.
Thanks
Ravi
"Tom Reis" wrote:

> I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in us
e
> when no one is connected to it. Is there a problem trying to do this?
>
>|||The default database is master. Not the one I am trying to restore.
"Ravi" <ravishankart@.hotmail.com> wrote in message
news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> What is the default database for your trusted connection? If the default
> database of your trusted connection is the database you trying to restore
it[vbcol=seagreen]
> will v=be problem.
> Also make sure no automated jobs periodically connecting the database.
> --
> Thanks
> Ravi
>
> "Tom Reis" wrote:
>
use[vbcol=seagreen]|||try EXEC sp_who2 and see there are any connections to the database
Thanks
Ravi
"Tom Reis" wrote:

> The default database is master. Not the one I am trying to restore.
> "Ravi" <ravishankart@.hotmail.com> wrote in message
> news:203C4DFF-64B5-427E-A841-8AB5F8A51302@.microsoft.com...
> it
> use
>
>|||Tom,
From ISQL first go to SQL prompt using:-
ISQL -Usa -Ppassword (ENTER)
Now execute the below commands in sequence:-
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE Command
GO
ALTER DATABASE <dbname> SET MULTI_USER
Note:
If the SQL Server version is 2000 then use OSQL instead of ISQL.
Thanks
Hari
SQL Server MVP
"Tom Reis" <reistom@.cdnet.cod.edu> wrote in message
news:%23Y8VXZbfFHA.3988@.TK2MSFTNGP10.phx.gbl...
>I have problems when trying to restore a database using the command line
> isql program. I use a trusted connection and it says the database is in
> use
> when no one is connected to it. Is there a problem trying to do this?
>

Saturday, February 25, 2012

restore master problem

When i try to restore master db with
sqlservr -c -m -T4022
ISQL -E , restore database master from device='d:\dump\masterdump.dat'
restore fail with message
Error: 3151, Severity: 21, State: 0.
Error: 9001, Severity: 21, State: 1.
and sqlserver terminated..
I have try this.
1. backup a new masterdump from other sqlserver b and and restore to server
a .. same problem
2. take this masterdump from server b and restore to other server, sucessful.
3. backup master from sqlserver(a) and restore to sqlserver(a) succesful.
i using sqlserver sp3
win2003 standard edition..
any suggestion?Hi,
Did you try rebuilding the master with rebuildm utlility and then try to
restore again?
--
Danijel Novak
"soonyu" <soonyu@.discussions.microsoft.com> wrote in message
news:3184264F-DC6F-4A12-B8B9-E7F8C508B14A@.microsoft.com...
> When i try to restore master db with
> sqlservr -c -m -T4022
> ISQL -E , restore database master from device='d:\dump\masterdump.dat'
> restore fail with message
> Error: 3151, Severity: 21, State: 0.
> Error: 9001, Severity: 21, State: 1.
> and sqlserver terminated..
> I have try this.
> 1. backup a new masterdump from other sqlserver b and and restore to
> server
> a .. same problem
> 2. take this masterdump from server b and restore to other server,
> sucessful.
> 3. backup master from sqlserver(a) and restore to sqlserver(a) succesful.
> i using sqlserver sp3
> win2003 standard edition..
> any suggestion?
>