What should I have done? Is there anything that can be done other than restoring from backup?
How does one know if the database is really recovering or is EM just joken? I can wait 2 hours
before starting the restore
I was BCPing 12 million rows into a staging table. II used the '-b' option every 20K which I thought
would do a commit and clear the log in batches. After the process EM appeared to show the transaction log
as empty. Upon inspecting the Bcp output file I discovered the message that the BCP did not complete
because syslogs was full. I could not do a truncate transaction log or a dump database. I tried to
do a truncate transaction with no_log and it appeared to just hang. I stopped the SQL Server thinking
I could dump the transaction log, but could not start the Sql Server again. I then stopped the NT Server
because 'if all else fails'. The SQL Server started but the user database if marked as recovering.
Hi everyone I want to know if it's possible to do a for/while-loop so i can use INSERT
Look: I've this int [] test = new test[140]; But i need to insert for every value (140) a number so normally it would be : INSERT ... (case1, case2, case3 ...) value (test[1],test[2],test[3] ...) But isn't there a way to it with a loop? SOmething Like this ?
for( int i = 0 , i< 140, i++) { INSERT case[i] value test[i] }
Extremely thanks for the reply . I am using transactional replication for the database . I will try with snapshot replication as you suggested .
You mentioned that it will work with Transactional replication only if the application uses the option ' with log ' for those transactions .
Can you let me know where can i set this option for transaction replication ? I am sorry but i am not well versed with database replication procedures and management .
Any ideas on how long it should take SQL Server 6.5 running on a 8 Gig RAID 0 array to "recover" a 4 GIG database. I rebooted the machine this morning (seldom ever have any problems with it) and it seems to be taking an awfully long time (15 min so far). I'll let you know what happens in any case.
I need to recover a database, but unfortunatelly i donīt have any backup... Well, it was not my fault. Anyway, i only have the physical .DAT files of the data and log devices of the database. Will it work if I create two devices with the same name as the old devices, create a database with the same name as the old database within these devices and then run a full script of my old database, then change the 'phy_name' on the sysdevices to point to where my old dats were, or replacing the current ones with the old ones? If not, will anything else work?
My server crashed i had full back up my .BAK file for every database and i reinstalled a fresh verion of sql server 2000 enterprise and when i comme in enterprise manger to restor the master its telling me i need to be in single user mode what do i do.
I have a 3GB DB that I was running an update script on. The sript failed and ran out of transaction log space. I expanded it and stopped and restarted SQL. The user DB is now marked as recovering. How long should I wait for it to recover? I don't want to have to restore again and start all over with my script. Please help.
accidently i have issued a DROP DATABASE XXX command in the sql client, thinking its a local server....... The whole 4 months of database database is now dropped.
Please help me , how can i recover the database ....
i am running an application build on c# and dot net frame work 2.0 running on windows server 2003 enterprise edition with service pack 2 on a Xeon Machine, when the application can to many data base request or face load...the date base service disappears...... can some buddy plz reply me how this problem can be resolve....
We currently have a company program in foxpro which inputs all of our information into its database. We are trying to shift from this to new updated software and a SQL database. There is a program we created which converts all the data from our old database into our new SQL database in preparation for our final move to the newer software. However, some of the tables in SQL were not taken directly from our old database but rather added in directly after our initial use of SQL, so when we ran our conversion software, a couple of specific tables were wiped because there was no equivilant within our old database. We already altered our conversion program to not touch those tables again, but is there any way to do a roll back or to find a backup of specific tables?
I have a mirred database and have snapshot created from the mirroed database. I can do data selecting from the snapshot. But when the pricipal server is down , I can re-active the mirroed database.( I did succesfully upto this). Then I need to restore the database from snapshot and which failing with following error message.
Code Snippet Msg 5123, Level 16, State 1, Line 3 CREATE FILE encountered operating system error 3(error not found) while attempting to open or create the physical file 'E:sql_datadevitst_mirrorlog st_mirror_log.ldf'. Msg 5024, Level 16, State 2, Line 3 No entry found for the primary log file in sysfiles1. Could not rebuild the log. Msg 5028, Level 16, State 2, Line 3 The system could not activate enough of the database to rebuild the log. Msg 3013, Level 16, State 1, Line 3 RESTORE DATABASE is terminating abnormally.
while recovering it prompts a message 'the system administrator must have exclusive use of database to run the restore operation'. now,how to do it? how to make database to use exclusively when it is connected to an web based aplication. thanks.
A friend of mine called and said that his database was suspect and he detached it and was unable to attach it. The SQL Server Version is 2000 with the latest service packs installed. When I checked it the database (MDF) size was 1MB and the LDF size was 3.8 GB. I was not able to attach the two together and I was not able to attach the database using sp_attach_single_file_db. I did find an old backup of his database and attached that so he can work off of it but it is 1 yr old and he needs recent data. Since the MDF seemed to be blank we cant do much with that, but there seems to be data in the LDF. Is it possible to extract any data from the LDF file?
I was coping database from my sql server 2005 to the same server but with different name. 4 steps completed successfully but the last step failed because the computer on which sql server is running turned off unexpectedly. When the server was running again, the source database was detached. I tried to attached it but sql server is reporting error 5 (system cannot access the specified file) I cannot access the file from windows explorer too. I discovered that the copy of the mdf file exists with the name of the target database but when I try to attach this new mdf file sql server reports that the file is not primary database file. Both files are the same size. What can I do? Thanks
My DB size was from 500MB to 10GB since 8/1998 to 12/2004. But now is 16GB (from 1/2005 - 5/2005), I don't why the data size growth too fast (as double) ?
ssql.Append("INSERT INTO FINDINGS (Facility) ") ssql.Append("VALUES ('" & Facility & "')") Try Dim NewRow As Integer = dba.ExecuteSQL_Affected(ssql.ToString) Catch ex As Exception MsgBox("There was an error saving records.", MsgBoxStyle.Information, "No Key") Exit Sub End Try
Assessment.dtblFindings_Initialize()
Code Block Public Function ExecuteSQL_Affected(ByVal sSql As String) As Integer '//Execute the query like Insert, Update and delete Dim RowsAffected As Integer Try
If Conn.State = ConnectionState.Closed Then
Conn.ConnectionString = "Data Source=" & oDBConfig.LocalDBLocation & "" & oDBConfig.LocalDBName & ";" Conn.Open() End If Dim cmd As New SqlCeCommand(sSql, Conn) cmd.CommandType = CommandType.Text RowsAffected = cmd.ExecuteNonQuery() cmd.Dispose() Conn.Close() Return RowsAffected Catch err As SqlCeException
MsgBox(Utility.ComposeSqlErrorMessage(err)) Catch ComErr As Exception
MsgBox(ComErr.ToString, MsgBoxStyle.Information) Finally End Try End Function
Code Block Assessment Form
Public Sub dtblFindings_Initialize() Dim rdr As SqlCeDataReader Dim dba As New DBAccess Dim ssql As StringBuilder = New StringBuilder ssql.Append("SELECT Facility FROM FINDINGS") rdr = dba.OpenResultSet(ssql.ToString) Try
rdr.Read()
While rdr.Read ...
So here is the problem. The normal function is to initiate the insert by pression a button. That should go through all the steps then hit the dtblFindings_Initialize command and rebuild the datatable. However when it happens for the first time (i.e. the first facility going into the database), the SELECT statement always returns nothing.
If I stop the application and Pull the database to the desktop, the row has been inserted. So I feel that I am somehow doing something wrong, not closing something, not initializing something....argh! Please help!!
The primary database i'm responsible for has started to grow super fast. Every couple of days is growing by 10% (which matches with the db settings). But, the recent growth doesn't match with the historical growth. It took a couple of months to grow from 7 to 8 GB, but it has grown to about 24 Gb in the last 2 months. Bottom line - trust my assertion that it's growing alarming fast.
I need help determine what objects are fueling the growth. If I know the objects, I can probably determine the cause. From a flip-side, it might be legit data stored very poorly. I'm open to any ideas...but I need to get ahead of this problem in the next week or so...or I'm going to run out of room on the hard drive and could start to affect my users.
I'm trying to work out a database design to make it quicker for my clientprogram to read and display updates to the data set. Currently it reads inthe entire data set again after each change, which was acceptable when thedata set was small but now it's large enough to start causing noticabledelays. I've come up with a possible solution but am looking for others'input on its suitability to the problem.Here is the DDL for one of the tables:create table epl_packages(customer varchar(8) not null, -- package_type char not null, -- primary keypackage_no int not null, -- /dimensions varchar(50) not null default(0),weight_kg int not null,despatch_id int, -- filled in on despatchloaded bit not null default(0),item_count int not null default(0))alter table epl_packagesadd constraint pk_epl_packagesprimary key (customer, package_type, package_no)My first thought was to add a datetime column to each table to record thetime of the last change, but that would only work for inserts and updates.So I figured that a separate table for deletions would make this complete.DDL would be something like:create table epl_packages(customer varchar(8) not null,package_type char not null,package_no int not null,dimensions varchar(50) not null default(0),weight_kg int not null,despatch_id int,loaded bit not null default(0),item_count int not null default(0),last_update_time datetime default(getdate()) -- new column)alter table epl_packagesadd constraint pk_epl_packagesprimary key (customer, package_type, package_no)create table epl_packages_deletions(delete_time datetime,customer varchar(8) not null,package_type char not null,package_no int not null)And then these triggers on update and delete (insert is handled automaticallyby the default constraint on last_update_time):create trigger tr_upd_epl_packageson epl_packagesfor updateas-- check for primary key changeif (columns_updated() & 1792) > 0 -- first three columns: 256+512+1024insert epl_packages_deletionsselectgetdate(),customer,package_type,package_nofrom deletedupdate Aset last_update_time = getdate()from epl_packages Ajoin inserted Bon A.customer = B.customer andA.package_type = B.package_type andA.package_no = B.package_nogocreate trigger tr_del_epl_packageson epl_packagesfor deleteasinsert epl_packages_deletionsselectgetdate(),customer,package_type,package_nofrom deletedgoThe client program would then do the initial read as follows:select getdate()selectcustomer,package_type,package_no,dimensions,weight_kg,despatch_id,loaded,item_countfrom epl_packageswherecustomer = {current customer}order bycustomer,package_type,package_noIt would store the output of getdate() to be used in subsequent updates,which would be read from the server as follows:select getdate()selectcustomer,package_type,package_no,dimensions,weight_kg,despatch_id,loaded,item_countfrom epl_packageswherecustomer = {current customer} andlast_update_time > {output of getdate() from previous read}order bycustomer,package_type,package_noselectcustomer,package_type,package_nofrom epl_packages_deletionswherecustomer = {current customer} anddelete_time > {output of getdate() from previous read}The client program will then apply the deletions and the updated/insertedrows, in that order. This would be done for each table displayed in theclient.Any critical comments on this approach and any improvements that couldbe made would be much appreciated!
Does anyone know how to upload (bulk) data from a client (written in Excel VBA) to a remote SQL2000 database? Of coarse I tried "INSERT INTO" and rst.addnew but I noticed this is much, much slower as downloading from the same remote database.
database : MS SQL server ver 6.50.201 problem: server startup / server time out details SQL server shows usage of 100 % CPU utilization, if started automatically / manually. and does not proceed / hangs up(server time out), but win nt operates extremely slow.
The background of the situation in brief is as stated below. The errorlog was found to have the messages warning : OPEN OBJECTS parameter may be too low. Attempt was made to free up descriptors in localdes() Run sp_configure to increase parameter value.
Error : 644, severity : 21, state; state 1 the non clustered leaf row entry for page 2 row 1 was not found in index page 40 indexid 2 database 'tempdb'
Error : 2620 severity 21 state 3 the offset of the row number at offset 32 does not match the entry in the offset table of the follwoing page : page pointer = 0x1395800, page no= 40, status = 0x2, objectid = 1, indexid = 2
Action taken I used the sp_option to increase the open objects from default 500 to 1000, and the LE threshold maximum value to 400 from the default 200. after which I used reconfigure go and restarted the computer to take the effect. The following did work fine and server was working ok. But then from yesterday I am having the problem that the MS SQL sever is utilizing the cpu to 98 - 99 % and I am not able to connect to the server. I tried to start the server with the minimal configuration by specifying the -f option in the service manager start up options, it showed the following message 00/12/07 10:40:49.73 ods Unable to connect. The maximum number of '5' configured user connections are already connected. System Administrator can configure to a higher value with sp_configure. 00/12/07 10:40:50.02 ods Unable to connect. The maximum number of '5' configured user connections are already connected. System Administrator can configure to a higher value with sp_configure.
afterwhich I tried with the option of starting the sql server with the option -c -f which in the event detail of the win nt shows "mesg 18109: Recovery dbid 6 ckpt(55813,8) oldest tras= (55813,0)"
The open procedure for service "MSSQLServer" in DLL "SQLCTR60.DLL" has taken longer than the established wait time to complete. The wait time in milliseconds is shown in the data. DB-LIBRARY error - SQL Server connection timed out.
The dbid is / was 6 for both the instances, the database which is having this dbid is database name "AM" and is having above 1300 tables (approx) what could be the problem and solution for it? kindly help me out of this situation.
If any more information is needed please contact me on devendrakulkarni@yahoo.com / devendra@me.iitb.ernet.in
I am in a trouble without doing any mistake. I restarted while in parallely my sql server was restarting i.e I opened a management studio.
When it booted up next time. I see that my database is gone. Though it is showed up in the server but has no node below it. I then checked the mdf files and ldf files and found mdf file to be of 0 KB and ldf file is of 1.73 GB. My database was in full recovery mode but i did not take any database backup.
Here ais the entry from my SQL server log:
The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0000000000000000 in file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAHello.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. I wonder if now there is a case to recover my database..Can I restore/recover the database from .ldf file as it was in full recovery model?Any help i shighly appreciated.
in sql server 2000 ,in query analyzer :for example i have a emp table ,when i execute a query ,i have to get the emp table column names with its data types...for example :empno ---intempname -- varchar like this...what is the query to get the output like this
I am not using the SA account when I log in using windows authentication it seems to pick up my domain and active directory ID which is "usapp1dxd" it appears greyed out as well as the password on the login screen so you can't change it.
If you go into the management studio and right click on the server name in the left hand pane go to properties security the radio button for sql server and Windows authentication mode is selected.
For the begining thank for your reply. I started with a new job and I was hopeless when all normaly claimed things can't be done. I asked a lot of peoples who works on MSSQL(including SWYNK) for my problems(I know that I'm beginer on MSSQL) but they didn't knows any solution. And afterall I wrote that. For your ilustration, we develope information system for Invest company. Back is on MSSQL and client is in ASP.
>So... if you need a database you need to look at what needs to be done and >pick your DBMS that meets your requirements. --I didn't resolve on which DB we will develope:((
--No named cursors I mean that in general is using curosr names bootless. And you must deal with names... In interbase: DECLARE var1,2 INTEGER; FOR SELECT column,column2 FROM TABLE WHERE ... INTO :var1,:var2 BEGIN some code in loop; END
In mssql: DECLARE .. DECLARE crs CURSOR FOR SELECT ... OPEN crs FETCH NEXT FROM crs INTO @var1,@var2 WHILE (@@FETCH_RESULT = 0) BEGIN some code in loop FETCH NEXT FROM crs INTO @var1,@var2 END CLOSE crs DEALLOCATE crs -I thing that in mssql it isn't elegant. -problem with recursive procs -you must deal with names -If you can you may use named cursors in Interbase in fact
>-it don't know create resultset's from >> stored procs asynchronously when in sp is something else then only one >> select(problem if I want check access rigths to sp. for exapmle "...AS >> CheckPrivilege( ... ) SELECT.." This is confusing if user runs large >> query & he must wait until it creates the whole recordset...Armageddon goes >> first... Here is a solution, but it isn't very elegant and in some >> cases don't exists good solution > >I'm not sure if configuring SQL Server's "cursor threshold" parameter would solve this. "When >set to -1, all keysets are generated synchronously. If the cursor threshold is set to 0, all >keysets will be generated asynchronously."
-"cursor threshold" resolves it only in single select's and procedures with only one select's -It's unacceptable when your your user runs large queries
>>-max of nested procs is 16. >That is the limit in V6.5. In V7.0 the limit is raised to 32. -cool:)
>Union operator can't be used in a Create View statement in V6.5 according to the documentation. >Does Oracle support this? It appears that V7.0 of MSSQL will support UNION in a view. -cool:))
>-It don't have good exception > handling.(something like EXCEPTION, WHEN... (oracle, Intebase)) > >There are whole sections on error handling in SQL Books OnLine depending on >how you are >accessing SQL Server. Maybe it's as good as Oracle/Interbase... maybe not. I >don't seem to have a problem with it.
-Books are very feeble:( -but I thing that it can't work with EXCEPTION blocs. Good Exception handling is important tool for fast developing of robust apps
-I used example(s) from INTERBASE because I worked more on it, but in Oracle it's alike.
For a query like below ... How do i have to select only the latest revisions, if i need to filter last current revisions of each document ... where the revision could be either alphabetical or even numerical ...
Presently I get all revisions with the below query ... Note: csd_revi is the field of CSD table for revisions.
I've gotten everything to work -- almost! Here's the scoop... I'm using SQL Server 7.0 and ColdFusion (you don't need to know anything about ColdFusion). I'm trying to get SQL Server to publish/share/etc. a database with the network so ColdFusion (our website management/creation program) can access it and use it in a webpage. Well, so far, ColdFusion can detect and access the database (called "iami"), but it cannot find any tables in the database (particularily one called "phase1"). Can anyone help me -- the sooner the better -- ???
If you reply before 4pm today and offer truly helpful advice/input, I'll send you a reward/incentive from me personally (just give me your mailing address) just for helping out!!! :-)