CREATE TABLE for another OWNER/SCHEMA and in another TABLESPACE?
I am logged in a SYSTEM user. Now I want to create a table aaa. The owner of this table should not be SYSTEM but user KARL. and the TABLESPACE should not be SYSTEM but the (existing) TABLESPACE tttt.
As far as I know I can achieve this by issuing the following command:
CREATE TABLE KARL.aaa ( a INTEGER, .......) TABLESPACE tttt;
Regarding the TABLESPACE parameter I am not sure. Is it possible to allocate a TABLE for User Karl in a TABLESPACE which is not assigned to him?
Furthermore I have an additional problem.
I have a script with hundreds of CREATE TABLE + ALTER TABLE + CREATE INDEX DDL statements.
All of them are not prepended with Schema/Owner and an TABLESPACE clause.
Can I put somehow one single instruction at the top of the script which telles Oracle
to use
- OWNER Karl as Schema/Owner for all subsequent DDL stements
- TABLESPACE tttt as TABLESPACE for all subsequent DDL stements
?
In MYsql there is a "use <database>" statement. Is there soemthing similar for Oracle?
Thank you
Peter