| Mukta |
Posted: May 06, 2008 03:12:35 AM |
Total Post: 28
Joined: Jan, 2007
|
hello everyone,
I am using a schema X, which has 10 tables. now i have to move 4 tables out of these 10 to another schema Y. My query here is
1.how do I create another schema.
2.how do i shift these tables into newly created schema.
I dont mind creating a tablespace within the same schema X.but i m not getting how it is to be done as i want to shift the existing tables to new tablespace.
ne help would be much appreciated |
|
|
Mohammed Taj |
| Posted: May 06, 2008 03:48:05 AM | |
|
Total Post: 630
Joined: Jul, 2007
|
1.how do I create another schema.
How you create your SCHEMA "x" then same command is use for creating new scheams.
SQL> CREATE USER username IDENTFIFIED BY password;
2.how do i shift these tables into newly created schema.
You can use
1. CTAS ( create table as select)
2. export import
3. COPY command
Search on net for full syntax.
|
|
|
|
|
http://sharear.blogspot.com |
| Posted: May 07, 2008 01:11:55 AM | |
|
Total Post: 43
Joined: Apr, 2008
|
suppose you move table test from x schema to y schema
for this
1.First create user Y (if it is exist then go to 2)
2. log on as sysdba
> sqlplus / as sysdba
SQL> create table y.test as select * from x.test;
the test table of y schema does not have the primary/foreign key and indexes which are in x schema. so you need to recreate those
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |