BACK UP DEVICE LOGICAL NAME
Sep 5, 2001Is there any SYSTABLE or table from where I can get the backup device logical name.
Thanks,
-Rajesh
Is there any SYSTABLE or table from where I can get the backup device logical name.
Thanks,
-Rajesh
I want to back up my database to a logical drive and restore it from this logical device. But I am unable to see my logical device through sql server management studio interface. I am able to back up to a logical device and restore it from logical device through T-SQL code. I am wondering how come I am unable to see my logical device from sql server management studio interface. Is there any way, I can solve this problem? Thanks in advance.
View 3 Replies View RelatedWhat's is the between backing up a database to a file and a logical backup device?
If I point the logical backup device to a file on the filesystem, it's same as backing up to a file? isn't?
Thanks
Hi all , hope my post finds u all well.
Currently I was reading about how to create a backup and i have some questions and i hope to find helpful answers..
what is back up media ,device and tape ?
how to initialize the media and what is the need for something like that ?
what about media headers that must be written ?
thanks in advance
Davids Maguire
This is my first attempt to use SQL Server Compact with Visual Studio 2005.
I wrote a program for Inventory Scaning which requires the database to be stored on an SD Card. As long as the device is left powered on, the programs function normally. However, if the device powers off and is then turned back on the 0xC0000005 error is displayed when the program attempts to do anything with the SQL Connection.
I have also written a small sample program to test and the results are repeatable each time.
The sample program consists of a single form with six buttons (Create Database, Open Database, Insert Records, Delete Records, Close Database, Dispose Database).
Both programs are written in VB.
Here is the code for the sample program.
Public Class frmSQLTest
Private cnDB As System.Data.SqlServerCe.SqlCeConnection
Private connString As String
Private Sub frmSQLTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.txtDB.Text = "Storage CardTest.sdf"
End Sub
Private Sub txtDB_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtDB.LostFocus
connString = "Data Source=" & Me.txtDB.Text
Me.txtStatus.Text = "Connection String Set"
End Sub
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click
If Me.txtDB.Text = Nothing Then
MessageBox.Show("Unable to Create Database")
Exit Sub
End If
Dim eng As New System.Data.SqlServerCe.SqlCeEngine(connString)
eng.CreateDatabase()
eng = Nothing
Me.txtStatus.Text = "Database Created"
End Sub
Private Sub btnOpenDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenDB.Click
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
If cnDB Is Nothing Then
cnDB = New System.Data.SqlServerCe.SqlCeConnection(connString)
End If
cnDB.Open()
Me.txtStatus.Text = "Database Opened"
sqlDB.Connection = cnDB
sqlDB.CommandText = "CREATE TABLE Master (Item nvarchar(12), Description nvarchar(19))"
sqlDB.ExecuteNonQuery()
sqlDB.CommandText = "CREATE INDEX idx_Master on Master (Item)"
sqlDB.ExecuteNonQuery()
Me.txtStatus.Text = "Master Table Created"
sqlDB = Nothing
End Sub
Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click
Dim RecCount As Long
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
sqlDB.Connection = cnDB
For RecCount = 1 To Me.nudRecs.Value
sqlDB.CommandText = "INSERT INTO Master ([Item], [Description]) " _
& "VALUES ('" & RecCount.ToString & "','Test Item " & RecCount.ToString & "')"
sqlDB.ExecuteNonQuery()
If RecCount Mod 100 = 0 Then
Me.txtStatus.Text = "Updating Record..." & RecCount.ToString
End If
Next
Me.txtStatus.Text = "Records Inserted"
sqlDB = Nothing
End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim sqlDB As New System.Data.SqlServerCe.SqlCeCommand
sqlDB.Connection = cnDB
sqlDB.CommandText = "Delete FROM Master"
Me.txtStatus.Text = "Master Table Cleared"
sqlDB = Nothing
End Sub
Private Sub btnCloseDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCloseDB.Click
cnDB.Close()
Me.txtStatus.Text = "Database Closed"
End Sub
Private Sub btnDispose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDispose.Click
cnDB = Nothing
System.IO.File.Delete(Me.txtDB.Text)
Me.txtStatus.Text = "Database Diposed"
End Sub
End Class
In my tests, I start the program (loaded on the Storage Card in the same directory as the database). SQL Server Compact is also installed on the SD Card to save space in Main Memory.
Steps to Re-Create the Error:
1. Click the Create Database button. Database is created properly.
2. Click the Open Database button. Database connection opens properly.
3. Click the Insert Records button. Records are inserted into the table properly.
4. Turn off the Symbol MC3000 unit.
5. Turn the unit back on.
6. When I click on any of the following buttons, the error is displayed. Close Database, Insert Records, Delete Records.
I have also tried closing the database (as well as closing and disposing the database) prior to step 4 above, but when I try to re-open the database (or create the database) again, the error displays.
Is there anyway to correct this issue?
With the real program, the database must be kept open as long as each form is open to prevent speed issues and the database must be stored on the SD Card since there is not enough storage space available on the device.
I have a database in development in SQL Server 6.5 that needs to be occasionally deleted and rebuilt from a script when table structures are changed. I found that when very complex queries were performed, the 2 MB default size of tempdb filled up and returned errors, so I went to the Enterprise Manager to expand tempdb, learned that I had to first expand a device to expand tempdb into, and foolishly chose to expand tempdb into the same device space used by my application, instead of into one of the system databases. Now when I try to delete the device in preparation for its rebuild, the Enterprise Manager responds with an error message saying the device can't be deleted because it contains system tables. Is there any way to get the expanded portion of tempdb out of my application device so that the device can be deleted, without reinstalling SQL Server?
View 1 Replies View RelatedBasically I've been using Visual Studio 2005 for a few weeks now moving a Pocket PC project from 2003 to 2005. When I hit the Start Debugging Button every time until today the project would rebuild and deploy to my pocket PC allowing me to debug etc but now I get
The remote connection to the device has been lost.
Please verify the device conection and restart debugging.
I used to get this problem in VS2003 sometimes and just like the numerous posts on different sites that I've looked at the problem eventually goes away and I'm none the wiser. One guy said that he found that if he went to bed the problem was resolved when he came back!
My PDA running Windows 2003 2nd Edition is directly connected to my PC via a USB port. I've rebooted my PC and done a soft reset on the PDA but it didn't help. I'm using ActiveSync 4.1.
Does anyone know how to resolve this problem?
Hi to All
when i m trying to execute following code
backup database web
to disk = 'c:inetpubwwwrootackupmybakup.bak'
with format
I m Getting Error like :
Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'c:inetpubwwwrootackupmybakup.bak'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
This error is Generated only when i m trying to access folders within "wwwroot" but not in any other folders , even command runs success fully for "wwwroot" folder . !!
but not for any subfolders of wwwroot.
Can Any One Help Me ??
Hello,I'm trying to create a simple back up in the SQL Maintenance Plan that willmake a single back up copy of all database every night at 10 pm. I'd likethe previous nights file to be overwritten, so there will be only a singleback up file for each database (tape back up runs every night, so each daysback up will be saved on tape).Every night the maintenance plan makes a back up of all the databases to anew file with a datetime stamp, meaning the previous nights file stillexists. Even when I check "Remove files older than 22 hours" the previousnights file still exists. Is there any way to create a back up file withoutthe date time stamp so it overwrites the previous nights file?Thanks!Rick
View 5 Replies View RelatedNew to Database Mirroring and I have a question about the Principal database server. I have a Database Mirroring setup configured for High-safety with automatic fail over mode using a witness.
When a fail over occurs because of a lost of communication between the principal and mirror, the mirror server takes on theĀ roll of Principal. When communication is returned to the Principal server, at some point does the database that was the previous Principal database automatically go back to being the Principal server?
I need to run two reports each of A5 Size to run back to page and print on single A4 paper means in 1st half Sale bill will be printed and in second half Gate Pass Will Be Printed both report will be on same page and size and shape should be maintained. How to do it.
View 4 Replies View RelatedHello,I am hoping you can help me with the following problem; I need to process the following steps every couple of hours in order to keep our Sql 2000 database a small as possible (the transaction log is 5x bigger than the db).1.back-up the entire database2.truncate the log3.shrink the log4.back-up once again.As you may have determined, I am relatively new to managing a sql server database and while I have found multiple articles online about the topics I need to accomplish, I cannot find any actual examples that explain where I input the coded used to accomplish the above-mentioned steps. I do understand the theory behind the steps I just do not know how to accomplish them!If you know of a well-documented tutorial, please point me in the right direction.Regards.
View 2 Replies View RelatedDoes anybody know of a way to rollback SQL Server 2005
databases back to SQL Server 2000? Is there a way of doing it without
resorting to Copy Database Wizard? I love to find a way of attaching a SS 2005 database
to a SS 2000 instance without any issues.
I recently upgraded to SS 2005 and I am very unhappy with the SS 2005 and I
want to rollback to SS 2000, which was a lot more stable. I am having
several major issues that are affecting my whole company's day-to-day
operations and the managers are not happy. Some of the issues include
night time batch running very sluggish for no apparent reason. This is a
biggest problem because it only occurs once or so a week and causes a disturbance
with the daily activities when the night time processing isnt completed on
time. The rest of the time, the batch processing runs great, even a little better then on SS 2000. I
don't believe it is a matter of my application needing to be retuned because if
that was the case, then why isn't it running sluggish every night? Also,
it's never the same day that the sluggish behavior occurs. If it was occurring
on the same night, then I would have something to investigate within our
application, but it doesn't. Another issue that I am having involves a
night time job that restores a copy of the production database to the Data
Warehouse server to be used for updating the data warehouse. Again, most
of the time it runs great (~2 1/2 hours), but once or twice a week, it goes
stupid and takes 6 1/2 hours for no apparent reason. Again, it is not happening
the same day either, which could give me something to invesigate. On SS 2000, this same job ran flawlessly. Never I did I run into situation that the
database restoration took that long to run. Even another issue involves a SQL Server Agent Job that was put into suspended
state. What's a suspended state and how can I get it out of suspended
state? I can find no information about suspended state in BOL. I
did a Google and nothing came up. If this suspended state was put
in for security reasons, great, but then tell me how I can remove the suspended
state. I am also not happy with the
fact that I can't get accurate information about the queries that are actively
running at that particular moment. In SS 2000, when I noticed high CPU
usage on the server, I would run the sp_who2 active stored proc and it would
show me all the active thread and how much CPU it was consuming. I would
then find the running threads with the highest CPU numbers and investigate the
query and see if we could improve it. Now in SS 2005, I get in the same
situation and run the sp_who2 stored proc, and there is no smoking gun.
All of the active threads are showing very little CPU usage, which I am very
suspect of. What the heck happen to sp_who2? I looked at some of
the other ways of looking at running processes (i.e... sys.sysprocesses) and
they don't appear to be giving the information that I need.
I am very unhappy and I just want to roll back to SS 2000 and wait a couple of
years before I upgrade to SS 2005.
Dave Brown
Hi all
We generally modify the logical name of a data file or log file from the vendor defined to our standard name. Is there any impact that you know about this? If you have 2 seperate database and accidently you have 2 same logical name .. I dont' think that will be an issue ... correct?
ALTER DATABASE XXX_UAT
MODIFY FILE (NAME = 'mdd_Data', NEWNAME = 'XXX_UAT_Data')
GO
ALTER DATABASE XXX_UAT
MODIFY FILE (NAME = 'mdd_Log', NEWNAME = 'XXX_UAT_Log')
GO
Hi,I want to change the logical name of the database. My database name and.MDF has the same name, but the logical name is different. Willchanging it impact anything?--sharif
View 1 Replies View RelatedI have a query. on my search page i have a number of textboxes e.g. title, subtitle, ISBN where users can enter a search string and when they click on a button the data is displayed in the gridview below.
my query seems to be bringing up the right records but with some additional records into the gridview. I have tried the same query within the SQL server management studio and it brings back two records like indicated but within my aspx page it brings back 6 additional records that have no relevance to the query. Im quite baffled as to why this is happening and i have debugged but nothing comes to light.
my code in my aspx page is as follows:
public void BindData(){String _BookID = TxtBookID.Text;String _Title = TxtTitle.Text;String _Subtitle = TxtSubtitle.Text;String _ISBN = TxtISBN.Text;String AuthorFName = TxtForename.Text;String AuthorLName = TxtSurname.Text;
SqlDataAdapter ad = new SqlDataAdapter("SELECT Book_ID, Book_ID_Internal AS [Book Internal ID], Title, Subtitle, ISBN, Edition, Publication_Date AS [Published Date] FROM Book WHERE Book_ID_Internal = '" + _BookID + "' OR Title = '" + _Title + "' OR Subtitle = '" + _Subtitle + "'", conn);DataSet ds = new DataSet();ad.Fill(ds, "Book");if (ds.Tables[0].Rows.Count == 0){//if there are no rows returned-state in the gridds.Tables[0].Rows.Add(ds.Tables[0].NewRow());GridView1.DataSource = ds;GridView1.DataBind();int columncount = GridView1.Rows[0].Cells.Count;GridView1.Rows[0].Cells.Clear();GridView1.Rows[0].Cells.Add(new TableCell());GridView1.Rows[0].Cells[0].ColumnSpan = columncount;GridView1.Rows[0].Cells[0].Font.Italic = true;GridView1.Rows[0].Cells[0].Text = "No Records Found";}else{GridView1.DataSource = ds;GridView1.DataBind();}}
if i input the same query into SQL management studio:
SELECT * FROM Book WHERE Book_ID_Internal = 'ITD 450' OR Title = 'HTML 4.0'
it returns two records which is correct.
Can anyone see where i am going wrong?
Hello,
Is there any way to change the logical filename of exsiting database
Thanks
Lara
In the database properties screen, there are four tabs: General, Transaction Log, Options, Permissions. In the General Tab, it lists four columns: File name, Location, Space Allocated, File Group.
The string in the File name column has a value such as MY_DATABASE_DAT, whereas the Location column has a value like D:mssql7dataMY_DATABASE.MDF.
The Location value is clearly the Windows file name. The "File name" (which I have seen called the "logical file") is a mystery to me. What is it used for? How can it be changed? Is there a problem if two different databases have the same "logical file" name?
(For example, if you do sp_detach_db, copy the file to another place and then sp_attach_db the new file to another database name, you have two different databases with the same "logical file" name.)
Much thanks to anyone who can shed light on this.
Hi everyone,
I have a database (xyz) one Machine A. On the same machine I want to create a copy of the (xyz)database with different name(xyz_1). When I restore with move option it will restore but the thing is logical file names of xyz and xyz_1 are same. I know I can change these file names by manupulating the system table.
My question is If I didn't change the logical file names of database xyz_1(new). Is there any problems or issues may arise.
Thank you,
Dindu.
The organisation I'm working for has SQL Server 2005 merge replication up and running on 11 servers in 3 different countries.
Ocasionally we experience problems caused by rows in a logical record relationship being replicated between servers in the wrong order, i.e. an attempt is made to insert child rows before the parent. I am not able to reproduce this behaviour on my test servers.
Has anyone else experienced this problem?
We have a progress database that we use RS on. The "status" field (active/inactive) is a logical field (true/false). When doing the SQL how do I specify that I want only active records (value = true).
View 1 Replies View RelatedHow to rename logical name for transaction log ?
thanks
Pros,
I would like to change the logical filenames for a database on my test server. I know this is done with ALTER DATABASE, but I'm not sure of the exact syntax. Can anyone help?
rb
I cannot find the answer to this: how do you update the logical file name for a database? Restore database "Alpha" over "Beta" specifying WITH MOVE parms allows "Alpha"'s physical files to overlay "Beta"'s, but now "Beta"'s logical file names are "Alpha_Data" and "Alpha_Log".
Updating sysfiles directly gives back a 270; "Get outta here!"
Can this not be done?
Hi All,
I've been asked to trouble shoot an installation where many stored procedures are performing poorly. Upon examination I've found that the queries in these procs consume a large volume of logical IO (table scans etc). I'm trying to show that this could cause poor performance of the stored procedures as well as degredation of the server as a whole - but I cant find any suitable counters in Perfmon.
Anyone help?
Jim
Hi
Every one
One thing i found out that my 2 databases in server A
Has same logical file name .
I have try to change the name but it is not allowing me to change.
I had refer BOL it says that we should have unique logical file name in a server for each database.
Question i have is does it going harm me i don't know this
if any one u know please suggest me.
Problem I already started getting is I do backup 5 small databases of 10 to 20 mb in one tape only. The 2 database which has same logical file name out
of which one is getting copied & another is not ,All other database it backup
perfecly.
But at the same time in a hard disk if i take backup of this database in a same device it works perfecly so i don't understand where the problem is
If any has any idea please suggest me
Thanks
Nirmal.
I'm moving a database (XYZtest) from the test server to the production server via sp_detach/sp_attach. I want the logical file names to be XYZ_data, rather than XYZtest_data, etc. I can easily rename the disk files, but how do I rename the logical file names?
Thanks,
Al
Hi,
Does anyone know how to change the logical file name of a database?
Appreciate any help.
Steve
I have a view based on few tables okay
I have a query that gives me document details of various revisions
Now i also get the latest rev of those if i use a MAX() in my Query
Now a case where i have say
Docu Numb - Revi - Received Date
Document1 - rev0 - 10/2004
Document1 - rev1 - 11/2004
Document1 - rev2 - 12/2004
Document1 - rev3 - 01/2005
Document1 - rev4 - 02/2005
Document1 - rev5 - 03/2005
Document1 - rev6 - 04/2005
Document1 - rev7 - 05/2005
If i query for latest it gives Document1 - rev7
And if i filter for a month of 12/2004
If i query for latest it should give Document1 - rev2
Now i need to get a filter with latest as rev2,
plus i also need as a indication of actual latest as rev 7
using a query
How do i do that ...
Coz when i use filter for a month and Max then it
does not consider rev7 for that filter and skip the record
and if i try to filter only as per month .. i get a wrong info
as latest rev2 which is not a true info as per database records.
May i possibly get both ... filtered info as per specific month and
also a rev info as what is the latest for a spec document.
Just i need to know is that possible .. in SQl using a query
Any more info needed please mail me on
neeraj.jariwala@gmail.com
Life is beautiful ... When you smile ...
Hi,
we consistently have logical page errors on one of our SQL Servers.
The output from CHECKDB is shown below. Any ideas why this keeps happening. We recently replaced the disk thinking this would solve the problem.
DBCC results for 'TMP_tbl_Pay_Totals'.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:391469) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
AND later on
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398376) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398377) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398378) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398379) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398448) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398449) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398450) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398451) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Table error: Page (1:398452) allocated to object ID 1412968160, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.
Server: Msg 2533, Level 16, State 1, Line 1
Final bit
CHECKDB found 0 allocation errors and 11 consistency errors in database 'ISS'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (ISS ).
Any help or ideas much appreciated.
Hi how do I select the current logical database name using a select statement.
View 8 Replies View RelatedI have a table with 50% Logical Scan Fragmentation. [ according to Dbcc Showcontig (myTable) ]
Why after running DBCC INDEXDEFRAG (myDB,myTable) does it still sit at 50%.
Why isn't it lower?
I'm trying to restore about 70 databases onto a new SQL server andwanted to script the creation and restore. I've done the creation withno problems, but on the restore, the logical names (of the originaldata) are all over the place and were historically wrong.So, when I use the script below... I've had to work out the Logicalname for the data and the log file and alter the script accordingly.Creation------------Create Database MyDatabase ON (NAME = MyDatabase_data, FileName ='D:DatabaseMSSQLDataMyDatabase.mdf') LOG ON (NAME = MyDatabase_log,FileName = 'D:DatabaseMSSQLDataMyDatabase.ldf') COLLATESQL_Latin1_General_CP1_CI_ASRestore-----------RESTORE FILELISTONLYfrom disk ='D:DatabaseMSSQLBACKUP2006-08-07MyDatabase_db_200608072100.BAK'restore database MyDatabasefrom disk ='D:DatabaseMSSQLBACKUP2006-08-07MyDatabase_db_200608072100.BAK'with REPLACE,MOVE 'SomeOtherRubbish_Data' TO'D:DatabaseMSSQLDataMyDatabase.mdf',MOVE 'SomeOtherRubbish_Log' TO'D:DatabaseMSSQLDataMyDatabase.ldf'goWhen I then look at the properties of the database, it shows the oldconvention which I don't want.So, even though I've been neat creating the database, it getsoverwritten with the odl rubbish name. How can I change the logicalname so that I can have a nice and neat naming convention ?Oh, Yes I know I added the collation when creating the database, butthat's another thing that we need to address at some point.Thanks in advance
View 2 Replies View Related