|
db:19.3
os:CentOS Linux release 7.8.2003 (Core)
1、tnsname
[oracle@sztech ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 13 15:02:53 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
5 ORCL READ WRITE NO
SQL> alter system register;
System altered.
[oracle@sztech ~]$ tnsping orcl;
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 13-DEC-2023 15:14:27
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.3.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.133.156)(PORT = 5500)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 msec)
[oracle@sztech ~]$ sqlplus system/oracle@orcl
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 13 15:16:19 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show con_name;
CON_NAME
------------------------------
ORCL
SQL>
2、alter session
[root@sztech ~]# su - oracle
Last login: Wed Dec 13 15:07:45 CST 2023 on pts/3
[oracle@sztech ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 13 15:22:41 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show con_name;
CON_NAME
------------------------------
CDB$ROOT
SQL> alter session set container=orcl;
Session altered.
SQL> show con_name;
CON_NAME
------------------------------
ORCL
SQL>
|
|