Need Script That Can Shrink Copy Of DB To Fit On A Notebook

Feb 11, 2004

I need a script that will take a 40GB 300+ table database and shrink it to the 1st 1000 rows in each table and delete security tables like tblchargecard. Want to get size to about 1gb to fit on a notebook for development. Any suggestions would be appreciated.

View 3 Replies


ADVERTISEMENT

Like Google Notebook

Jul 25, 2007

Hi All,

Has anyone tried writing a db structure that would replicate a google notebook heirarchy?

I'm very interested in learning to do this. My knowledge of MSSQL is poor. I had someone else develop a db in MSSQL for me. I'd like to add a similar functionality for my website to that of google notebooks. I don't need the browser plugins and stuff, only the ability to create new notes and sub notes which can have a few fields. For instance.

A - History
----a1.Name: World War 1
----a2.Name: Germany 1918-1945
----a3.Name: World War 2
------a3i.Name: Causes of World War II
------a3ii.Notes: bla bla bl a
------a3iii.Description: These notes are about the causes of WWII
------a3.SubTopic.a1.Name: Hitler's actions prior to WWII
------a3.SubTopic.a1.Notes: notes notes notes
------a3.SubTopic.a1.Description: desc desc desc

I need to develop a max of two level heirarchy for my website to provide my students a google notebook like functionality. I want to develop it for my school's website. Can someone help?

Navs

View 4 Replies View Related

Transfer Of Subset Of Data To/from Notebook

Mar 25, 2004

I have a need to dump a subset of a database from the server (SQL Server) to a notebook via the network, for data entry to be done on the notebook when it is in the field & not connected to the network & then the changes made to this data on the notebook to be applied to the database on the server.

The application for the front end to this is in Access. Would MSDE be the way to go for the database on the notebook ?

It's a small application with not many users, likelihood of conflicting edits is small.

Would the data transfer best be done with replication or with DTS ?
Presumably replication would allow options for control over conflicts, such as the same bit of data being changed on the server & on the notebook’s copy of the data ?

I need guidance re direction to head in with this.

Thanks

View 2 Replies View Related

How To Link To ACT7 With SQLexpress,both On Same Notebook.

Apr 9, 2007

How to link to ACT7 with SQLExpress,both on same Notebook.





I tried to make ODBC via settings Adm.Tools for Sql Server, and I made System DNS,



From Msaccess 2003 I try to male "get external data" and via ODBC databases,.... but it did not work. I don't see

and popping up if listing/prgs/database or whatever, it remains dead.

I can however via Start,Programs work with Sql express studio and with a demo database it is working,but I need the ACT7 tables to work with.

What my main task is, is to connect via Msaccess/ODBC to my ACT7 ( Sql) in order to do some update/import etc etc.

because standard Import features very poor for Additional Contacts etc.



Thanks for any help.

William

View 2 Replies View Related

How To Shrink A Tranlog Which Won't Shrink

Jan 5, 2007

If you have problems shrinking a transaction log no matter what commands you issue, here's a way to shrink the tranlog:

1. Right click on the properties of the database and go to the options tab.
2. Change the recovery mode to simple.
3. Right click again on the database - go to all tasks - shrink database.
4. Shrink the database.
5. Change the recovery mode back to what you had it as.

I found this out by trial and error as I could not find any documentation on it and no matter what I tried, I could not get the transaction log to shrink.

View 4 Replies View Related

The Remote Copy Of Database X Has Not Been Rolled Forward To A Point In Time That Is Encompassed In The Local Copy

May 11, 2006

Hi,

I set up DB mirror between a primary (SQL1) and a mirror (SQL2); no witness. I have a problem when I issue command:


alter database DBmirrorTest
Set Partner = N'TCP://SQL2.mycom.com:5022';
go


The error message is:

The remote copy of database "DBmirrorTest" has not been rolled forward to a point in time that is encompassed in the local copy of the database log.

I have the steps below prior to the command. (Note that both servers' service accounts use the same domain account. The domain account I login to do db mirror setup is a member of the local admin group.)

1. backup database DBmirrorTest on SQL1

2. backup database log

3. copy db and log backup files to SQL2

4. restore db with norecovery

5. restore log with norecovery

6. create endpoints on both SQL1 and SQL2

CREATE ENDPOINT [Mirroring]

STATE=STARTED

AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)

FOR DATA_MIRRORING (ROLE = PARTNER)

7. enable mirror on mirror server SQL2

:connect SQL2

alter database DBmirrorTest

Set Partner = N'TCP://SQL1.mycom.com:5022';

go

8. Enable mirror on primary server SQL1

:connect SQL1

alter database DBmirrorTest

Set Partner = N'TCP://SQL2.mycom.com:5022';

go

This is where I got the error.

The remote copy of database "DBmirrorTest" has not been rolled forward to a point in time that is encompassed in the local copy



Thanks for any help,

KT

View 8 Replies View Related

Detach-copy-attach: Can Not Copy Files - Getting Access Denied

Feb 28, 2008



Hi!
I did:
alter database mydb set single_user with rollback immediate;
exec sp_detach_db @dbname='mydb', @keepfulltextindexfile='true';

then I tried to copy files to new location on other drives, same server but got
>>Cannot copy <myfile>: Access is denied
Make sure the disk is not full or write-protected and that the file is not currently in use<<

I also tried rename of file without success.
I also tried with db service stoppet (not preferred) without success.

How to find out, which process locks the files?
Best regards

View 7 Replies View Related

Copy? Export? How To Copy Stored Procedures

Aug 30, 2005

How do I transfer/copy the stored procedures in my Test DB to my LIVE DB?  IT won't allow me to export keeps giving me an error. 

View 4 Replies View Related

Copy A Database With Copy The .mdf File And Attaching It With A New Name?

Nov 4, 2006

Hello,

if i have a given database (a model) and i want to copy this database in the same database instance. Is it ok to copy the mdf and ldf file and attach the files with a new database name in the same instance.

Or is the datebase name part of the .mdf file?

Regards
Markus





View 6 Replies View Related

Use Copy Wizard To Copy Databases

Jan 23, 2012

I am attempting to use the copy wizard to copy databases from SQL Server 2005 to SQL Server 2008 R2 w/ FP1.

The copy fails with a login failure to SQL Server 2005. I have a user id & password under Windows for both servers. I have a user id and password under SQL security with the called for admin security rights.

The 2005 server has two instances, 20 databases, two dozen maintenance plans, and over a hundred users. I really would like to use the utility so I don't have to recreate everything manually.

View 1 Replies View Related

Shrink DB

Jun 6, 2002

I have a SQL 7.0 sp3 server and I am trying to shrink a production database for use on other servers. The database/log sizes are 9601mb / 138mb with 772mb / 128mb free. I truncate a table that contains binary data. After this the database/log sizes are 9601mb / 138mb with 6634mb / 111mb free. The next step is to use EM to issue a shrink db. After this the database/log sizes are 6807mb / 378mb with 9.56mb / 365mb free.

After the use of truncate the the data in the datafile is about 2967mb.
After the shrink db the data in the datafile is about 6797mb.

The size of the data grew after the shrink db was issued. I looked at the tables and the space is largely associated with two tables that have a binary field, but the number or rows are still the same. I ran a checkdb just to make sure that there was not a problem and no problems were reported. I have used this process many times and this is the first time I have come up with these results. Any suggestions?
Thanks,
Glen

View 2 Replies View Related

Shrink Db

Aug 17, 2001

if I shrink the db will it enable me to create another db with that space released by the first db?

View 1 Replies View Related

How Can I Shrink My Log?

Jul 19, 2000

How can i shrink my log file? It is like 900 megs and i
was it to be more like 400 megs.

Please Help

Melissa Sener
Project Manager
Square Yard

View 5 Replies View Related

Log Not Shrink

Sep 27, 2002

Hi, My name is Alexander and came´s to ask about Sql Server log.
Do you know why sometimes the log not truncate? All time
comes increasing!

I setup "Automatic Shrink" and it swims happens. If you can help me!
Thanks in advanced

View 3 Replies View Related

Shrink Db

Jun 30, 1999

Hi everybody:

Actually I have a 8.5 Gb database but the correct size that I need
to due disk space is 5 Gb. When I make a backup, the size of the dump is
4Gb, so I wonder if I create a 4- 4.5Gb my dump db will fit in it, but
not. Other way is create antoher db with 4 - 4.5 Gb and transfer via
sql-transfer or sql-bcp but I got a message that my device is too
short.

So I ask : What are the correct ways to reduce the size of a
database ?


Thanks in advance.

View 1 Replies View Related

Why Is SQL DB So Big? Can I Shrink?

Jun 16, 2004

Hello,

We just migrated our DB from one SQL Server to Another. Both DB's used to be the same size at 11GB. The new SQL Server is a whopping 33GB, and I can't seem to find out why. The new DM has fewer tables (the data is identical).

Does anyone know how I can compact or shrink my DB, know why or how it grew so much and didn't go back down to normal size, and maybe where I can search properties or change settings to find out what is going on and prevent it from happening again.

I know MS Access has a shrink utility, but don't know where it is in SQL Server.

Thanks, in advance for your help.

Rodney

View 12 Replies View Related

Shrink Db

Jul 26, 2004

Hello,
I have a 24go sqlserver 2000 database, but only 5go used, when i use the shrink command in em there is no change.

can i modify the property of the db (auto-shrink => on ) actually it's on OFF.

View 6 Replies View Related

To Shrink Or Not To Shrink ??

Nov 27, 2006

Newbie question about reclaiming some disk space on our SQL server.

We currently have a db that has the following stats:

space allocated: 34734 MB
space free: 843.66

of this the current size of .mdf is 33877 MB and the space used is 33873 MB

the drive that holds this database is running out of space, what is the best method for me to use to reclaim some disk space?

I have read books online and am a little bit confused as to whether or not using shrinkfile on the .mdf will free up space to the OS? Do I need to do anything else before or after such as reindex? Also what is the overhead as we only have about 10% free on the drive.

View 4 Replies View Related

Shrink An LDF

May 22, 2006

I am trying to shrink a log file (.LDF), but it will not work. I am typing:
BACKUP LOG "Database1" WITH TRUNCATE_ONLY
dbcc shrinkfile ("Database1_log", 50)
The microsoft site says this should work:
http://support.microsoft.com/kb/272318/
...but I can't get the file to shrink, at all? I'm sure the SQL services need to be running. I am logged in as my Administrator / sa. What could I be missing? Trying to shrink it too much? (THANKS).

View 3 Replies View Related

Questions About Bulk Copy Insert Using 'Memory Based Bulk Copy Operations'

Feb 1, 2007

Hi~,

Before implementing memory based bulk copy insert with IRowsetFastLoad interface of SQL Server 2005 OLE DB provider, I want to know some considerations.

- performance : compared with T-SQL's "BULK INSERT ..." and bcp utility

- SQL Server's resource usage : when running memory based bulk copy, server resource's influence

- server side action(behavior) : when server is busy, delayed-update means IRowsetFastLoad::Commit(true) method can insert right after?

- row-count : The rowcount limitation can be inserted by IRowsetFastLoad::InsertRow() method before IRowsetFastLoad::Commit

- any other guide lines

View 1 Replies View Related

Why Is Database Still Big After Shrink?

Jul 26, 2000

A few of the databases I have are take up a lot of space, but when I look at the actual space that's being used, it's very small. I've tried shrinking them but they still remain at this bloated size. Is there any other way to reduce their size?

View 3 Replies View Related

Auto Shrink Db

Oct 24, 2001

what's this : "auto shrink " db option in properties ???

in which case may i use this option ?
please help

View 3 Replies View Related

10GB Log Won&#39;t Shrink

Sep 18, 2000

Txn log is nearly 10GB with only 60MB actually used. Disk has 150MB remaining. SQL 7.0 SP2.
I've truncated the log several times. I'm aware that the active portion of the log can be at the end and have added many records to cycle the active portion round to the start of the log file. How big are these log segments?

I've run dbcc shrinkfile with and without a target size.

I've checked DBCC OPENTRAN. No open txns exist.

What else can I try? I've looked through similar postings and haven't spotted anything.

Yours hopefully,

Simon

View 2 Replies View Related

Shrink File

Mar 27, 2000

I am looking for the correct procedure for shrinking a database file ,
please reply back if anybody knows the solution
Thanks
Ajay

View 1 Replies View Related

Shrink Transaction Log

Jan 18, 2001

Is it possible to shrink Transaction Log file? If yes, how? Urgent matter please.

Regards,

View 1 Replies View Related

How To Shrink A Log File?

Oct 20, 1999

On a database with a log file that has an unrestricted file growth, the file size exceeds 1 GB. Since this excessive was caused by a badly written update statement, I want to reduce the size to about 200MB.
After reading the BOL I was convinced that I only need to take two actions: truncate the log file (to create some free space in the log file)and shrink it.
These are the statements I executed:

backup log ODS with truncate_only
dbcc shrinkfile (ODS_Log, truncateonly)

After I executed these statements - BTW, there were no errors - the file size was still the same. Can somebody tell me why?

Thanks,
Stef

View 1 Replies View Related

Shrink Error Log

Feb 17, 2000

Is there a way to shrink the error log in SQL 6.5 without stoping the server?

View 1 Replies View Related

My SQL 7 Log File Won&#39;t Shrink

Aug 27, 1999

Hi,

I have created a new database in SQL Server 7 with the auto grow options set to on. I then added a whole load of new data to the table which made the transaction log file grow to 20Mb.

I then truncated the transaction log to remove all the completed transactions. The Enterprise Manager now shows the Log to only have 3MB of data in it but the file is still 20MB.

I have tried setting the truncate log on checkpoint option, and tried running DBCC SHRINK DATABASE and DBCC SHRINK FILE commands but these seem to have no affect on the file size.

Does anyone have any idea what I might have missed/done wrong?

Yours well and truly stuck,

Martin

View 2 Replies View Related

Shrink Logfile ?

Jun 9, 2000

How do I shrink my transaction log file ? The physical file are 10Gb in size but only contains 100Mb data so I want to shrink it to save diskspace. I tried DBCC SHRINKFILE command but the file dont shrink.

Any other methods to shrink a transaction log file ? Like backup/restore ?

Help !




Thanks

View 2 Replies View Related

Shrink SQL 6.5 Transaction Log

Mar 7, 2001

Is it possible to shrink the size of a transaction log file in SQL 6.5. Normally in SQL 7.0 I use detach and reattach but this is not supported in 6.5. The log file for a 200Mb database is 749Mb with no unused space and no open transaction. Thanks

View 2 Replies View Related

Cannot Shrink Transaction Log

Sep 25, 2002

Hi,

I have a t-log on one database which is 400mb when the database size is only 30mb. dbcc shrinkfile does not work and dbcc opentran shows no open transactions. When I tried to do a Backup log with truncate_only the following message displays:

The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.

The database in question is not a publisher and only receives 5 subscribed articles, none of which are changed very often. The database operates 24 x 7.

Does anyone have a solution to this dilemma?

Thank You

View 4 Replies View Related

SHRINK Database

Nov 9, 1999

I am in the process of copying database from large size to smaller size one. The actual data in the database is very less.
When I try to shrink the database, I am getting message I can't shrink the database.

Can any one suggest on 'How to copy this database?'

Thank you,

View 4 Replies View Related

Can't Shrink The Database Log...

Jan 21, 2004

Hi
I have a SQL2k db ABC with only 2mb data but around 500 log. I did the followings
----------------------------------
backup log ABC with truncate_only
dbcc shrinkdatabase(ABC, 10)
Cannot shrink log file 2 (ABC_Log) because all logical log files are in use.
DbId FileId CurrentSize MinimumSize UsedPages EstimatedPages
------ ------ ----------- ----------- ----------- --------------
7 2 58768 128 58768 128

use ABC
sp_spaceused
database_name database_size unallocated space
------------ ------------------ ------------------
ABC 506.75 MB -0.51 MB
reserved data index_size unused
------------------ ------------------ ------------------ ------------------
2248 KB 1288 KB 544 KB 416 KB

sp_helpdb ABC
name size maxsize growth usage
-------------- ------------------ ------------------ ------ ---------
ABC_Data 1728 KB Unlimited 10% data only
ABC_Log 517184 KB Unlimited 10% log only

question:
1. what is the negative -0.51 MB for unallocated space?
2. I can't kill all the process logins, is there other way to shrink the database log side?

thanks
-D

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved