View Full Version : stop و restart کردن sql
rezaei manesh
چهارشنبه 30 شهریور 1384, 12:47 عصر
سلام
من با چه دستوری می تونم sql رو stop و start کنم؟
در کل می خوام از بانک اطلاعاتی یه کپی تهیه کنم برای این کار نیاز دارم که sql رو stop کنم و بعد کپی و بعد دوباره start کنم ؟!
حمیدرضاصادقیان
چهارشنبه 30 شهریور 1384, 14:41 عصر
دوست عزیز خوب چرا اینکارو میکنی یک لحظه بانک رو به صورت Single User دربیار بعد گزینه Auto Close رو در قسمت Option بانک تیک بزن بعد هم فایلهای مورد نظرت رو کپی کن
ولی با دستور Shutdown میتونی اینکاری که میخوای انجام ّبدی.
موفق باشی
rezaei manesh
چهارشنبه 30 شهریور 1384, 16:00 عصر
سلام
خوب حالا از دستور shutDown چطوری استفاده کنم؟
بعد که stop کردم و کارم رو انجام دادم چطور دوبار run کنم؟؟؟
rezaei manesh
چهارشنبه 30 شهریور 1384, 17:13 عصر
سلام
طریقه استفاده کردنشو پیدا کردم حالا چطور restart کنم؟
( Dim cmdE As SqlCommand = New SqlCommand(" shutDown ", cnndatabase
()cmdE.ExecuteScalar
AminSobati
چهارشنبه 30 شهریور 1384, 17:18 عصر
همچنین میتونین روی دیتابیس Right Click کنین و Take Offline انجام بدین. بعد از انجام Copy، دوباره Online کنین.
Achchan
چهارشنبه 30 شهریور 1384, 17:41 عصر
یک لحظه بانک رو به صورت Single User دربیار بعد گزینه Auto Close رو در قسمت Option بانک تیک بزن
Would you please telling me why?I understand single user mode but "Auto Close" option is for closing the connections when they are idle,It is an option for Desktop systems such as ACCESS not for enterprise class softwares such as SQL Server.If you really have many concurrent users and a busy environment then go to Management\CurrentActiivity\Process Info and there send a message and deadline for each user or application.After that deadline kill the processes(I do this using an automated script) and the bring your database offline so you can copy the datafiles without problem.
Please do not guide other ones to dangerous ways,it can be misleading.I have seen AutoClose as a dangerous performance killer especially for OLTP sysetms with many concurrent users.
-Best wishes and feel free to mail me: baronc_rampantc@yahoo.ca
rezaei manesh
چهارشنبه 30 شهریور 1384, 18:38 عصر
سلام
من می خوام همه کار ها رو خود کاربر بکه توسط برنامه
اگه می شه دستوراتشو بگین
اگه run کردن sql هم بگین ممنون می شم
راستی یکی دیگه از مشکلاتم اینه که چگونه مسیر بانک رو پیدا کنم ؟؟؟
Achchan
پنج شنبه 31 شهریور 1384, 15:24 عصر
For finding the path of a database files including datafiles and transaction logs you could issue the followings:
use pubs
go
select name,filename from sysfiles
go
Would you please telling more about what do you want to do?Who will be the end user?He/She will backup and restore?By which tool or script?What is your backup strategy?
Best wishes
m-khorsandi
شنبه 02 مهر 1384, 08:47 صبح
درود
میتونم ازتون بپرسم که برای چی میخواهید که MSSQLServer رو Stop کنید و از DB کپی بگیرید؟
این کاری که قصد انجام اون رو دارید مانند Backup گرفتن هست ، که برای اون راههای بهتری وجود داره.
rezaei manesh
شنبه 02 مهر 1384, 08:57 صبح
سلام
من منظور شما رو متوجه نمی شم می شه بیشتر و فارسی توضیح بدین؟
در ضمن من یه راه حل عملی می خوام(می کاربر با یک کلیک از بانک پشتیبان بگیره و با یک کلیک restore بکنه از داخل برنامه
من هم این روش رو انخاب کردم که توش موندم
من می خوام دو تا فایل بانک رو فشرده کنم و در یه جای دیگه کپی کنم و در مرحله بازیابی اینو برگشت بدم
حالا مشکل من پیدا کردم مسیر بانک و restart کردن sql هستش؟!!!!!!!!!!!!!!!!!!
m-khorsandi
شنبه 02 مهر 1384, 09:40 صبح
شما میتونید برای Stop کردن سرویس MSSQLSERVER از دستور SHUTDOWN استفاده کنید.
بعد از اجرای این دستور SQL دیگه پاسخگوی درخواستی نیست. برای همین برای Start کردن سرویس
مورد نظر میبایست(یا میتونی) از Command Prompt ای با این شکل استفاده کنی: net start mssqlserver
Achchan
شنبه 02 مهر 1384, 10:34 صبح
من یه راه حل عملی می خوام(می کاربر با یک کلیک از بانک پشتیبان بگیره و با یک کلیک restore بکنه از داخل برنامه من هم این روش رو انخاب کردم که توش موندم
Do you mean One-Click is practical (عملی) and the other ways are not?
There is no One-click way friend.Forget it if you want to stay in this area.
m-khorsandi
شنبه 02 مهر 1384, 12:08 عصر
Dear friend (achchan),
Do you think that your answers in English are so intersting?
.Please write your answers in Persian and study the rules
rezaei manesh
شنبه 02 مهر 1384, 12:42 عصر
خوب این دستور net start رو از توی برنامه چطور در محیط Command Prompt اجرا کنم؟
؟؟؟
m-khorsandi
شنبه 02 مهر 1384, 12:55 عصر
شما با VB کار میکنی؟؟
rezaei manesh
شنبه 02 مهر 1384, 13:29 عصر
سلام
با vb.net کار می کنم
بد جورری گیر کردم؟!!
Achchan
شنبه 02 مهر 1384, 15:26 عصر
Dear Mr.Khorsandi,
I have read the agreement of joining this forum and there is no such a rule.One more interesting thing is that the FAQ of this forum is in English itlesf! : http://www.barnamenevis.org/forum/faq.php?faq=vb_faq#faq_vb_board_usage
I have the right to post in whatever language I prefer since ther is no restriction in agreement.The most important thing for me is to make a meaningful ,didactic relationship with my peers not to post in this language or that language.
As I have mentioned in some other posts ,I think our software community is very little and young so don't restrict it with such personal feelings and preferences.Let us share knowledge with eachother instead of speaking about nuances.
-Best regards.
m-khorsandi
یک شنبه 03 مهر 1384, 08:23 صبح
یه سر به این لینک بزن:
http://www.barnamenevis.org/forum/showthread.php?t=28912
rezaei manesh
یک شنبه 03 مهر 1384, 08:41 صبح
سلام
مشکلم حل شد
یه فایلbat به پروژه اضافه کردم بعد توسط اون این دستورات رو اجرا کردم
با تشکر از همه دوستان که منو توی این قسمت کمک کردند
اگه کسی هم در این مورد کمکی خواست خوشحال می شم اگه بتونم کمکش کنم
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.