Oracle




Need to follow the below steps for Create User and Grant Permissions:

Step 1: Connect sysdba

sqlplus / as sysdba;

ORACLE-CREATE-USER-AND-GRANT-PERMISSIONS

Step 2: Create user command syntex:

CREATE USER USER_NAME 
IDENTIFIED BY PASSWORD
DEFAULT TABLESPACE USERS
QUOTA 20M ON USERS;

Execute below user command:

	
	CREATE USER c##blog_user_10
	IDENTIFIED BY test#0010
	DEFAULT TABLESPACE USERS
	QUOTA 20M ON USERS;

ORACLE-CREATE-USER-AND-GRANT-PERMISSIONS

Step 3:

Syntex: grant create session, create table, create sequence, create view to USER_NAME;


	grant create session, create table, create sequence, create view to c##blog_user_10;

ORACLE-CREATE-USER-AND-GRANT-PERMISSIONS

Step 4:

Syntex: conn USER_NAME/PASSWORD;


	conn c##blog_user_10/test#0010;

ORACLE-CREATE-USER-AND-GRANT-PERMISSIONS

Step 5: show user;

ORACLE-CREATE-USER-AND-GRANT-PERMISSIONS

Step 6: Now you can create a table and insert data into it.


	-- Table create command
	CREATE TABLE student(
	    id NUMBER GENERATED BY DEFAULT AS IDENTITY,
	    first_name VARCHAR2(250) NOT NULL,
	    last_name VARCHAR2(250) NOT NULL,
	    PRIMARY KEY(id)
	);
	
	-- Insert command
	INSERT INTO student (first_name, last_name) VALUES ('Hareesh', 'Soni');
	
	-- Commit command
	commit;