错误:ORA-65096:oracle 中的通用用户名或角色名无效

2023-09-18数据库问题
2

本文介绍了错误:ORA-65096:oracle 中的通用用户名或角色名无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我刚刚安装了 Oracle,但缺少 Scott 架构.所以我想自己生成它.我得到了 Scott 模式的 sql 脚本,但是当我尝试运行查询时:

I just installed Oracle, and it was missing the Scott schema. So i am trying to generate it myself. I got the sql script of Scott schema, but when i try to run the query:

create user Scott identified by tiger; 

它显示以下错误:

ORA-65096:oracle 中的通用用户名或角色名无效.

ORA-65096: invalid common user or role name in oracle.

基本上它不允许我创建用户 Scott.

Basically it is not allowing me to create a user Scott.

这是为什么,我该如何解决我的问题?

Why is that, and how can I fix my problem?

推荐答案

99.9% 的错误 ORA-65096: invalid common user or role name 意味着您在登录 CDB 时应该登录到 PDB.例如,如果您使用默认的 19c 安装设置,您应该登录 ORCLPDB(PDB)而不是 ORCL(CDB).

99.9% of the time the error ORA-65096: invalid common user or role name means you are logged into the CDB when you should be logged into a PDB. For example, if you used the default 19c installation settings, you should login to ORCLPDB (the PDB) instead of ORCL (the CDB).

危险 - 如果您坚持以错误的方式创建用户,请按照以下步骤操作.

DANGER - If you insist on creating users the wrong way, follow the steps below.

像这样设置未记录的参数(如前导下划线所示)只能在 Oracle Support 的指导下完成.在没有此类指导的情况下更改此类参数可能会使您的支持合同无效.因此,请自行承担风险.

Setting undocumented parameters like this (as indicated by the leading underscore) should only be done under the direction of Oracle Support. Changing such parameters without such guidance may invalidate your support contract. So do this at your own risk.

具体来说,如果您设置 "_ORACLE_SCRIPT"=true,则将在 ORACLE_MAINTAINED 列设置为Y"的情况下进行一些数据字典更改.这些用户和对象将被错误地从某些 DBA 脚本中排除.并且它们可能被错误地包含在某些系统脚本中.

Specifically, if you set "_ORACLE_SCRIPT"=true, some data dictionary changes will be made with the column ORACLE_MAINTAINED set to 'Y'. Those users and objects will be incorrectly excluded from some DBA scripts. And they may be incorrectly included in some system scripts.

如果您对上述风险没有问题,并且不想以正确的方式创建普通用户,请在创建用户之前运行此命令:

If you are OK with the above risks, and don't want to create common users the correct way, run this command before creating the user:

alter session set "_ORACLE_SCRIPT"=true;  

我在这里找到了答案

这篇关于错误:ORA-65096:oracle 中的通用用户名或角色名无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

如何在MySQL中为每个组选择第一行?
How to select the first row for each group in MySQL?(如何在MySQL中为每个组选择第一行?)...
2024-04-16 数据库问题
13

MySQL - 获取最低值
MySQL - Fetching lowest value(MySQL - 获取最低值)...
2024-04-16 数据库问题
8

在 cmakelist.txt 中添加和链接 mysql 库
Add and link mysql libraries in a cmakelist.txt(在 cmakelist.txt 中添加和链接 mysql 库)...
2024-04-16 数据库问题
41

考勤数据库的良好数据库设计(架构)是什么?
What is a good database design (schema) for a attendance database?(考勤数据库的良好数据库设计(架构)是什么?)...
2024-04-16 数据库问题
7