I have a new fresh instance of Oracle Express 11g. I'm trying to create a new Schema with a Table and a View in the default db (xe).
My script is:
create user XAuthority identified by mysecret; alter session set current_schema = XAuthority; create schema authorization XAuthority create table CUSTOMER ( ID int, CUSTOMER text) create view CUSTOMER_VIEW as select * from CUSTOMER grant select on CUSTOMER_VIEW to xareadonly;
but I get an error:
SQL Error: ORA-02421: missing or invalid schema authorization identifier 02421. 00000 - "missing or invalid schema authorization identifier"
*Cause: the schema name is missing or is incorrect in an authorization clause of a create schema statement.
*Action: If the name is present, it must be the same as the current schema.
I'm familiar with Postgres and MySql but it seems Oracle is quite different. Can anyone tell me what's wrong here?