Home > Database > Mysql Tutorial > SQLSERVER手动增长日志文件和数据文件

SQLSERVER手动增长日志文件和数据文件

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:20:26
Original
1293 people have browsed it

SQLSERVER 手动 增长 日志 文件 和 数据 文件 手动 增长 日志 文件 ,实际上就是修改 日志 文件 的大小 size 的单位是MB 下面设置 日志 文件 大小是2048MB ALTER DATABASE [ GPOSDB ] MODIFY FILE (name = GPOSDB_Log,size = 2048 ) EXEC sys.[sp_helpdb] @d

SQLSERVER手动增长日志文件数据文件

手动增长日志文件,实际上就是修改日志文件的大小  size 的单位是MB

下面设置日志文件大小是2048MB

<span>ALTER</span> <span>DATABASE</span> <span>[</span><span>GPOSDB</span><span>]</span> MODIFY <span>FILE</span>(name<span>=</span>GPOSDB_Log,size<span>=</span><span>2048</span>)
Copy after login

EXEC sys.[sp_helpdb] @dbname = [GPOSDB] -- sysname

<span>--</span><span>收缩<strong>日志</strong><strong><strong>文件</strong></strong> </span>
<span>USE</span> <span>[</span><span>GPOSDB</span><span>]</span> 
<span>GO</span> 
<span>ALTER</span> <span>DATABASE</span> <span>[</span><span>GPOSDB</span><span>]</span> <span>SET</span><span> RECOVERY SIMPLE;
</span><span>GO</span>
<span>--</span><span>设置简单恢复模式 </span>
<span>DBCC</span> SHRINKFILE (GPOSDB_Log, <span>1</span><span>); 
</span><span>GO</span> 
<span>--</span><span>恢复为原模式</span>
<span>ALTER</span> <span>DATABASE</span> <span>[</span><span>GPOSDB</span><span>]</span> <span>SET</span> RECOVERY <span>FULL</span><span>;
</span><span>GO</span>
Copy after login

 

-----------------------------------------------------------------

--手动增长数据文件,实际上就是修改数据文件的大小 size 的单位是MB  下面设置日志文件大小是2048MB

<span>ALTER</span> <span>DATABASE</span> <span>[</span><span>GPOSDB</span><span>]</span> MODIFY <span>FILE</span>(name<span>=</span>GPOSDB_Data,size<span>=</span><span>2048</span>)
Copy after login

EXEC sys.[sp_helpdb] @dbname = [GPOSDB] -- sysname

--收缩数据文件  收缩为2MB

<span>USE</span> <span>[</span><span>GPOSDB</span><span>]</span> 
<span>GO</span> 
<span>DBCC</span> SHRINKFILE (N<span>'</span><span>GPOSDB_Data</span><span>'</span> , <span>2</span><span>) 
</span><span>GO</span>
Copy after login



如有不对的地方,欢迎大家拍砖o(∩_∩)o

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template