我需要根据性能和查询(10 位数字)为 SQL Server 选择数据类型(BigInt vs Decimal)
我已启动并运行 SQL Server 2014,我正在尝试将特定数据库备份到 Azure 存储。我使用存储帐户名称作为身份和主键作为密码创建了一个凭据。然后我尝试将数据库备份到 URL,但出现以下错误:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Backup failed for Server '*****'. (Microsoft.SqlServer.SmoExtended)
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: A nonrecoverable I/O error occurred on file "https://******.blob.core.windows.net/backupcontainer/demo_backup_2016_06_22_110957.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (400) Bad Request.. (Microsoft.SqlServer.Smo)
Run Code Online (Sandbox Code Playgroud) 我在 Ubuntu 14.04 上使用 Postgres 9.5。我想在日志达到特定大小时旋转它们。所以我编辑了 /etc/postgresql/9.5/main/postgresql.conf 并设置了这个
log_rotation_size = 50MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
Run Code Online (Sandbox Code Playgroud)
然后我重新启动了我的服务器
sudo /etc/init.d/postgresql restart
Run Code Online (Sandbox Code Playgroud)
但是在运行了一些操作之后,我的磁盘空间用完了,并且发现我的日志根本没有轮换……
myuser@mymachine:~$ ls -al /var/log/postgresql/postgresql-9.5-main.log
-rw-r----- 1 postgres postgres 3165773943 Dec 29 18:34 /var/log/postgresql/postgresql-9.5-main.log
Run Code Online (Sandbox Code Playgroud)
我还需要做什么才能开始日志轮换?
我有下表,我试图将列“前缀”限制为 ASCII 字母字符。但是,在使用以下约束后,我仍然可以插入其他字符。为什么它不起作用?
CREATE TABLE test
(
id INTEGER NOT NULL PRIMARY KEY,
prefix TEXT NOT NULL,
CHECK(prefix NOT LIKE '%[^a-zA-Z]%')
)
Run Code Online (Sandbox Code Playgroud)
使用 Python 的 sqlite3 包和 DB Browser for SQLite
我在理解为什么此代码在组表 400000 行中返回数百万行时遇到了一些问题。RID 循环和 t2 上的索引查找应返回 1 行,它们返回组表中的所有行。
Create table #group (IDperson uniqueidentifier, MGroup_Idx int,
NGroup_Idx int)
create index i1 on #group (NGroup_Idx);
-- insert some data
SELECT * FROM #group t
LEFT JOIN #group t2 ON t.NGroup_Idx = t2.NGroup_Idx
AND t2.MGroup_Idx IS not NULL
WHERE ISNULL(t.MGroup_Idx, t2.MGroup_Idx) IS NOT NULL
Run Code Online (Sandbox Code Playgroud)
我一直在尝试启动 SQL Server 2017 并收到“没有足够的存储空间来完成此操作”。'
完整错误:
TDSSNIClient 初始化失败,错误为 0xe,状态代码为 0x1。原因:错误:19101,严重性:-1,状态:0。(参数:)。错误以简洁模式打印,因为格式化过程中出现错误。跟踪、ETW、通知等被跳过。没有足够的存储空间来完成此操作。
在系统事件上:
SQL Server (MSSQLSERVER) 服务因以下特定于服务的错误而终止:没有足够的存储空间来完成此操作。
我在所有驱动器上都有足够的空间,任何帮助表示赞赏。
是否可以像普通表一样获得 TOAST 表的死/活元组数?
CREATE TABLE messages1 (message text);
INSERT INTO messages1
SELECT (SELECT
string_agg(chr(floor(random() * 26)::int + 65), '')
FROM generate_series(1,10000))
FROM generate_series(1,10);
SELECT reltoastrelid::regclass
FROM pg_class
WHERE relname = 'messages1';
DELETE FROM messages1
WHERE ctid IN (
SELECT ctid
FROM messages1
ORDER BY 1
LIMIT 6
);
postgres=# SELECT reltoastrelid::regclass
postgres-# FROM pg_class
postgres-# WHERE relname = 'messages1';
reltoastrelid
--------------------------
pg_toast.pg_toast_147777
(1 row)
postgres=# select relname, vacuum_count, n_tup_del, n_live_tup, n_dead_tup from pg_stat_user_tables where relname='pg_toast.pg_toast_147777';
relname | vacuum_count | n_tup_del …Run Code Online (Sandbox Code Playgroud) 有没有办法检查是什么导致存储过程重新编译(索引重建、统计更新和参数嗅探除外 - 无需运行分析器跟踪或扩展事件),我们是否可以停止/取消/终止自动重新编译过程以减少 CPU 负载?
sql-server ×5
postgresql ×2
datatypes ×1
disk-space ×1
log ×1
mysql ×1
regex ×1
replication ×1
size ×1
sqlite ×1
t-sql ×1