Oracle 12C R1 OR R2監聽相關配置包含pdb

shawnloong發表於2017-06-29
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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-2141392/,如需轉載,請註明出處,否則將追究法律責任。

相關文章