----- tnsnames.ora 文件如下:
[oracle@o1930c admin]$ cat tnsnames.ora
prod =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.52)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
-----使用网络远程登录
sqlplus sys@prod as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 28 10:36:11 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
----重建密码文件orapwprod
cd $ORACLE_HOME/dbs
mv orapwprod orapwprod.bak
orapwd file='orapwprod' password=PROD_123_prod
sqlplus sys@prod as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 28 11:11:42 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SYS@prod>
SYS@prod>
SYS@prod>
SYS@prod>
SYS@prod>
SYS@prod> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
SYS@prod>
----登录成功
02-15
666
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-14
3837
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)