sqlplus /nolog -> conn /as sysdba 登录到oracle
将session切换到PDB下alter session set container=pdborcl
建立表空间create tablespace tablespace_name datafile ‘/home/oracle/var/data/tablespace_name.dbf‘ size 500m autoextend on;
查看表空间select tablespace_name,file_id,file_name from dba_data_files;
建立用户create user table_name identified by password default tablespace tablespace_name;
对用户授权grant dba to toolbar;
提交commit;
conn [email protected]
ERROR:
ORA-01017: invalid username/password; logon denied
始终无法登录
设置TNS_ADMIN
export TNS_ADMIN=/home/oracle/app/oracle/product/12.1.0/dbhome_2/network/admin
依旧没有解决
conn [email protected]
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
出现TNS错误,应该是TNS脚本的问题
查看services,发现应该是pdborcl的服务名有问题
select name,pdb from v$services;
NAME PDB
------------------------------ ------------------------------
pdborcl.localdomain PDBORCL
orclXDB CDB$ROOT
orcl.localdomain CDB$ROOT
SYS$BACKGROUND CDB$ROOT
SYS$USERS CDB$ROOT
在tnsnames.ora里面加入
PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl.localdomain)
)
)
OK啦
^_^祝玩得愉快