Oracle PDB下本地用户无
Oracle PDB下本地用户无法使用本地连接的问题
模拟:
1.本地用户本地连接:
sql> show con_name;
CON_NAME
CDB$ROOT
SQL> alter session set container=pdb1;
Session altered.
SQL> create user test identified by test;
User created.
SQL> grant connect,resource to test;
Grant succeeded.
使用test用户连接:
SQL> conn test/test
ERROR:
ORA-01017: invalid username/passWord; loGon denied
Warning: You are no longer connected to oracle.
解决办法:
给该PDB配置tnsname:
查出该PDB的service_name
select name,network_name,pdb from v$services where pdb=’PDB1’;
NAME NETWORK_NAME PDB
pdb1 pdb1 PDB1
tnsname.ora:
pdb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = 192.168.238.14)(PORT = 1529))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)
尝试连接:
SQL> alter session set container=pdb1;
SQL> conn test/test
@pdb1;
Connected.
问题解决。
2.公有用户本地连接:
SQL> show con_name
CON_NAME
CDB$ROOT
SQL> create user C##abc identified by c##abc;
SQL> grant connect,resource to c##abc;
进入PDB进行查看该公有用户:
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
2 PDB$SEED READ ONLY NO
3 ABC READ WRITE NO
5 SALESPDB MOUNTED
SQL> alter session set container=abc;
Session altered.
SQL> select username from dba_users where username=’C##ABC’;
USERNAME
C##ABC
SQL> conn c##abc/c##abc
Connected.
可以连接~
结论:
在PDB中创建的本地用户,无法使用本地连接该用户conn name/password
需要使用网络连接该用户conn name/password@tnsname
在CDB中创建的公有用户,会在PDB下自动创建,在PDB中可以使用本地连接该公有用户。
--结束END--
本文标题: Oracle PDB下本地用户无法使用本地连接
本文链接: https://lsjlt.com/news/50062.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0