<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server (και άλλες databases)</title><link>https://www.dotnetzone.gr:443/cs/forums/28/ShowForum.aspx</link><description>Θέματα που αφορούν τον SQL Server (7.0, 2000, 2005) αλλά και Oracle, Access, DB2, MySQL, κλπ.</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/3072.aspx</link><pubDate>Fri, 24 Jun 2005 19:33:12 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:3072</guid><dc:creator>dbaltas</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/3072.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=3072</wfw:commentRss><description>&lt;p&gt;&lt;font style="BACKGROUND-COLOR: #efefef"&gt;Για να κάνεις restore&amp;nbsp;&amp;nbsp;μία βάση π.χ dbSample&amp;nbsp; στον SQL Server 2000, πρέπει να βεβαιωθείς ότι &lt;br /&gt;κανένα Connection στη βάση δεν είναι ανοιχτό.&lt;br /&gt;By default όταν ανοίγεις ένα Connection και έπειτα το κλείνεις αυτό μένει στο Pool για γρήγορη απάντηση σε μελλοντικά αιτήματα.&lt;br /&gt;&lt;br /&gt;Αυτό μπορείς να το λύσεις αν προσθέσεις στο ConnectionString του Connection με το οποίο έχεις ανοίξει ΠΡΟΗΓΟΥΜΕΝΩΣ τη βάση dbSample το ";pooling=false".&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2210.aspx</link><pubDate>Thu, 26 May 2005 04:20:05 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2210</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2210.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2210</wfw:commentRss><description>Για την ιστορία δεν μπόρεσα να κάνω τίποτα καλύτερο, από restart όλης της εφαρμογής μετά το restore της db (δεν είναι ότι καλύτερο σίγουρα, αλλά όταν τρέχουν deadlines δεν υπάρχει χρόνος για πολύ ψάξιμο). Ευχαριστώ για την βοήθεια &lt;img src="/forums/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;br /&gt; &lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2189.aspx</link><pubDate>Tue, 24 May 2005 22:01:44 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2189</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2189.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2189</wfw:commentRss><description>Τότε &lt;img src="/forums//emoticons/emotion-9.gif" alt="Crying" /&gt;&lt;br /&gt;&lt;br /&gt;Ακόμα και αν μπορούσες να παγώσεις το connection δεν έχει νόημα. Οτιδήποτε state είχε κρατηθεί, ανοικτά transaction ή locks θα χάνονταν με το restore. Αλλά και το άλλο process, αν δεν είχε γραφτεί για να καταλαβαίνει από "παγωμένα" connections θα άρχιζε να ρίχνει exceptions.&lt;br /&gt;&lt;br /&gt;Μου φαίνεται ότι η μόνη σου ελπίδα είναι αν καταλαβαίνει το άλλο process από πεσμένα connections και να προσπαθεί να τα ξανασηκώσει.</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2185.aspx</link><pubDate>Tue, 24 May 2005 21:30:48 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2185</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2185.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2185</wfw:commentRss><description>&lt;b&gt;&lt;span class="inlineLink"&gt;&lt;/span&gt;&lt;/b&gt;οκ, προφανώς δεν έχω το cn...:(&lt;br /&gt; &lt;br /&gt; και δυστοιχώς δεν μπορώ να αλλάξω το connection σε ένα process που δεν μου ανήκει, ε;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2184.aspx</link><pubDate>Tue, 24 May 2005 21:30:05 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2184</guid><dc:creator>KelMan</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2184.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2184</wfw:commentRss><description>&lt;p&gt;&lt;font style="BACKGROUND-COLOR: #efefef"&gt;Δήλωσε ένα CommandObject, βάλτο να κάνει "USE xxx" (όπου xxx ή άλλη DB) και σύνδεσέ το με το Connection. Κατόπιν τρέξτο με ExecuteNonQuery.&lt;br /&gt;Μην δοκιμάσεις να παίξεις με το ChangeDatabase method γιατί απλά ανοίγει ένα δεύτερο connection στη νέα DB!&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2183.aspx</link><pubDate>Tue, 24 May 2005 21:20:41 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2183</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2183.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2183</wfw:commentRss><description>&lt;font size="3"&gt; &lt;p&gt;&lt;/font&gt;Dim cmdSwitch As SqlCommand = New SqlCommand("USE MASTER", cn)&lt;br /&gt;cmdSwitch.ExecuteNonQuery()&lt;br /&gt;cmdSwitch.CommandText="USE MYDB"&lt;br /&gt;cmdSwitch.ExecuteNonQuery()&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2182.aspx</link><pubDate>Tue, 24 May 2005 21:08:20 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2182</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2182.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2182</wfw:commentRss><description>πως ακριβώς μπορώ να αλλάξω την db του συγκεκριμένου connection;&lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2180.aspx</link><pubDate>Tue, 24 May 2005 20:39:59 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2180</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2180.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2180</wfw:commentRss><description>Kυρίως γιατί δεν έχω τον κώδικα που το ανοίγει, και δεν είμαι σίγουρος για το τι ακριβώς κάνει...&lt;br /&gt; Θα δοκιμάσω την λύση που μου προτείνεις.&lt;br /&gt; Ευχαριστώ για τις άμεσες απαντήσεις. &lt;img src="/forums/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2179.aspx</link><pubDate>Tue, 24 May 2005 20:32:26 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2179</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2179.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2179</wfw:commentRss><description>&lt;p&gt;Αν είναι τόσο σημαντικό να κρατήσεις το connection, εκτέλεσε ένα USE Master ή κάποια άλλη άσχετη βάση επάνω του και μετά το restore ξανακάνε USE MyDB. Γιατί όμως να μην το κλείσεις και να το ξανανοίξεις? &lt;/p&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2178.aspx</link><pubDate>Tue, 24 May 2005 20:23:50 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2178</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2178.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2178</wfw:commentRss><description>Λοιπόν τελικά όντως έχω ένα connection ανοιχτό σε status sleeping/AWAITING COMMAND στην db που θέλω να κάνω restore. Το πρόβλημα είναι ότι δεν θέλω να κάνω kill το process γιατι το χρειάζομαι αργότερα. Γνωρίζετε κάποιο τρόπο να το κάνω suspend(η όποια άλλη κατάσταση μου επιτρέπει να κανώ το restore χωρίς πρόβλημα) και μετά το restore να το επαναφέρω.&lt;br /&gt; Ευχαριστώ&lt;br /&gt; &lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2174.aspx</link><pubDate>Tue, 24 May 2005 17:03:14 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2174</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2174.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2174</wfw:commentRss><description>&lt;p&gt;Και δεν έχει μείνει κανένα connection στο pool? Και είναι και ο SQLSERVERAGENT σταματημένος?&lt;br /&gt;&lt;br /&gt;Αν δεις την περιγραφή του λάθους (3101) αναφέρει ότι μπορείς να χρησιμοποιήσεις την εντολή ALTER DATABASE SET SINGLE_USER για να πετάξεις όλους τους χρήστες από τη βάση. Μετά το restore, κάνεις ALTER DATABASE SET MULTI_USER για να δουλεύει πάλι η βάση για πολλούς χρήστες.&lt;br /&gt;&lt;br /&gt;Τρέξε και ένα sp_who από το connection σου πριν κάνεις το restore. Ίσως να βρεις κάποιο connection που δεν περίμενες&lt;/p&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2173.aspx</link><pubDate>Tue, 24 May 2005 16:15:04 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2173</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2173.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2173</wfw:commentRss><description>Όχι, στην Master συνδέομαι. Και δεν είναι άλλος χρήστης μέσα.&lt;br /&gt;</description></item><item><title>Re: Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2157.aspx</link><pubDate>Mon, 23 May 2005 23:50:54 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2157</guid><dc:creator>Παναγιώτης Καναβός</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2157.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2157</wfw:commentRss><description>&lt;p&gt;&lt;font style="BACKGROUND-COLOR: #efefef"&gt;Μήπως το connectionstring σου κοιτάζει την ίδια βάση? Δοκίμασε να συνδεθείς στη master ή κάποια άλλη βάση πρώτα. Βεβαιώσου επίσης ότι δεν είναι κανείς άλλος συνδεδεμένος, ούτε SQL Analzer ούτε Enterprise Manager, ούτε ανοιχτό query παράθυρο μέσα στο visual studio&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Visual Basic .Net + SQL Server 2000 + restore database</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/2155.aspx</link><pubDate>Mon, 23 May 2005 23:29:09 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:2155</guid><dc:creator>aNTwNHs</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/2155.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=28&amp;PostID=2155</wfw:commentRss><description>Καλησπέρα,&lt;br /&gt; προσπαθώ να κάνω restore μια βάση σε SQL Server 2000 μεσα από VB.NET.&lt;br /&gt; &lt;pre class="source"&gt;&lt;table border="0" cellspacing="0" width="100%"&gt;&lt;tr&gt;&lt;td width="15"&gt;&lt;/td&gt;&lt;td bgcolor="lightgrey" width="15"&gt;&lt;/td&gt;&lt;td bgcolor="lightgrey"&gt;&lt;br&gt;&lt;font face="Lucida Console, Courier" size="2"&gt; &lt;br/&gt;Dim cn As System.Data.SqlClient.SqlConnection &lt;br/&gt;Try &lt;br/&gt;cn = New System.Data.SqlClient.SqlConnection(MySettings.ConnectionString) &lt;br/&gt;Dim sql As New System.Data.SqlClient.SqlCommand("restore database DatabaseName from disk = 'c:\tmp\DatabaseName.dat' with replace", cn)&lt;br/&gt;cn.Open() &lt;br/&gt;sql.ExecuteNonQuery() &lt;br/&gt;cn.Close() &lt;br/&gt;Catch ex As System.Exception &lt;br/&gt;ExceptionManager.Publish(Me, ex) &lt;br/&gt;cn.Close() &lt;br/&gt;End Try&lt;br/&gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/pre&gt;&lt;br /&gt; Πέρνω το μήνυμα: Exclusive access could not be obtained because the database in use&lt;br /&gt; &lt;br /&gt; Στην βάση δεν είναι άλλος χρήστης συνδεδεμένος (το backup με παρόμοια υλοποίηση δεν έχει πρόβλημα)&lt;br /&gt; &lt;br /&gt; Καμιά ιδέα;&lt;br /&gt;</description></item></channel></rss>