TO MOVE TABLESPACE

I need to move tablespace to other disk: IN ORACLE 10G
I use following commands:
1 i connect to database as sysdba i not shutdown database
2 I take tablespace offline ALTER TABLESPACE TB1 OFFLINE;
3.i copy datafile on SO
4 I try to move tablespace ALTER TABLESPACE RENAME 'D:\ CARPETA\TB1.DBF' TO 'E:\ CARPETA\TB1.DBF' OR
ALTER DATABASE RENAME 'D:\ CARPETA\TB1.DBF' TO 'E:\ CARPETA\TB1.DBF'
1 but error *RENAME  
2 too error *to
i can't to move tablespace.
thanks

Andrea, you should always post the actuall command you issued and the error Oracle returned where possible. In the code you list you are missing the tablespace_name from the command.
From the DBA Administration manual chapter on managing data files here is the command for renaming all the datafiles that make up a tablespace in a single command:
ALTER TABLESPACE users
RENAME DATAFILE '/u02/oracle/rbdb1/user1.dbf',
'/u02/oracle/rbdb1/user2.dbf'
TO '/u02/oracle/rbdb1/users01.dbf',
'/u02/oracle/rbdb1/users02.dbf';
You would also have the option of renaming the files one at a time.
HTH -- Mark D Powell --

Similar Messages

  • In which oracle release alter table move tablespace introduce

    Hi,
    Can you please provide me one information that from which oracle realease oracle introduce alter table move tablespace tablespace_name; ...
    Thanks

    user644122 wrote:
    Hi,
    Can you please provide me one information that from which oracle realease oracle introduce alter table move tablespace tablespace_name; ...
    ThanksDon't know whether it was in Oracle 7, but documentation says that it was in Oracle 8i
    Look at this link:
    http://www.oracle.com/pls/db102/print_hit_summary?search_string=move+tablespace
    By the way, why you need this information?
    Edited by: Kamran Agayev A. on Oct 2, 2009 11:54 PM

  • How to move Tablespace from One disk group to another disk group in RAC

    Hi All,
    I have 11gR2 RAC env on Linux.
    As ofnow I have problem with disk group. I have 3 disk group which is almost full - 98%. I have added one NEW disk group and want to move some of the Tablespace(TBS) from OLD disk group to NEW diskgroup and make some free space in OLD disk group.
    Can any one suggest me how to move TBS from one disk group to another disk grup without shutting down the instance.
    DB is in Noarchive mode.
    Thanks...

    user12039625 wrote:
    Hi Helios,
    Thanks for doc id but I am looking for noarchive mode solution. becaues I got ORA-
    "ORA-01145: offline immediate disallowed unless media recovery enabled " when run alter database datafile '...' offline.
    Hence I am trying something and findout below steps but not sure how useful it is:
    1- put tablespace offine
    2- Copy the file to new diskgroup using Either RMAN or DBMS_FILE_TRANSFER.
    3- Rename the file to point to new location.
    4- Recover the file.
    5- Bring the file online.
    I had move 240M TBS from OLE to NEW.
    These steps run successfully so I think this is valid for noarchive mode.Hence want to confirm..so inform me please.
    Thanks :)I have doubt in my mind:
    1. You database is in noarchivelog mode
    2. You're taking tablespace offline
    3. Suppose you're moving a file of size 10GB(or any larger filesize) to another disk group
    4. Now after moving the file, you're trying to bring the tablespace online............NOW
    tablespace will need recovery. if the required data is inside the SGA then it is ok. But if the data has been flushed, then?
    if step 2 and 3 has taken significant time, then most probably you'll not be able to bring that tablespace online.
    Regards,
    S.K.

  • What is the best way to move tablespace

    i have to move one big tablespace (with 130-140 datafiles) from one instance to another (it's oracle 10.2.0.0.4), so what is the best way to do it?

    anfy2002us wrote:
    yeah and i think that transportable tablespace it the best way, but for such big database it might take several day, and there is no way to go offline for several daysWell, With TTS, Oracle won't actually export/import the data, it only export and import the metadata related to the tablespace and the schemas and tables of course. Most time you need to spend on the operation is copying files at OS level on storage. So it won't take days to copy the files unless your storage is terribly slow.

  • Redefinition For Move Tablespace.

    Hi,
       I am using Release 11.2.0.3.0 of oracle. Now i am supposed to move a 'big table big_tab1(~700GB)+its indexes' to a different tablespace which is encrypted. I am trying to follow redefinition approach inspite of ALTER TABLE MOVE , as because we wont be able to have much downtime on prod. But below are my difficulties.
       I am having a foreign key constraint(con_1) on table tab1 which refers to the primary key of big table  big_tab1. if i am using COPY_TABLE_DEPENDENTS for copying all the constraints and indexes as it is, then all my indexes not being shifted to encrypted tablespace, they are created in the existing unencrypted tablespace only?
                                                                             else
       If i am creating the indexes/constraints manually (by specifing the encrypted tablespace) on the interim table, just after the START_REDEF_TABLE, then my indexeses will be created on new encrypted tablespace but i have to drop the existing foreign key(con_1) and create the 'foreign key constraint ' that is on table tab1, and it will refer to the redefined table big_tab1, so it will take lock for that duration of ALTER statement, and the purpose of online redefinitio will not be full filled.
       Please suggest?

    You are confused.
    The data for a table is stored in segments. For a partitioned table the data is contained in partitions: the table HAS NO DATA. Each partitions data is stored in its own segment which can be in its own tablespace.
    For a subpartitioned table the data is contained in subpartitions: the table HAS NO DATA, the partitions HAVE NO DATA. ALL DATA IS IN THE SUBPARTITIONS. Each subpartitions data can be in its own tablespace. There is NO index data to be moved. There is NO index partition data to be moved. There is NO data except the data in the index subpartitions.
    If you want to modify the tablespace the NEW partitions or subpartitions will use (as opposed to moving existing data to a new tablespace) then you need to use the 'modify_index_default_attrs' clause of the ALTER INDEX statement.
    See ALTER INDEX in the SQL Reference
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_1008.htm#BGECEJHE
    >
    modify_index_default_attrs
    Specify new values for the default attributes of a partitioned index.
    Restriction on Modifying Partition Default Attributes The only attribute you can specify for a hash-partitioned global index or for an index on a hash-partitioned or composite-partitioned table is TABLESPACE.
    TABLESPACE Specify the default tablespace for new partitions of an index or subpartitions of an index partition.
    >
    See the example in the doc
    >
    Modifying Default Attributes: Example The following statement alters the default attributes of local partitioned index prod_idx, which was created in "Creating an Index on a Hash-Partitioned Table: Example". Partitions added in the future will use 5 initial transaction entries and an incremental extent of 100K:
    ALTER INDEX prod_idx
    MODIFY DEFAULT ATTRIBUTES INITRANS 5 STORAGE (NEXT 100K);

  • Lobsegment move tablespace

    Hi Friends,
    Oracle 10g (Win2003)
    I want to move my lobsegment to other tablespace, Is the command syntax the same with moving a table?
    Another thing, why are my tablespaces have max value limit of 32Gb for each
    datafile? Can I increase it?
    Thanks a lot

    http://tahiti.oracle.com
    If after reading the docs there is any further issue please let us know.

  • Move Tablespace

    I've got some user tables on SYSTEM TABLESPACE
    How could I move these user tables to
    USER TABLESPACE
    THX

    My version is 7.3
    as a matter of fact
    I wanna move a whole schema from
    SYSTEM TABLESPACE to USERDATA TABLESPACE
    Maybe I'll try to write a script
    (get all the schema's table from DD)
    to generate
    a script (move all the schema's table)
    but
    is there any graceful solution
    null

  • Unable to move tablespace form pervious tablespace ,

    Dear All ,
    I have *10g database on rehl5* .I move table space of table transaction_images* user table space to images table space* .It completed successfully
    Problem is transaction_images table show using table space images but store data in user table space .
    Note :-I am also rebuild index also.
    Thanks in advance
    Shaikh Abdul Moyed
    Edited by: abdul moyed on Jan 24, 2011 10:36 PM

    Satish Kandi wrote:
    I have *10g database on rehl5* .I move table space of table transaction_images* user table space to images table space* .It completed successfully How did you MOVE the table? What is the table structure?
    Problem is transaction_images table show using table space images but store data in user table space .How did you check this?I move table space not a table .
    Using em ->administrator-> schema ->tables

  • How to move table from one tablespace to other tablespace?

    how to move table from one tablespace to other tablespace?

    887274 wrote:
    how to move table from one tablespace to other tablespace?
    alter table <table_name> move  tablespace <new_tablespace_name>;
    Rebuild the indexes; alter index <index_name> rebuild <new_tablespace_name> online;Example;:
    SQL> create table ttt( ID NUMBER PRimary key);
    Table created.
    SQL> insert into ttt values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL> alter table ttt move tablespace users;
    Table altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 UNUSABLE
    SQL> alter index SYS_C0010863 rebuild tablespace users online;
    Index altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL>

  • How to move lobsegment and  lobindex to a different Tablespace

    Oracle Version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
    Os: Solaris 10
    Hello Everybody,
    I want to move a lobsegment and a lobindex to a differrent tablespace.
    But when i am executing the following statement in order to move the LOBINDEX I am getting the errors listed below:
    SQL> ALTER INDEX SYS_IL0000012358C00008$$ REBUILD TABLESPACE INDX;
    ALTER INDEX SYS_IL0000012358C00008$$ REBUILD TABLESPACE INDX
    ERROR at line 1:
    ORA-02327: cannot create index on expression with datatype LOB
    Is there any differrent commands/methods of moving the LOBSEGMENT/LOBINDEX to a differrent tablespace.
    Any help Appreciated..
    Regards,
    Prosenjit Mukherjee.

    Hi,
    Assuming that I have table "TEST" in USERS TableSpace
    CREATE TABLE TEST
    TEST_ID NUMBER NOT NULL,
    TEST_NAME CLOB,
    CONSTRAINT PK_TEST PRIMARY KEY(TEST_ID)
    SQL> ALTER TABLE TEST MOVE TABLESPACE EXAMPLE;
    Above command will move the table to new tablespace but will not move the CLOB segment and it will still be in original tablespace. This is because LOB data is stored outside of the table.
    Check the tablespace of the CLOB column by issuing following sql.
    SQL> SELECT index_name, tablespace_name
    FROM user_indexes WHERE table_name = ‘TEST’;
    INDEX_NAME TABLESPACE_NAME
    SYS_IL0000073575C00002$$ USERS
    In order to move CLOB column to different tablespace, we have to issue following command.
    SQL> ALTER TABLE TEST MOVE LOB(TEST_NAME) STORE AS (TABLESPACE EXAMPLE);
    In above example, TEST_NAME is the CLOB column which we want to move to new tablespace and EXAMPLE is target tablespace. Above command will successfully move LOB segments to the new tablespace. We can verify it by issuing same sql again.
    SQL> SELECT index_name, tablespace_name
    FROM user_indexes WHERE table_name = ‘TEST’;
    INDEX_NAME TABLESPACE_NAME
    SYS_IL0000073575C00002$$ EXAMPLE
    - Pavan Kumar N

  • Move schema to a diff.tablespace

    Dear all,
    How can I move a particular shcema objects or the complete schema from his default tablespace to other tablespace ?
    Kai

    Kai,
    Here are some ways you can move schema from its default tablespace to other tablespace.
    Using anonymous pl/sql block or sql script;
    DECLARE
       CURSOR mcur
       IS
          SELECT   table_name FROM user_tables;
       v_sql                        VARCHAR2 (100);
       c_tablespace_name CONSTANT   VARCHAR2 (30) := 'MY_NEW_TS_NAME';
    BEGIN
       FOR x IN mcur
       LOOP
          v_sql :=
                'alter table '
             || x.table_name
             || ' move tablespace '
             || c_tablespace_name;
          DBMS_OUTPUT.put_line (v_sql);
       -- execute immediate v_sql :
       END LOOP;
    END;*2nd Method*;
    Using conventional export and import
    exp username/password file=myuserexport.dmp log=myuserexport.log
    Before importing
    1. drop all the objects from user (except roles and db-link).
    2. Setup a new default tablespace and revoke unlimited tablespace from the user and set quota 0 on old tablespace.
    3. You can also drop entire user and recreate one with new default tablespace
    imp username/password file=myuserexport.dmp log=myuserexport.log*3rd Method: (if using 10g), you can make use of datapump (remap tablespace)*
    http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
    Regards
    Edited by: OrionNet on Mar 11, 2009 12:27 AM

  • Move tables (some with LONG datatypes) across tablespaces in Oracle 9i

    I have a 14GB tablespace which about 3,000 tables (and only tables) in. Only 2.6GB is used so I would like to resize the tablespace to about 3GB initially.
    I moved the tables with "alter table <owner>.<tablename> move tablespace <tablespace>" and this worked for most of the tables but failed on some with this kind of error:
    alter table IFSAPP.COMMAND_SYS_BUFFER_TAB move tablespace IFSAPP_DATA_TEMP
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatypeI then moved the other tables back to the original a little frustrated.
    Further reading suggested exporting and importing the tables is the way to go.
    I prefer the alter table because Oracle manages the lock whilst it moves. If I export and import, the table could change in between, potentially ending with me importing an old copy, couldn't it? [It seems neigh on impossible to guarantee an available window to do much!]
    So I though I could you the alter table move for ALL tables and those that are left, use export/import, to minimise the risk.
    How should I proceed?
    1) Create TEMP_TABLESPACE as 3GB
    2) "alter table ... move tablespace ..." for all tables in ORIGINAL_TABLESPACE to TEMP_TABLESPACE
    3) For the remaining tables, individually:
    a) lock table (not sure how)
    b) export table: exp user/pass tables=tablename file=exp.dmp rows=yes
    c) drop table
    d) create table in TEMP_TABLESPACE*
    e) import table: imp user/pass tables=tablename
    * this means I need to know how to re-create the table. It also means views and indexes and packages are going to become invalid.
    4) drop tablespace ORIGINAL_TABLESPACE
    5) Create ORIGINAL_TABLESPACE as 3GB
    6) "alter table ... move tablespace ..." for all tables in TEMP_TABLESPACE to ORIGINAL_TABLESPACE
    7) For the remaining tables, individually:
    a) lock table (not sure how)
    b) export table: exp user/pass tables=tablename file=exp.dmp rows=yes
    c) drop table
    d) create table in ORIGINAL_TABLESPACE
    e) import table: imp user/pass tables=tablename
    This seems high risk and messy.
    Has anyone advice or tips to make it simpler?
    As it stands I am considering leaving alone, the risks worry me!
    Thanks

    Interesting idea.. so this would create a temporary table in the temporary tablespace.
    Rather than set the default tablespace, can I merely add the tablespace clause?
    COPY FROM user/password@database CREATE TmpTblName TABLESPACE TmpTablespace USING SELECT
    * FROM Table_name;
    Either way - can you confirm for each table, I would need to:
    COPY FROM user/password@database CREATE TmpTblName TABLESPACE temp_tablespace USING SELECT * FROM Table_name;
    At this point all indexes for these will be invalid.
    Drop tablespace ORIGINAL_TABLESPACE
    Create ORIGINAL_TABLESPACE as 3GB
    COPY FROM user/password@database CREATE TblName TABLESPACE original_tablespace USING SELECT * FROM TmpTable_name;
    rebuild any indexes which are unusable.
    recompile any invalid objects

  • Move tables to application tablespace

    Hai All,
    In my application many tables and indexes stay in system tablespace. Use query 'Alter table table_name move tablespace app_tbs' and 'Alter table index_name move tablespace indx_tbs'. we can move objects from system tablespace to application tablespace. Any other solution for this kind of activity.
    Please help,
    Shiju

    Alter table index_name move tablespace indx_tbsThis is not move but rebuild for index.
    Nicolas.

  • Move schema to another tablespace

    I want to move one schema and all objects own by particular schema to it's own tablespace (new_tablespace).
    will command provided below move all existing schema objects to new tablespace or just new objects?
    alter user default tablespace new_tablespace;

    mishomor wrote:
    I know it's long time since I posted this but I finally had a change to implement it.
    Thing is, if I execute command on one-by-one basis it works fine, but if I try block you guys posted it doesn't work. It ends with error:
    Error starting at line 1 in command:
    begin
    for tbl in (select table_name from all_tables where owner = 'FLOWS_020000') loop
    execute immediate 'alter table ' || tbl.table_name || ' move tablespace flows';are you executing this as the owner of 'tbl_name'?
    end loop;
    end;
    Error report:
    ORA-00942: table or view does not exist
    ORA-06512: at line 3
    00942. 00000 - "table or view does not exist"
    Cause:
    Action:
    begin
    for tbl in (select table_name from all_tables where owner = 'FLOWS_020000') loop
    execute immediate 'alter table ' || tbl.table_name || ' move tablespace flows';
    end loop;
    end;
    output of
    select table_name from all_tables where owner = 'FLOWS_020000';
    brings bunch of tables!!
    If I just run ...
    alter table FLOWS_020000.whatever_table move tablespace flows;
    alter index FLOWS_020000.whatever_index rebuild tablespace flows;
    ... it works fine.
    Because here you specifically qualified the table name with the owner. In your procedure above, you did not do that, so 'whatever_table' was assumed to be owned by whoever was executing the procedure.
    I am using SqlDeveloper 1.5.4

  • Move large tables and indexes into own tablespace

    I currently manage a 100Gb 10.2.0.4 SE database on Windows.
    There is one data tablespace and one indexes.
    I have one table xxxHistory that is periodically cleared out, however, six months of data must be retained.
    The table is currently 17Gb and has 95 million rows, the corresponding nine or so indexes take another 47Gb.
    I am having a small problem with I/O waits on this table so, I want to move this table and the indexes to their own tablespaces, which I will create (xxxHistory_D and xxxHistory_I).
    I know the two methods, exp/imp (difficult due to foreign keys) and the prefered method of :
    alter table tbl move tablespace tblsp and
    alter index ind rebuild tablespace tblsp.
    I have no problems with the syntax etc, having used this method many times.
    My question is, does anyone have a better idea of how to approach this to minimise downtime?
    The system cannot be used if this table is not available.
    I am also going to migrate to 11.2x when available but can't find anything in the new features to help.
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Thanks,

    BigPhil wrote:
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Strategically this sounds as if you really do need partitioning; since you're on SE, you could consider the v7 "partition view" concept.
    Create one table per month, and index each table separately.
    Add a constraint to each table of the form: "movement date between to_date('...') and to_date('...')"
    Create a union all view of the tables.
    Getting rid of a single month means redefining the view.
    In theory any queries you do should be able to filter predicate pushdown and thus eliminate redundant partitions, and also handle pushing joins down into the union all view. But that's something you would have to test carefully.
    You could even create the tables as index organized tables - which may be the solution to your I/O wait problems - if your queries are about stock movement then all the movements for a given stock will be thinly scattered across the table, leading to one block I/O per row required. IOTs would give you an overhead on inserts, but eliminate waits on queries.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Error while adding repository user

    Hi, We have a repository and a user associated to that 10.2.0.3, we dropped repository owner (schema) and re created a fresh repository with out un regestering the repository_user(target) , after creating new repository we dropped the table (WB_RT_VE

  • Library Cache Pin Wait Event (within the context of APEX)

    Hello, Firstly - Oracle Version: 10.2.0.4.0 Apex Version: 3.0.1.00.08 Okay, my colleague (no really! This isn't one of those "Ahem ... A friend of mine has contracted something nasty +downstairs+..."-type questions) is having problems compiling a pac

  • Wait for event Node - (ParForEach index 000000)

    Hi all, I have a wait event and my work flow resulted in error at this node with the (ParForEach index 000000) error.. what might be the problem.. Thanks in advance, Sethu

  • Save a .bpm as a .jgp

    Wanting to save a .bpm as a .jpg.  Don't see that as an option in the Save list.  Help.

  • Physical inventory recount error in WM - T.code  LI14

    Hi Guys I have an error while entering recount at WM t.code LI14 Error message is An error occurred in an internal table Message no. L4111