SQL>col con_name format A30;
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 1131039996 PDB$SEED READ ONLY
3 263525486 NETDATAPDB READ WRITE
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 NETDATAPDB READ WRITE NO
查询service_name
SQL> select name,pdb from v$services;
NAME PDB
------------------------------ --------------------------------------------------------------------------------------------------------------------------------
netdata CDB$ROOT
SYS$BACKGROUND CDB$ROOT
SYS$USERS CDB$ROOT
netdatapdb NETDATAPDB
netdataXDB CDB$ROOT
切换至cdb
SQL> alter session set container=netdatapdb;
SQL> create tablespace tbs_netdata datafile '/u01/app/oracle/oradata/netdata/netdatapdb/tbs_netdata01.dbf' size 100M autoextend on next 20M maxsize 8G;
Tablespace created.
SQL> create user netdata identified by netdata default tablespace tbs_netdata temporary tablespace temp;
User created.
SQL> grant create view,create table,create trigger,create synonym,create procedure to netdata;
Grant succeeded.
SQL> grant unlimited tablespace to netdata;
Grant succeeded.
配置监听
[oracle@ORA12CR2-213-8 ~]$ cd /u01/app/oracle/product/12.2.0/db_1/network/admin
[oracle@ORA12CR2-213-8 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
[oracle@ORA12CR2-213-8 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = netdata)
)
(SID_DESC =
(GLOBAL_DBNAME = netdatapdb)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = netdata)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.8)(PORT = 1521))
)
ADR_BASE_LISTENER = /u01/app/oracle
DIAG_ADR_ENABLED_LISTENER = OFF
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MODE
---------- ---------- ------------------------------ ----------
2 1131039996 PDB$SEED READ ONLY
3 263525486 NETDATAPDB READ WRITE
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 NETDATAPDB READ WRITE NO
查询service_name
SQL> select name,pdb from v$services;
NAME PDB
------------------------------ --------------------------------------------------------------------------------------------------------------------------------
netdata CDB$ROOT
SYS$BACKGROUND CDB$ROOT
SYS$USERS CDB$ROOT
netdatapdb NETDATAPDB
netdataXDB CDB$ROOT
切换至cdb
SQL> alter session set container=netdatapdb;
SQL> create tablespace tbs_netdata datafile '/u01/app/oracle/oradata/netdata/netdatapdb/tbs_netdata01.dbf' size 100M autoextend on next 20M maxsize 8G;
Tablespace created.
SQL> create user netdata identified by netdata default tablespace tbs_netdata temporary tablespace temp;
User created.
SQL> grant create view,create table,create trigger,create synonym,create procedure to netdata;
Grant succeeded.
SQL> grant unlimited tablespace to netdata;
Grant succeeded.
配置监听
[oracle@ORA12CR2-213-8 ~]$ cd /u01/app/oracle/product/12.2.0/db_1/network/admin
[oracle@ORA12CR2-213-8 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
[oracle@ORA12CR2-213-8 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = netdata)
)
(SID_DESC =
(GLOBAL_DBNAME = netdatapdb)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
(SID_NAME = netdata)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.8)(PORT = 1521))
)
ADR_BASE_LISTENER = /u01/app/oracle
DIAG_ADR_ENABLED_LISTENER = OFF
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24486203/viewspace-2141392/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24486203/viewspace-2141392/