我的数据库正在为某个路径生成重做文件,我们称之为“旧/路径”,我想将它移动到一个新路径,我们在 oracle 中称之为“新/路径”
有人可以帮忙吗?
我的数据库正在为某个路径生成重做文件,我们称之为“旧/路径”,我想将它移动到一个新路径,我们在 oracle 中称之为“新/路径”
有人可以帮忙吗?
大约一年前,我开始从事一个项目,以设置一个运行存储过程的作业。我现在回到这里来完成它。当我运行该作业时,我收到一条错误消息,指出该作业正在“构建”用户下运行(这是我们系统上的有效帐户)。
但是我不知道为什么要这样做。我以自己的用户 ID (keith.miller) 登录,但我看不到工作中的任何内容。以下是我的工作创建 SQL 的重要部分:
EXEC msdb.dbo.sp_add_job @job_name=N'Restore Database',
@enabled=1,
@notify_level_eventlog=0,
@notify_level_email=0,
@notify_level_netsend=0,
@notify_level_page=0,
@delete_level=0,
@description=N'No description available.',
@category_name=N'[Uncategorized (Local)]',
@owner_login_name=N'XXX\Keith.Miller', @job_id = @jobId OUTPUT
EXEC msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Restore',
@step_id=1,
@cmdexec_success_code=0,
@on_success_action=1,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'EXEC dbo.spRestoreDatabase',
@database_name=N'master',
@flags=0
如果我以“构建”身份登录时创建作业,会发生这种情况吗?有没有一种方法可以检查这个,或者我可以在其他地方查看为什么正在使用构建用户?
我将表从非分区更改为分区使用
ALTER table schema.table_name MODIFY partition by list(column_name)
automatic (partition p_null values(null))
但它腐败并抛出
ORA-00600: 内部错误代码,参数:[ktsircinfo_num1]、[5]、[104]、[2789130]、[]、[]、[]、[]、[]、[]、[]、[]
我检查索引column_name
已分区但表没有并且表在 dba_segments 中没有段。
现在,我无法对这张桌子做任何事情。我尝试了 dbms_repair、drop index、drop table、truncate、delete、select 但它们都抛出
ORA-00600: 内部错误代码,参数:[ktsircinfo_num1]、[5]、[104]、[2789130]、[]、[]、[]、[]、[]、[]、[]、[]
谁能帮我!!!
我有一个包含多列的表。还有一个包含数据的文本文件,每行一个值:
aaa
bbb
ccc
ddd
如何将文件加载到文件中的特定列以及设置其他列?
+----+------+------+------+------------+
| id | col2 | col2 | col3 | created_at |
+----+------+------+------+------------+
| | | | | |
+----+------+------+------+------------+
| | | | | |
+----+------+------+------+------------+
| | | | | |
+----+------+------+------+------------+
我想将文件中的数据加载到 中col2
,并将列设置created_at
为now()
。
===>
+----+------+------+------+------------+
| id | col2 | col2 | col3 | created_at |
+----+------+------+------+------------+
| 1 | aaa | | | <timestamp>|
+----+------+------+------+------------+
| 2 | bbb | | |<timestamp> |
+----+------+------+------+------------+
| 3 | ccc | | |<timestamp> |
+----+------+------+------+------------+
如何做到这一点LOAD DATA LOCAL INFILE ...
?
-- https://doxygen.postgresql.org/btreefuncs_8c_source.html#l00625
CREATE TABLE s2 AS SELECT g::int AS g FROM generate_series(1, 10000) g;
ALTER TABLE s2 ADD PRIMARY KEY (g);
SELECT root,level FROM bt_metap ('s2_pkey');
SELECT * FROM bt_page_stats ('s2_pkey', 3) gx
SELECT itemoffset,itemlen,ctid
,pg_column_size(ctid) ctid_size,data
,pg_column_size(data) size_data
FROM bt_page_items ('s2_pkey', 3)
ORDER BY itemoffset LIMIT 10;
回报
itemoffset | itemlen | ctid | ctid_size | data | size_data
------------+---------+--------+-----------+-------------------------+-----------
1 | 8 | (1,0) | 6 | | 1
2 | 16 | (2,1) | 6 | 6f 01 00 00 00 00 00 00 | 24
3 | 16 | (4,1) | 6 | dd 02 00 00 00 00 00 00 | 24
4 | 16 | (5,1) | 6 | 4b 04 00 00 00 00 00 00 | 24
5 | 16 | (6,1) | 6 | b9 05 00 00 00 00 00 00 | 24
6 | 16 | (7,1) | 6 | 27 07 00 00 00 00 00 00 | 24
7 | 16 | (8,1) | 6 | 95 08 00 00 00 00 00 00 | 24
8 | 16 | (9,1) | 6 | 03 0a 00 00 00 00 00 00 | 24
9 | 16 | (10,1) | 6 | 71 0b 00 00 00 00 00 00 | 24
10 | 16 | (11,1) | 6 | df 0c 00 00 00 00 00 00 | 24
(10 rows)
我想知道 itemlen 16 是什么意思?
我试图跑\dp heroes
进去,psql
但它立即抛出了以下内容!(heroes
是表名)
ERROR: operator is not unique: unknown || "char"
LINE 16: E' (' || polcmd || E'):'
^
HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
我用谷歌搜索并找到了这些,但我不清楚到底发生了什么!
参考:https://www.postgresql.org/message-id/[email protected]
尝试使用架构名称访问它也不起作用
\dp public.heroes;
初读时,我认为我必须投射它,但我认为我错了。
\dp heroes::"char";
顺便说一句,这是一个作为 docker 容器运行的 Postgres 实例。
这是它内部生成的查询:
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'S' THEN 'sequence' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' END as "Type",
pg_catalog.array_to_string(c.relacl, E'\n') AS "Access privileges",
pg_catalog.array_to_string(ARRAY(
SELECT attname || E':\n ' || pg_catalog.array_to_string(attacl, E'\n ')
FROM pg_catalog.pg_attribute a
WHERE attrelid = c.oid AND NOT attisdropped AND attacl IS NOT NULL
), E'\n') AS "Column privileges",
pg_catalog.array_to_string(ARRAY(
SELECT polname
|| CASE WHEN NOT polpermissive THEN
E' (RESTRICTIVE)'
ELSE '' END
|| CASE WHEN polcmd != '*' THEN
E' (' || polcmd || E'):'
ELSE E':'
END
|| CASE WHEN polqual IS NOT NULL THEN
E'\n (u): ' || pg_catalog.pg_get_expr(polqual, polrelid)
ELSE E''
END
|| CASE WHEN polwithcheck IS NOT NULL THEN
E'\n (c): ' || pg_catalog.pg_get_expr(polwithcheck, polrelid)
ELSE E''
END || CASE WHEN polroles <> '{0}' THEN
E'\n to: ' || pg_catalog.array_to_string(
ARRAY(
SELECT rolname
FROM pg_catalog.pg_roles
WHERE oid = ANY (polroles)
ORDER BY 1
), E', ')
ELSE E''
END
FROM pg_catalog.pg_policy pol
WHERE polrelid = c.oid), E'\n')
AS "Policies"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','v','m','S','f','p')
AND c.relname OPERATOR(pg_catalog.~) '^(heroes)$' COLLATE pg_catalog.default
AND n.nspname OPERATOR(pg_catalog.~) '^(public)$' COLLATE pg_catalog.default
ORDER BY 1, 2;
我有 SQL Server 2016 企业版,我将数据库恢复到 SQL Server 2019 企业版。但我想检查是否可以在 SQL Server 2019 Standard 中恢复它。
如果我在 SQL Server 2019 Enterprise 中运行 DMV sys.dm_db_persisted_sku_features,返回的结果是:Compression, Partitioning, ColumnStoreIndex
这意味着我不能降级到标准版。但根据 Microsoft 文档,SQL Server 2019 Standard 支持这些功能。那么为什么这些结果出现在 sys.dm_db_persisted_sku_features 中?
在启用 FIPS 的 Ubuntu 20.04 服务器上安装 MySQL Server 8.0.33 会导致错误。安装以前的 MySQL Server 版本 (8.0.32) 时不会出现此错误。当服务器未在启用 FIPS 的情况下运行时,也不会发生该错误。
在安装过程中,它返回以下错误消息:
2023-05-15T18:39:17.482061Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2023-05-15T18:39:17.482074Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
我在全新安装的 Ubuntu Server 20.04 上进行了尝试,以确保不是其他包或设置导致了错误。
这是我的步骤:
$ sudo apt update
$ sudo apt upgrade
GRUB_CMDLINE_LINUX_DEFAULT
从中删除了默认操作/etc/default/grub
(这些操作阻止 FIPS 正确启用)。$ sudo update-grub
以应用更改。$ sudo pro attach <UA Token>
$ sudo pro enable fips
$ sudo apt install mysql-server
(这是失败发生的地方)。nodetool <options> upgradesstables
如果我计划将 Cassandra 版本从 4.0.5 升级到 4.1.1,是否需要运行?
一个非常奇怪的情况,查询返回 1380 个项目,但是当包装在一个函数中时,同一个函数返回一行
我试过删除并重新创建该功能。
当这样调用时,通过一个函数,返回 1 行。
CREATE OR REPLACE FUNCTION get_temps(tid uuid) RETURNS uuid
LANGUAGE sql
AS
$$
WITH RECURSIVE
start_set (temp_id, display_name, parent_temp_id) AS
(SELECT t.temp_id, t.display_name, t.parent_temp_id
FROM temps t
WHERE t.temp_id = tid),
subitems (temp_id, display_name, parent_temp_id) AS
(SELECT s.temp_id, s.display_name, s.parent_temp_id
FROM start_set s
UNION ALL
SELECT t.temp_id, t.display_name, t.parent_temp_id
FROM temps t
JOIN subitems subs ON t.parent_temp_id = subs.temp_id)
SELECT temp_id
FROM subitems;
$$;
当调用 not-in-a-function-wrapper 时,它返回 1380 行
WITH RECURSIVE
start_set (temp_id, display_name, parent_temp_id) AS
(SELECT t.temp_id, t.display_name, t.parent_temp_id
FROM temps t
WHERE t.temp_id = tid),
subitems (temp_id, display_name, parent_temp_id) AS
(SELECT s.temp_id, s.display_name, s.parent_temp_id
FROM start_set s
UNION ALL
SELECT t.temp_id, t.display_name, t.parent_temp_id
FROM temps t
JOIN subitems subs ON t.parent_temp_id = subs.temp_id)
SELECT temp_id
FROM subitems;
我没有想到什么?