Oracle数据库ALTER SESSION

时间:2018-01-22 14:45:25

标签: oracle

我已以系统用户身份登录。 所以我有两个可插拔的数据库 1)PDB $ SEED 2)PDBORCL

现在我想改变会话,需要将容器设置为pdborcl。但它给我的错误如下。

SQL> ALTER  SESSION  SET  CONTAINER  =  pdborcl;
ERROR:
ORA-65024: Pluggable database PDBORCL is not open.

注意:我还更改了我的tsnames.ora文件,如下所示

# tnsnames.ora Network Configuration File: D:\app\SgMadankar\virtual\product\12.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL = 
 (ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521))

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL = 
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521))
      (CONNECT_DATA =
       (SERVICE = DEDICATED)
       (SERVICE_NAME = orcl)
    )
  )

PDBORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdborcl)
    )
  ) 

1 个答案:

答案 0 :(得分:1)

1-您需要与具有SYSDBA权限的用户建立连接,SYS会很好。

2-您需要打开可插拔数据库。

SQL> ALTER PLUGGABLE DATABASE ALL OPEN;