Fast Project Rollbacks

RK3308B开发板WiFi+蓝牙一体模组RTL8821CS驱动移植保姆级教程(含DTS配置与避坑点) 本文提供RK3308B开发板RTL8821CS WiFi+蓝牙模组驱动移植的完整教程,涵盖SDK环境配置、DTS设备树设置、内核编译优化及功能验证全流程。重点解析引脚复用冲突、电源管理等关键配置,并给出常见错误解决方案,帮助开发者快速实现双模通信功能。 阅读详情
 

Fast Project Rollbacks

The projects that I work on require both deployment and rollback scripts. Using a database backup as a rollback strategy is not acceptable for a number of reasons.

  • Downtime needs to be measured in minutes and the restore would take hours.
  • The project normally affects a portion of the databases so rollbacks are intended to affect the objects and data that have been deployed and not any other objects or data.
  • Visibility of the rollback steps is needed as an audit log.

I have a particular approach to scripting up the rollback of database projects that I should like to share with you.

Goals for creating rollback scripts

Code readability

All code has to be peer-reviewed and the effort involved in a thorough peer review is not always appreciated. Indeed Cisco used to publish recommendations for peer reviews that include recommendations on the following

  • The amount of code that could be expected to be peer reviewed per session.
  • The amount of time in minutes allowed in any one peer review session before a break was needed.

The figures for both the volume of code and the time spent are likely to be far lower than you would expect therefore anything you can do to make the code easier to read is going to aid the peer review process.

Remember a peer review should not be regarded as an obstacle to overcome but as an insurance policy to ensure that it won't be your code that is to blame for a production incident.

If your code is readable then the peer review can be achieved quicker and any bugs should be easier to spot.

Code readability leads to my second goal

Code Maintainability

I don't code on the fly. I put quite a bit of time and effort into my design but if I can use the analogy of the battle plan then no battle plan survives engagement with the enemy.

Things that made perfect sense in the design stage might not be practical in the real world. My code is probably going to change so it must be easy to change.

Code Durability

If a rollback script runs more than once then it should do no harm and produce no error messages. I am only concerned with rollback scripts here but the same comment also applies to deployment scripts. Ideally the both deployment and rollback scripts should produce status messages to act as a log of what has taken place.

Most of my deployments start in the very early hours of the morning when I'm fully decaffeinated so any unexpected error messages are unwelcome.

Speed of execution

Time is money. If your database is unavailable then it is costing you money. In some cases using a backup as a rollback strategy simply isn't financially feasible except as a method of last resort.

Having a script that can execute in seconds, or at the worst minutes is far better than a restore of a terabyte database that may take hours.

Script headers

I use script headers for three purposes.

  • To provider brief notes on what the script is supposed to do, prerequisites, special actions
  • To generate dynamic status messages showing the server, time of deployment, the account running the script.
  • To set session settings such as XACT_ABORT and NOCOUNT ON.

Consider the code below.

SET XACT_ABORT,NOCOUNT ON
---------------------------------------------------
USE AW_TARGET
GO
---------------------------------------------------
PRINT '---------------------------------------------------'
DECLARE 
	@CRLF CHAR(2) ,-- Carriage return and line feed
	@Deployer SYSNAME, -- The account running the script
	@DeploymentDate CHAR(20), -- The date and time of execution
	@DBName SYSNAME -- The database name to which the action applies.
SET @CRLF=CHAR(13)+CHAR(10)
SET @Deployer = SUSER_SNAME()
SET @DeploymentDate = convert(CHAR(20),getdate(),120)
SET @DBName = DB_NAME()
RAISERROR('DEPLOYMENT SERVER: %s%sDEPLOYER: %s%sDeployment Date: %s%sDatabase: %s',10,1,@@SERVERNAME,@CRLF,@Deployer,@CRLF, @DeploymentDate,@CRLF, @DBName)
PRINT '---------------------------------------------------'

The first line simply switches the following two session options on.

Session option

Action when ON

XACT_ABORT

Any action resulting in an error will rollback the transaction in which the error occurred.

NOCOUNT

Suppresses the (n row(s) affected) message and makes the audit messages easier to read.

In this case the AW_TARGET database is simply a copy of AdventureWorks

The remaining line cause the following message to be displayed

---------------------------------------------------
DEPLOYMENT SERVER: DBDevelopment01
DEPLOYER: Development01/David
Deployment Date: 2008-09-07 15:54:33 
Database: AW_Target
---------------------------------------------------

Removing views

The following code may look familiar

IF  EXISTS (INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA='Production' AND TABLE_NAME='vProductAndDescription')
	DROP VIEW Production.vProductAndDescription
GO

Mechanically there is nothing wrong with the above but for removing multiple objects the repetitive nature of the code makes it easy to miss errors.

The following code shows an alternative method of removing a set list of views


DECLARE @SQL VARCHAR(MAX) , @CRLF CHAR(2)
SET @CRLF = CHAR(13)+CHAR(10)
SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+ 'DROP VIEW '
+ QUOTENAME(TABLE_SCHEMA)
+ '.'
+ QUOTENAME(TABLE_NAME)
FROM INFORMATION_SCHEMA.[VIEWS]
WHERE 
	TABLE_SCHEMA='Production'
AND TABLE_NAME IN (
	'vProductAndDescription',
	'vProductModelCatalogDescription',
	'vProductModelInstructions'
)
PRINT @SQL
--EXEC (@SQL)
GO

Although it may seem like overkill for three simple views the process comes into its own when the view list gets longer. The view list acts as a manifest that can be checked against the deployment script or release notes.

To prevent accidents while experimenting I have commented out the EXEC statement but when run the script will produce the following.

---------------------------------------------------
DEPLOYMENT SERVER: D_POOLE
DEPLOYER: D_POOLE/David
Deployment Date: 2008-09-07 16:05:05 
Database: AW_Target
---------------------------------------------------
DROP VIEW [Production].[vProductAndDescription];
DROP VIEW [Production].[vProductModelCatalogDescription];
DROP VIEW [Production].[vProductModelInstructions]

Removing Stored Procedures

The method for removing stored procedures is almost identical differing only in the INFORMATION_SCHEMA view and associated field names.


DECLARE @SQL VARCHAR(MAX) , @CRLF CHAR(2)
SET @CRLF = CHAR(13)+CHAR(10)
SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+	'DROP '
+	ROUTINE_TYPE
+	QUOTENAME(ROUTINE_SCHEMA)
+	'.'
+	QUOTENAME(ROUTINE_NAME)
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME IN(
	'ListSales',
	'SetSale',
	'AddSale',
	'RejectSale'
)
PRINT @SQL
--EXEC(@SQL) -- commented out to prevent accidents
GO

Removing tables

Removing tables is very similar but in this case we have to consider the dependencies between the tables.

If you try and delete a table where referenced by a foreign key constraint then the delete will fail. This means that we must first remove any foreign key constraints referencing the tables that we want to remove.

The first stage is to assemble a table containing the list of database tables we want to drop.

DECLARE @TableList TABLE (ID INT NOT NULL, TableName sysname NOT NULL)
INSERT INTO @TableList (ID,TableName)  
SELECT OBJECT_ID(TABLE_SCHEMA+'.'+TABLE_NAME),TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
AND TABLE_NAME IN (
	'BillOfMaterials',
	'Culture',
	'Document',
	'Illustration',
	'Location'
)

The next stage is to use this table to establish a list of foreign key constraints and generate the SQL to remove them.

DECLARE @SQL VARCHAR(MAX) , @CRLF CHAR(2)
SET @CRLF = CHAR(13)+CHAR(10)
-----------------------------------------------------------------------------
-- Generate SQL to remove FKs
-----------------------------------------------------------------------------
SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+	'ALTER TABLE '
+	QUOTENAME(OBJECT_NAME(fkeyid))
+	' DROP CONSTRAINT '
+	QUOTENAME(OBJECT_NAME(constid))
FROM sysreferences
WHERE rkeyid IN (SELECT id FROM @TableList)

Finally we must append the SQL to remove the tables themselves.

SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+	'DROP TABLE '
+	QUOTENAME(TABLE_SCHEMA)
+	'.'
+	QUOTENAME(TABLE_NAME)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
AND TABLE_NAME IN (SELECT TableName FROM @TableList)
PRINT @SQL
--EXEC(@SQL) -- Commented out to prevent accidents
GO

Our code above will produce the following output

ALTER TABLE [ProductDocument] DROP CONSTRAINT [FK_ProductDocument_Document_DocumentID];
ALTER TABLE [ProductInventory] DROP CONSTRAINT [FK_ProductInventory_Location_LocationID];
ALTER TABLE [ProductModelIllustration] DROP CONSTRAINT [FK_ProductModelIllustration_Illustration_IllustrationID];
ALTER TABLE [ProductModelProductDescriptionCulture] DROP CONSTRAINT [FK_ProductModelProductDescriptionCulture_Culture_CultureID];
ALTER TABLE [WorkOrderRouting] DROP CONSTRAINT [FK_WorkOrderRouting_Location_LocationID];
DROP TABLE [Production].[BillOfMaterials];
DROP TABLE [Production].[Culture];
DROP TABLE [Production].[Document];
DROP TABLE [Production].[Illustration];
DROP TABLE [Production].[Location]

The advantage to this method is that you don't have to worry about the order in which tables are deleted or the names of the foreign key constraints.

Removing Replication

If our tables are replicated then any attempt to delete them will still fail in which case we need to consider the code below.

DECLARE @TABLELIST TABLE(TableName sysname not null)
INSERT INTO @TABLELIST
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
AND TABLE_NAME IN (
	'BillOfMaterials',
	'Culture',
	'Document',
	'Illustration',
	'Location'
)

Once again we build up a table containing a list of the database tables for which we wish to drop replication.

I use the presence of the sysarticles table to detect whether or not the database is replicated but I could just as well use IF DATABASEPROPERTYEX('AdventureWorks','IsPublished')=1

IF EXISTS(SELECT 1 FROM sysobjects WHERE [name]='sysarticles')
	BEGIN
		DECLARE @SQL VARCHAR(MAX) , @CRLF CHAR(2)
		SET @CRLF = CHAR(13)+CHAR(10)
SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
		+	'exec sp_dropsubscription @publication = N'''
		+	P.[name]
		+	''',@article = N'''
		+ A.[name]
		+ ''', @subscriber = N''all'', @destination_db = N''all'''
		+ @CRLF
		+	'exec sp_droparticle @publication = N'''
		+ p.[name]
		+	''',@article = N'''
		+ A.[name]
		+    ''', @force_invalidate_snapshot = 1'
		FROM sysarticles AS A
			INNER JOIN syspublications AS P
			ON A.pubid = P.pubid
		AND A.name IN (SELECT TableName FROM @TableList
		)
		PRINT @SQL
		--EXEC (@SQL) -- Commented out to prevent accidents
	END

The output from this code is as follows

exec sp_dropsubscription @publication = N'AdventureWorks_Reporting',@article = N'BillOfMaterials', @subscriber = N'all', @destination_db = N'all'
exec sp_droparticle @publication = N'AdventureWorks_Reporting',@article = N'BillOfMaterials', @force_invalidate_snapshot = 1;
exec sp_dropsubscription @publication = N'AdventureWorks_Reporting',@article = N'Culture', @subscriber = N'all', @destination_db = N'all'
exec sp_droparticle @publication = N'AdventureWorks_Reporting',@article = N'Culture', @force_invalidate_snapshot = 1;
exec sp_dropsubscription @publication = N'AdventureWorks_Reporting',@article = N'Document', @subscriber = N'all', @destination_db = N'all'
exec sp_droparticle @publication = N'AdventureWorks_Reporting',@article = N'Document', @force_invalidate_snapshot = 1;
exec sp_dropsubscription @publication = N'AdventureWorks_Reporting',@article = N'Illustration', @subscriber = N'all', @destination_db = N'all'
exec sp_droparticle @publication = N'AdventureWorks_Reporting',@article = N'Illustration', @force_invalidate_snapshot = 1;
exec sp_dropsubscription @publication = N'AdventureWorks_Reporting',@article = N'Location', @subscriber = N'all', @destination_db = N'all'
exec sp_droparticle @publication = N'AdventureWorks_Reporting',@article = N'Location', @force_invalidate_snapshot = 1

Removing Columns

Just as we cannot remove tables if they are referenced by foreign key constraints we are also prevented from removing columns if they are referenced by check or default constraints.

The following code removes any column constraints on ModifiedDate in the HumanResource.EmployeeAddress table.


DECLARE @SQL VARCHAR(MAX) , @CRLF CHAR(2)
SET @CRLF = CHAR(13)+CHAR(10)
SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+	'ALTER TABLE '
+	OBJECT_SCHEMA_NAME(COL.id)
+	'.'
+	OBJECT_NAME(COL.id)
+	' DROP CONSTRAINT '
+	OBJECT_NAME(C.ConstID)
FROM sysconstraints AS C
	INNER JOIN syscolumns AS COL
	ON C.Id = COL.Id
	AND C.ColID = COL.ColID
WHERE COL.id IN(
	OBJECT_ID('HumanResources.EmployeeAddress')
)
AND COL.Name = 'ModifiedDate'

Once the constraints have been removed we can remove the column itself.

SELECT @SQL=COALESCE(@SQL+';'+@CRLF,'') 
+	'ALTER TABLE '
+	OBJECT_SCHEMA_NAME(COL.id)
+	'.'
+	OBJECT_NAME(COL.id)
+	' DROP COLUMN '
+	COL.Name
FROM syscolumns AS COL
WHERE COL.id IN(
	OBJECT_ID('HumanResources.EmployeeAddress')
)
AND COL.Name IN( 
	'ModifiedDate' -- Add the list of fields that you want to remove.
)
PRINT @SQL
--EXEC(@SQL)    -- Commented out to prevent accidents

SQL2000 considerations

In SQL2005 and SQL2008 we have the VARCHAR(MAX) data type.

In SQL2000 and earlier we have an 8000 character limit to a VARCHAR. If your rollback has a large number of objects of a specific type then you have to consider whether your dynamic rollback commands will exceed the 8000 character limit.

Obviously you could repeat the scripts for a different block of objects but there is an alternative approach.

The example below uses our "Removing Columns" example

-- If the TEMPDB table already exists then get rid of it.
IF OBJECT_ID('TempDB..#RollbackCommands') IS NOT NULL
	DROP TABLE #RollbackCommands
GO
-- Create the table to hold the rollback commands
-- The IDENTITY column is to ensure that commands run in the correct order.
CREATE TABLE #RollbackCommands (
	CommandID INT NOT NULL IDENTITY(1,1) 
		CONSTRAINT PK_RollbackCommands PRIMARY KEY CLUSTERED,
	 CommandText varchar(1024) 
)
-- Place our commands in the temp table
INSERT INTO #RollbackCommands(CommandText)
SELECT 
	'ALTER TABLE '
+	OBJECT_SCHEMA_NAME(COL.id)
+	'.'
+	OBJECT_NAME(COL.id)
+	' DROP CONSTRAINT '
+	OBJECT_NAME(C.ConstID)
FROM sysconstraints AS C
	INNER JOIN syscolumns AS COL
	ON C.Id = COL.Id
	AND C.ColID = COL.ColID
WHERE COL.id IN(
	OBJECT_ID('HumanResources.EmployeeAddress')
)
AND COL.Name = 'ModifiedDate'
-- Place our commands in the temp table
INSERT INTO #RollbackCommands(CommandText)
SELECT 
	'ALTER TABLE '
+	OBJECT_SCHEMA_NAME(COL.id)
+	'.'
+	OBJECT_NAME(COL.id)
+	' DROP COLUMN '
+	COL.Name
FROM syscolumns AS COL
WHERE COL.id IN(
	OBJECT_ID('HumanResources.EmployeeAddress')
)
AND COL.Name = 'ModifiedDate'

Having assembled our commands we now have to execute them in order

DECLARE 
	@CommandID INT,
	@CommandText VARCHAR(1024)
SET @CommandID = 0
WHILE @CommandID IS NOT NULL
	BEGIN
		SELECT @CommandID = MIN(CommandID)
		FROM	#RollbackCommands
		WHERE CommandID>@CommandID
		IF @CommandID IS NOT NULL
			BEGIN
				SELECT @CommandText = CommandText
				FROM #RollbackCommands
				WHERE CommandID = @CommandID
				PRINT @CommandText
				--EXEC(@SQL)    -- Commented out to prevent accidents
			END
	END
ALTER TABLE #RollbackCommands
	DROP CONSTRAINT PK_RollbackCommands
-- If the TEMPDB table already exists then get rid of it.
IF OBJECT_ID('TempDB..#RollbackCommands') IS NOT NULL
	DROP TABLE #RollbackCommands
GO

Conclusion

Although these scripts may look a little verbose initially, the more objects you have to remove from a database the more useful these code snippets become. In fact it is easy to set these up as templates then whoever peer reviews the code knows that they have to verify the list of objects in the WHERE clause.

Three advantages of this approach to rollback are as follows

  • You don' t have to worry about the order in which objects are destroyed, simply maintain the list of the objects
  • If constraint names are SQL server assigned names then these scripts derive those names automatically. You don't need to know the names of the constraints.
  • If you accidentally run the code for a 2nd or subsequent time it will do no harm. As the system is assembling the list of commands from system tables there is no chance of errors occurring when trying to delete an object that no-longer exists.

By David Poole

Autosar MCAL-S32K324 Fee配置-基于EB Autosar MCAL S32K324 Fee配置详解 阅读详情

相关推荐

【YOLO 系列】基于YOLO V8的智能车载交通标志识别系统【python源码+Pyqt5界面+数据集+训练代码】

本文详细介绍了基于YOLO V8构建智能车载交通标志识别系统的完整流程。从环境搭建、数据集准备、模型训练到PyQt5图形界面开发,提供了Python源码和实战代码,帮助开发者快速实现高精度、实时的交通标志检测应用,提升驾驶辅助系统的开发效率。

wdx012345的博客 968

设置ODBC的自定义类CSetODBC

何志丹一,功能描述用于配置数据源用户名及密码.1,可以得到连接串,此串可用于CMyRecordset(派生于CRecordset)的GetDefaultConnect(),也可以用干CDataBase类OpenEx.2,如果用户配置正确,只需要配置一次,相关信息记录在文件.3,可以指定存储信息的文件名.因为有可能几个程序共用一个数据源.4,用户可以重新配置数据5,可以得到当前数据的类型.6

闻缺陷则喜何志丹 3158

DAZ STUDIO 快速渲染技巧

DAZ STUDIO 快速渲染技巧: 本文将向您展示几个快速渲染技巧。您将学习如何使您的Daz Iray渲染和照明在Daz工作室内更快。 当你有一个大场景,这可能需要很多小时进行渲染。 但是如果你想大幅度降低渲染时间呢?这篇文章的提示应该能让你达到这个目标。 首先,我们需要弄清楚一件事——没有“完美的环境或设置”这样的东西。是因为渲染设置是高度个性化和主观性的东西,这主要取决于场景和硬件。如果你有一个功能强大的计算机,你可以允许更多的低渲染时间,反之亦然。因此,一切都取决于您尝试渲染的对象和机器。

DAZSTUDIO的博客 9652

SQL并行执行的机制解析与计划调控实践

并行执行是大数据量场景的核心提速手段,但用错代价极高。本文从问题边界讲起,梳理并行度的确定层级、优化器生成并行计划的逻辑、数据再分布与通信代价、倾斜成因与识别方法,覆盖表设计、索引策略、并行DML、RAC调度与参数取舍,配合三个真实失败案例与诊断步骤,给出一套可落地的并行治理流程与误区清单。

搞定过:百亿级数据、万级QPS、零宕机、AI工业化。 797

SAP License:SAP会计凭证抬头的字段状态控制

FI模块的同事一般都知道在FI中有个字段状态变式,可以控制在凭证输入时哪些字段是必输、哪些可选哪些隐藏,但这只对凭证行项目中有效,你是否想过对于凭证抬头的字段是哪控制呢? 在中国,会计附件上都要带一个附件张数字段,但SAP的默认配置中没有这一字段,并非SAP没有设置此字段,而是我们没有配置这一字段。如果需要在凭证输入时放出分支号(BRNCH)、附件页数(NUMPG)等字段,在个人参数文件中加入参数CSF,参数值AR,即可。如下图: 实际上,这是对凭证国家的一个设置,在SAP中,配置了AR这个国家..

SAP权限管控|SAP用户权限管理|SAP权限合规检查|SAP全日志管理 2228

RK3566-预装APP

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档。

qq_24093081的博客 702

VMware 安装 SQL Server 双节点 AlwaysOn 可用性组教程 —— WSFC、AG 与侦听器完整部署(系列核心篇)

13_VMware 安装 SQL Server 双节点 AlwaysOn 可用性组教程 —— WSFC、AG 与侦听器完整部署(系列核心篇) 系列定位 :《SQL Server 数据库全栈运维实战系列》第 13 篇,与《MySQL 数据库全栈运维实战系列》同构对标(对标 MySQL 13 主从与 I…

dk843108982的博客 259

微信8.0所有URL Scheme大全:隐藏入口与使用场景详解 内附195条微信URL Scheme

URL Scheme 类似于一个协议地址,它的作用和网页的https://差不多,只不过它不是打开网页,而是直接跳转到微信App内部的功能页面。→ 打开微信扫一扫→ 打开零钱通详情→ 打开微信面对面支付微信功能的“快捷指令”。整理下来,微信的 URL Scheme 基本覆盖了支付、联系人、扫一扫、小程序、运动设备等多个入口。对开发者来说,这些 Scheme 就像是隐藏的快捷通道,在某些场景(比如支付唤起、活动红包、客服入口)能大大简化流程。微信对外部调用限制非常严格。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 2229

数据库优化不是只加索引:从 SQL、表结构到写入链路的完整取舍

上线之后,有的查询确实变快,但一段时间之后,写入接口越来越卡、有些 SQL 依旧不走索引、高峰时段锁等待堆积。同时,这条查询只需要 id、order_no、amount,还没有形成覆盖索引,依旧会回表。更新语句的过滤条件,必须能够命中索引,锁定尽可能少的行。有时候 SQL 明明有索引,explain 却看到优化器选择全表扫描,不是索引失效,是 MySQL 统计信息不准,优化器误判扫描行数。如果只有三个单列索引,MySQL 优化器只会选择其中一个索引,剩下的条件需要回表过滤,还需要文件排序,效率很低。

acd12009的博客 144

如何选择深度强化学习算法:MuZero/SAC/PPO/TD3/DDPG/DQN/等算法

如何选择深度强化学习算法:MuZero/SAC/PPO/TD3/DDPG/DQN/等算法

丨汀、的博客 5225

lammps案例:扭转

扭转有两种方式,一是固定一端旋转另外一端,二是两端沿相反的方向旋转。案例为两侧旋转方式,扭转后的效果如图所示。

lammps_jiayou的博客 1201

嵌入式数据库横向对比:HSQLDB · Derby · DuckDB · SQLite · H2 · SQLTiny

SQLTiny 是用 C++20 从零实现的轻量嵌入式数据库,核心定位为支持 MySQL Wire Protocol 的多语言、可网络访问的嵌入式数据库。区别于 SQLite(文件锁)、DuckDB(列式分析)、HSQLDB/H2(私有协议),它以极简代码量(~15k LOC)和标准协议兼容,填补了“嵌入式 + 多语言直连 + TCP server”空白。虽当前性能受限于全局锁与无索引 JOIN,但其清晰架构与生态兼容性使其成为教学、原型开发及多语言项目中理想的 MySQL 替代品。

Life is not divided 271

qcc304x笔记之手机端显示电量(九)

默认的sdk有些安卓手机不支持电量显示,所以需要加电量显示的补丁 流程分析 1. 首先新建一个task,并将task注册给电池模块 appBatteryRegister(batteryRegistrationForm) 实现handler处理函数,当battery模块电池电量更新后,会将电池百分比值发送到本模块,然后我们就可以在handler中将实时电量同步到手机端了。 hfpAtCmdInit atCmdTask.task.handler = appAtCmdHandleM...

在云巅的博客 2202

云数仓向PostgreSQL生态延伸的技术动因与工程代价

Snowflake以2.5亿美元收购Crunchy Data,把云数仓的触角伸向PostgreSQL生态。本文从负载补齐、元数据标准化与AI应用低延迟读写三个切面拆解收购动机,逐层分析列存与行存的能力边界、存算分离下引入事务负载的提交延迟预算、逻辑复制的接缝风险、元数据统一与混合负载隔离冲突,并给出迁移落地的分阶段验收清单与七个典型误区,最后提供评估厂商PostgreSQL能力的六项观察指标。

搞定过:百亿级数据、万级QPS、零宕机、AI工业化。 463

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

记一次Sql Server2012免费版如何升级到2016企业版本

本文记录了将SQL Server 2012免费版升级至企业版的完整流程,重点解决因版本限制导致无法使用代理功能的问题。通过加载ISO安装包,选择从旧版本升级,完成功能安装与实例配置后,需手动启用“代理XP”并检查服务状态。若代理仍异常,需通过安装程序添加“SQL Server代理”组件,最终实现企业版功能完整启用。

qq_57492774的博客 215

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

SQL Server 基础语法详解:从建库建表到约束与增删改查

本文以学生信息表 Students 为主线,系统讲解数据库基础语法,涵盖建库、建表、约束添加及增删改查操作。通过 SQL Server T-SQL 示例,清晰区分数据库、表结构与记录的操作对象,强调字段类型、非空、自增、主键、唯一、检查与默认约束的定义与应用,帮助读者理清各语句间的逻辑关系,掌握数据库管理的核心技能。

2601_96519735的博客 1588

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

PostgreSQL 日报| OAuth 校验库置空仍可登录(11 月 9 日)

Tomas Vondra 提交了针对 commit a798660ebe3 中"bogus parameterizations"漏洞的清理版修复补丁,并为各个回退分支分别提供了对应的版本。据报道,OpenAI 正在进行新一轮融资,已额外筹集 110 亿美元,整轮融资尚未正式收官,预计将在未来数周内完成。作为一款面向现代开发流程的 Serverless Postgres 数据库,Lakebase 支持即时分支与环境克隆,并通过计算与存储分离的架构提升性能、降低成本、增强可靠性。函数中发现了一个 bug。

IvorySQL的博客 245

#SQLite 数据库笔记一:(概念 / 终端指令 / SQL 语句 / C 编程 / 回调函数)

数据库 = 数据的仓库,假设数据是海量。能力说明存储数据持久化保存,程序退出数据还在统计数据、分组、排序数据管理增、删、改、查(CRUD)嵌入式设备上也会用数据库(单片机网关、路由器、工业 HMI 都常见),因为 sqlite 体积小、无需服务进程、单文件即可。数据库 = 库 > 表 > 记录(行) > 字段(列)sqlite3 = 开源、C 写的、单文件、免安装、最多 2T 的嵌入式关系型数据库。

lwq20051110的博客 260

DeepSeek总结的 PostgreSQL 18.7、17.12、16.16、15.20、14.25 及 19 RC 2 发布说明

发布于 2026-11-12,由 PostgreSQL 全球开发组发布PostgreSQL 项目 安全PostgreSQL 全球开发组已发布所有受支持版本的更新,包括 18.7、17.12、16.16、15.20 和 14.25,以及 PostgreSQL 19 的第二个发布候选版本。本次发布修复了 52 个安全漏洞和过去几个月报告的 140 多个 bug。有若干问题可能需要你在更新后采取额外步骤,下文有详细说明。请参阅"更新"一节,了解更新后可能需要执行的步骤。完整变更列表请查阅发布说明。

l1t的专栏 262

2026最新PostgreSQL到Doris数据同步完整教程:全流程图形化配置无需写ETL

本文演示通过NineData控制台将PostgreSQL数据实时同步至Apache Doris的完整流程,涵盖结构、全量、增量三阶段复制。全程图形化操作,无需编写脚本,支持键列与分布键可视化映射、复制规格预检查、数据对比校验及延迟告警。适用于构建稳定高效的实时分析数仓,助力报表与大屏查询基于最新数据。

云原生智能数据管理平台 210

1-10 PostgreSQL中多表连接全解:inner/left/right/full/cross join

本文基于 PostgreSQL 15+ 完整拆解 5 种主流连接:内连接、左连接、右连接、全连接、笛卡尔连接。结合可落地的测试数据,演示每种连接的执行逻辑、返回结果,重点剖析 NULL 值对 JOIN 匹配的核心影响,彻底解决多表连接数据丢失、匹配异常、结果错乱的问题。

zhangjw34的专栏 144

网站的SQL 注入:从攻击原理到防御措施

SQL 注入(SQL Injection)是 Web 应用中最古老、危害最大的安全漏洞之一。简单来说就是攻击者通过在用户输入中注入了恶意的SQL 代码,让数据库执行非正常的操作,从而能窃取数据、篡改内容甚至控制整个服务器。SQL 注入虽然古老,但至今仍是 Web 安全的头号威胁。永远不要把用户输入直接拼进 SQL 语句。首选:使用 PDO/MySQLi 预处理语句 + 关闭模拟预处理配合:输入类型校验与格式验证加固:数据库最小权限 + 关闭错误回显外围:WAF + 定期安全扫描。

2501_94567985的博客 603

01_SQLServer 体系架构全解 —— 实例进程、关系引擎、SQLOS 与事务日志深入

01_SQLServer 体系架构全解 —— 实例进程、关系引擎、SQLOS 与事务日志深入 系列定位 :《SQL Server 数据库全栈运维实战系列》第 01 篇,与《MySQL 数据库全栈运维实战系列》同构对标(对标 MySQL 01 对应篇目)。 适用版本 :SQL Server 2019/…

dk843108982的博客 1041

多数据库开发和管理工具 SQLark,支持达梦/Oceanbase/TiDB/Oracle/MySQL/PG 数据库!

工具选型这个事,没有绝对的优劣,适合自己的工作流最重要。如果你也在用 OceanBase,可以试试 SQLark,至少在连接配置这个环节,确实要省心不少。

零俗 205

快捷键与热键有何异同?

本文对比了热键与快捷键在“粘贴”操作中的异同:用户层面,热键需按Alt+字母组合,快捷键则直接Ctrl+V;开发者层面,修改热键仅需调整菜单标题,而修改快捷键需编辑资源文件中的加速器设置。文章强调专业分工的重要性,并推荐相关排样优化与工具箱技术博文。

闻缺陷则喜何志丹 1774

SQL Server 增删改查与约束全解:INSERT/UPDATE/DELETE、LIKE 模糊查询、主外键约束

看着简单,但delete和truncate的区别、where漏写、null判断、like通配符、约束命名,每一处都能让新手卡半天。文末给出 WinForm 连接 SQL Server 的完整写法。

2501_94699871的博客 202
上一篇: Monitoring Changes in Your Database Using DDL Triggers
下一篇: Importing Excel 2007 File to sqlserver2005 with ssis
lchstudy
博客等级 码龄20年 6粉丝 10原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值