在 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/