move a read only Tablespace
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: move a read only Tablespace

  1. #1
    Join Date
    Mar 2002
    Posts
    301

    move a read only Tablespace

    Hi,

    I want to copy a read-only tablespace to another location and the tomorrow to rename it via the database ant remove the old location.

    will this work?

    Today:
    OS>cp all_data_files_tbs_read_only to_another_location

    Tomorrow:
    SQL> Alter tablespace tbs_read_only offline;
    SQL> Alter database rename datafile to to_another_location;
    SQL> Alter tablespace read write;
    OS>rm old all_data_files_tbs_read_only

    Bensmail

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    what?

  3. #3
    Join Date
    Mar 2002
    Posts
    301
    what what?

  4. #4
    Join Date
    Oct 2008
    Location
    Chandigarh, India
    Posts
    322
    rest everything right but issue alter tablespace online before alter tablespace read write...
    but y did u not try it at ur end??
    lucky

  5. #5
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,471

    Wink Piece of cake

    Rest assured it will work.
    Code:
    SQL> alter tablespace example offline;
    
    Tablespace altered.
    
    SQL> !cp /u01/data/ORCL/example01.dbf /u01/data/ORCL/example01a.dbf
    
    SQL> alter database rename file '/u01/data/ORCL/example01.dbf'
      2     to '/u01/data/ORCL/example01a.dbf';
    
    Database altered.
    
    SQL> alter tablespace  example online;
    
    Tablespace altered.
    
    SQL> select tablespace_name, file_name, online_status from dba_data_files;
    
    TABLESPACE_NAME     FILE_NAME                        ONLINE_
    ------------------  -------------------------------  -------
    USERS               /u01/data/ORCL/users01.dbf       ONLINE
    UNDOTBS1            /u01/data/ORCL/undotbs01.dbf     ONLINE
    SYSAUX              /u01/data/ORCL/sysaux01.dbf      ONLINE
    SYSTEM              /u01/data/ORCL/system01.dbf      SYSTEM
    EXAMPLE             /u01/data/ORCL/example01a.dbf    ONLINE
    
    SQL>
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width