Tuesday, March 20, 2012
Active Tables
and stored procedures are not using. I have to find those
and delete or move to a different database. Is there any
way in System tables (Or using profiler) or some other
method to find unwanted tables and SP? I mean. I want to
run a query to find last two months not accessed objects
(Tables and SP)Renny,
As you mentioned, Profiler is your friend here. You might want to check the
Entegra auditing utility (www.lumigent.com) as well.
--
Dejan Sarka, SQL Server MVP
Please reply only to the newsgroups.
"Renny P" <rpannikodu@.aquarion.com> wrote in message
news:0b8a01c3aeaa$2b892f30$a301280a@.phx.gbl...
> I have a live database. In that Database so many tables
> and stored procedures are not using. I have to find those
> and delete or move to a different database. Is there any
> way in System tables (Or using profiler) or some other
> method to find unwanted tables and SP? I mean. I want to
> run a query to find last two months not accessed objects
> (Tables and SP)|||You can also have a look at SQLClean from www.lockwoodtech.com, which can
actually check the source code of your application for unused database
objects if you have it.
You might also find the following script useful:
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=629
to look for columns that are used but have only one distinct value in them
and similar issues.
--
Jacco Schalkwijk
SQL Server MVP
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OphQq6qrDHA.1184@.TK2MSFTNGP10.phx.gbl...
> Renny,
> As you mentioned, Profiler is your friend here. You might want to check
the
> Entegra auditing utility (www.lumigent.com) as well.
> --
> Dejan Sarka, SQL Server MVP
> Please reply only to the newsgroups.
> "Renny P" <rpannikodu@.aquarion.com> wrote in message
> news:0b8a01c3aeaa$2b892f30$a301280a@.phx.gbl...
> > I have a live database. In that Database so many tables
> > and stored procedures are not using. I have to find those
> > and delete or move to a different database. Is there any
> > way in System tables (Or using profiler) or some other
> > method to find unwanted tables and SP? I mean. I want to
> > run a query to find last two months not accessed objects
> > (Tables and SP)
>|||Hi all,
We have a few databases that we need to convert from LATIN1_GENERAL_BIN
to UNICODE. What are the steps involved in doing this?
Thanks!sql
Saturday, February 25, 2012
Accidently delete records
I'm need help!
I have accidently deleted all record from a table. I don't have a backup at the time I deleted. Could you all tell me if there's a way to recover those records?
Thanks.
David
You may be able to use your transaction logs to do a point in time restore,
I'm not sure, but there is hope.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David
|||Lyle,
How do I do that? Could you please share some hint?
"Lyle Spencer" wrote:
> You may be able to use your transaction logs to do a point in time restore,
> I'm not sure, but there is hope.
> "David" <David@.discussions.microsoft.com> wrote in message
> news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> at the time I deleted. Could you all tell me if there's a way to recover
> those records?
>
>
|||YOu will need to take your full backups and apply the
trans logs up to the point in time you deleted the table
and you can then retrieve the records.
Here's an example from BOL
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
[vbcol=seagreen]
>--Original Message--
>Lyle,
>How do I do that? Could you please share some hint?
>
>"Lyle Spencer" wrote:
point in time restore,[vbcol=seagreen]
message[vbcol=seagreen]
69D4AA671891@.microsoft.com...[vbcol=seagreen]
don't have a backup[vbcol=seagreen]
there's a way to recover
>.
>
|||Hmmm... My problem is that I've never done a backup for that database.
"anonymous@.discussions.microsoft.com" wrote:
> YOu will need to take your full backups and apply the
> trans logs up to the point in time you deleted the table
> and you can then retrieve the records.
> Here's an example from BOL
> -- Restore the database backup.
> RESTORE DATABASE MyNwind
> FROM MyNwind_1, MyNwind_2
> WITH NORECOVERY
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log1
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log2
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> point in time restore,
> message
> 69D4AA671891@.microsoft.com...
> don't have a backup
> there's a way to recover
>
|||Hi,
This will work only if you have the database in FULL recovery model, must
have a FULL database Backup ,
all the subsequent trasnaction log backup files after the full backup.
I feel that in your case you cant revert back with out a backup.
Note:-
Based on the criticality of data please choose a recovery model and define
necessory backup procedures
for your SQL Server databases.
Thanks
Hari
MCDBA
"David" <David@.discussions.microsoft.com> wrote in message
news:EEEAE0E7-BA74-40BF-BC32-840649B457DA@.microsoft.com...[vbcol=seagreen]
> Hmmm... My problem is that I've never done a backup for that database.
>
> "anonymous@.discussions.microsoft.com" wrote:
|||> Hmmm... My problem is that I've never done a backup for that database.
Then you must not consider the data very important!
http://www.aspfaq.com/2449
|||I've never use Lumigent, but they claim to go through the internal free list
(as well as syslogs) to recover what might never be recoverable otherwise.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David
|||Hi David,
Saw your reply and try download the Log P.I software and this is realyl good.
The web site is www.logpi.com You can restore the deleted transactions, but make sure you follow the steps they have mentioned.
Regards
RK.
"David" wrote:
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup at the time I deleted. Could you all tell me if there's a way to recover those records?
> Thanks.
> David
Accidently delete records
I'm need help!
I have accidently deleted all record from a table. I don't have a backup at
the time I deleted. Could you all tell me if there's a way to recover those
records?
Thanks.
DavidYou may be able to use your transaction logs to do a point in time restore,
I'm not sure, but there is hope.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David|||Lyle,
How do I do that? Could you please share some hint?
"Lyle Spencer" wrote:
> You may be able to use your transaction logs to do a point in time restore
,
> I'm not sure, but there is hope.
> "David" <David@.discussions.microsoft.com> wrote in message
> news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> at the time I deleted. Could you all tell me if there's a way to recover
> those records?
>
>|||YOu will need to take your full backups and apply the
trans logs up to the point in time you deleted the table
and you can then retrieve the records.
Here's an example from BOL
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
>--Original Message--
>Lyle,
>How do I do that? Could you please share some hint?
>
>"Lyle Spencer" wrote:
>
point in time restore,[vbcol=seagreen]
message[vbcol=seagreen]
69D4AA671891@.microsoft.com...[vbcol=seagreen]
don't have a backup[vbcol=seagreen]
there's a way to recover[vbcol=seagreen]
>.
>|||Hmmm... My problem is that I've never done a backup for that database.
"anonymous@.discussions.microsoft.com" wrote:
> YOu will need to take your full backups and apply the
> trans logs up to the point in time you deleted the table
> and you can then retrieve the records.
> Here's an example from BOL
> -- Restore the database backup.
> RESTORE DATABASE MyNwind
> FROM MyNwind_1, MyNwind_2
> WITH NORECOVERY
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log1
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log2
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
>
> point in time restore,
> message
> 69D4AA671891@.microsoft.com...
> don't have a backup
> there's a way to recover
>|||Hi,
This will work only if you have the database in FULL recovery model, must
have a FULL database Backup ,
all the subsequent trasnaction log backup files after the full backup.
I feel that in your case you cant revert back with out a backup.
Note:-
Based on the criticality of data please choose a recovery model and define
necessory backup procedures
for your SQL Server databases.
Thanks
Hari
MCDBA
"David" <David@.discussions.microsoft.com> wrote in message
news:EEEAE0E7-BA74-40BF-BC32-840649B457DA@.microsoft.com...[vbcol=seagreen]
> Hmmm... My problem is that I've never done a backup for that database.
>
> "anonymous@.discussions.microsoft.com" wrote:
>|||> Hmmm... My problem is that I've never done a backup for that database.
Then you must not consider the data very important!
http://www.aspfaq.com/2449|||I've never use Lumigent, but they claim to go through the internal free list
(as well as syslogs) to recover what might never be recoverable otherwise.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David|||Hi David,
Saw your reply and try download the Log P.I software and this is realyl good
.
The web site is www.logpi.com You can restore the deleted transactions, but
make sure you follow the steps they have mentioned.
Regards
RK.
"David" wrote:
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup a
t the time I deleted. Could you all tell me if there's a way to recover thos
e records?
> Thanks.
> David
Accidently delete records
I'm need help!
I have accidently deleted all record from a table. I don't have a backup at the time I deleted. Could you all tell me if there's a way to recover those records?
Thanks.
DavidYou may be able to use your transaction logs to do a point in time restore,
I'm not sure, but there is hope.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David|||Lyle,
How do I do that? Could you please share some hint?
"Lyle Spencer" wrote:
> You may be able to use your transaction logs to do a point in time restore,
> I'm not sure, but there is hope.
> "David" <David@.discussions.microsoft.com> wrote in message
> news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> > Hello All,
> >
> > I'm need help!
> > I have accidently deleted all record from a table. I don't have a backup
> at the time I deleted. Could you all tell me if there's a way to recover
> those records?
> >
> > Thanks.
> > David
>
>|||YOu will need to take your full backups and apply the
trans logs up to the point in time you deleted the table
and you can then retrieve the records.
Here's an example from BOL
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1, MyNwind_2
WITH NORECOVERY
GO
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
GO
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
>--Original Message--
>Lyle,
>How do I do that? Could you please share some hint?
>
>"Lyle Spencer" wrote:
>> You may be able to use your transaction logs to do a
point in time restore,
>> I'm not sure, but there is hope.
>> "David" <David@.discussions.microsoft.com> wrote in
message
>> news:37E4E743-B412-4BF9-BFE2-
69D4AA671891@.microsoft.com...
>> > Hello All,
>> >
>> > I'm need help!
>> > I have accidently deleted all record from a table. I
don't have a backup
>> at the time I deleted. Could you all tell me if
there's a way to recover
>> those records?
>> >
>> > Thanks.
>> > David
>>
>.
>|||Hmmm... My problem is that I've never done a backup for that database.
"anonymous@.discussions.microsoft.com" wrote:
> YOu will need to take your full backups and apply the
> trans logs up to the point in time you deleted the table
> and you can then retrieve the records.
> Here's an example from BOL
> -- Restore the database backup.
> RESTORE DATABASE MyNwind
> FROM MyNwind_1, MyNwind_2
> WITH NORECOVERY
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log1
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> GO
> RESTORE LOG MyNwind
> FROM MyNwind_log2
> WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> >--Original Message--
> >Lyle,
> >
> >How do I do that? Could you please share some hint?
> >
> >
> >"Lyle Spencer" wrote:
> >
> >> You may be able to use your transaction logs to do a
> point in time restore,
> >> I'm not sure, but there is hope.
> >>
> >> "David" <David@.discussions.microsoft.com> wrote in
> message
> >> news:37E4E743-B412-4BF9-BFE2-
> 69D4AA671891@.microsoft.com...
> >> > Hello All,
> >> >
> >> > I'm need help!
> >> > I have accidently deleted all record from a table. I
> don't have a backup
> >> at the time I deleted. Could you all tell me if
> there's a way to recover
> >> those records?
> >> >
> >> > Thanks.
> >> > David
> >>
> >>
> >>
> >.
> >
>|||Hi,
This will work only if you have the database in FULL recovery model, must
have a FULL database Backup ,
all the subsequent trasnaction log backup files after the full backup.
I feel that in your case you cant revert back with out a backup.
Note:-
Based on the criticality of data please choose a recovery model and define
necessory backup procedures
for your SQL Server databases.
Thanks
Hari
MCDBA
"David" <David@.discussions.microsoft.com> wrote in message
news:EEEAE0E7-BA74-40BF-BC32-840649B457DA@.microsoft.com...
> Hmmm... My problem is that I've never done a backup for that database.
>
> "anonymous@.discussions.microsoft.com" wrote:
> > YOu will need to take your full backups and apply the
> > trans logs up to the point in time you deleted the table
> > and you can then retrieve the records.
> >
> > Here's an example from BOL
> > -- Restore the database backup.
> > RESTORE DATABASE MyNwind
> > FROM MyNwind_1, MyNwind_2
> > WITH NORECOVERY
> > GO
> > RESTORE LOG MyNwind
> > FROM MyNwind_log1
> > WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> > GO
> > RESTORE LOG MyNwind
> > FROM MyNwind_log2
> > WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM'
> >
> > >--Original Message--
> > >Lyle,
> > >
> > >How do I do that? Could you please share some hint?
> > >
> > >
> > >"Lyle Spencer" wrote:
> > >
> > >> You may be able to use your transaction logs to do a
> > point in time restore,
> > >> I'm not sure, but there is hope.
> > >>
> > >> "David" <David@.discussions.microsoft.com> wrote in
> > message
> > >> news:37E4E743-B412-4BF9-BFE2-
> > 69D4AA671891@.microsoft.com...
> > >> > Hello All,
> > >> >
> > >> > I'm need help!
> > >> > I have accidently deleted all record from a table. I
> > don't have a backup
> > >> at the time I deleted. Could you all tell me if
> > there's a way to recover
> > >> those records?
> > >> >
> > >> > Thanks.
> > >> > David
> > >>
> > >>
> > >>
> > >.
> > >
> >|||> Hmmm... My problem is that I've never done a backup for that database.
Then you must not consider the data very important!
http://www.aspfaq.com/2449|||I've never use Lumigent, but they claim to go through the internal free list
(as well as syslogs) to recover what might never be recoverable otherwise.
"David" <David@.discussions.microsoft.com> wrote in message
news:37E4E743-B412-4BF9-BFE2-69D4AA671891@.microsoft.com...
> Hello All,
> I'm need help!
> I have accidently deleted all record from a table. I don't have a backup
at the time I deleted. Could you all tell me if there's a way to recover
those records?
> Thanks.
> David
accidentally populate tables into System databases/master database
I accidentally populate tables into System databases/master database. What should I do? Should I delete all the tables I populate in mster database?
Thank you very much!
I would transfer the tables and data to the database where they 'should' be located, and then DELETE the ones in the master database.
|||
To move a table to another disk you have to
-create a secondary file group on an another location (or separate) of physical disk.
-drop the clustered index of the table and re-create it on that file group (Alter Table ... | MOVE TO { partition_scheme_name ( column_name ) | filegroup
| "default"}
- see Books Online).
This procedure can be use on large tables; if the size of your tables is not so big you can copy these tables with import/export wizard to a test db and copy backb in database with that filegroup made default.
|||Thank you All,
I just deleted all the talbes were accidentally created in System/Master Database in sql server 2005. Sql server seems working fine.
Friday, February 24, 2012
Accessing the transaction log
Can someone let me know how I can have a look at the transaction log in SQL server. I'd like to find out what INSERT, UPDATE, DELETE commands have been executed on a table today, yesterday etc.
Can I see this easily?check this out...
http://www.lumigent.com/products/le_sql.html|||use DBCC LOG (dbname) it is undocumented and output is not easily readable but it might work for you|||check this out...
http://www.lumigent.com/products/le_sql.html
Thanks for this, I have installed it, however the trial version doesn't let me look at my own DBs. Any idea how much it costs, as there is no priceing on their website (I'm yet to contact them)|||use DBCC LOG (dbname) it is undocumented and output is not easily readable but it might work for you
Thanks for this, I bever actually used SQL server from the command line, I used ORACLE but ages ago, can you refresh my memory on how to get to the command line so I can type in the command you gave me, thanks a lot|||Thanks for this, I bever actually used SQL server from the command line, I used ORACLE but ages ago, can you refresh my memory on how to get to the command line so I can type in the command you gave me, thanks a lot
use the query analyzer to execute this.|||use the query analyzer to execute this.
Thanks, tried with all the options 1/2/3/4, can't really make much sense of it.
What I was looking for is when an insert / update / delete happened and what the data the cell contained before.
Or does this not exist in a transaction log?|||use the query analyzer to execute this.
Ok, it does make sense, now that I tried create and update commands and run the transaction log command. I guess it's as far as this will take me. Might have have another look at that Lumi.. software, it's just that the trial version doesn't seem to give me much options to see transactions on tables I created in my db previously.
Anyway, thanks for advice and if someone else knows a good free kit, I'd love to hear about it, thanks again!|||you can also try
select * from ::fn_dblog(null, null)
There's a bit of info on this function at:
http://www.novicksoftware.com/UDFofWeek/Vol1/T-SQL-UDF-Volume-1-Number-27-fn_dblog.htm
Regards,
hmscott
Sunday, February 19, 2012
accessing the database remotely from non-microsoft platform
Is it possible to access a microsoft sqlserver database (for select, insert,
update, delete, and for miscellaneous administrative actions such as table
and index creation and deletion) remotely from a compiled C program (and/or,
from Perl) running on a NON microsoft platform, such as Sun's Solaris and/or
Linux?
What toolset(s) could be used (on the UNIX/Linux end) for such a purpose?
Would it require a corresponding special toolset to be installed on the
Windows server end as well? (I'd prefer not to have to do that if
possible.)
If you are not now rolling on the floor laughing at the "heresy" of such a
notion, thanks in advance.
Dan
drlevy@.glowing.com (replace 'glowing' with 'lucent')Some suggestions here:
http://www.sommarskog.se/mssqlperl/unix.html
Simon