Website wordpress chạy trên IIS7 không
nhận link rewrite có thể xử lý bằng cách cấu hình rewrite trong
web.config thay cho .htaccess
Yêu cầu IIS7 đã install URL Rewrite Module. Set rule rewrite trong web.config như sau
Thứ Sáu, 30 tháng 5, 2014
Thứ Ba, 15 tháng 4, 2014
[PLESK] How to retrieve Plesk admin password on Windows
How to retrieve Plesk admin password on Windows
Resolution
Plesk 12.5
plesksrvclient.exe utility located in the %plesk_bin% folder to set up a new password or retrieve the old one.You can set up a new password by running the following command:
"%plesk_bin%\plesksrvclient" -set true You can also retrieve the current password by running this utility with the following command:
"%plesk_bin%\plesksrvclient" -getTo retrieve the password in the command line, you can use the "-nogui" option:
"%plesk_bin%\plesksrvclient" -get -nogui > plesk_password.txtAfter that, you can find the retrieved Plesk password in the
plesk_password.txt file. https://support.plesk.com/hc/en-us/articles/213410689
Plesk 17.8
Password Admin Plesk
plesk bin admin --set-admin-password -passwd "your_new_password"
Retrieve administrator's Plesk database password on Plesk 17.8 for Windows
In Plesk 17.8 included "plesk sbin psadb" utility for operate with admin DB password. To use it connect to the server via RDP and open cmd.exe as Administrator
plesk sbin psadb --help
Usage: psadb [OPTIONS]...
-g, --get-admin-password show the Plesk system databases Admin's password in console.
-c, --copy-admin-password copy the Plesk system databases Admin's password to clipboard.
-s, --set-admin-password --password=<new password> set the new Plesk system databases Admin's password in the database
and update it in Plesk.
-u, --update-admin-password --password=<new password> update the Plesk system databases Admin's password in Plesk only.
-h, --help display this help and exit
To reach administrator's password for Plesk database execute the following:
plesk sbin psadb --get-admin-password
Chủ Nhật, 13 tháng 4, 2014
[IIS] How To Configure PassivePortRange In IIS
How to add PassivePortRange in IIS and firewall exception fot Microsoft FTP service (MSFTPSVC) in windows server ?
Applicable to : Windows 2000 Server with IIS5Windows 2003 Server with IIS6
Windows 2008 Server with IIS7
To work FTP passive connection properly we have to do two things
A) Add Passive port range in IIS
B) Add firewall exception in windows firewall
For Windows 2000 Server
A) Add Passive port range in IISConfigure PassivePortRange via Registry Editor
1. Start Registry Editor (Regedt32.exe).
2. Locate the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msftpsvc\Parameters\
3. Add a value named “PassivePortRange” (without the quotation marks) of type REG_SZ.
4. Close Registry Editor.
5. Restart the FTP service.
Note: The range that FTP will validate is from 5001 to 65535.
B) Add firewall exception in windows firewall
To add a range of ports to Windows Firewall from the Command Line
1. Click Start, click Run, type cmd, and then click OK.
2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in ” “.
FOR /L %I IN (5500,1,5701) DO netsh firewall add portopening TCP %I "Passive FTP"%I
3. Each port in the range will be added with an “OK” confirmation.
Or you can manually add the port exception as follows.
1. Click Start >> Run >> firewall.cpl ( Hit enter) , and select the Exceptions tab.
2. Click the Add Port button.
3. Enter a Name for the Exception and the first number in the port range.
4. Click TCP if not already selected and click OK.
5. Repeat for each port in the range – for large ranges see the end of the document.
6. Enable the Windows Firewall on the General Tab.
For Windows 2003 Server
A) Add Passive port range in IISa) To Enable Direct Metabase Edit
1. Open the IIS Microsoft Management Console (MMC).
2. Right-click on the Local Computer node.
3. Select Properties.
4. Make sure the Enable Direct Metabase Edit checkbox is checked.
b) Configure PassivePortRange via ADSUTIL script
1. Click Start, click Run, type cmd, and then click OK.
2. Type cd Inetpub\AdminScripts and then press ENTER.
3. Type the following command from a command prompt.
adsutil.vbs set /MSFTPSVC/PassivePortRange “5500-5700″
4. Restart the FTP service.
You’ll see the following output, when you configure via ADSUTIL script:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001.
All rights reserved.PassivePortRange : (STRING) “5500-5700″
B) Add firewall exception in windows firewall
To add a range of ports to Windows Firewall from the Command Line
1. Click Start, click Run, type cmd, and then click OK.
2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in ” “.
FOR /L %I IN (5500,1,5701) DO netsh firewall add portopening TCP %I "Passive FTP"%I
3. Each port in the range will be added with an “OK” confirmation.
Or you can manually add the port exception as follows.
1. Click Start >> Run >> firewall.cpl ( Hit enter) , and select the Exceptions tab.
2. Click the Add Port button.
3. Enter a Name for the Exception and the first number in the port range.
4. Click TCP if not already selected and click OK.
5. Repeat for each port in the range – for large ranges see the end of the document.
6. Enable the Windows Firewall on the General Tab.
For Windows 2008 Server
A) Add Passive port range in IIS
1. Go to IIS 7.0 Manager. In the Connections pane, click the server-level node in the tree.
2. Double-click the FTP Firewall Support icon in the list of features.
3. Enter a range of values for the Data Channel Port Range.
4. Once you have entered the port range for your FTP service, click Apply in the Actions pane to save your configuration settings.
Notes:
1. The valid range for ports is 1024 through 65535. (Ports from 1 through 1023 are reserved for use by system services.)
2. You can enter a special port range of “0-0″ to configure the FTP server to use the Windows TCP/IP dynamic port range. The default dynamic port range in windows 2008 server is from 49152 to 65535.
You can view this details by issuing the folowing command in the server.
C:\Users\Administrator>netsh int ipv4 show dynamicport tcp
3. For additional information, please see the following Microsoft Knowledge Base articles:
* 929851 – http://support.microsoft.com/kb/929851/
4. This port range will need to be added to the allowed settings for your firewall server.
To configure the external IPv4 Address for a Specific FTP Site
1. Go to IIS 7.0 Manager. In the Connections pane, click the FTP site that you created earlier in the tree, Double-click the FTP Firewall Support icon in the list of features.
2. Enter the IPv4 address of the external-facing address of your firewall server for the External IP Address of Firewall setting.
3. Once you have entered the external IPv4 address for your firewall server, click Apply in the Actions pane to save your configuration settings.
B. Add firewall exception in windows firewall
To add a range of ports to Windows Firewall from the Command Line
1. Click Start, click Run, type cmd, and then click OK.
2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in ” “.
3. FOR /L %I IN (49152,1,65535) DO netsh advfirewall firewall add rule name="Passiveport"%I dir=out action=allow protocol=TCP localport=%I
4. Each port in the range will be added with an “OK” confirmation.
The command to add individual port in exception is pasting below.
C:\Users\Administrator>netsh advfirewall firewall add rule name="OpenPort65535" dir=out action=allow protocol=TCP localport=65535
Reference : http://support.microsoft.com/kb/555022
http://learn.iis.net/page.aspx/309/configuring-ftp-firewall-settings/
Thứ Bảy, 12 tháng 4, 2014
[IIS] IIS7 Custom Error not working
II7 customError not working
chinh trong web.config
<httpErrors errorMode="Custom" existingResponse="Replace">
chinh trong IIS -> Configuration Editor (trong cụm Management) -> chỉnh system.webServer/httpErrors
chinh trong web.config
<httpErrors errorMode="Custom" existingResponse="Replace">
chinh trong IIS -> Configuration Editor (trong cụm Management) -> chỉnh system.webServer/httpErrors
Thứ Tư, 9 tháng 4, 2014
[ASP.NET][IIS] SesstionState : Session state can only be used when enableSessionState is set to true
Error
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
You need to :
1. include a <pages... > attribute in web.config :
<pages enableSessionState = "true" />
*or*
2. enable SessionState in the <%@ Page ...%> directive in your page :
<%@ Page enableSessionState = "true" %>
Also, the System.Web.SessionStateModule should exist in your
<httpModules> section in the application configuration.
Hoặc:
Vào IIS -> site -> modules -> session bỏ check mục “Invoke only for request to ASP.NET applications or managed handler”
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
You need to :
1. include a <pages... > attribute in web.config :
<pages enableSessionState = "true" />
*or*
2. enable SessionState in the <%@ Page ...%> directive in your page :
<%@ Page enableSessionState = "true" %>
Also, the System.Web.SessionStateModule should exist in your
<httpModules> section in the application configuration.
Hoặc:
Vào IIS -> site -> modules -> session bỏ check mục “Invoke only for request to ASP.NET applications or managed handler”
[MSSQL] Full Text Search/Full Text Index
Check full text search install
SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')
IF IT RETURNS 1, fulltextsearch functionality is installed in your server.
SELECT DATABASEPROPERTY('databasename','isfulltextenabled')
output : 1 then is enabled 0 then not
Enable a Database for Full-Text Indexing (SQL Server Management Studio)
http://technet.microsoft.com/en-us/library/ms403375%28v=sql.90%29.aspx
In Microsoft SQL Server 2005, by default, all user-created databases are full-text enabled. However, there may be situations in which full-text indexing has been disabled.
SELECT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')
IF IT RETURNS 1, fulltextsearch functionality is installed in your server.
SELECT DATABASEPROPERTY('databasename','isfulltextenabled')
output : 1 then is enabled 0 then not
Enable a Database for Full-Text Indexing (SQL Server Management Studio)
http://technet.microsoft.com/en-us/library/ms403375%28v=sql.90%29.aspx
In Microsoft SQL Server 2005, by default, all user-created databases are full-text enabled. However, there may be situations in which full-text indexing has been disabled.
-
In Object Explorer, expand the server group, right-click
the database for which you want to enable full-text indexing, and then
select Properties.
-
Select the Files page, and then select Use full-text indexing.
Thứ Năm, 3 tháng 4, 2014
[IIS] Import / Export application pool/website config
To Export the Application Pools on IIS 7 :
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
To import the Application Pools:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
To Export all you’re website:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
This will export all the websites on you’re webserver, therefor you need to edit the sites.xml and remove the websites that you do not need to import for example:
To Import the website:
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
It’s also possible to export a single website or application pool all you need to do is add the name of the Application Pool or Website to the command line:
To export/import a single application pool:
%windir%\system32\inetsrv\appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml
Import:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\myapppool.xml
To export/import a single website:
%windir%\system32\inetsrv\appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml
Import:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml
http://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
To import the Application Pools:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
To Export all you’re website:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
This will export all the websites on you’re webserver, therefor you need to edit the sites.xml and remove the websites that you do not need to import for example:
To Import the website:
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
It’s also possible to export a single website or application pool all you need to do is add the name of the Application Pool or Website to the command line:
To export/import a single application pool:
%windir%\system32\inetsrv\appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml
Import:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\myapppool.xml
To export/import a single website:
%windir%\system32\inetsrv\appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml
Import:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml
http://www.microsoftpro.nl/2011/01/27/exporting-and-importing-sites-and-app-pools-from-iis-7-and-7-5/
[MSSQL] Shrink Database MSSQL
http://msdn.microsoft.com/en-us/library/ms189493%28v=sql.90%29.aspx
Example:
A. Shrinking a data file to a specified target size
The following example shrinks the size of a data file named DataFile1 in the UserDB user database to 7 MB.
USE UserDB;
GO
DBCC SHRINKFILE (DataFile1, 7);
GO
B. Shrinking a log file to a specified target size
The following example shrinks the log file in the AdventureWorks database to 1 MB. To allow the DBCC SHRINKFILE command to shrink the file, the file is first truncated by setting the database recovery model to SIMPLE.
USE AdventureWorks;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE AdventureWorks
SET RECOVERY FULL;
GO
C. Truncating a data file
The following example truncates the primary data file in the AdventureWorks database. The sys.database_files catalog view is queried to obtain the file_id of the data file.
USE AdventureWorks;
GO
SELECT file_id, name
FROM sys.database_files;
GO
DBCC SHRINKFILE (1, TRUNCATEONLY);
D. Emptying a file
The following example demonstrates the procedure for emptying a file so that it can be removed from the database. For the purposes of this example, a data file is first created and it is assumed that the file contains data.
USE AdventureWorks;
GO
-- Create a data file and assume it contains data.
ALTER DATABASE AdventureWorks
ADD FILE (
NAME = Test1data,
FILENAME = 'C:\t1data.ndf',
SIZE = 5MB
);
GO
-- Empty the data file.
DBCC SHRINKFILE (Test1data, EMPTYFILE);
GO
-- Remove the data file from the database.
ALTER DATABASE AdventureWorks
REMOVE FILE Test1data;
Example:
A. Shrinking a data file to a specified target size
The following example shrinks the size of a data file named DataFile1 in the UserDB user database to 7 MB.
USE UserDB;
GO
DBCC SHRINKFILE (DataFile1, 7);
GO
B. Shrinking a log file to a specified target size
The following example shrinks the log file in the AdventureWorks database to 1 MB. To allow the DBCC SHRINKFILE command to shrink the file, the file is first truncated by setting the database recovery model to SIMPLE.
USE AdventureWorks;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE AdventureWorks
SET RECOVERY FULL;
GO
C. Truncating a data file
The following example truncates the primary data file in the AdventureWorks database. The sys.database_files catalog view is queried to obtain the file_id of the data file.
USE AdventureWorks;
GO
SELECT file_id, name
FROM sys.database_files;
GO
DBCC SHRINKFILE (1, TRUNCATEONLY);
D. Emptying a file
The following example demonstrates the procedure for emptying a file so that it can be removed from the database. For the purposes of this example, a data file is first created and it is assumed that the file contains data.
USE AdventureWorks;
GO
-- Create a data file and assume it contains data.
ALTER DATABASE AdventureWorks
ADD FILE (
NAME = Test1data,
FILENAME = 'C:\t1data.ndf',
SIZE = 5MB
);
GO
-- Empty the data file.
DBCC SHRINKFILE (Test1data, EMPTYFILE);
GO
-- Remove the data file from the database.
ALTER DATABASE AdventureWorks
REMOVE FILE Test1data;
[MSSQL] Enable Broker in MSSQL
Enabling Service Broker
The following T-Sql enables or disabled service broker on SqlServer 2005. The Service Broker is required by .net for SqlCacheDependency support
-- Enable Service Broker:
ALTER DATABASE [Database Name] SET ENABLE_BROKER;
-- Disable Service Broker:
ALTER DATABASE [Database Name] SET DISABLE_BROKER;
Is Service Broker enabled?
To determine whether or not Service Broker is enabled for a particular database, execute the following T-SQL
SELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name';
is_broker_enabled will be 1 if Service Broker is enabled for the given database, otherwise it'll be 0.
The following T-Sql enables or disabled service broker on SqlServer 2005. The Service Broker is required by .net for SqlCacheDependency support
-- Enable Service Broker:
ALTER DATABASE [Database Name] SET ENABLE_BROKER;
-- Disable Service Broker:
ALTER DATABASE [Database Name] SET DISABLE_BROKER;
Is Service Broker enabled?
To determine whether or not Service Broker is enabled for a particular database, execute the following T-SQL
SELECT is_broker_enabled FROM sys.databases WHERE name = 'Database name';
is_broker_enabled will be 1 if Service Broker is enabled for the given database, otherwise it'll be 0.
[MSSSQL] Xem số connection vào DB MSSQL
-- Get a count of SQL connections by login_name
select loginame, count(loginame)as Connections from master.dbo.sysprocesses
group by loginame
ORDER BY Connections desc
-----SQL 2012 tro len
SELECT DB_NAME(database_id) as DBName,
login_name,
COUNT(session_id) as NumberOfConnections
FROM sys.dm_exec_sessions
GROUP BY database_id, login_name
order by NumberOfConnections desc;
-- Get a count of SQL connections by IP address
SELECT ec.client_net_address, es.[program_name],
es.[host_name], es.login_name,
COUNT(ec.session_id) AS [connection count]
FROM sys.dm_exec_sessions AS es
INNER JOIN sys.dm_exec_connections AS ec
ON es.session_id = ec.session_id
GROUP BY ec.client_net_address, es.[program_name], es.[host_name], es.login_name
ORDER BY [connection count] desc;
select loginame, count(loginame)as Connections from master.dbo.sysprocesses
group by loginame
ORDER BY Connections desc
-----SQL 2012 tro len
SELECT DB_NAME(database_id) as DBName,
login_name,
COUNT(session_id) as NumberOfConnections
FROM sys.dm_exec_sessions
GROUP BY database_id, login_name
order by NumberOfConnections desc;
-- Get a count of SQL connections by IP address
SELECT ec.client_net_address, es.[program_name],
es.[host_name], es.login_name,
COUNT(ec.session_id) AS [connection count]
FROM sys.dm_exec_sessions AS es
INNER JOIN sys.dm_exec_connections AS ec
ON es.session_id = ec.session_id
GROUP BY ec.client_net_address, es.[program_name], es.[host_name], es.login_name
ORDER BY [connection count] desc;
[MSSQL] Modify default schema DB MSSQL
exec sp_MSforeachtable "ALTER SCHEMA dbo TRANSFER ? PRINT '? modified' "
=>change schema all table
EXEC('sp_changeobjectowner @objname = ''username.tablename'', @newowner = dbo')
Hoặc có thể chạy lệnh để thay đổi schema từ tên user.table --> dbo.table
USE ngochienco;
GO
ALTER SCHEMA dbo TRANSFER ngochien3101.orderlist;
GO
Change all object in database (table, procedure, view)
Part 1
Open Microsoft SQL Server Management Studio and log in.
Click the New Query button.
Paste the following script into the New Query box changing oldschema to the name of the current schema:
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + o.Name
FROM sys.Objects o
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id
WHERE s.Name = 'oldschema'
And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V')
Click Execute
This query will result in output in the Results box which looks similar to the output below:
ALTER SCHEMA dbo TRANSFER yourschema.Table1
ALTER SCHEMA dbo TRANSFER yourschema.Table2
ALTER SCHEMA dbo TRANSFER yourschema.Table3
Part 2
Click the New Query button.
Paste the queries from the output of Part 1 into your new Query box
Click Execute
This will transfer the schema name across to the new schema, also changing the stored procedures and views.
Cách 2:
/*
Change ALL database object ownership to dbo, including;
U = user table
V = view
s = system table
p = stored proc
FN = function
Variables:
%%DATABASENAME%% - Database Name you're updating
%%CURRENTOBJECTOWNERNAME%% - CURRENT object owner name
*/
declare @object varchar(517)
declare @dbname nvarchar( 128 )
/* BE SURE TO DECLARE THE CORRECT DATABASE HERE!!!! */
SELECT @dbname = '%%DATABASENAME%%'
declare objects cursor for select name
from sysobjects o
where o.type in ('U','V','S','P','FN') and
convert(sysname,user_name(o.uid)) = '%%CURRENTOBJECTOWNERNAME%%' /* this is the database-USER you are changing FROM */
open objects
while(1=1)
begin
fetch next from objects into @object
if @@fetch_status < 0 break
exec ('sp_changeobjectowner ' + '''' + '%%CURRENTOBJECTOWNERNAME%%' + '.' + @object + '''' + ', ' + '''' + 'dbo' + '''' )
end
deallocate objects
=>change schema all table
EXEC('sp_changeobjectowner @objname = ''username.tablename'', @newowner = dbo')
Hoặc có thể chạy lệnh để thay đổi schema từ tên user.table --> dbo.table
USE ngochienco;
GO
ALTER SCHEMA dbo TRANSFER ngochien3101.orderlist;
GO
Change all object in database (table, procedure, view)
Part 1
Open Microsoft SQL Server Management Studio and log in.
Click the New Query button.
Paste the following script into the New Query box changing oldschema to the name of the current schema:
SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + o.Name
FROM sys.Objects o
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id
WHERE s.Name = 'oldschema'
And (o.Type = 'U' Or o.Type = 'P' Or o.Type = 'V')
Click Execute
This query will result in output in the Results box which looks similar to the output below:
ALTER SCHEMA dbo TRANSFER yourschema.Table1
ALTER SCHEMA dbo TRANSFER yourschema.Table2
ALTER SCHEMA dbo TRANSFER yourschema.Table3
Part 2
Click the New Query button.
Paste the queries from the output of Part 1 into your new Query box
Click Execute
This will transfer the schema name across to the new schema, also changing the stored procedures and views.
Cách 2:
/*
Change ALL database object ownership to dbo, including;
U = user table
V = view
s = system table
p = stored proc
FN = function
Variables:
%%DATABASENAME%% - Database Name you're updating
%%CURRENTOBJECTOWNERNAME%% - CURRENT object owner name
*/
declare @object varchar(517)
declare @dbname nvarchar( 128 )
/* BE SURE TO DECLARE THE CORRECT DATABASE HERE!!!! */
SELECT @dbname = '%%DATABASENAME%%'
declare objects cursor for select name
from sysobjects o
where o.type in ('U','V','S','P','FN') and
convert(sysname,user_name(o.uid)) = '%%CURRENTOBJECTOWNERNAME%%' /* this is the database-USER you are changing FROM */
open objects
while(1=1)
begin
fetch next from objects into @object
if @@fetch_status < 0 break
exec ('sp_changeobjectowner ' + '''' + '%%CURRENTOBJECTOWNERNAME%%' + '.' + @object + '''' + ', ' + '''' + 'dbo' + '''' )
end
deallocate objects
[MSSQL] FIX DATABASE SUSPECT
use master
EXEC sp_resetstatus dbname
ALTER DATABASE dbname SET EMERGENCY
DBCC checkdb(dbname)
ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (dbname, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE dbname SET MULTI_USER
Đăng ký:
Bài đăng (Atom)
