谁会用dtc进行数据备份与还原了,普通的数据库备份与还原太慢了!

xingxingxiangrong 2009-03-08 08:54:32
rt!

...全文
122 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqq_chen 2009-03-11
  • 打赏
  • 举报
回复
不能再回答了,以后很长一段时间内不上csdn了。

老版的csdn没事还可以看看,新版的怎么看怎么不舒服。


其实已经很长时间没有做技术,这两天有空才上来看看,结果一个老朋友也没看到,看来大家都已经不上了,哎!

做技术挺累人的,不过问题解决了,也很有乐趣。

老了,现在应该是年轻人的天下了,加油啊!年青人!!!
cqq_chen 2009-03-11
  • 打赏
  • 举报
回复
我的是Access->sql
这根本就不是问题了。

如果你把这理解成备份,问题就大了。

数据结构,比如索引、主键、check之类的用这种方式是不能copy的。特别是自动ID更是大有问题。
xingxingxiangrong 2009-03-11
  • 打赏
  • 举报
回复
我是sql--〉sql 一个数据库上导出了
不是sql-->access,而且是在一个数据库上导出,相当于备份,不知道我理解的对么
cqq_chen 2009-03-11
  • 打赏
  • 举报
回复
跟踪得到吗?我的和你的很类似,我是用来导入大量Access中的数据的,没有关系。
xingxingxiangrong 2009-03-11
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 cqq_chen 的回复:]
看第5楼的回答,再试一次。
[/Quote]
改了Public Sub Main()运行完还是没动静,到底是为什么了


Private Sub Command1_Click()
Main
End Sub


或是直接设sub main 为启动项都不行
嗷嗷叫的老马 2009-03-11
  • 打赏
  • 举报
回复
汗,楼上很久没出现了.......
cqq_chen 2009-03-10
  • 打赏
  • 举报
回复
看第5楼的回答,再试一次。
cqq_chen 2009-03-10
  • 打赏
  • 举报
回复
Private Sub Main()
你没有修改啊!兄弟仔细一些
xingxingxiangrong 2009-03-10
  • 打赏
  • 举报
回复
运行还没没动静
xingxingxiangrong 2009-03-10
  • 打赏
  • 举报
回复

'---------------------------------------------------------------------------
' Save or execute package
'---------------------------------------------------------------------------

'goPackage.SaveToSQLServer "(local)", "sa", ""
goPackage.Execute
goPackage.Uninitialize
'to save a package instead of executing it, comment out the executing package line above and uncomment the saving package line
Set goPackage = Nothing

Set goPackageOld = Nothing

End Sub


'------------- define Task_Sub1 for task Copy Data from test to [te].[dbo].[test] 任务 (Copy Data from test to [te].[dbo].[test] 任务)
Public Sub Task_Sub1(ByVal goPackage As Object)

Dim oTask As DTS.Task
Dim oLookup As DTS.Lookup

Dim oCustomTask1 As DTS.DataPumpTask2
Set oTask = goPackage.Tasks.New("DTSDataPumpTask")
Set oCustomTask1 = oTask.CustomTask

oCustomTask1.Name = "Copy Data from test to [te].[dbo].[test] 任务"
oCustomTask1.Description = "Copy Data from test to [te].[dbo].[test] 任务"
oCustomTask1.SourceConnectionID = 1
oCustomTask1.SourceSQLStatement = "select [id],[name] from [te].[dbo].[test]"
oCustomTask1.DestinationConnectionID = 2
oCustomTask1.DestinationObjectName = "[te].[dbo].[test]"
oCustomTask1.ProgressRowCount = 1000
oCustomTask1.MaximumErrorCount = 0
oCustomTask1.FetchBufferSize = 1
oCustomTask1.UseFastLoad = True
oCustomTask1.InsertCommitSize = 0
oCustomTask1.ExceptionFileColumnDelimiter = "|"
oCustomTask1.ExceptionFileRowDelimiter = vbCrLf
oCustomTask1.AllowIdentityInserts = True
oCustomTask1.FirstRow = 0
oCustomTask1.LastRow = 0
oCustomTask1.FastLoadOptions = 2
oCustomTask1.ExceptionFileOptions = 1
oCustomTask1.DataPumpOptions = 0

Call oCustomTask1_Trans_Sub1(oCustomTask1)


goPackage.Tasks.Add oTask
Set oCustomTask1 = Nothing
Set oTask = Nothing

End Sub

Public Sub oCustomTask1_Trans_Sub1(ByVal oCustomTask1 As Object)

Dim oTransformation As DTS.Transformation2
Dim oTransProps As DTS.Properties
Dim oColumn As DTS.Column
Set oTransformation = oCustomTask1.Transformations.New("DTS.DataPumpTransformCopy")
oTransformation.Name = "DirectCopyXform"
oTransformation.TransformFlags = 63
oTransformation.ForceSourceBlobsBuffered = 0
oTransformation.ForceBlobsInMemory = False
oTransformation.InMemoryBlobSize = 1048576
oTransformation.TransformPhases = 4

Set oColumn = oTransformation.SourceColumns.New("id", 1)
oColumn.Name = "id"
oColumn.Ordinal = 1
oColumn.Flags = 16
oColumn.Size = 0
oColumn.DataType = 3
oColumn.Precision = 0
oColumn.NumericScale = 0
oColumn.Nullable = False

oTransformation.SourceColumns.Add oColumn
Set oColumn = Nothing

Set oColumn = oTransformation.SourceColumns.New("name", 2)
oColumn.Name = "name"
oColumn.Ordinal = 2
oColumn.Flags = 104
oColumn.Size = 50
oColumn.DataType = 129
oColumn.Precision = 0
oColumn.NumericScale = 0
oColumn.Nullable = True

oTransformation.SourceColumns.Add oColumn
Set oColumn = Nothing

Set oColumn = oTransformation.DestinationColumns.New("id", 1)
oColumn.Name = "id"
oColumn.Ordinal = 1
oColumn.Flags = 16
oColumn.Size = 0
oColumn.DataType = 3
oColumn.Precision = 0
oColumn.NumericScale = 0
oColumn.Nullable = False

oTransformation.DestinationColumns.Add oColumn
Set oColumn = Nothing

Set oColumn = oTransformation.DestinationColumns.New("name", 2)
oColumn.Name = "name"
oColumn.Ordinal = 2
oColumn.Flags = 104
oColumn.Size = 50
oColumn.DataType = 129
oColumn.Precision = 0
oColumn.NumericScale = 0
oColumn.Nullable = True

oTransformation.DestinationColumns.Add oColumn
Set oColumn = Nothing

Set oTransProps = oTransformation.TransformServerProperties


Set oTransProps = Nothing

oCustomTask1.Transformations.Add oTransformation
Set oTransformation = Nothing

End Sub
xingxingxiangrong 2009-03-10
  • 打赏
  • 举报
回复

Option Explicit
Public goPackageOld As New DTS.Package
Public goPackage As DTS.Package2
Private Sub Main()
Set goPackage = goPackageOld

goPackage.Name = "新建包"
goPackage.Description = "DTS 包描述"
goPackage.WriteCompletionStatusToNTEventLog = False
goPackage.FailOnError = False
goPackage.PackagePriorityClass = 2
goPackage.MaxConcurrentSteps = 4
goPackage.LineageOptions = 0
goPackage.UseTransaction = True
goPackage.TransactionIsolationLevel = 4096
goPackage.AutoCommitTransaction = True
goPackage.RepositoryMetadataOptions = 0
goPackage.UseOLEDBServiceComponents = True
goPackage.LogToSQLServer = False
goPackage.LogServerFlags = 0
goPackage.FailPackageOnLogFailure = False
goPackage.ExplicitGlobalVariables = False
goPackage.PackageType = 0


Dim oConnProperty As DTS.OleDBProperty

'---------------------------------------------------------------------------
' create package connection information
'---------------------------------------------------------------------------

Dim oConnection As DTS.Connection2

'------------- a new connection defined below.
'For security purposes, the password is never scripted

Set oConnection = goPackage.Connections.New("SQLOLEDB")

oConnection.ConnectionProperties("Persist Security Info") = True
oConnection.ConnectionProperties("User ID") = "sa"
oConnection.ConnectionProperties("Initial Catalog") = "te"
oConnection.ConnectionProperties("Data Source") = "(local)"
oConnection.ConnectionProperties("Application Name") = "DTS 导入/导出向导"

oConnection.Name = "连接1"
oConnection.ID = 1
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "(local)"
oConnection.UserID = "sa"
oConnection.ConnectionTimeout = 60
oConnection.Catalog = "te"
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False

'If you have a password for this connection, please uncomment and add your password below.
'oConnection.Password = "<put the password here>"

goPackage.Connections.Add oConnection
Set oConnection = Nothing

'------------- a new connection defined below.
'For security purposes, the password is never scripted

Set oConnection = goPackage.Connections.New("SQLOLEDB")

oConnection.ConnectionProperties("Persist Security Info") = True
oConnection.ConnectionProperties("User ID") = "sa"
oConnection.ConnectionProperties("Initial Catalog") = "te"
oConnection.ConnectionProperties("Data Source") = "(local)"
oConnection.ConnectionProperties("Application Name") = "DTS 导入/导出向导"

oConnection.Name = "连接2"
oConnection.ID = 2
oConnection.Reusable = True
oConnection.ConnectImmediate = False
oConnection.DataSource = "(local)"
oConnection.UserID = "sa"
oConnection.ConnectionTimeout = 60
oConnection.Catalog = "te"
oConnection.UseTrustedConnection = False
oConnection.UseDSL = False

'If you have a password for this connection, please uncomment and add your password below.
'oConnection.Password = "<put the password here>"

goPackage.Connections.Add oConnection
Set oConnection = Nothing

'---------------------------------------------------------------------------
' create package steps information
'---------------------------------------------------------------------------

Dim oStep As DTS.Step2
Dim oPrecConstraint As DTS.PrecedenceConstraint

'------------- a new step defined below

Set oStep = goPackage.Steps.New

oStep.Name = "Copy Data from test to [te].[dbo].[test] 步骤"
oStep.Description = "Copy Data from test to [te].[dbo].[test] 步骤"
oStep.ExecutionStatus = 1
oStep.TaskName = "Copy Data from test to [te].[dbo].[test] 任务"
oStep.CommitSuccess = False
oStep.RollbackFailure = False
oStep.ScriptLanguage = "VBScript"
oStep.AddGlobalVariables = True
oStep.RelativePriority = 3
oStep.CloseConnection = False
oStep.ExecuteInMainThread = False
oStep.IsPackageDSORowset = False
oStep.JoinTransactionIfPresent = False
oStep.DisableStep = False
oStep.FailPackageOnError = False

goPackage.Steps.Add oStep
Set oStep = Nothing

'---------------------------------------------------------------------------
' create package tasks information
'---------------------------------------------------------------------------

'------------- call Task_Sub1 for task Copy Data from test to [te].[dbo].[test] 任务 (Copy Data from test to [te].[dbo].[test] 任务)
Call Task_Sub1(goPackage)





cqq_chen 2009-03-10
  • 打赏
  • 举报
回复
把你的bas代码copy看看!
xingxingxiangrong 2009-03-10
  • 打赏
  • 举报
回复
是么,那你给我打包一个工程发到我的邮箱 l7698082@163.com ,谢谢了
cqq_chen 2009-03-10
  • 打赏
  • 举报
回复
怪!我试过,都可行!!
xingxingxiangrong 2009-03-10
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 cqq_chen 的回复:]
Private Sub Main()
-->
Public Sub Main()

在from中调用 main就行,试看看。
[/Quote]
试过了,没反应,也不提示错误
cqq_chen 2009-03-09
  • 打赏
  • 举报
回复
Private Sub Main()
-->
Public Sub Main()

在from中调用 main就行,试看看。
xingxingxiangrong 2009-03-09
  • 打赏
  • 举报
回复
引用了,但生成的bas文件运行没没反应!
cqq_chen 2009-03-09
  • 打赏
  • 举报
回复
看明白引用了什么文件,把包导入到工程中就可以使用了。
xingxingxiangrong 2009-03-08
  • 打赏
  • 举报
回复
UP
xingxingxiangrong 2009-03-08
  • 打赏
  • 举报
回复
我拿sql导出一个bas文件,但不知道怎么用了
在嵌入式Linux下,设备树(device tree)用来描述硬件平台的各种资源,Linux内核在启动过程中,解析设备树,获取各种硬件资源来初始化硬件。设备树的overlay功能是指可以在系统运行期间动态修改设备树。一般情况下,如上图所示,设备树经过DTC编译器编译为二进制的hello.dtb文件,加载到内存,随Linux内核一起启动后,一般就无法更改了。如果我们想修改设备树,需要修改hello.dts文件文件,重新编译成二进制文件:hello.dtb,然后重新启动内核,重新解析。有了设备树的overlay功能,省去了设备树的重新编译和内核重启,我们可以直接编写一个设备树插件:overlay.dts,编译成overlay.dtbo后,直接给设备树“打补丁”,在运行期间就可以动态添加节点、修改节点...设备树的overlay功能,在很多场合都用得到,让我们的开发更加方便:外界插拔设备,无法在设备树中预先描述:耳机树莓派 + FPGA开发板基于I2C的温度传感器管脚的重新配置:PIN multiplexing修改bootcmd、分区...设备树的overlay功能,目前还没有加入到内核mainline(linux-5.10.x),但目前有些开发板和配套的BSP已经支持了,支持在系统运行期间动态修改设备树文件。如果你手头的开发板或内核平台还没有支持device tree overlay,可以学习本期课程,学习内核中设备树overlay的实现原理,如何给内核打补丁,使内核支持设备树的overlay功能。有了本期课程的学习基础,明白了设备树overlay的实现原理和运行机制,你就可以尝试在自己的开发板平台上实现这个功能了。本期课程的主要内容如下:在开发板上如何实现设备树的overlay功能Configfs文件系统的配置与挂载Configfs编程接口如何编写设备树 overlay插件设备树 overlay的编译和运行设备树overlay运行机制分析本期课程适合哪些人学习:嵌入式驱动工程师嵌入式BSP工程师嵌入式软件工程师想从事嵌入式开发的同学全网首家讲解设备树overlay的视频教程。   

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧