数据库遍历
create table #tt ( name nvarchar(50), rows char(50), reserved varchar(50), data varchar(50), index_size varchar(50), unused varchar(50) ) go --排序所有的表,按行数 insert #tt exec sp_msforeachtable 'exec sp_sp
create table #tt ( name nvarchar(50), rows char(50), reserved varchar(50), data varchar(50), index_size varchar(50), unused varchar(50) ) go --排序所有的表,按行数 insert #tt exec sp_msforeachtable 'exec sp_sp
rem auther:www.yumi-info.com rem date:20171222 rem ******MySQL backup start******** @echo off forfiles /p "D:\phpStudy\backup" /m backup_*.sql -d -30 /c "cmd /c del /f @path" set &
set rq=%date:~0,10% rem exp dlsjzs/dlsjzs@orcl file=d:\dbbak\dlsjzs%date:~0,4%%date:~5,2%%date:~8,2%.dmp expdp dlsjzs/dlsjzs@orcl logfile=log.log directory=expdp_dmp dumpfile
生成数据库快照declare @query varchar(1000) declare @DatabaseName varchar(128) declare @snapshotName varchar(128) declare @snapDataName varchar(128) declare @snapFileName varchar(128) declare @snapFilePath va
SQL Server中获取所有数据库名Select Name FROM Master.dbo.SysDatabases orDER BY Name方式一(多库备份):--使用拼凑SQL的方式 DECLARE @SQL VARCHAR(MAX) SELECT @SQL = COALESCE(@SQL,'') + ' BACKUP DATABASE '+ QUOTENAME(name,'[]') /