First, the basic usage:
First press 11G before
Conn/as Sysdba;
Create user test identifed by test;
ORA-65096: The public user name or role name is not valid.
Check the official document that "trying to create a generic user, you need to use C # #或者c # #开头", when the heart will have doubts, what is common user? It doesn't matter if it's built first.
Create C # #user test identifed by test;
Created successfully
Sql>show Con_name;
Con_name
------------------------------
Cdb$root
select
con_id,dbid,
NAME
,OPEN_MODE
from
v$pdbs;
CON_ID DBID NAME OPEN_MODE ---------- ---------- ------------------------------ ----------
2 4066409480 PDB$SEED READ ONLY
3 2270995695 PDBORCL MOUNTED
Sql>alter session Set CONTAINER=PDBORCL;
Then use create user test identifed by test;
ORA-01219: The database is not open: Allow query resolution only in fixed tables/views!
Ora-01219:database not open:queries allowed on fixed tables/views only
"ORA-01219: Database not open: Only allow query in fixed table/view" Warning window!
Workaround:
Log in to Oracle Sql*plus
C:\users\administrator>
C:\users\administrator>sqlplus/nolog
Sql*plus:release 10.2.0.1.0-production on Tuesday January 29 10:54:36 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Sql> Connect Sys/sys as Sysdba
This section is to find out the error when opening the database
Sql> select Open_mode from V$database;
Open_mode
----------
Mounted
sql> ALTER DATABASE open;
ALTER DATABASE Open
*
ERROR at line 1:
Ora-01157:cannot identify/lock data file 4-see DBWR trace file
Ora-01110:data file 4: '/DATA/APP/ORADATA/ORA237/USERS01.DBF '
This is about the '/data/app/oradata/ora237/users01.dbf ' file problem.
All we have to do is erase this residue file.
Proceed to the next step:
sql> ALTER DATABASE datafile '/DATA/APP/ORADATA/ORA237/USERS01.DBF ' offline drop;
Database altered.
sql> ALTER DATABASE open;
Database altered.
Oracle 12C ORA-65096: Invalid public user name or role name