sqlplus sys/sys as sysdba;
select name,cdb from v$database;
col pdb_name for a30
select pdb_id,pdb_name,dbid,status,creation_scn from dba_pdbs;
select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 964253477 PDB$SEED READ ONLY
3 3329151580 ORCLPDB MOUNTED
在这里补充一下:orace12c 中PDB数据库 默认为ORACLPDB ,用户可以根据自己需求,
找到并点击Database Configurantion Assistant 然后下一步:
按照步骤依次操作即可。
SQL> create user c##test identified by test;
SQL> alter session set container=PDBORCL;
会话已更改。
SQL> show con_name;
CON_NAME
------------------------------
PDBORCL
SQL> startup;
插接式数据库已打开。
SQL> create user test identified by test default tablespace users temporary tablespace temp;
用户已创建。
SQL> grant create user,drop user,alter user,create any view,connect,resource,dba,create session,create any sequence to test ;
授权成功。
E:\java\Orcal_database\Orcal\virtual\product\12.1.0\dbhome_1\network\admin\tnsnames.ora文件中添加
ORCLPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCLPDB)
)
)
例子: alter user c##test identified by 123456;
列子: revoke connect, resource from c##test;