查了一些资料“oracle 11g 以前的版本的用户名和密码是不区分大小写的; oracle 11g 用户名和密码默认区分大小写,可更改alter system set sec_case_sensitive_logon=false 设置改为不区分大小写。”
但有的资料显示“不区分大小写,关键字、用户、密码 、字段名 、表名、序列名
触发器
名等是不区分的”
这个有什么特殊界定嘛?或者有什么明确说明嘛?
您好,默认情况下,SQL语句不区分大小写(密码除外),但创建的对象名称都统一以大写的形式存入数据库中。11g的测试示例如下:
SYS@mysrv>create user U1 identified by oracle;
User created.
Elapsed: 00:00:00.16
SYS@mysrv>grant dba to U1;
Grant succeeded.
Elapsed: 00:00:00.01
SYS@mysrv>select username from dba_users where username=‘U1’;
USERNAME
Elapsed: 00:00:00.01
SYS@mysrv>create user u1 identified by oracle;
create user u1 identified by oracle
ERROR at line 1:
ORA-01920: user name ‘U1’ conflicts with another user or role name
Elapsed: 00:00:00.01
SYS@mysrv>create user u2 identified by oracle;
User created.
Elapsed: 00:00:00.01
SYS@mysrv>select username from dba_users;
USERNAME
SCOTT
SYS@mysrv>conn U1/oracle
Connected.
U1@mysrv>conn u1/oracle
Connected.
U1@mysrv>conn u1/ORACLE
ERROR:
ORA-01017: invalid username/password; logon denied
@>conn u1/oracle
Connected.
U1@mysrv>create table t1 (id int);
Table created.
Elapsed: 00:00:00.05
U1@mysrv>create table T1(id int);
create table T1(id int)
ERROR at line 1:
ORA-00955: name is already used by an existing object
Elapsed: 00:00:00.00
U1@mysrv>create table t2
2 (id int);
Table created.
Elapsed: 00:00:00.01
U1@mysrv>select table_name from user_tables;
TABLE_NAME
Elapsed: 00:00:00.08
U1@mysrv>
Warning: You are no longer connected to ORACLE.
@>conn u1/oracle
U1@mysrv>select * from t1;
no rows selected
Elapsed: 00:00:00.01