C语言学习网

12c连接pdb的两种方法

发表于:2022-10-04 作者:安全数据网编辑
编辑最后更新 2022年10月04日,连接可插拔数据库的两种方法$sqlplus / as sysdbaSQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 17:59:56 2018

连接可插拔数据库的两种方法

$sqlplus / as sysdbaSQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 17:59:56 2018Copyright (c) 1982, 2014, Oracle.  All rights reserved.Connected to:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Advanced Analytics and Real Application Testing optionsSQL> show pdbs    CON_ID CON_NAME                       OPEN MODE  RESTRICTED---------- ------------------------------ ---------- ----------         2 PDB$SEED                       READ ONLY  NO         3 PDB1                           READ WRITE NO         4 PDB2                           READ WRITE NO         5 PDB3                           READ WRITE NO         6 PDB4                           READ WRITE NO                 --方法1SQL> alter session set container=pdb1;Session altered.SQL> show pdbs    CON_ID CON_NAME                       OPEN MODE  RESTRICTED---------- ------------------------------ ---------- ----------         3 PDB1                           READ WRITE NOSQL> exitDisconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Advanced Analytics and Real Application Testing options--方法二$sqlplus sys/oracle@roidb01:1521/pdb1 as sysdbaSQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 18:02:02 2018Copyright (c) 1982, 2014, Oracle.  All rights reserved.Connected to:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, OLAP, Advanced Analytics and Real Application Testing optionsSQL> show pdbs    CON_ID CON_NAME                       OPEN MODE  RESTRICTED---------- ------------------------------ ---------- ----------         3 PDB1                           READ WRITE NOSQL> show user;USER is "SYS"SQL> 
0