The "ORACLE12C" Deployment service establishes the user and the problems encountered in building the database and some new features of 12C

Source: Internet
Author: User
Tags documentation sqlplus

This is an Oracle small white unbearable torture, struggling to make, the cost of painstaking efforts.

Differences between ORACLE12C and 11g versions

A problem was encountered while creating the user (my findings are based on the problems encountered):
Problem Description:
Prompt for ORA-65096 when creating the required user for the service: the public user name or role is invalid.
Cause of the problem:
According to Oracle's official documentation, the 12C version creates a public user name (CDB user) that must be #开头 in C # #或C #, and that the C # #用户名登陆 must be added to the login after testing.

CDB and PDB explanations:
Oracle 12C introduces new features for CDB and PDB, allowing a single database container (CDB) to host multiple pluggable databases (PDB) in a multi-tenant environment introduced in Oracle 12C databases (multitenant environment).
CDB is all called container database, the Chinese translation is a data base container, the PDB is all called pluggable database, you can plug and Unplug databases.
Before Oracle 12C, the instance and database were one-to-one or many-on relationships (RAC): an instance could be associated with only one database, and the database could be loaded by multiple instances. The instance and database cannot be a one-to-many relationship. When you enter Oracle 12C, the instance and database can be a one-to-many relationship.
Here is the concept map given in the official documentation:

My understanding: This structure is somewhat similar to the Docker relationship. A management library (CDB) to manage the pluggable database (PDB), if you want to create a user in the PDB library without adding C # #的, but also this user can only be used in this one PDB library, can not be applied to other libraries.
Create a sample SQL for a public user:
CREATE USER C # #test identified by Test DEFAULT tablespace test account UNLOCK;
You must also add c## when doing an authorization or landing operation:
GRANT RESOURCE to C # #test;

Some common SQL statements related to the CDB are included with the PDB:
Example statements that create a PDB space (you need to create a tablespace file first):
Create tablespace tscreditlog datafile '/home/oracle/app/oracle/creditdb/creditlog/tscreditlog01.dbf ' size 20M;

Query the name of all PDB and CDB:
SELECT name, PDB from V$services ORDER by name;

View only PDB libraries:show PDBs;
(PDB I see two states read and write and read-only)

Open all PDB libraries: alter pluggable database all open;
Switch to a PDB (container toggle):ALTER SESSION SET container=namepdb;
Switch to CDB:alter session set Container=cdb$root;
Look at the name of the current container:show? Conname;

Some of the problems encountered during the operation and how to solve them:

only error is question mark or garbled: Character set inconsistency causes:
Run: Alter session set Nls_language=american;
If the database prompt is garbled for a question mark: The
needs to be under the Oracle user. Bash_profile Add environment variable Nls_lang
Create tablespace failure problem:
1. Tablespace folder authorization is problematic;
2. Tablespace folder does not exist
Prompt creation failure when creating table (Insufficient prompt permission, no user, etc.):
Checks the script that created the user, returns the authorization success at the time of the first execution or succeeds but does not have permission, so re-executes it again. Problem Solving (problem rule-big strokes: Many problems can be solved by restarting an instance or re-executing it).
Create tablespace error ORA-65048:
Error processing current DDL statement in pluggable database PDBORCL ORA-00959: tablespace ' TEST ' does not exist
only need to restart the database to solve!
? How to start and close the Oracle database
?? Sql>shutdown abort;? ? -One by one abnormal shutdown, but the fastest way to shut down, because of the newly installed database, there is not so many scruples.
Sql>startup?
Happy to create the user normally ~ ~

Navicat Unable to connect oracle12c problem, prompting no matching authentication protocol:
Problem reason: Navicat has a OCI.dll file version that is too low. No further in-depth research, the following directly find the solution.
Two files required for Oracle:
Baidu Cloud Link: Http://pan.baidu.com/s/1jIfQ95G Password: wm9l
If you don't have navicat, go to Baidu Next (Nacicat for Oracle)
Here, unzip the Instantclient-basic-nt-12.1.0.2.0.zip directly into the instantclient_10_2 directory of Navicat for Oracle's extracted directory.
Then this directory is more instantclient_12_1 this directory, and then extract Instantclient-sqlplus-nt-12.1.0.2.0.zip to Instantclient_12_1
Complete
Finally open Navicat for Oracle Click Tools, Options, OCI
Here are two options to see my path.
OCI Your Path \instantclient_12_1.oci.dll
SQL Your Path \instantclient_12_1.sqlplus.exe

Then create a new connection to connect to the database:

Get.

The "ORACLE12C" Deployment service establishes the user and the problems encountered in building the database and some new features of 12C

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.