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 PDBpdb1 pdb1 PDB1tnsname.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_nameCON_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##ABCSQL> conn c##abc/c##abc
Connected.可以连接~
结论:
十三、恢复目录恢复目录数据库用来代替控制文件存储RMAN信息库的信息。首先创建恢复目录数据库。恢复目录数据库可以跟目标数据库在一个数据库上也可以在不同数据库上。1.创建恢复目录数据库的表空间SQL> create tablespace tbs_hfml …
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。