Is there a way to have the Resource Database (mssqlsystemresource.mdf) appear
in the list of Databases in SQL Server Management Studio for easy browsing of
it's contents, or is the only browse option to open the MDF file with a text
editor such as notepad?
Thanks.
Chris Jones
Application Development Consultant
Giving credit where credit is due, I found the following info I am about to
post at the following location:
http://www.aspfaq.com/sql2005/show.asp?id=28
Since the engine has hooks that hide the mssqlsystemresource database from
users, you don't have direct access to it through the GUI.
However, there is a way around this:
1.)Determine where the system databse files live, and keep this path handy:
USE master
GO
SELECT REPLACE(filename, 'master.mdf', '')
FROM sys.sysfiles
WHERE fileid = 1
2.)Stop the SQL Server service;
3.)Copy the files mssqlsystemresource.*df -> resource_copy.*df.
NOTE: do *not* rename or remove the mssqlsystemresource files!
4.)Start the SQL Server service;
5.)Run the following code in a new query window:
EXEC sp_attach_db
'Resource_Copy',
'<path from above>resource_copy.mdf',
'<path from above>resource_copy.ldf'
6.)Now, the system will no longer identify this database as a "special"
database
7.)You can easily scan through the names of system objects that might
otherwise be unknown (and browse any code associated with these objects) from
a GUI (like SQL Server Management Studio).
Thanks.
Chris Jones
Application Development Consultant
"Chris" wrote:
> Is there a way to have the Resource Database (mssqlsystemresource.mdf) appear
> in the list of Databases in SQL Server Management Studio for easy browsing of
> it's contents, or is the only browse option to open the MDF file with a text
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant
|||Yes, if you start your SQL Server is single user mode.
Why do you need to see the contents? It just contains definitions of stored
procedures and views, and you can get to all those using the
OBJECT_DEFINITION function.
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:83427BEB-8A5E-4A21-B8CC-EF65E1BEF9DD@.microsoft.com...
> Is there a way to have the Resource Database (mssqlsystemresource.mdf)
> appear
> in the list of Databases in SQL Server Management Studio for easy browsing
> of
> it's contents, or is the only browse option to open the MDF file with a
> text
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant
Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts
Friday, February 24, 2012
Browse mssqlsystemresource.mdf (SQL Server's Resource Database)
Is there a way to have the Resource Database (mssqlsystemresource.mdf) appea
r
in the list of Databases in SQL Server Management Studio for easy browsing o
f
it's contents, or is the only browse option to open the MDF file with a text
editor such as notepad?
Thanks.
Chris Jones
Application Development ConsultantGiving credit where credit is due, I found the following info I am about to
post at the following location:
http://www.aspfaq.com/sql2005/show.asp?id=28
Since the engine has hooks that hide the mssqlsystemresource database from
users, you don't have direct access to it through the GUI.
However, there is a way around this:
1.)Determine where the system databse files live, and keep this path handy:
USE master
GO
SELECT REPLACE(filename, 'master.mdf', '')
FROM sys.sysfiles
WHERE fileid = 1
2.)Stop the SQL Server service;
3.)Copy the files mssqlsystemresource.*df -> resource_copy.*df.
NOTE: do *not* rename or remove the mssqlsystemresource files!
4.)Start the SQL Server service;
5.)Run the following code in a new query window:
EXEC sp_attach_db
'Resource_Copy',
'<path from above>resource_copy.mdf',
'<path from above>resource_copy.ldf'
6.)Now, the system will no longer identify this database as a "special"
database
7.)You can easily scan through the names of system objects that might
otherwise be unknown (and browse any code associated with these objects) fro
m
a GUI (like SQL Server Management Studio).
--
Thanks.
Chris Jones
Application Development Consultant
"Chris" wrote:
> Is there a way to have the Resource Database (mssqlsystemresource.mdf) app
ear
> in the list of Databases in SQL Server Management Studio for easy browsing
of
> it's contents, or is the only browse option to open the MDF file with a te
xt
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant|||Yes, if you start your SQL Server is single user mode.
Why do you need to see the contents? It just contains definitions of stored
procedures and views, and you can get to all those using the
OBJECT_DEFINITION function.
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:83427BEB-8A5E-4A21-B8CC-EF65E1BEF9DD@.microsoft.com...
> Is there a way to have the Resource Database (mssqlsystemresource.mdf)
> appear
> in the list of Databases in SQL Server Management Studio for easy browsing
> of
> it's contents, or is the only browse option to open the MDF file with a
> text
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant
r
in the list of Databases in SQL Server Management Studio for easy browsing o
f
it's contents, or is the only browse option to open the MDF file with a text
editor such as notepad?
Thanks.
Chris Jones
Application Development ConsultantGiving credit where credit is due, I found the following info I am about to
post at the following location:
http://www.aspfaq.com/sql2005/show.asp?id=28
Since the engine has hooks that hide the mssqlsystemresource database from
users, you don't have direct access to it through the GUI.
However, there is a way around this:
1.)Determine where the system databse files live, and keep this path handy:
USE master
GO
SELECT REPLACE(filename, 'master.mdf', '')
FROM sys.sysfiles
WHERE fileid = 1
2.)Stop the SQL Server service;
3.)Copy the files mssqlsystemresource.*df -> resource_copy.*df.
NOTE: do *not* rename or remove the mssqlsystemresource files!
4.)Start the SQL Server service;
5.)Run the following code in a new query window:
EXEC sp_attach_db
'Resource_Copy',
'<path from above>resource_copy.mdf',
'<path from above>resource_copy.ldf'
6.)Now, the system will no longer identify this database as a "special"
database
7.)You can easily scan through the names of system objects that might
otherwise be unknown (and browse any code associated with these objects) fro
m
a GUI (like SQL Server Management Studio).
--
Thanks.
Chris Jones
Application Development Consultant
"Chris" wrote:
> Is there a way to have the Resource Database (mssqlsystemresource.mdf) app
ear
> in the list of Databases in SQL Server Management Studio for easy browsing
of
> it's contents, or is the only browse option to open the MDF file with a te
xt
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant|||Yes, if you start your SQL Server is single user mode.
Why do you need to see the contents? It just contains definitions of stored
procedures and views, and you can get to all those using the
OBJECT_DEFINITION function.
HTH
Kalen Delaney, SQL Server MVP
http://sqlblog.com
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:83427BEB-8A5E-4A21-B8CC-EF65E1BEF9DD@.microsoft.com...
> Is there a way to have the Resource Database (mssqlsystemresource.mdf)
> appear
> in the list of Databases in SQL Server Management Studio for easy browsing
> of
> it's contents, or is the only browse option to open the MDF file with a
> text
> editor such as notepad?
> --
> Thanks.
> Chris Jones
> Application Development Consultant
Labels:
appearin,
browse,
database,
databases,
management,
mdf,
microsoft,
mssqlsystemresource,
mssqlsystemresourcemdf,
mysql,
oracle,
resource,
server,
sql,
studio
Thursday, February 16, 2012
Bring Log File (LDF) Online
Hi,
I have a server with two separate paritions running SQL 2005. One partition
with the data (mdf) files failed entirely and all data was lost. The second
partition with the log (ldf) files remained entact.
One of the failed databases was restored from tape, but it's not recent
enough. I want to make the database "see" the log file. How can I make a
SQL database recongize a more recent log file?
Once the database/log file are both online, then I can hopefully analyze the
log file using third party tools (ie: Apex or Lumigent) to retrieve data.
Thanks in advance.Hi Dennis
You can't see the log as such, the restored database would have it's own log
file. If your database is in full recovery mode and you have log backups,
they could be rolled forward
http://msdn2.microsoft.com/en-us/library/ms189596.aspx although if you have
not backed up the tail log it will not be up to the point of failure
http://msdn2.microsoft.com/en-us/library/ms179314.aspx
John
"Dennis Grecu" <Dennis Grecu@.discussions.microsoft.com> wrote in message
news:728FC0C4-B069-40F6-A874-96265D0FF4FE@.microsoft.com...
> Hi,
> I have a server with two separate paritions running SQL 2005. One
> partition
> with the data (mdf) files failed entirely and all data was lost. The
> second
> partition with the log (ldf) files remained entact.
> One of the failed databases was restored from tape, but it's not recent
> enough. I want to make the database "see" the log file. How can I make a
> SQL database recongize a more recent log file?
> Once the database/log file are both online, then I can hopefully analyze
> the
> log file using third party tools (ie: Apex or Lumigent) to retrieve data.
> Thanks in advance.
>
I have a server with two separate paritions running SQL 2005. One partition
with the data (mdf) files failed entirely and all data was lost. The second
partition with the log (ldf) files remained entact.
One of the failed databases was restored from tape, but it's not recent
enough. I want to make the database "see" the log file. How can I make a
SQL database recongize a more recent log file?
Once the database/log file are both online, then I can hopefully analyze the
log file using third party tools (ie: Apex or Lumigent) to retrieve data.
Thanks in advance.Hi Dennis
You can't see the log as such, the restored database would have it's own log
file. If your database is in full recovery mode and you have log backups,
they could be rolled forward
http://msdn2.microsoft.com/en-us/library/ms189596.aspx although if you have
not backed up the tail log it will not be up to the point of failure
http://msdn2.microsoft.com/en-us/library/ms179314.aspx
John
"Dennis Grecu" <Dennis Grecu@.discussions.microsoft.com> wrote in message
news:728FC0C4-B069-40F6-A874-96265D0FF4FE@.microsoft.com...
> Hi,
> I have a server with two separate paritions running SQL 2005. One
> partition
> with the data (mdf) files failed entirely and all data was lost. The
> second
> partition with the log (ldf) files remained entact.
> One of the failed databases was restored from tape, but it's not recent
> enough. I want to make the database "see" the log file. How can I make a
> SQL database recongize a more recent log file?
> Once the database/log file are both online, then I can hopefully analyze
> the
> log file using third party tools (ie: Apex or Lumigent) to retrieve data.
> Thanks in advance.
>
Bring Log File (LDF) Online
Hi,
I have a server with two separate paritions running SQL 2005. One partition
with the data (mdf) files failed entirely and all data was lost. The second
partition with the log (ldf) files remained entact.
One of the failed databases was restored from tape, but it's not recent
enough. I want to make the database "see" the log file. How can I make a
SQL database recongize a more recent log file?
Once the database/log file are both online, then I can hopefully analyze the
log file using third party tools (ie: Apex or Lumigent) to retrieve data.
Thanks in advance.Hi Dennis
You can't see the log as such, the restored database would have it's own log
file. If your database is in full recovery mode and you have log backups,
they could be rolled forward
http://msdn2.microsoft.com/en-us/library/ms189596.aspx although if you have
not backed up the tail log it will not be up to the point of failure
http://msdn2.microsoft.com/en-us/library/ms179314.aspx
John
"Dennis Grecu" <Dennis Grecu@.discussions.microsoft.com> wrote in message
news:728FC0C4-B069-40F6-A874-96265D0FF4FE@.microsoft.com...
> Hi,
> I have a server with two separate paritions running SQL 2005. One
> partition
> with the data (mdf) files failed entirely and all data was lost. The
> second
> partition with the log (ldf) files remained entact.
> One of the failed databases was restored from tape, but it's not recent
> enough. I want to make the database "see" the log file. How can I make a
> SQL database recongize a more recent log file?
> Once the database/log file are both online, then I can hopefully analyze
> the
> log file using third party tools (ie: Apex or Lumigent) to retrieve data.
> Thanks in advance.
>
I have a server with two separate paritions running SQL 2005. One partition
with the data (mdf) files failed entirely and all data was lost. The second
partition with the log (ldf) files remained entact.
One of the failed databases was restored from tape, but it's not recent
enough. I want to make the database "see" the log file. How can I make a
SQL database recongize a more recent log file?
Once the database/log file are both online, then I can hopefully analyze the
log file using third party tools (ie: Apex or Lumigent) to retrieve data.
Thanks in advance.Hi Dennis
You can't see the log as such, the restored database would have it's own log
file. If your database is in full recovery mode and you have log backups,
they could be rolled forward
http://msdn2.microsoft.com/en-us/library/ms189596.aspx although if you have
not backed up the tail log it will not be up to the point of failure
http://msdn2.microsoft.com/en-us/library/ms179314.aspx
John
"Dennis Grecu" <Dennis Grecu@.discussions.microsoft.com> wrote in message
news:728FC0C4-B069-40F6-A874-96265D0FF4FE@.microsoft.com...
> Hi,
> I have a server with two separate paritions running SQL 2005. One
> partition
> with the data (mdf) files failed entirely and all data was lost. The
> second
> partition with the log (ldf) files remained entact.
> One of the failed databases was restored from tape, but it's not recent
> enough. I want to make the database "see" the log file. How can I make a
> SQL database recongize a more recent log file?
> Once the database/log file are both online, then I can hopefully analyze
> the
> log file using third party tools (ie: Apex or Lumigent) to retrieve data.
> Thanks in advance.
>
Subscribe to:
Posts (Atom)