随笔分类 -  数据库

摘要:取消账号强制策略时出现错误 当 MUST_CHANGE 为 ON (开)时,不能将 CHECK_POLICY 和 CHECK_EXPIRATION 选项设为 OFF (关)。 (Microsoft SQL Server,错误: 15128)这错误引起的原因是因为勾选了那个"强制实施密码策略",于是. 阅读全文
posted @ 2020-05-14 09:27 Thenext 阅读(853) 评论(0) 推荐(0)
摘要:安装 pgadmin4 命令 sudo apt-get install pgadmin4 设置deepin的root密码 命令 sudo passwd 提示 输入新的 UNIX 密码:重新输入新的 UNIX 密码:passwd:已成功更新密码 设置postgres的密码 命令 thenext@the 阅读全文
posted @ 2020-01-12 19:13 Thenext 阅读(601) 评论(0) 推荐(0)
摘要:Linux downloads (Debian) 首先创建一个文件 命令是sudo /etc/apt/sources.list.d/pgdg.list 并加入 deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main 更新列表: w 阅读全文
posted @ 2020-01-12 19:03 Thenext 阅读(1113) 评论(0) 推荐(0)
摘要:使用 阅读全文
posted @ 2019-07-22 23:04 Thenext 阅读(849) 评论(0) 推荐(0)
摘要:1、安装 使用如下命令,会自动安装最新版,这里为9.5 安装完成后,默认会: (1)创建名为"postgres"的Linux用户 (2)创建名为"postgres"、不带密码的默认数据库账号作为数据库管理员 (3)创建名为"postgres"的表 安装完成后的一些默认信息如下: config /et 阅读全文
posted @ 2019-07-08 14:26 Thenext 阅读(480) 评论(0) 推荐(0)
摘要:select score as '成绩' ,name as '姓名' from studentsUNION ALLselect AVG(score) from students; 在最后一行显示平均数; select score as '成绩' ,name as '姓名' from students 阅读全文
posted @ 2019-06-16 21:30 Thenext 阅读(1038) 评论(0) 推荐(0)
摘要:在postgresql中,字段名,或是表名中如果含有大写字母的时候 例如, Table_Name,这样的名在查询中这样写 SELECT * FROM "Table_Name" 这样的表名必须要加 “ ” 如果是都是小写的话就不需要例如 table_name SELECT * FROM Table_N 阅读全文
posted @ 2019-06-16 16:36 Thenext 阅读(855) 评论(0) 推荐(0)
摘要:*如果是系统崩溃,需要找回数据,PostgreSQL安装目录的data文件夹要存在 1.备份PostgreSQL安装目录到其他目录下 2.停止Postgres服务,可以在运行中输入services.msc,在启动的窗口中关闭掉postgres服务,也可以通过在cmd中输入 net stop post 阅读全文
posted @ 2019-05-27 21:18 Thenext 阅读(834) 评论(0) 推荐(0)
摘要:SQL server : select * into #products_temp from products; 直接查询一个到临时表 Postgersql : create temporary table "t_2" as select * from "SC_Contacts"; 创建一个临时表 阅读全文
posted @ 2019-05-27 15:49 Thenext 阅读(371) 评论(0) 推荐(0)
摘要:背景 背景 处理方法 第二种方法: 重新注册服务,其实比重新安装还简单了;执行命令就可以了, 第一步:进入到数据库的安装目录,cd D:\PostgreSQL\bin; 第二部:执行服务注册:pg_ctl register -N pg921 -D D:\PostgreSQL\data -S auto 阅读全文
posted @ 2019-05-21 21:58 Thenext 阅读(1343) 评论(0) 推荐(0)
摘要:典型使用场景 随着使用时间的增加,数据库中的数据量也不断增加,因此数据库查询越来越慢。 加速数据库的方法很多,如添加特定的索引,将日志目录换到单独的磁盘分区,调整数据库引擎的参数等。这些方法都能将数据库的查询性能提高到一定程度。 对于许多应用数据库来说,许多数据是历史数据并且随着时间的推移它们的重要 阅读全文
posted @ 2019-05-18 08:57 Thenext 阅读(2099) 评论(0) 推荐(0)
摘要:TFDConnection: FetchOptions.Mode 设置为fmAll, 返回全部结果, 否则默认只返回前50条, 效果与open以后再执行FetchAll一样 Specifies how the result set records must be fetched into FireD 阅读全文
posted @ 2019-04-17 16:14 Thenext 阅读(1068) 评论(0) 推荐(0)
摘要:First chance exception at $763FC632. Exception class EMSSQLNativeException with message '[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 10. 阅读全文
posted @ 2019-04-02 15:46 Thenext 阅读(513) 评论(0) 推荐(0)
摘要:declare @dbname varchar(50)select @dbname ='WebFZ' create table #tableT(tn sysname)insert into #tableT exec ('select name from '+@dbname+'..sysobjects 阅读全文
posted @ 2019-01-23 13:43 Thenext 阅读(140) 评论(0) 推荐(0)
摘要:1、select * from sys.dm_tran_locks或sp_LOCK 查看request_node 字段中为'X'(排他锁)或'IX'(意向排他锁)2、用sp_who2 + pid(进程ID) 查看进程的详细信息3、用dbcc inputbuffer(pid) 查看一起死锁的语句内容 阅读全文
posted @ 2019-01-07 21:18 Thenext 阅读(1095) 评论(0) 推荐(0)
摘要:对象类型: AF = 聚合函数 (CLR) C = CHECK 约束 D = DEFAULT(约束或独立) F = FOREIGN KEY 约束 FN = SQL 标量函数 FS = 程序集 (CLR) 标量函数 FT = 程序集 (CLR) 表值函数 IF = SQL 内联表值函数 IT = 内部 阅读全文
posted @ 2018-12-01 08:54 Thenext 阅读(394) 评论(0) 推荐(0)
摘要:Delphi数据类型与各数据库数据类型对比如下表,如有具体说明见表中脚注: Delphi Type Oracle Types SQL Server Types MySQL Types [1] InterBase Types PostgreSQL Types SQLite Types ftSmalli 阅读全文
posted @ 2018-11-13 13:56 Thenext 阅读(773) 评论(0) 推荐(0)
摘要:备份并新建同名数据库,并替换原数据文件 1 把问题数据库备份后直接删除 停掉SQLSERVER服务,把服务器上出问题的数据库, 假设名称为 test的数据库文件及日志文件备份到其他目录,然后直接将其删除,把其数据库文件及日志文件也删除 2 新建同名数据库 启动SQLSERVER服务,新建同名数据库t 阅读全文
posted @ 2018-11-06 16:21 Thenext 阅读(760) 评论(0) 推荐(0)