When you create a user encounters an Oracle database using Navicat premium pit

       Recently affected by the epidemic, it has been telecommuting from home so can not be connected directly to the company's database, so they need to create a local database. After creating the database, when you run the project, it has been given the wrong general description is connection error, unable to connect data sources and the like;

Because Navicat premium has been using this tool, before occasionally with PLSQL / Developer, three libraries in creating a project requires the use of (three users) using Navicat; did not pay attention to some of the problems created when users, resulting in project not on the database connection. Actually, the problem is still sensitive issue because the rules when creating a user in Navicat. Now do some summary.

1, when you create an Oracle database users Navicat, the user name in lowercase or uppercase, uppercase in user interface view will be automatically converted, then show you:

Use the Query window to create a user ttsp, then refresh the database:

We can see the data directly into the left side of instances of uppercase TTSP

Then delete the user ttsp, refresh the user

Then use the capital to create a user TTSP, grant dba permission

See the user is uppercase, lowercase create user also capitalized;

Next, create a user, use double quotes

You can see on the left to see the user name is indeed lowercase ttsp, pay attention to the pit right here, if you just see this place shows ttsp, then you are in the project data source configuration file, use the user name ttsp , it will error; (you can see my left created a user and manager MANAGER users, this is used in the project, is to use the user manager created in this way, but you may have forgotten, years ago created an once);

To demonstrate manage user connection error, first delete the user MANAGER

When the data table under Note users, delete the statement to add cascade; or will be error, and before the presentation does not add cascade, it is empty because it is a user.

Now only manager the user (using the create user "manager" identified by "manager");

Now switch to the project profile, project start

Then access the project in a browser:

 

可以看到直接在配置文件中配置manager用户,密码是manage,项目启动会报错:无效的用户名/密码,登录被拒绝;所以这样直接查看Navicat的视图页面中用户配置数据源会出错!

接下来用PLSQL/Developer验证一下:

 

也会提示这个错误

但是如果用"manager"/"manager"来登录就可以登录成功

 

 

接下来再Navicat中重新创建MANAGER用户(因为刚才为了排除干扰MANAGER用户给删除了);

 

 传输完成之后,MANAGER用户下就有数据了

然后删除"manager"用户,也是为了排除干扰(注意删除用户前需要先断开用户的连接)

没了"manager"用户,然后在项目中修改数据源配置

可以看到修改配置后,启动项目虽然有错,但是没有报用户名及密码无效的错误;然后再到浏览器中访问项目:

 可以正常进入主页了!

有趣的是,在项目中把数据源配置改一下,把用户名和密码改成小写manager,发现照样可以连接

 

照样可以访问,此时配置的manager用户其实就是MANAGER用户(相当于没有区分大小写),用PLSQL/Developer测试也是一样。(注意我用的Oracle10g,所以用户名和密码默认不区分大小写,Oracle11g及以后是区分大小写的,可以通过设置alter system set sec_case_sensitive_logon=false来不区分大小写);所以创建用户的时候直接创建大写的即可,最好不用带双引号去创建用户。

 

 

发布了74 篇原创文章 · 获赞 20 · 访问量 1万+

Guess you like

Origin blog.csdn.net/u011174699/article/details/104391842