|
Database mirroring is a new feature of SQL Server 2005 (SP1 and later).
SQL Server 2005 database mirroring is based around log shipping. Clients connect to the Principal (active) node and submit their queries; data modifications are recorded to the transaction log on the Principal, which sends log updates to the Mirror (standby) node. In the asynchronous (high-performance) mode, the Principal reports success to the client as soon as the modifications are recorded to its own log, it does not wait for the Mirror to write to its log. In this mode, some updates can be lost on failure of the Principal node, if the corresponding log operations have not yet been recorded in the log.
In synchronous (high-safety) mode, the Principal waits for the Mirror to complete recording the modifications to its log before reporting success to the client, when committing the transaction. This causes a delay to the client as all the log records have to be transferred over the network and written to the log file. This prevents lost updates.
For automatic failover, a third node, the Witness, is required. This doesn't keep a copy of the database, it only informs the other two instances which it can see. If the Mirror and Witness can see each other but neither can see the Principal, the Mirror assumes that the Principal has failed and takes over the Principal role. The Principal, if it loses contact with both Mirror and Witness, takes its database offline.
The standard SQL Server 2000 high-availability solution is clustering. I would recommend investigating that before venturing into trying to implement your own solution. It may be possible to implement a manual 'mirroring' solution using Transactional Replication. I've not tried to do this.
|
|
|
|
|
Mike Dimmick wrote: (SP1 and later).
I'm sure I saw them demo database mirroring at the SQL Server 2005 launch. I take it that it didn't work properly in real life until the service pack got released.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
They left it at 'experimental' - you had to turn on a trace flag to get it to work. With this level of confidence in the feature I would recommend applying the service pack before trying it.
I'd recommend not using mirroring for a database with a high level of write activity (say, ASP.NET session state). For a start, you need to use the Full recovery model, which means that the transaction log just grows until you back it up. We're using a SQL Server database as a shared state store for our thin client product, when used in a server farm mode (for load balancing and failover), but due to the requirements of the protocol the database gets updated multiple times per client request. I think I can probably get this down to two. Anyway, because the Mirror partner has to acknowledge all transactions, you get a delay of several milliseconds (normal cross-machine call overhead) on committing every transaction, which slows down your client quite a bit.
In fact I found in in-house testing that if the Mirror went offline for a while, the transaction rate went up a lot. When the Mirror came back online it could never catch up with the transactions that had occurred while it was offline. At least, on the low-end white-box hardware that I was testing with.
For mostly-write databases, clustering is a better solution than mirroring.
|
|
|
|
|
Hi friends!!!
I have a table where i have a set of tutor ids and the relevant points they get according to a student.
table is like
student_name // tutor1_id // points // tutor2_id // points ....
john // 101 // 4 // 102 // 5
jacob // 102 // 3 // 105 // 4
and another table
tutor_id // tutor_name
101 ron
102 reid
103 abc
...
I need to show the points the tutor name and the student name together with a join among the two tables..
Right now i am using union operator for getting all the records
Is there any other method how i can get all the details together
Thanks for your time...
I was born dumb!!
 Programming made me laugh  !!!
--sid--
|
|
|
|
|
hi
try this query
select t1.student_name,t2.tutor_name ,t1.points from table1 t1,table2 t2 where t1.tutor1_id=t2.tutor_id ......
but i think u should not maintain the table1 like this (as u did)
try this way...
studentname//tutor//points
john // 101 // 4
john// 102 // 5
and so on
if u feel its voilating normalization then split it into two tables.
happy coding
|
|
|
|
|
Hi,
Can u please tell me what is the exact output u require.
Also can u please provide me with the table structure of the first table
student_name // tutor1_id // points // tutor2_id // points ...
what does this ... indicate
Thanking you in Advance
Regards
Pratik Shah
|
|
|
|
|
Hi Forum,
I am having some really iritating problems with an simple input page which should pass parameters into a stored procedure from the text boxes first and last name.
I keep getting the error during exection of sp_myinsert, pfirstname not defined, every time i try to submit the form
Has anyone got any suggestions I have giving my code for procedure and page
many thanks
boy
--------------------------------
CREATE DEFINER=``@`localhost` PROCEDURE `sp_myInsert`(pFirstName varchar(20), pLastName varchar(30))
BEGIN
INSERT INTO Names (FirstName, LastName) values (pFirstName, pLastName);
END
-------------------------------------------
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub page_load()
End Sub
''' <summary>
''' Page_load
''' Recognised by ASP and must be provided on loading of page.
'''
''' Creates connection to database, passes stored procedure into test database
''' and fills a table, which is showing in web browser
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Sub sendData(ByVal sender As Object, ByVal e As EventArgs)
Dim litErr As New LiteralControl
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=; uid=; pwd=;database=test;"
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection,t so can pass SQL query
cmdString.Connection = connection
Try
'Set command string to equal SPROC
cmdString.CommandText = "sp_myinsert"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
Dim param As New MySqlParameter
param = cmdString.Parameters.Add("p_firstname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
param = cmdString.Parameters.Add("p_lastname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text
cmdString.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
litErr.Text = ex.Message
MsgBox(ex.Message)
End Try
End Sub
</script>
<!DOCTYPE html PUBLIC
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="vbscript" type="text/vbscript">
</script>
</head>
<body>
<form id="form1" runat="server">
ENTER FIRSTNAME<asp:TextBox runat="server" ID="txtFirstName">
</asp:TextBox><br /><br />
ENTER LAST NAME
<asp:TextBox runat="server" ID="txtLastName"></asp:TextBox>
<asp:Button runat="server" ID="submit" Text="Submit" onclick="sendData" />
</form>
</body>
</html>
|
|
|
|
|
hi
i think u have made a mistake while declaring the parameter you require in SP_insert
it should be like this
CREATE PROCEDURE getDesc
@Firstname varchar(200),
@Lastname varchar(50)
AS
begin
---- insert Statment-----------
end
|
|
|
|
|
cheers for help but i solved the issue
just in case you have lost sleep over it the problem was
the stored procedure in mySql doesn't support the @ for parameters so u declare the procedure like this
Create procedure sp_insert(IN p_firstName varchar(20), IN p_lastName varchar(20)
AS
BEGIN
INSERT
END
Need to declare them as input parameters
But the reason it wasn't insert as when ur passing the parameters into the procedure from asp you need to provide ? as the prefix, as this is mySQLs prefix.
So its done parameter.add("?p_firstname".........
Thanks
boyind
|
|
|
|
|
hi,
I want to know is it possible to access sql server db from client machine without the client sql loaded??
thanks in advancd
regards
mamatha
|
|
|
|
|
mamatha_raghu wrote: without the client sql loaded
What is client sql?
What exactly you want to do?
|
|
|
|
|
|
hi,
thanks for the reply
but iam very sorry i did not get any information about my question
plz provide any clear information
and my question was is there any possibility of accessing and sharing data of sql server from a client machine on which there is no sql client installed?
regards
mamatha
|
|
|
|
|
I thought I was quite clear :/
By the Sql Client you mean the Sql Server Native Client? If not what are you on about? "Sql Client" could mean alot of different things.
If you are on about the Sql Server Native Client then my original answer still applies. Read the link.
Yes, you can access Sql Server without the Sql Server Native Client installed, but with reduced functionality.
Here's what functionality you get for using the Sql Server Native Client:
http://msdn2.microsoft.com/en-us/library/ms131456.aspx[^]
|
|
|
|
|
The SQL Server OLE DB provider and ODBC driver, plus associated network libraries, are part of MDAC (Microsoft Data Access Components) for SQL Server 2000 and earlier. At least MDAC 2.6 is required for accessing SQL Server 2000.
Since Windows 2000, MDAC is part of the operating system. Windows 2000 shipped version 2.5 so requires updating to access SQL Server 2000. Windows XP SP2 ships the latest redistributable version 2.8 SP1. Windows Server 2003 SP1 ships with MDAC 2.8 SP2 which is not available separately. Basically, on Windows XP or later you don't need to install extra software to access SQL Server 2000 or earlier.
The .NET Framework implements the SQL Server access protocol natively, but requires the network libraries from MDAC.
You can access SQL Server 2005 using the SQLOLEDB provider for ADO/OLE DB, SqlConnection from .NET 1.1, and the SQL Server ODBC driver. However, the old provider does not support many new features of SQL Server 2005. To get full functionality, you need to install and use SQL Native Client (for ADO/OLE DB/ODBC), or use .NET Framework 2.0 or later.
For ADO/OLE DB, specify SQLNCLI rather than SQLOLEDB. For ODBC, use the 'SQL Native Client' driver rather than the 'SQL Server' driver.
|
|
|
|
|
hi, can anybody give me an idea as to what is the sequence of events carried out to build and execute .dtsx packages in SSIS. Coz i want to be able to call the same methods in the same sequence from my C#.NET ETL application.Please help
|
|
|
|
|
i have a pull subscriptions .
and i need run this pull subscription by manual or
i mean execute this replcation by T-Sql or class into FramWork
123
|
|
|
|
|
Sir!
I am trying to develop a computer based Result Tabulation System for the school I work in.
I have designed the tables for Teachers, Classes, Students etc. but am stuck with the design of tables for exam system itself. Can you please guide me as to how better it could be done?
The examination system of school is as follows.
1. There are Two Terms in an academic year
2. There are two Bimontlhy's(BM) in each term
3. There are Four Class works(cw), One Oral Project(OP) and One Assessment Test(AT) in one Bimonthly
4. The aggregate of all the class works and OP and ATs make one Bimonlthly
Its Like
cw1+cw2+cw3+cw4+OP+AT = BiMonthly(BM)
5. The aggregate of two Bi Monthly and Term Exams make A Term Assements
and
BM1+BM2+First Term Exam = First Term
I am wondering as how to make normalized tables and avoid any anomalies.
Should I make separate tables for Classworks like
tblClasswork: cwID, cwname, cwshort
1 , Classwork1, cw1
and same for AT and OPs.
and them make a table for Bimonthly to Put CWID in it ...
and then for term?
I have also tried to create a table named
tblExamData with fields: stuID, teacherID, subjectID, sessionID, cwID, opID, atID, bmID, termID
but it won't serve the purpose coz it will store the information about CWs, Ops and Ats not the obtained marks of the students.
I have also tried to change it like
tblExamData: stuID, teacherID, subjectID, sessionID, cwID, cwMarks, opId, opMarks, atID, atMarks, bmID, bmMarks, termID, termMarks.
but then there may be some update, delete anomalies.?
what to do with it?
I apologise for this long write up but i am writing in a hope to get a better guideline.
thank you
regards,
|
|
|
|
|
I am also working on the same system but this one is for the university,
I will send it to you in few days be in contact with me...
my cell No. is +92-333-7112553
|
|
|
|
|
Yeah! thank you! Its nice to hear that you are working with a same kind of system!... Good to be in contact haa'n
mine cell is +92-321-4169324
Tahir
|
|
|
|
|
I'm not sure if I should be posting this here or in one of the .net forums.
I'm trying to get data from two access tables:
tblFoo
FooID FooText
1 Text1
2 Text2
3 Text3
...
lnkFoo
FooID1 FooID2
1 2
1 3
2 7
...
I want to get the FooText for every row in lnkFoo eg:
Text1 Text2
Text1 Text3
Text2 Text7
...
Using the Configure Data Adaptor wizard I can get both FKs from lnkFoo and the FooText value for either FooID1 or FooID2 by putting both tables in the query builder and dragging to link either FooID1 or FooID2 in lnkFoo to FooID in tblFoo, but if I create links to both FK's in lnkFoo no records are returned.
The nonworking query that is generated looks like this:
SELECT lnkFoo.FooID1, lnkFoo.FooID2, tblFoo.FooText, tblFoo.FooID
FROM (lnkFoo INNER JOIN
tblFoo ON lnkFoo.FooID1 = tblFoo.FooID AND lnkFoo.FooID2 = tblFoo.FooID)
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Putting a second copy of the table into the query designer and linking FooID1 and FooID2 to different instances of tblFoo worked. Is there a more graceful way to do this though?
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
select
(select FooText from tblFoo where FooID=a.FooID1),
(select FooText from tblFoo where FooID=a.FooID2)
from lnkFoo a
|
|
|
|
|
Has anybody out there come across problems when trying to search a DB of person names, when those names contain non-standard characters? I've got a DB full of Irish names, a generic search function in my app, and the user is complaining that he can't search independent of fadas. I.E., For the name Ciarán Martin, if he searches for ciaran it doesn't return a row.
This must be an issue in other countries too, I mean all you German developers, come on, with the weird S and the umlaut... How do you get around this? Or is the only way to implement a character map in the .NET code, for all the specific characters in question, to their lower case standard alphabet equivalents? I really really don't wanna do that....
All the dude ever wanted... was his rug back.
|
|
|
|
|
You need to disable accent-sensitivity in the column's collation. You can do this with the ALTER TABLE table ALTER COLUMN statement.
Generally you replace AS (for Accent Sensitive) in the name of the collation with AI (for Accent Insensitive). So if the collation is now Latin1_General_CI_AS (Windows collation, uses 1252 character set, general dictionary sort, case insensitive, accent sensitive), you should change it to Latin1_General_CI_AI .
|
|
|
|
|