Sunday, March 11, 2012
datamap
Regards,
MarcWhat's a 'datamap'?
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"fedum" <anonymous@.discussions.microsoft.com> wrote in message
news:82B772DB-A543-4A29-8872-9FB759118ADF@.microsoft.com...
> I had some problems with my SQL-program and had to re-install the program.
Is it possible to copy the datamap back into th sql directory and use this
data or is this only possible with a restore?
> Regards,
> Marc|||Perhaps fedum is referring to the mdf, ldf and ndf files? If so, fedum, check out sp_attach_db.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Brian Moran" <brian@.solidqualitylearning.com> wrote in message
news:%23vxpAP2sDHA.2408@.tk2msftngp13.phx.gbl...
> What's a 'datamap'?
>
> --
> Brian Moran
> Principal Mentor
> Solid Quality Learning
> SQL Server MVP
> http://www.solidqualitylearning.com
>
> "fedum" <anonymous@.discussions.microsoft.com> wrote in message
> news:82B772DB-A543-4A29-8872-9FB759118ADF@.microsoft.com...
> > I had some problems with my SQL-program and had to re-install the program.
> Is it possible to copy the datamap back into th sql directory and use this
> data or is this only possible with a restore?
> > Regards,
> > Marc
>|||well I mean the directory under the MSSQL7 directory where sql stores his data. Because I have now resent backup from my data and therefore I would like to try if I could copy this data back under this directory
Regards
Marc|||See my post from yesterday.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"fedum" <anonymous@.discussions.microsoft.com> wrote in message
news:EDC83C7C-E88B-4313-9F4F-0C6B1306E6CD@.microsoft.com...
> well I mean the directory under the MSSQL7 directory where sql stores his data. Because I have now
resent backup from my data and therefore I would like to try if I could copy this data back under
this directory.
> Regards,
> Marc|||Thanks
But when I read the comment about sp_attach_db then it is allways combined with sp_detach_db. The problem is that the database is not detached before becouse of the problems withh SQL. Can I allso use the attach without detach' Can you please inform
Marc|||Sometimes sp_attach_db will work even if you didn't detach it first, sometimes it doesn't. Give it a
try!
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"fedum" <anonymous@.discussions.microsoft.com> wrote in message
news:90CF0F46-34BA-4881-9A6E-23E1E3233730@.microsoft.com...
> Thanks,
> But when I read the comment about sp_attach_db then it is allways combined with sp_detach_db. The
problem is that the database is not detached before becouse of the problems withh SQL. Can I allso
use the attach without detach' Can you please inform?
> Marc
Sunday, February 26, 2012
Databases updating simultaneously
I have managed to create a second copy of my "live" database, for
software testing purposes.
Inspecting the properties of the new database, everything seems in
order. The logical file name is the same, which I believe is fine, and
the physical database (and log file name) is different.
However, despite the fact that there is no application currently
accessing the "testing" copy, both databases are seemingly being
updated simultanously. I can tell this from the physical file sizes on
the server, which are identical, and growing at the same rate.
Does anyone have any suggestions why this might be happening - and how
I can stop it?
Thanks in anticipation!
PhilRS200Phil (philsowden@.dataservicesltd.co.uk) writes:
Quote:
Originally Posted by
I have managed to create a second copy of my "live" database, for
software testing purposes.
>
Inspecting the properties of the new database, everything seems in
order. The logical file name is the same, which I believe is fine, and
the physical database (and log file name) is different.
>
However, despite the fact that there is no application currently
accessing the "testing" copy, both databases are seemingly being
updated simultanously. I can tell this from the physical file sizes on
the server, which are identical, and growing at the same rate.
>
Does anyone have any suggestions why this might be happening - and how
I can stop it?
It sounds funny to me that you can see the files grow. Autogrow events
on live databases should be rare events and not happen frequently. You
create them with a reasonable initial size, and then you preferrably
increase then while you have a maintenance window. Autogrow during
production should be avoided, as it could cause the database to be
inaccessible while autogrow is in progress.
To tell why your databases grow in parallel would require more knowledge
about your server. Here we are left to wild guesses. Maybe you set up
replication between the databases?
sp_who can tell you if there are any processes in the database at all.
You can use SQL Server Profiler to see if there is any action in the
server.
Which version of SQL Server are you using?
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Friday, February 24, 2012
databases disappeared but MDF, LDF still there...
copied databases into a new server using Database Copy Wizard. The previous
databases were copied with no problems. The last one however, still copied
ok but the databases on the "source" server disappeared! I tried
"re-copying" same databases back into the source server but I am getting a
'name conflict' error. From my research, this meant the mdf and ldf files
are still there. Note that I "copied" and NOT "moved" these databases. Can
you please tell me how I can restore these databases? I also tried
re-creating the missing database so I can export data back into it but I got
"Error 5170: Cannot create file 'e:\data\MSSQL\...\.MDF' because it already
exists. etc" Thank you for helping.
_________________
Freedom is nothing else but a chance to be better. (Albert Camus)
One of the reason could be, the source and the destination database file
names could be same.
When you are using copy database wizard, try to modify destination file name
to something else and then try to copy.
Hopefully, it should work.
Thanks
GYK
databases disappeared but MDF, LDF still there...
copied databases into a new server using Database Copy Wizard. The previous
databases were copied with no problems. The last one however, still copied
ok but the databases on the "source" server disappeared! I tried
"re-copying" same databases back into the source server but I am getting a
'name conflict' error. From my research, this meant the mdf and ldf files
are still there. Note that I "copied" and NOT "moved" these databases. Can
you please tell me how I can restore these databases? I also tried
re-creating the missing database so I can export data back into it but I got
"Error 5170: Cannot create file 'e:\data\MSSQL\...\.MDF' because it already
exists. etc" Thank you for helping.
--
_________________
Freedom is nothing else but a chance to be better. (Albert Camus)One of the reason could be, the source and the destination database file
names could be same.
When you are using copy database wizard, try to modify destination file name
to something else and then try to copy.
Hopefully, it should work.
Thanks
GYK
Friday, February 17, 2012
database versioning
can help!
I have a database mydb, about 5gb.
I want to keep a copy of it on the server, but as mydb_old.
(yes I have space for it!)
What's a good way to get it there, database copy wizard, copying files,
backup/restore?
Thanks.
(I want to keep the original mydb also, with the same filegroup filenames.
I'll do further work on mydb, but may want to reference the old mydb_old)
Josh
Tibor,
Thanks.
Josh
"Tibor Karaszi" wrote:
> I prefer backup/restore. When you restore, obviously you specify the "mydb_old" name for the
> database and also use the MOVE clause to specify new physical filenames for each file. Something
> like:
> RESTORE DATABASE mydb_old
> FROM ...
> WITH
> MOVE 'mydb_data' to 'C:\mydb_data.mdf'
> ,MOVE 'mydb_log' to 'C:\mydb_log.ldf'
> ...
> You can later change the *logical* names for each database file (ALTER DATABASE), but it isn't
> really neccesary (logical filenames doesn't have to be unique within the instance, only within the
> database).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "JRStern" <JRStern@.discussions.microsoft.com> wrote in message
> news:19322621-FA70-4987-8475-05FC5EEA4355@.microsoft.com...
>
database versioning
can help!
I have a database mydb, about 5gb.
I want to keep a copy of it on the server, but as mydb_old.
(yes I have space for it!)
What's a good way to get it there, database copy wizard, copying files,
backup/restore?
Thanks.
(I want to keep the original mydb also, with the same filegroup filenames.
I'll do further work on mydb, but may want to reference the old mydb_old)
JoshI prefer backup/restore. When you restore, obviously you specify the "mydb_old" name for the
database and also use the MOVE clause to specify new physical filenames for each file. Something
like:
RESTORE DATABASE mydb_old
FROM ...
WITH
MOVE 'mydb_data' to 'C:\mydb_data.mdf'
,MOVE 'mydb_log' to 'C:\mydb_log.ldf'
...
You can later change the *logical* names for each database file (ALTER DATABASE), but it isn't
really neccesary (logical filenames doesn't have to be unique within the instance, only within the
database).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"JRStern" <JRStern@.discussions.microsoft.com> wrote in message
news:19322621-FA70-4987-8475-05FC5EEA4355@.microsoft.com...
> Hey any admin should know this stuff cold but I'm a little fuzzy, hope you
> can help!
> I have a database mydb, about 5gb.
> I want to keep a copy of it on the server, but as mydb_old.
> (yes I have space for it!)
> What's a good way to get it there, database copy wizard, copying files,
> backup/restore?
> Thanks.
> (I want to keep the original mydb also, with the same filegroup filenames.
> I'll do further work on mydb, but may want to reference the old mydb_old)
> Josh
>
>|||Tibor,
Thanks.
Josh
"Tibor Karaszi" wrote:
> I prefer backup/restore. When you restore, obviously you specify the "mydb_old" name for the
> database and also use the MOVE clause to specify new physical filenames for each file. Something
> like:
> RESTORE DATABASE mydb_old
> FROM ...
> WITH
> MOVE 'mydb_data' to 'C:\mydb_data.mdf'
> ,MOVE 'mydb_log' to 'C:\mydb_log.ldf'
> ...
> You can later change the *logical* names for each database file (ALTER DATABASE), but it isn't
> really neccesary (logical filenames doesn't have to be unique within the instance, only within the
> database).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "JRStern" <JRStern@.discussions.microsoft.com> wrote in message
> news:19322621-FA70-4987-8475-05FC5EEA4355@.microsoft.com...
> > Hey any admin should know this stuff cold but I'm a little fuzzy, hope you
> > can help!
> >
> > I have a database mydb, about 5gb.
> >
> > I want to keep a copy of it on the server, but as mydb_old.
> >
> > (yes I have space for it!)
> >
> > What's a good way to get it there, database copy wizard, copying files,
> > backup/restore?
> >
> > Thanks.
> >
> > (I want to keep the original mydb also, with the same filegroup filenames.
> > I'll do further work on mydb, but may want to reference the old mydb_old)
> >
> > Josh
> >
> >
> >
>
Database Users
I have 2 databases on my sql server, each database has different set of
users.
I want to copy the data between database "a" to database "b".
When i backup "a" and restore into "b" the database users also copy from "a"
and come to "b"
I want to replace these users, but i cannot delete them. because the
database user owns objects in database.
is there a way to rename the database users, or replace them?
Thanks in advance.This is a good page to help your problem
http://support.microsoft.com/default.aspx?scid=kb;en-us;246133
HTH
--
Ray Higdon MCSE, MCDBA, CCNA
--
"MAQ" <pakmaq@.hotmail.com> wrote in message
news:uwyiJVscDHA.1204@.TK2MSFTNGP12.phx.gbl...
> Hi Guys.
> I have 2 databases on my sql server, each database has different set of
> users.
> I want to copy the data between database "a" to database "b".
> When i backup "a" and restore into "b" the database users also copy from
"a"
> and come to "b"
> I want to replace these users, but i cannot delete them. because the
> database user owns objects in database.
> is there a way to rename the database users, or replace them?
> Thanks in advance.
>
Tuesday, February 14, 2012
Database Trigger on Update Table
I want to create a trigger on a table (A) which can copy the records
into new table(B) whenever it updates or any new record inserted into
the table (A).
Kindly create this trigger for me.
TIACREATE TRIGGER A_IU
ON A
FOR INSERT, UPDATE
AS
INSERT B
SELECT *
FROM Inserted
GO
On 28 Jun 2006 04:54:08 -0700, "Atif Iqbal" <aatif.iqbal@.gmail.com>
wrote:
>Dear All,
>I want to create a trigger on a table (A) which can copy the records
>into new table(B) whenever it updates or any new record inserted into
>the table (A).
>Kindly create this trigger for me.
>TIA|||Hi
Marco
create trigger tr_MyTable on MyTable after update
as
if @.@.ROWCOUNT = 0 return
insert MyAuditTable
select i.ID, d.MyColumn, i.MyColumn from inserted i join deleted d on
d.ID = o.Id
"Atif Iqbal" <aatif.iqbal@.gmail.com> wrote in message
news:1151495648.866045.307900@.75g2000cwc.googlegroups.com...
> Dear All,
> I want to create a trigger on a table (A) which can copy the records
> into new table(B) whenever it updates or any new record inserted into
> the table (A).
> Kindly create this trigger for me.
> TIA
>