Help me shrink this database in SQL Server 2005

I archived a ton of records from a database, and it is expected to grow very slowly going forward.  So please don't ask if I really need to shrink it or not.  Yes...I definitely need to shrink it.  I'm thinking it only needs to be 5GB now. But
I don't know how to shrink it without it running for a very long time.
408,092 MB Size
405,195 MB Space Available
I only have about 70 GB spare space on the drive that holds the log files, so I can't have it growing huge while the shrink is running.
Anyone know any tricks to get this done more efficiently?

Are there LOB columns (text/ntext/image, (n)varchar/varbinary(MAX), xml) in the database? In that case the shrink could take a really long time, I believe. In that case it may be faster in terms of clock-time to build a new database and move all data move
over. But it will certainly take more of your time.
Shrinking is an online operation, that is it works with small transactions, so you can 1) interrupt it 2) back up the tranaction log while it's running to keep the disk space in check.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • How to attach database in sql server 2005 restricted mode

    hi i have a database i want once i have attach database in sql server 2005, anyone cannot do detach, script and delete my database except myself. I mean i want to secure my database to avoid unauthorized persons access
    how it is possible in sql server 2005 express management studio

    There are restrictions for normal Logins but a administrator in SQL server can always detach,script and delete your database.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How can i make iphone mobile website,  database in Sql Server 2005 ?

    how can i make iphone mobile website,  database in Sql Server 2005 ?
    Thanks & Regards
    Jamshed Ali
    Email id: [email protected]

    You need to be a little clearer in what you're asking.
    You can't make any web site in SQL Server - it's a database engine, not a website tool.
    What you can do is create web sites that pull data from a back-end SQL Server, but the SQL server doesn't handle the client connection at all (that's handled by a web server such as Apache, IIS, or similar).
    There are many ways to build such a site including .NET, PHP, Perl and more (although I don't know all the options for Windows servers because they're not as common outside of corporate/enterprise networks).
    In either case, given your choice of development language (HTML, plus one of the PHP/Perl/.NET/etc. options), plus your database (SQL Server) plus your web server (IIS, Apache, etc.) you can make any web site you like (or, at least, you're capable of developing).
    If you want to opimize that web site for iPhones then there are many references on how mobile browsing differs from the desktop. I'd recommend this book as a reference (and, yes, I understand the irony of linking to a paperback book for web design guidance ). Googling mobile web design (or iPhone web design) might yield more results.

  • How to attached a sql server 2008 database on sql server 2005

    Hi,
    I have a backup of database designed over sql server 2008. I need to attacched this on a machine where sql server 2005 is installed and I am getting the message while attaching the database.
    "The database can not be opened because it is version 661.
    the server supports version 611 and earlier"

    You need to install/have another instance of SQL Server 2008, restore over there the database and perhaps create a SSIS package to move objects and data into SQL Server 2005
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Cannot connect to Oracle 11gR2 database from SQL Server 2005

    Both SQL Server (Windows) and Oracle (Linux) are in 64bit environments.
    I have done the following on a Windows 2008 R2 with SQL Server 2005:
    Install InstantClient from Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) to C:\Oracle
    Install oledb from 64-bit ODAC 11.2 Release 3 (11.2.0.2.1) for Windows x64 by executing install.bat oledb c:\oracle odac
    Note: Not sure whether 11.2.0.2.1 version of ODAC will cause any problem since I cannot find 11.2.0.1.0 version.
    I have checked the Allow inprocess of OraOLEDB.Oracle provider in SSMS.
    I have executed sp_addlinkedserver @server = 'ORACLE_TEST', @srvproduct = 'Oracle', @provider = 'OraOLEDB.Oracle', @datasrc = '##.##.##.##:1521/TEST'
    The ##.##.##.## is the ip address of the Linux server which has the Oracle 11gR2 database TEST.
    I have executed sp_addlinkedsrvlogin @rmtsrvname = 'ORACLE_TEST', @useself = 'FALSE', @rmtuser = 'xxxx', @rmtpassword = 'yyyy'
    The xxxx is the oracle username and yyyy is the password for the oracle user xxxx.
    I know the oracle database TEST is up since I have setup connection in Oracle SQL Developer having:
    ##.##.##.## as the hostname
    1521 as the Port
    xxxx as the username
    yyyy as the password
    TEST as the service name
    When I click Test Connection for the linked server ORACLE_TEST in SSMS, it just hang.
    When I issue a query like select count(*) from oracle_test..xxxx.table1, it just run forever. I'm not so sure how to query an oracle table. I have also tried select count(*) from oracle_test.xxxx.xxxx.table1.
    When I retype the password in the Linked Server Properties, it just run forever.
    Do I need to create a tnsnames.ora on the Windows machine?
    Do I need to change the tnsnames.ora on Linux machine?
    I'm very new to Oracle.

    This forum is dealing with connections from an Oracle database to SQL Server - so the Oracle database is the driving site and this is the way round from your linked server set up.
    As you're suing the instant client you might post your issue in the instant client forum:
    Instant Client

  • Issue in rebuilding index after restoring database from sql server 2005 to 2012

    Hi All,
    We have recently restored a database named DBA_admin from our sql server 2005 instance to sql server 2012 and we have added the database to out weekly maintenance plan. After adding the database to maintenance plan the job is failing every weekend due to
    below error message.
    Error message from maintenance plan history:
    Executing the query "ALTER INDEX [PK_lsttype] ON [dbo].[lstAssign..." failed with the following error: "Invalid object name 'admin.dbo.databaselog'.
      ALTER_INDEX - dbo.PK_lsttype". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Below is the code within the maintenance plan which the rebuild index task is using for database dba_admin:
    USE [dba_admin]
    GO
    ALTER INDEX [PK_lstType] ON [dbo].[lstType] REBUILD PARTITION = ALL WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 98, DATA_COMPRESSION = PAGE)
    Please let me know if any one knows how to fix this issue.
    Thanks in Advance.

    Sorry for the confusion.
    Here is what is happening.
    The query is failing while trying to rebuild index [Pk_lsttype] on table [lstAssign], both these objects belong to database
    admin.
    I have verified the old instance there is table databaselog within the database
    dba_admin, but in new SQL instance within the database dba_admin the table is not present.
    Even I'm not sure of what this table databaselog has to do with rebuilding indexes on table
    lstAssign within the admin database.
    I have manually tried to execute the alter index command within the database
    admin and it is failing with the below error.
    ALTER_TABLE - dbo.Query_pnb_sms
    Msg 208, Level 16, State 1, Procedure ddlDatabaseTriggerLog, Line 39
    Invalid object name 'dba_admin.dbo.databaselog'.

  • Remove Standby/Read only mode for a database in sql server 2005

    Hi,
          I have a problem in sql sever . my database is showing standby/read-only mode. i want to remove that mode.please help me for the issue.

    HI
    Did you assign any DB read only user?
    check the administrator guide in your SAP Business one->Documntation->system setup->Administrator guide...
    but removing DB read only user is impossible.....

  • MS SQL Server 2005 Remote Database Connection

    Hello Friends,
    I have a database in SQL Server 2005, i installed SQL server with windows authentication. Now when I tries to connect to the server using Type 3 jdbc. I downloaded jdbc 1.2 driver from,
    http://msdn2.microsoft.com/hi-in/data/aa937724(en-us).aspx
    now i want to connect to the database from remote machine(different network).
    How can i achieve this, and what setting i have to make to the sql server?
    Any suggestion will be greatly appreciated.
    Regards
    Mohneesh

    okey i done with some experiment.
    now i am able to do it from local machine with the following code
    String url="jdbc:sqlserver://LocalIP:1433;integratedSecurity=true;";
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection conn = DriverManager.getConnection("url");
    now when i move to remote system and change the Local IP to remote IP(server has static IP)
    it comes up with SQLException: Login failed.for user ''.
    com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
    please help me its kinda urgent.
    Regards
    Mohneesh

  • Can i open an SQL express 2005 database in SQL server express 2012?

    Hi,
    i have a database and it's in SQL express 2005 but because my windows 8 is not compatible with the installer, i have to install the latest 2012 installer. my problem now is that i cannot open it in the 2012 edition..what do i have to do?

    Hi white_roses,
    Could you let us know how do you restore the database to SQL Server 2012 Express edition? Please help to collect the detail error information of this issue, it will benefit for us to do further investigation.
    As Sandesh and ED suggested above, we can directly detach our databases from SQL Server 2005 and then attach them to SQL Server 2012. For detail steps, please refer to the following article:
    http://msdn.microsoft.com/en-us/library/ms187858.aspx
    After we move a database from the instance of SQL Server on server A to the instance of SQL Server on server B, users may be unable to log in to the database on server B. If need the logins information on Server B, please refer to the following article:
    http://support.microsoft.com/kb/918992
    If you have any question, please feel free to let me know.
    Thanks,
    Jerry Li

  • Siebel database migration from Sql Server 2005 to Oracle 11g RAC.

    Hi,
    We would like to migrate our Siebel database from Sql Server 2005 to Oracle 11g RAC. Can you suggest the best way to do that ?
    The current configurations are:
    Application : Siebel
    database : SQL Server 2005
    The hardware can be changed if needed. Can you please suggest the best approach ?
    Thanks,
    Naveen.
    Edited by: Naveen Kumar C on Mar 18, 2011 9:10 PM
    Edited by: Naveen Kumar C on Mar 18, 2011 11:44 PM

    Hi Naveen,
    We would like to migrate our Siebel database from Sql Server 2005 to Oracle 11g RAC. Can you suggest the best way to do that ?You will need much more which suggestions.
    You will need a Siebel professional which has done this type of migration. Migrating the Database is not a task so hard, after migrating your environment should be functional and healthy it is usually the task problematic.
    The hardware can be changed if needed. Can you please suggest the best approach ?We can recommend the minimum recommended, but this documentation already does, you need to do a analysis on your environment and ask a vendor Siebel tell the which is recommended for you and how to find the best "number" for you, in your case is very hard because everything changes.
    Check this Step-by-Step
    Migrating a Microsoft SQL Server Database to Oracle Database 11g
    http://st-curriculum.oracle.com/obe/db/hol08/sqldev_migration/mssqlserver/migrate_microsoft_sqlserver_otn.htm
    Regards,
    Levi Pereira

  • Importing data from SQL Server 2005 database

    Dear Friends
    Scenario:
    We have built an application for which the database is SQL Server 2005.
    Now, we have planned to switch over to Oracle 8i database.
    There is a field with data type as Varchar(Max) – which can hold data with a maximum length of 231 characters (SQL Server 2005)
    In Oracle 8i, the Varchar2 max size 4000 bytes or characters.
    We want to import the data from SQL Sever 2005 database into Oracle 8i database.In the process, the value for the particular field whose data type set as Varchar(Max) in SQL Server 2005 and contains more than 4000 characters gets automatically truncated while importing into oracle.
    We want the entire characters stored in the field to be imported into oracle database.
    Please suggest solutions.
    Thanks and regards
    Bharath Kumar V

    Use CLOB if the data is purely text data. BLOB otherwise.
    But the question is why you want to switch over to an Oracle version which is de-supported by Oracle?

  • SQL Server 2005 to Oracle via OLE DB

    I've got a project where I need to access several tables in an Oracle (9i) database from SQL Server 2005. I installed the Oracle OLE DB provider and the Oracle 9i client. I can access the tables via the Oracle client without issue. I tried creating a "Linked Server" in SQL 2005 Mgmt Studio. Sometimes I can get it to test the connection successfully, but I can never get it to read anything from the database.
    Depending on what configuration I use, (MS OLEDB Provider, or the Oracle OLEDB Provider - varying the in process flag and other values) the errors range from not being able to instantiate the OLEDB provider to the server just returning an result that the table I'm trying to access doesn't exist.
    I keep reading in the forums about Transparent Gateways.... Do I have to have a gateway running for this? Shouldn't I be able to access the Oracle tables via OLEDB?
    Any help is greatly appreciated. Thanks.
    J

    I finally got everything working by using the ORacle 10x OLEDB client to create a linked server. You also have to set the OLEDB "allow in process" flag to get it going.
    With the 10x client and the in process flag, everything worked exactly as expected.
    J

  • Reading BLOB from SQL Server 2005 using DB Link from Oracle 10g

    Hi All,
    I am trying to read a table's data from SQL Server 2005 using ODBC DB Link created in Oracle 10g (10.2.0.3/4) database. I am not using oracle gateway.
    I am able read all data except for the BLOB data from SQL server 2005. It gives error given below when I try to execute query SELECT * from T_TRANSACTION_DATA@sdeslink inside a stored procedure:
    ORA-22992: cannot use LOB locators selected from remote tables
    Kindly help how to read BLOB from SQL server 2005 inside Oracle 10g.
    Best Regards!
    Irfan

    Irfan,
    If you can read the blob data using 10.2 HSODBC then there should be no problem using the 11g gateway.
    I recommend you download the latest version which is 11.2.0.3 available from My oracle Support as -
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    This is a full version and does not need a previous version to have bene installed. When installing it needs to be in a completlely separate ORACLE_HOME from the existing 11.2 install.
    For the Ora-22992 problem have a look at this note in My Oracle Support -
    Ora-22992 has a workaround in 10gR2 (Doc ID 436707.1)
    Regards,
    Mike

  • Error connecting to SQL  server 2005 from Dreamweaver 8

    Hi I have a database in SQL server 2005.I just started using
    dreamweaver's server behaviours.When I use the "log in" behaviour I
    get the following error.
    Microsoft VBScript compilation (0x800A0401)
    Expected end of statement
    /MyBlog/Connections/connBlog.asp, line 9, column 38
    MM_connBlog_STRING = Provider=SQLOLEDB;workstation
    id="FAZ-F6EE655890B";integrated security=SSPI;data
    source="FAZ-F6EE655890B\SQLEXPRESS";persist security
    info=False;initial catalog=MyBlog;
    -------------------------------------^
    First thing that came to my mind was obviously my database
    conn isnot right but when I define a conn using the built in
    dreamweaver's dialogue and test it, it says that the test
    succeeded.Also in the dialogue for the "login page" it shows the
    values of fields from the database, so it is definitely connecting
    to the database.So I don't know why am i getting this error.Please
    someone help!

    See if this TechNote helps:
    ASP error "VBScript compilation error '800a0401' "
    http://www.adobe.com/go/15717
    Are you using the ASP VBScript server model?
    Try creating a simple recordset that displays all records
    from a table and
    see if you can get that to work. It's less complex code than
    the user
    authentication server behavior and might help to isolate the
    problem.
    David Alcala
    Adobe Product Support

  • SQL Server 2005 Vista Problems

    I have 3 databases in SQL Server 2005 that I want to connect
    to. Everything works fine in XP, but when I try to set it up on
    Vista I get all sorts of problems. All software is latest version
    with all available updates installed.
    After restarting the Vista computer, the first database I
    select in CF administrator connects successfully, but the other two
    return Connection Reset error. It doesn't matter which of the 3 I
    select, just the first one connects.
    However, whichever one it is that CF confirmed was
    successful, when accessed from a CF page also returns Connection
    Reset error.
    The security settings in SQL Server are the same for each
    database.
    Anyone got any idea how to solve this problem??
    Doug

    The one that was connecting was connecting to port 1434. I
    have now locked it down and only port 1433 is available. Now I get
    the same error every time I try to make a connection:
    Error establishing socket. Connection refused: connect
    Apart from the port number (which was not 1433 on my old XP
    computer) everything else is identical.
    Is there some setting in Vista out of the box that has to be
    changed to get CF to connect to SQL Server 2005?
    Doug

Maybe you are looking for

  • Creating a text with transparent background using javax.media.j3d.Raster

    Hi, I'm trying to display a text in Java3D using the Raster but I'm not sure to make the background of the text transparent. Does anyone have any ideas. Here's my code for creating the Raster image: private javax.media.j3d.Raster getRaster(String str

  • Why trackpad generates 'fake' clicks when lid is closed on Windows 8?

    Hi everyone, I'm experiencing a pretty weired behavior by the trackpad - when the lid is closed, the trackpad generates fake clicks. I'm using an external mouse and suddenly getting right-clicks and things like that. As soon as I open the lid it all

  • Hyperlinks limitations in iPad Adobe Reader

    We have made an interactive PDF in InDesign CC with 89 slides, some forms, 5 hyperlinks to web and 147 hyperlinks to jump to other slides. Generated PDF in Adobe Reader on PC works OK. On iPad looks like iPad Adobe Reader 11.2.4 accepts only round 10

  • Local Copy of CF10 Documentation

    Hi, When I installed CF10, I selected the option in the installer to install the documentation.  However I cannot see any sign of it on my PC. Where does it put it?  I realise I can access it online, but I have always found it much more efficient to

  • How to change to native file name in ucm using custom component

    I am having the requirement to change the  name of the native file to some PO_contentid_1 . contentid is the contents content id. please help