oracle database creates users and inserts data

Oracle Chapter 1 Database Permission Settings

preamble

​ The specific error type, I think it is probably like this

1. Oracle is a little more complicated than mysql

First, create a tablespace

-- 创建名为"TEST_DATA"表空间
CREATE TABLESPACE TEST_DATA NOLOGGING
-- 数据存放的位置
DATAFILE 'D:\test_data.dbf' 
-- 初始空间50M
size 50M
-- 每次扩大50M
AUTOEXTEND ON next 50M
-- 最大可以扩大到 20280M 如果想扩大至无限:unlimited 
maxsize 20480M
extent management local;


The second step is to create a user to grant permissions


CREATE USER c##dba_test IDENTIFIED BY dba_test
PROFILE DEFAULT
DEFAULT TABLESPACE test_data
ACCOUNT UNLOCK;

GRANT connect,resource,dba TO c##dba_test;
grant create session TO c##dba_test;


Two ORA-65096: invalid public user name or role name

​ This is a new feature of oracle12, some container mechanism and the like, but it is useless

​ In the CDB container, the user name must be c##prefixed to be successfully created. If you do not add this, you will not be allowed to create a user

 create user c##xyt identified by xyt;
 

Third, there is another error that should be ora-01950 without operating authority

​ This is when you insert data, you don’t have the permission to operate the database. If you want to add data to the data table you built, a box pops up. Sorry, you don’t have permission. Although very angry, but there is no need to be angry about the code, hahahaha, look at my specific solution process below

Four complete solution process

-- 创建表空间
create temporary tablespace dlu_xyt
-- 数据存放的位置
tempfile 'D:\yunwei\Oracle\dlu_xyt.dbf'
-- 初始空间50M
size 50m
-- 每次扩大50M
autoextend on next 50m 
-- 最大可以扩大到 20280M 如果想扩大至无限:unlimited 
maxsize 20480m
extent management local;


CREATE USER c##dlu_xyt IDENTIFIED BY dlu_xyt
PROFILE DEFAULT
DEFAULT TABLESPACE test_data
ACCOUNT UNLOCK;

GRANT connect,resource,dba TO c##dlu_xyt;
grant create session TO c##dlu_xyt;

insert image description here

Guess you like

Origin blog.csdn.net/CNMBZY/article/details/132129196