Sunday 17 March 2019

How to create pluggable database manually in 12c.

=====How to create pluggable database manually in 12c R2=====

1) Connect to sys user

[oracle@prim admin]$ sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 18 00:13:01 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>

2) Create pluggable database.

SQL> CREATE PLUGGABLE DATABASE FIN ADMIN USER sys_fin IDENTIFIED BY *********;
Pluggable database created.

3) Check current status new added pluggable database.

SQL> COLUMN NAME FORMAT A15
           COLUMN RESTRICTED FORMAT A10
           COLUMN OPEN_TIME FORMAT A40

SQL> SELECT NAME, OPEN_MODE, RESTRICTED, OPEN_TIME FROM V$PDBS;

NAME OPEN_MODE RESTRICTED OPEN_TIME
--------------- ---------- ---------- ----------------------------------------
PDB$SEED READ ONLY NO 17-MAR-19 10.17.34.413 PM +05:30
HR READ WRITE NO 17-MAR-19 10.17.57.507 PM +05:30
FIN MOUNTED 17-MAR-19 11.46.33.523 PM +05:30

4) Check pluggable database open_mode to READ WRITE

SQL> alter pluggable database FIN open READ WRITE;

Pluggable database altered.

SQL> SELECT NAME, OPEN_MODE, RESTRICTED, OPEN_TIME FROM V$PDBS;

NAME OPEN_MODE RESTRICTED OPEN_TIME
--------------- ---------- ---------- ----------------------------------------
PDB$SEED READ ONLY NO 17-MAR-19 10.17.34.413 PM +05:30
HR READ WRITE NO 17-MAR-19 10.17.57.507 PM +05:30
FIN READ WRITE NO 17-MAR-19 11.47.28.202 PM +05:30

5) Connect lsnrctl utility check current status and reload it.

[oracle@prim datafile]$ lsnrctl
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 17-MAR-2019 23:50:02
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prim.example.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 17-MAR-2019 22:02:16
Uptime 0 days 1 hr. 47 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0.1/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/prim/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prim.example.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "844e079f51654a64e053a040a8c09b6a.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "844f4557a96a62bee053a040a8c00a75.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "fin.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "hr.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

==> Reload listener

LSNRCTL> reload listener
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prim.example.com)(PORT=1521)))
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prim.example.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 17-MAR-2019 22:02:16
Uptime 0 days 1 hr. 48 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0.1/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/prim/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prim.example.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "844e079f51654a64e053a040a8c09b6a.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "844f4557a96a62bee053a040a8c00a75.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
Service "fin.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "hr.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.example.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> exit

6) Add new pluggable database in to tnsnames.ora

FIN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prim.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = fin.example.com)
)
)
[oracle@prim admin]$ tnsping fin
TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 18-MAR-2019 00:05:31
Copyright (c) 1997, 2016, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prim.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = fin.example.com)))
OK (10 msec)

7) Connect to new pluggable database.

[oracle@prim admin]$ sqlplus sys_fin@fin
SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 18 00:05:09 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show con_name;
CON_NAME
------------------------------
FIN
SQL> show con_id;
CON_ID
------------------------------
4

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...