无法删除 Oracle 中的还原点

有人(不是我)创建了许多名称中包含连字符的还原点。例如 restore_point-001。

当我尝试使用 Drop Restore Point 删除还原点时,它会出现 sql 命令错误,表示它没有正确结束。我尝试将名称放在单引号中并尝试重命名名称,但 v$restorepoint 不允许这样做。

有没有办法删除以这种方式命名的还原点?

iamhenry_c_s_d_n 回答:无法删除 Oracle 中的还原点

我试过把名字放在单引号 ...

我不是 DBA,但你的描述让我想起了这一点:

让我们尝试创建一个,其名称包含一个“减号”符号(就像您的还原点):

SQL> create table restore_point-001 (id number);
create table restore_point-001 (id number)
                          *
ERROR at line 1:
ORA-00922: missing or invalid option

不,这行不通。您说您将名称括在单引号中:

SQL> create table 'restore_point-001' (id number);
create table 'restore_point-001' (id number)
             *
ERROR at line 1:
ORA-00903: invalid table name


SQL>

不,它不是字符串文字

那么,让我们尝试使用双引号

SQL> create table "restore_point-001" (id number);

Table created.

哈!有用!现在让我们放弃它:没有任何引号:

SQL> drop table restore_point-001;
drop table restore_point-001
                        *
ERROR at line 1:
ORA-00933: SQL command not properly ended

单引号:

SQL> drop 'table restore_point-001';
drop 'table restore_point-001'
     *
ERROR at line 1:
ORA-00950: invalid DROP option

双引号

SQL> drop table "restore_point-001";

Table dropped.

SQL>

所以,是的 - 我不知道为什么人们坚持使用“无效”字符以及 -001_001 有什么好处,但是 - 如果我是你,我会尝试使用>

drop restorepoint "restore_point-001";

看看会发生什么。

本文链接:https://www.f2er.com/96109.html

大家都在问