Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Friday, March 23, 2012

Help with an error message

I keep getting this error message when I try to restore a database backup that I have made.

System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Databases\GTT_Data.MDF" failed with the operating system error 5(error not found). (Microsoft.SqlServer.Express.Smo)

What I have done is created a backup of my sql sever database and I am now trying to restore it into sql server express for someone to play around with without it affecting my actual database. This is where the error messages are coming from.

Please help

Are you getting this during the restore ? If the machines are not the same for backup and restore you might not have the drives / folders available as they are on the original system. If so you either have to create those folders or Restore the database with the WITH MOVE option to specify a new destination. (thats because the original location is tored in the backup file).

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Yes its during the restore. Yes the machines are not the same. Please could you give me further details on how to restore the databse with the WITH MOVE option.

Thanks for your help

|||Hi,

look in your BOL (Books online, the Online help of SQL Server)

There is a point Restore a database and move Files which will help you

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/877ecd57-3f2e-4237-890a-08f16e944ef1.htm

RESTORE DATABASE MyAdvWorks
FROM MyAdvWorks_1
WITH NORECOVERY,
MOVE 'MyAdvWorks' TO
'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.mdf',
MOVE 'MyAdvWorksLog1'
TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\NewAdvWorks.ldf'
RESTORE LOG MyAdvWorks
FROM MyAdvWorksLog1
WITH RECOVERY

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Friday, February 24, 2012

Help Setting Up A Linked Server to Query Directory Services

I'm not sure what I'm doing wrong here but I've been banging my head against
for a few hours now.
Background:
SQL 2000 on Windows 2000 Server SP4 as member server in an Active Directory
Domain
MSSQLSVR service and SQL Agent are running as a Domain Administrator
Ive tried to create a linked server with "OLE DB Provider for Microsoft
Directory Services" as the data source. Ive tried this via Query Analylzer
and via Enterprise Manager. The result is the same:
select cn from openquery(AD,'select cn from "LDAP://DC=dfi-intl,dc=com"
where objectCategory="person" and objectClass="users" ')
Gives this error:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution against OLE DB
provider 'ADSDSOObject'.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prepare
returned 0x80040e14].
I've tried to create it this way via QA:
sp_addlinkedserver 'AD', 'Active Directory Service
Interfaces', 'ADSDSOObject', 'adsdatasource'
and then in EM, Ive played with all the security stuff but it's still a no
go. I'm completely at my limit with this. Can anyone offer a suggestion?
Thanks in advance.
Errol NealErrol Neal wrote:
> I'm not sure what I'm doing wrong here but I've been banging my head against
> for a few hours now.
> Background:
> SQL 2000 on Windows 2000 Server SP4 as member server in an Active Directory
> Domain
> MSSQLSVR service and SQL Agent are running as a Domain Administrator
> Ive tried to create a linked server with "OLE DB Provider for Microsoft
> Directory Services" as the data source. Ive tried this via Query Analylzer
> and via Enterprise Manager. The result is the same:
> select cn from openquery(AD,'select cn from "LDAP://DC=dfi-intl,dc=com"
> where objectCategory="person" and objectClass="users" ')
> Gives this error:
> Server: Msg 7321, Level 16, State 2, Line 1
> An error occurred while preparing a query for execution against OLE DB
> provider 'ADSDSOObject'.
> OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prepare
> returned 0x80040e14].
> I've tried to create it this way via QA:
> sp_addlinkedserver 'AD', 'Active Directory Service
> Interfaces', 'ADSDSOObject', 'adsdatasource'
> and then in EM, Ive played with all the security stuff but it's still a no
> go. I'm completely at my limit with this. Can anyone offer a suggestion?
> Thanks in advance.
> Errol Neal
Hi
I don't know if it helps, but try to alter your OPENQUERY statement a
little bit.
The following works for me and compared to yours I've only specified the
AD servername and not with DC= as you have.
select * from openquery
(
ADSI,'SELECT name, mail, cn
FROM ''LDAP://dc-1''
WHERE objectCategory = ''Person'' AND objectClass = ''user'''
)
Regards
Steen Schlüter Persson
DBA|||Thanks a lot! Syntax was defintely an issue. Using single quotes instead of a
double quote. I appreciate the reply!
"Steen Persson (DK)" wrote:
> Errol Neal wrote:
> > I'm not sure what I'm doing wrong here but I've been banging my head against
> > for a few hours now.
> > Background:
> >
> > SQL 2000 on Windows 2000 Server SP4 as member server in an Active Directory
> > Domain
> > MSSQLSVR service and SQL Agent are running as a Domain Administrator
> >
> > Ive tried to create a linked server with "OLE DB Provider for Microsoft
> > Directory Services" as the data source. Ive tried this via Query Analylzer
> > and via Enterprise Manager. The result is the same:
> >
> > select cn from openquery(AD,'select cn from "LDAP://DC=dfi-intl,dc=com"
> > where objectCategory="person" and objectClass="users" ')
> >
> > Gives this error:
> >
> > Server: Msg 7321, Level 16, State 2, Line 1
> > An error occurred while preparing a query for execution against OLE DB
> > provider 'ADSDSOObject'.
> > OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prepare
> > returned 0x80040e14].
> >
> > I've tried to create it this way via QA:
> >
> > sp_addlinkedserver 'AD', 'Active Directory Service
> > Interfaces', 'ADSDSOObject', 'adsdatasource'
> >
> > and then in EM, Ive played with all the security stuff but it's still a no
> > go. I'm completely at my limit with this. Can anyone offer a suggestion?
> >
> > Thanks in advance.
> >
> > Errol Neal
> Hi
> I don't know if it helps, but try to alter your OPENQUERY statement a
> little bit.
> The following works for me and compared to yours I've only specified the
> AD servername and not with DC= as you have.
> select * from openquery
> (
> ADSI,'SELECT name, mail, cn
> FROM ''LDAP://dc-1''
> WHERE objectCategory = ''Person'' AND objectClass = ''user'''
> )
>
> --
> Regards
> Steen Schlüter Persson
> DBA
>

Help Setting Up A Linked Server to Query Directory Services

I'm not sure what I'm doing wrong here but I've been banging my head against
for a few hours now.
Background:
SQL 2000 on Windows 2000 Server SP4 as member server in an Active Directory
Domain
MSSQLSVR service and SQL Agent are running as a Domain Administrator
Ive tried to create a linked server with "OLE DB Provider for Microsoft
Directory Services" as the data source. Ive tried this via Query Analylzer
and via Enterprise Manager. The result is the same:
select cn from openquery(AD,'select cn from "LDAP://DC=dfi-intl,dc=com"
where objectCategory="person" and objectClass="users" ')
Gives this error:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution against OLE DB
provider 'ADSDSOObject'.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Prep
are
returned 0x80040e14].
I've tried to create it this way via QA:
sp_addlinkedserver 'AD', 'Active Directory Service
Interfaces', 'ADSDSOObject', 'adsdatasource'
and then in EM, Ive played with all the security stuff but it's still a no
go. I'm completely at my limit with this. Can anyone offer a suggestion?
Thanks in advance.
Errol NealErrol Neal wrote:
> I'm not sure what I'm doing wrong here but I've been banging my head again
st
> for a few hours now.
> Background:
> SQL 2000 on Windows 2000 Server SP4 as member server in an Active Director
y
> Domain
> MSSQLSVR service and SQL Agent are running as a Domain Administrator
> Ive tried to create a linked server with "OLE DB Provider for Microsoft
> Directory Services" as the data source. Ive tried this via Query Analylzer
> and via Enterprise Manager. The result is the same:
> select cn from openquery(AD,'select cn from "LDAP://DC=dfi-intl,dc=com"
> where objectCategory="person" and objectClass="users" ')
> Gives this error:
> Server: Msg 7321, Level 16, State 2, Line 1
> An error occurred while preparing a query for execution against OLE DB
> provider 'ADSDSOObject'.
> OLE DB error trace [OLE/DB Provider 'ADSDSOObject' ICommandPrepare::Pr
epare
> returned 0x80040e14].
> I've tried to create it this way via QA:
> sp_addlinkedserver 'AD', 'Active Directory Service
> Interfaces', 'ADSDSOObject', 'adsdatasource'
> and then in EM, Ive played with all the security stuff but it's still a no
> go. I'm completely at my limit with this. Can anyone offer a suggestion?
> Thanks in advance.
> Errol Neal
Hi
I don't know if it helps, but try to alter your OPENQUERY statement a
little bit.
The following works for me and compared to yours I've only specified the
AD servername and not with DC= as you have.
select * from openquery
(
ADSI,'SELECT name, mail, cn
FROM ''LDAP://dc-1''
WHERE objectCategory = ''Person'' AND objectClass = ''user'''
)
Regards
Steen Schlüter Persson
DBA|||Thanks a lot! Syntax was defintely an issue. Using single quotes instead of
a
double quote. I appreciate the reply!
"Steen Persson (DK)" wrote:

> Errol Neal wrote:
> Hi
> I don't know if it helps, but try to alter your OPENQUERY statement a
> little bit.
> The following works for me and compared to yours I've only specified the
> AD servername and not with DC= as you have.
> select * from openquery
> (
> ADSI,'SELECT name, mail, cn
> FROM ''LDAP://dc-1''
> WHERE objectCategory = ''Person'' AND objectClass = ''user'''
> )
>
> --
> Regards
> Steen Schlüter Persson
> DBA
>

Help Restoring SQL 7

I have a SQL 7 Server that crashed and I don't have a backup of the data. I
do have the data directory that held the database. How can I get my database
running again? I have reinstalled SQL and tried to overwrite the existing
data directory but that didn't work. Can anyone help me?
If you have all of the database files, primary (.mdf), secondary (.ndf), but
especially the log file(s) (.ldf), then after you've reinstalled, you can use
the primary file (.mdf) to sp_attach_db.
This will do recovery on the database; so, you might want to use copies of
the files at first. If there is corruption, you will need to get with MS PSS
to see if there is a way for them to recover it.
Sincerely,
Anthony Thomas
"New2SQL" wrote:

> I have a SQL 7 Server that crashed and I don't have a backup of the data. I
> do have the data directory that held the database. How can I get my database
> running again? I have reinstalled SQL and tried to overwrite the existing
> data directory but that didn't work. Can anyone help me?

Help Restoring SQL 7

I have a SQL 7 Server that crashed and I don't have a backup of the data. I
do have the data directory that held the database. How can I get my databas
e
running again? I have reinstalled SQL and tried to overwrite the existing
data directory but that didn't work. Can anyone help me?If you have all of the database files, primary (.mdf), secondary (.ndf), but
especially the log file(s) (.ldf), then after you've reinstalled, you can us
e
the primary file (.mdf) to sp_attach_db.
This will do recovery on the database; so, you might want to use copies of
the files at first. If there is corruption, you will need to get with MS PS
S
to see if there is a way for them to recover it.
Sincerely,
Anthony Thomas
"New2SQL" wrote:

> I have a SQL 7 Server that crashed and I don't have a backup of the data.
I
> do have the data directory that held the database. How can I get my datab
ase
> running again? I have reinstalled SQL and tried to overwrite the existing
> data directory but that didn't work. Can anyone help me?

Help Restoring SQL 7

I have a SQL 7 Server that crashed and I don't have a backup of the data. I
do have the data directory that held the database. How can I get my database
running again? I have reinstalled SQL and tried to overwrite the existing
data directory but that didn't work. Can anyone help me?If you have all of the database files, primary (.mdf), secondary (.ndf), but
especially the log file(s) (.ldf), then after you've reinstalled, you can use
the primary file (.mdf) to sp_attach_db.
This will do recovery on the database; so, you might want to use copies of
the files at first. If there is corruption, you will need to get with MS PSS
to see if there is a way for them to recover it.
Sincerely,
Anthony Thomas
"New2SQL" wrote:
> I have a SQL 7 Server that crashed and I don't have a backup of the data. I
> do have the data directory that held the database. How can I get my database
> running again? I have reinstalled SQL and tried to overwrite the existing
> data directory but that didn't work. Can anyone help me?