Oracle 11g Express Edition - missing or invalid schema authorization identifier
CREATE SCHEMA
  
  Purpose
  
  Use the CREATE SCHEMA statement to create multiple tables and views and perform multiple grants in your own schema in a single transaction.


Well you have multiple issues. First of all you need to have CREATE SESSION system privilege granted to the newly created user. Secondly your data types are incompatible in Oracle(int should be converted to number and text to varchar2).

In order to use CREATE SCHEMA statement you need to be connected to database as the user which you have specified on the statement.

The problem is you are not connected to database as xauthority by altering the session.

SQL&gt; conn sys/password
Connected.

SQL&gt; create user XAuthority identified by mysecret;

User created.

SQL&gt; alter session set current_schema = XAuthority;

Session altered.

SQL&gt; create schema authorization XAuthority
create table CUSTOMER(ID number, CUSTOMER_name varchar2(20))
create view CUSTOMER_VIEW as select * from CUSTOMER
grant select on CUSTOMER_VIEW to xareadonly;  2    3    4  
create schema authorization XAuthority
*
ERROR at line 1:
ORA-02421: missing or invalid schema authorization identifier

SQL&gt; show user
USER is "SYS"


The user should be xauthority but it is still SYS.

You need create session system privilege to connect to the database.

SQL&gt; grant create session to xauthority;

Grant succeeded.


You need quota on tablespace to create schema objects such as table.

SQL&gt; alter user xauthority quota unlimited on orapdb1_tbs1;

User altered.

SQL&gt; conn xauthority/mysecret
Connected.

SQL&gt; conn xauthority/mysecret
Connected.
SQL&gt; create schema authorization XAuthority
create table CUSTOMER(ID number, CUSTOMER_name varchar2(20))
create view CUSTOMER_VIEW as select * from CUSTOMER;

Schema created.