Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle 12c PDB Analysis     - Running the open-source Swift under Linux platform (Linux)

- Spring Boot + Nginx + Tomcat + SSL configuration notes (Server)

- The lambda expression Java8 (constructor references) (Programming)

- How to install Visual Studio Code on Ubuntu (Linux)

- Java to achieve local fileCopy (Programming)

- Git you do not know about some of the things (Linux)

- Linux Network Programming - raw socket programming (Programming)

- imp / exp Oracle Database import and export commands (Database)

- The script Linux command (Linux)

- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)

- Linux Beginner Guide: Installing packages on Ubuntu and Fedora (Linux)

- Adjust the size of the hard disk VirtualBox (Linux)

- Swift defined type conversion and type aliases (typealias) (Programming)

- Linux stand-alone OGG synchronous Oracle 11g DB test (Database)

- Availability Hadoop platform - Oozie Workflow (Server)

- Three minutes to teach you to easily grasp the grep command regular expression (Linux)

- AIX system file security aspects (Linux)

- True and false in Perl (Programming)

- Use FirewallD build dynamic firewall (Linux)

- Heartbeat (v1, v2, pacemaker) cluster components Overview (Server)

 
         
  Oracle 12c PDB Analysis
     
  Add Date : 2018-11-21      
         
         
         
  Anyway, Oracle 12c out for so long, for various reasons do not always start learning, now seems a bit late. 12c is always heard PDB in a new architectural pattern in a variety of chat technology is also probably know one kind of new architecture model pluggable, but it seems SQLServer has a similar architecture, anyway Oracle circle is still very fire, but I heard 12c r2 can support 4096 pdb, this is too big, docker installed about to try :)

Also own local tried it, in fact, spent some time in the middle of, the middle is always interrupted by all kinds of things, so are left some fragmentary pieces of knowledge that he re-index the environment deleted do several times.

In this attempt, I tried two learning methods, the first one is simply does not see the official documents, purely by feel you do encounter problems check google, Baidu, metalink to do, there is some reluctance finally results, but the overall feeling is not conventional thinking to solve some problems, like the larger from month to solve their own learning bias. Finally, there could be changes to the implicit argument, I think for the early entry to the study, that was very desirable, so there is some thing, albeit reluctantly, but my feeling is that this method does not learn the system is not comprehensive, it is easy to by various Raiders to affect, or not recommended.

Then in the interval of a day, ready to pump again today to learn about an hour or so, really want to find official documents and more detailed and systematic introduction of more comprehensive, many blog also basically in FIG official website, so that the their own learning time will be convenient for some, it suffices to follow the probability of error is smaller, not very frustrating.

But I also see the election documents, I compiled some information I have to do a simple conclusion.

This figure is official, I think it could not get better than this diagram, and directly attached to it. The CDB is inside the container, PDB is a plug-in database, hrpdb, salespdb has a corresponding PDBA to manage, integrated management by the CDB administrator to be responsible. Root is a basic template storage container, and the seed is to provide a template mechanism. Seed can be based on a template to create the corresponding PDB, I also want to demonstrate this approach.

First we create a database 12c comes pluggable database, or choose dbca silent way to do it, to get a direct command.

In this way and 10g, 11g main difference is that there is an option to create the CDB.

dbca -silent -createDatabase -templateName $ ORACLE_HOME / assistants / dbca / templates / General_Purpose.dbc -gdbname newtest -sid newtest -characterSet UTF8 -createAsContainerDatabase true -sysPassword oracle -systemPassword oracle

Copying database files

1% complete

3% complete

11% complete

18% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

46% complete

47% complete

52% complete

57% complete

58% complete

59% complete

62% complete

Completing Database Creation

66% complete

70% complete

74% complete

85% complete

96% complete

100% complete

After you finish creating we started to look at some simple CDB, PDB's.

First, to a two bursts, take a look at the container and the container name id

sqlplus / as sysdba

SQL> show con_id con_name

CON_ID

------------------------------

1

CON_NAME

------------------------------

CDB $ ROOT

SQL> select file_name from dba_data_files;

FILE_NAME

-------------------------------------------------- ------------------------------

/U01/app/oracle/oradata/newtest/system01.dbf

/U01/app/oracle/oradata/newtest/sysaux01.dbf

/U01/app/oracle/oradata/newtest/undotbs01.dbf

/U01/app/oracle/oradata/newtest/users01.dbf

Switch to seed, to view the container id and name

SQL> alter session set container = pdb $ seed;

Session altered.

SQL> show con_id con_name

CON_ID

------------------------------

2

CON_NAME

------------------------------

PDB $ SEED

View the data file, this time we can see that in fact, root and seed, there will be a separate system table space.

SQL> select file_name from dba_data_files;

FILE_NAME

-------------------------------------------------- ------------------------------

/U01/app/oracle/oradata/newtest/pdbseed/system01.dbf

/U01/app/oracle/oradata/newtest/pdbseed/sysaux01.dbf

Of course, want to get a clearer overview of pdb information, you can use the show pdbs

SQL> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB $ SEED READ ONLY NO

Results We then sysdba login, if there are multiple pdb, show pdbs display will be more. There is no create PDB, only a seed

SQL> conn / as sysdba

Connected.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB $ SEED READ ONLY NO

Let's create a new PDB, use seed based on the created.

Created by default when the PDB, if you do not specify the mapping between files, there will be the following questions, we can save in advance to do with OMF.

SQL> CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdb1admin IDENTIFIED BY oracle;

CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdb1admin IDENTIFIED BY oracle

*

ERROR at line 1:

ORA-65016: FILE_NAME_CONVERT must be specified

SQL> alter system set db_create_file_dest = '/ U01 / app / oracle / oradata / newtest';

System altered.

SQL> CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdb1admin IDENTIFIED BY oracle;

Pluggable database created.

Start at the new pdb

SQL> alter pluggable database pdb1 open;

Pluggable database altered.

This time to check again that the two records.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB $ SEED READ ONLY NO

3 PDB1 READ WRITE NO

If you look more roles can be found in fact related to the role of DBA added a lot, among them PDB_DBA such a role.

SQL> SELECT ROLE FROM DBA_ROLES WHERE ROLE LIKE '% DBA%';

ROLE

------------------------------

DBA

CDB_DBA

PDB_DBA

XDBADMIN

OLAP_DBA

LBAC_DBA

6 rows selected.

1 * ALTER SESSION SET CONTAINER = PDB $ SEED

SQL> SELECT ROLE FROM DBA_ROLES WHERE ROLE LIKE '% DBA';

ROLE

------------------------------

DBA

CDB_DBA

PDB_DBA

OLAP_DBA

LBAC_DBA

After you have created, we look at how to delete PDB

Remove pdb

SQL> alter session set container = pdb1;

Session altered.

SQL> select file_name from dba_data_files;

FILE_NAME

-------------------------------------------------- ------------------------------

/ U01 / app / oracle / oradata / newtest / NEWTEST / 23CD9A96BE236CE4E0532F857F0A62CC / datafil

e / o1_mf_system_c3pwol80_.dbf

/ U01 / app / oracle / oradata / newtest / NEWTEST / 23CD9A96BE236CE4E0532F857F0A62CC / datafil

e / o1_mf_sysaux_c3pwol8c_.dbf

Start deleting.

SQL> drop pluggable database pdb1 including datafiles;

drop pluggable database pdb1 including datafiles

*

ERROR at line 1:

ORA-65040: operation not allowed from within a pluggable database

Can not be deleted under the current user, and it has not CDB administrator, use sysdba to delete.

SQL> conn / as sysdba

Connected.

SQL> drop pluggable database pdb1 including datafiles;

drop pluggable database pdb1 including datafiles

*

ERROR at line 1:

ORA-65025: Pluggable database PDB1 is not closed on all instances.

Come close you want to delete

SQL> alter pluggable database pdb1 close;

Pluggable database altered.

After close you can safely delete the

SQL> drop pluggable database pdb1 including datafiles;

Pluggable database dropped.

We now take a look at how to create the CDB administrator

SQL> create user c ## cdbadmin identified by oracle default tablespace users temporary tablespace temp;

User created.

Given DBA authority.

SQL> grant dba to c ## cdbadmin;

Grant succeeded.

It can try to connect at this time, of course, the CDB administrator name is the beginning of the c ##, is so specified.

SQL> conn c ## cdbadmin / oracle

Connected.

SQL> show pdbs

SP2-0382: The SHOW PDBS command is not available

Create PDB again, you may want to have friends began to say how they created the PDB, secrecy, or because there is a problem worth mentioning.

SQL> CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdb1admin IDENTIFIED BY oracle;

Pluggable database created.

SQL> conn / as sysba

SQL> alter session set container = pdb1;

Session altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

3 PDB1 MOUNTED

To start writing another look, this time there is a problem, just still possible, now how to repair strained, and syntax does not matter.

SQL> startup

Warning: PDB altered with errors.

Pluggable Database opened.

But the view PDB status is not a problem.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

3 PDB1 READ WRITE YES

SQL> conn / as sysdba

Connected.

Through the following ways to analyze the error.

SQL> select message, time from pdb_plug_in_violations;

MESSAGE

-------------------------------------------------- ------------------------------

TIME

-------------------------------------------------- -------------------------

Sync PDB failed with ORA-959 during 'create user c ## cdbadmin identified by * d

efault tablespace users temporary tablespace temp container = all '

05-NOV-15 11.30.37.118745 PM

If in doubt, use oerr look for ora-959

SQL>! Oerr ora 00959

00959, 00000, "tablespace '% s' does not exist"

// * Cause:

// * Action:

Thus the problem becomes clear. Because there is no table space uers

alter session set container = pdb1;

Create a can.

SQL> create tablespace users datafile '/U01/app/oracle/oradata/newtest/NEWTEST/23CDBE4149E16F08E0532F857F0A58E3/users01.dbf' size 20M;

Tablespace created.

Again shutdown and startup there is no problem.

SQL> shutdown immediate

Pluggable Database closed.

SQL> startup

Pluggable Database opened.

These are the beginning PDB learning, but also want to continue to summarize, these places should continue to practice, the players need to do data migration.
     
         
         
         
  More:      
 
- Puppet installation and testing (Server)
- Docker manage data (Linux)
- Axel install plug under CentOS 5/6 acceleration yum downloads (Linux)
- Linux operating tips: Can not open file for writing or operation not permitted solution (Linux)
- Editor of the popular Linux Gvim (Linux)
- Two alert log ORA Errors (Database)
- Ubuntu user use PPA to install Uget 2.0.5 (Linux)
- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)
- Linux fast set ip bond (Linux)
- Nginx version information hidden or modified (Server)
- Teamviewer not start in Linux (Linux)
- Java proxy mode (Programming)
- MySQL event table to achieve timing build a small note (Database)
- Java code JIT compiler-friendly Mody (Programming)
- mysqldump issue a note (Database)
- Linux SSH commands (Linux)
- An Analysis of the C Algorithm for Calculating the Number of Days Between Date (Programming)
- Use regular expressions to check whether the input box to enter a URL (Programming)
- Java garbage collection (Programming)
- C # C ++ Java interface type conversion (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.