I have a purpose: create some small model in Oracle consisting of two schemas.
Every schema will contain 2-3 tables and 2-3 packages for functions. And I tried to write a script of creation required DDL objects, using DBForge.
And here I have some big troubles when I've restarted DBForge, deleted existing connection, and made a new one.
Now, when I try to create new user, it shows error "Invalid common user or role name":
What is this? When I hadn't delete a connection before, this script had been executed with no errors.
When I try to create a tablespace, it shows errors: cannot add file 'my_datafile_name' - file is already part of database.
Maybe I do some wrong in re-creation of tablespace? I tried to use an instruction "ALTER DATABASE DATAFILE xxx OFFLINE DROP", but it doesn't work.
I understand not very good, how to recreate right 1) tablespace with datafiles 2) user (schema) 3) packages.
If someone has a small working example, it would be great. But if not, I ask to tell where I am wrong at least.
I think i made big mistakes in code, but can't find.
I've just started to learn Oracle, in MS SQL it seems to be much simplier. Big thanks.
ALTER SESSION SET "_ORACLE_SCRIPT" = TRUE;
ALTER SESSION SET CURRENT_SCHEMA = system;
alter database datafile 'tbspc_01.dat' offline drop;
CREATE BIGFILE TABLESPACE tbspc_01
DATAFILE 'tbspc_01.dat'
SIZE 20M
REUSE
AUTOEXTEND ON;
CREATE USER gateway
IDENTIFIED BY pass4gateway
DEFAULT TABLESPACE tbspc_01
QUOTA UNLIMITED ON tbspc_01;
CREATE BIGFILE TABLESPACE tbspc_02
DATAFILE 'tbspc_02.dat'
SIZE 20M
REUSE
AUTOEXTEND ON;
CREATE USER domain
IDENTIFIED BY pass4domain
DEFAULT TABLESPACE tbspc_02
QUOTA UNLIMITED ON tbspc_02;