I am trying to copy my Oracle database to my local Oracle XE database. I am using Oracle SQL Developer.
I connected to my database, then exported a .sql file from my database. I then created a new local database and I tried running the .sql file against it.
I get an error when I did that:
CREATE TABLE "user"."table_name"
:::
:::
TABLESPACE "tablespace name" ;
Error report -
ORA-00959: tablespace "tablespace name" does not exist
00959. 00000 - " tablespace '%s' does not exist
- Cause:
- Action:
What is "tablespace"? Should I remove it?
CREATE TABLE isn't always a simple statement, the one which enumerates columns and their datatypes, possibly some constraints. Nope, it can get really complex - see documentation.
Just for example, this is what SQL Developer extracts from metadata for Scott's
DEPTtable:TABLESPACEis one of parameters you can use, and it specifies ... well, tablespace in which Oracle creates that table. Usually, there's one tablespace we use for our data. Sometimes, there are more of them - in that case, you can choose which one to use. If you don't specify it, Oracle will use a default tablespace assigned to that user.Therefore, can you omit it? Yes, you can - table will then be created in that default tablespace (regardless of its name).