Oracle 12c 扩展以支持 varchar2 > 4000 字节对不是 sysdba 的用户不起作用

标签 oracle oracle12c

在 oracle 12c 兼容的 12.0.0 上,更改为使用 sysdba 权限扩展。
我现在可以用 varchar2(16000) 作为列创建一个表并插入一个 > 4000 字节的字符串;但仅当作为 sysdba 连接时。
当以普通用户而不是 sysdba 的身份连接时,我无法使用大于 4000 字节的 varchar2,抛出错误 ORA-60019。谁能解释为什么?
当以非 sysdba 用户身份登录时,参数 max_string_size= extended 和 compatible=12.0.0。

最佳答案

执行以下步骤,让我知道问题是否已解决。我要求再次设置参数只是为了确保
一切都秩序井然。

1) 备份您的 spfile(获取 spfile 的位置)

sqlplus / as sysdba
show parameter spfile;

2) 关闭数据库。
sqlplus / as sysdba
shutdown immediate

3)以UPGRADE模式重启数据库。
startup upgrade

4) 将 MAX_STRING_SIZE 的设置更改为 EXTENDED。
alter system set MAX_STRING_SIZE ='EXTENDED' scope=spfile;

5)
sqlplus / as sysdba
@%ORACLE_HOME%\RDBMS\ADMIN\utl32k.sql
 @%ORACLE_HOME%\RDBMS\ADMIN\utlrp.sql

Note: The utl32k.sql script increases the maximum size of the VARCHAR2, NVARCHAR2, and RAW columns for the views where this is required. The script does not increase the maximum size of the VARCHAR2, NVARCHAR2, and RAW columns in some views because of the way the SQL for those views is written.

rdbms/admin/utlrp.sql script helps to recompile invalid objects. You must be connected AS SYSDBA to run the script.



6) 在NORMAL 模式下重启数据库。
sqlplus / as sysdba
shutdown immediate
startup;
show parameter MAX_STRING_SIZE; 

7) 使用列数据类型 varchar2 创建超过 4000 大小的新表。

关于Oracle 12c 扩展以支持 varchar2 > 4000 字节对不是 sysdba 的用户不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30878036/

相关文章:

c# - 泄漏 Entity Framework 的抽象——只是一点点

c# - EF 查询 Oracle 抛出 "ORA-12704: character set mismatch"

sql - 如果没有ON关键字,您是否可以拥有INNER JOIN?

oracle - 每次 EXECUTE IMMEDIATE 后都需要 COMMIT 吗?

java - JDBC海量数据供选择

oracle - 能够通过 localhost 而不是通过 IP 地址访问 Oracle 数据库

c++ - 在 Oracle OCCI/OCI 中,读取 LOB 的缓冲区是否应该大于实际数据?获取 ORA-32116

sql - 使用 Oracle Sql developer(远程)连接到 oracle 12c

sql - 当我想在比较中使用空参数时,应该如何处理 PL/SQL 存储过程中的空参数?

sql - PLS-00488 : object "string" must be a type or subtype - but it is a type