Oracle 12c creates pluggable database (PDB) and user-detailed

Source: Internet
Author: User


Objective



Because Oracle 12c uses the CDB-PDB architecture, similar to Docker, multiple pluggable-db can be loaded within the CONTAINER-DB, so additional configuration is required after installation to be used.



First, modify the Listener.ora, Tnsnames.ora


###listener.ora###
LISTENER =
(DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  (CONNECT_DATA = (SERVICE_NAME = orcl))
)
#sid listList cdb and all pdb database names, all sid and oracle environment variables are consistent #
SID_LIST_LISTENER =
(SID_LIST =
  (SID_DESC =
  (GLOBAL_DBNAME = orcl) #cdb db_name
  (SID_NAME = orcl)
  )
  (SID_DESC =
  (GLOBAL_DBNAME = pdborcl) #pdb db_name
  (SID_NAME = orcl)
  )
)
###listener.ora###
 
##tnsnames.ora###
#cdb
Orcl =
(DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) )
  (CONNECT_DATA =
  (SERVICE_NAME = orcl) #cdb's db_name
  )
)
#pdb
Pdborcl =
(DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVICE_NAME = pdborcl) #pdb's db_name
  )
)
##tnsnames.ora###




Use the "Service_name+domain_name" connection when the client connects. If there's a ora-01017, it's probably



Second, create the PDB



CDB is equivalent to the operating system, invoking and managing each PDB. The PDB is equivalent to a database instance that truly provides business requirements. After the Oracle 12c installation, only the CDB is created and the corresponding PDB needs to be generated itself.



1. Create PDB



Under the Sqlplus:


create pluggable database pdborcl
admin user pdbadmin identified by pdbadmin
role=(resource)
file_name_convert=( ‘PDB$SEED‘s directory‘ , ‘PDBOrcl‘s directory‘ );




2. Synchronizing files


select pdb_name,status from cdb_pdbs



If the PDB status is need sync, you need:


select pdb_name,status from cdb_pdbs


SHUTDOWN immediate or alter pluggable database PDBORCL close immediate;


alter pluggable database pdborcl open restricted ;
exec dbms_pdb.sync_pdb ; #调用dbms_pdb进行pdb


3. New users


create user scott account unlock identified by tiger ;
grant resource to scott ;




Create the user as described above, if ora-01017 appears, it is likely that there is a 1, no connection specified service_name to the specific PDB, or Oracle is sensitive to password case. The former checks whether Sid_list is listed in Listener.ora, and checks whether the connection string is specified in Tnsnames.ora. If you cannot modify the front-end program, you can use


alter system set SEC_CASE_SENSITIVE_LOGON = false ;


Forces the case check of the Oracle to be closed for confirmation.



Iii. Common Commands



Show PDBs: See how many pdb are contained in the current database container. If the session is in a PDB, you can view the current PDB.


alter session set container=PDBNAME


Toggles the current session into a PDB. Switch to operate with private users of the current PDB


	
startup/shutdown immediate


Close the cdb/pdb of the current session


	
alter pluggable database PDBNAME open ;


Open the specified PDB



alter pluggable database PDBNAME close immediate ;


Close the specified PDB



Summarize



The above is the entire content of this article, I hope that the content of this article on everyone's study or work can bring certain help, if there is doubt you can message exchange.



Oracle 12c creates pluggable database (PDB) and user-detailed


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.