Create tablespace with datafile

Hello

We have consistent backup of cold (managed by the user) of 10.2.0.1 on our usb drive. Now I want to create a new tablespace using this data file (there is only one file of data in the previous db tablespace) in my current 11.2.0.1 db running. Please tell me how to create the new tablespace using the saved data file. Operating system is windows xp for both the database.

Thanking you.

Hello

This seems quite difficult... The easiest way is to start an instance of 10g, export data (using exp/expdb) and then import it into the running instance of 11 g...
I found a similar thread here, it might give you some help import a Datafile (.dbf) in 11 g 10 g tablespace

HtH

Johan

Tags: Database

Similar Questions

  • create tablespace with giving the relative path

    Can I create tablespace with the help of relative to the parameter "DATA file" path?

    I get error ORA: 01119 when I run with the relative path in the code example:
    CREATE TABLESPACE "INDX" 
    BLOCKSIZE 8192 
    DATAFILE  '\myrelativeFolder\indx01.dbf' 
    SIZE 2604M       
    AUTOEXTEND ON NEXT 10485760  MAXSIZE 32767M EXTENT MANAGEMENT LOCAL  AUTOALLOCATE  ONLINE PERMANENT;
    Version: Oracle 10g, PlSql Developer.

    --

    Maybe add environment variable operating system to the value of the DATA file somehow? I don't want to create the tablespace with full path, from the name of the drive and ending with file name.

    Edited by: CharlesRoos the 14.10.2010 18:16

    On Unix, use the korn shell, you could try something like this:

    #!/bin/ksh
    
    REL_PATH="\myrelativeFolder\indx01.dbf"
    
    sqlplus $ORA_USER/$ORA_PSWD@$ORACLE_SID << EOF > $LOGFILE
    declare
      v_Path varchar2(50) := '${REL_PATH}';
    
    begin
      execute immediate 'CREATE TABLESPACE "INDX" BLOCKSIZE 8192 DATAFILE ' || v_Path || ' SIZE 2604M
                         AUTOEXTEND ON NEXT 10485760  MAXSIZE 32767M EXTENT MANAGEMENT LOCAL
                         AUTOALLOCATE  ONLINE PERMANENT';
    
    end;
    /
    exit;
    EOF
    exit 0
    
  • create tablespace with existing data file

    Dear Sir.
    We can create tablespace with an existing data file so I can use the tables and objects already exist in the data file?

    Kind regards

    Read about "transportable tablespace" and see if this is what you need.

  • syntax used to create the tablespace with autoextend

    Hello

    Thanks for giving me the syntax for creating a tablespace of 15G in size with autoextend on.
    I have 3 5 GB data files each.

    Kind regards
    VN

    Change as needed:

    CREATE TABLESPACE VN DATAFILE
      '/u01/oradata/data3.dbf' SIZE 5120M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED,
      '/u01/oradata/data2.dbf' SIZE 5120M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED,
      '/u01/oradata/data1.dbf' SIZE 5120M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
    LOGGING
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    BLOCKSIZE 8K
    SEGMENT SPACE MANAGEMENT AUTO
    FLASHBACK ON
    /
    

    Best regards

    mseberg

  • bytes free to create tablespace

    Hello
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE     11.2.0.2.0     Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    i have created a new tablespace of 1MB file with the following syntax:
    
    CREATE TABLESPACE SCHEMA_OBJECTS 
           DATAFILE 'E:\Oracle\app\oracle\oradata\XE\SCHOBJ.DBF' SIZE 1M
           LOGGING
           ONLINE
            PERMANENT
            EXTENT MANAGEMENT LOCAL AUTOALLOCATE
            BLOCKSIZE 8K   
            SEGMENT SPACE MANAGEMENT AUTO
            FLASHBACK ON;
    
    Before creating user or any objects, if i fire the below query for allocated and free space
    
    SELECT   a.tablespace_name, a.file_name, a.BYTES allocated_bytes,
             b.free_bytes,(a.bytes-b.free_bytes) used_bytes
        FROM dba_data_files a,
             (SELECT   file_id, SUM (BYTES) free_bytes
                  FROM dba_free_space b
              GROUP BY file_id) b
       WHERE a.file_id = b.file_id
    ORDER BY a.tablespace_name;
    
    ALLOCATED_BYTES     FREE_BYTES     USED_BYTES
    1048576                         983040                 65536
    681574400                         38797312     642777088
    
    The question for me is as i have not created any object why there is a value used bytes  in query.
    Meaning that allocated and free_bytes should be same.
    
    Please let me know why it is like this
    
    Regards,
      Rakesh.

    Each data file has a header block. Each data file has a 64 k bitmap that blocks is used or free.

    This written in the online documentation.
    The question for me is why you prefer not to read and clutter up this forum with questions doc.

    -------
    Sybrand Bakker
    Senior Oracle DBA

  • create tablespace error

    Hello.
    Actally, I want to create the user and a new tablespace. Then import the data into it.
    Kindly help.


    SQL > select name from v$ datafile;

    NAME
    --------------------------------------------------------------------------------
    /U01/app/Oracle/oradata/DB11G/System01.dbf
    /U01/app/Oracle/oradata/DB11G/sysaux01.dbf
    /U01/app/Oracle/oradata/DB11G/undotbs01.dbf
    /U01/app/Oracle/oradata/DB11G/users01.dbf
    /U01/app/Oracle/oradata/DB11G/example01.dbf

    SQL > create tablespace my_tbs datafile ' / u01/app/oracle/oradata/DB11G/system01.dbf' SIZE 20 M AUTOEXTEND ON;
    create tablespace has_tablespace datafile ' / u01/app/oracle/oradata/DB11G/system01.dbf' SIZE 20 M AUTOEXTEND ON
    *
    ERROR on line 1:
    ORA-01537: failed to add file ' / u01/app/oracle/oradata/DB11G/system01.dbf'-fichier
    already a part of the database

    then I tried this


    create tablespace has_tablespace datafile 'example01.dbf' SIZE = 32 M AUTOEXTEND ON;
    create tablespace has_tablespace datafile 'example01.dbf' SIZE = 32 M AUTOEXTEND ON
    *
    ERROR on line 1:
    ORA-02237: invalid file size

    Hello

    Why you trying to add the data file system and with the same name there also? If really necessary, then you need to resize it.

    create tablespace has_tablespace datafile 'example01.dbf' SIZE = 32 M AUTOEXTEND ON;

    You use a syntax wrong here. It should be 'size 32 M' and not 'size = 32 M. There should be no '=' sign in the allocation of the size.

    If this change is intended to be useful, and then provide appropriate points and close the thread ;)

  • tablespaces or datafile

    Hi if we have a tablespace as a user with all the 4 datafile datafile size 500 MB and unlimited extended auto. My question is how oracle facing datafile. how he fill the data file to move a second if first datafile reaches 500 MB what oracle passes in second mode or extent to which one. If after 500 MB he spends 2nd and 3rd away when I come at first how it measures and the second crossing.
    If we already know our data is so huge and take as much space in the datafile 100 GB or more. What is the size, we have upgraded the datfile. or we used big file of large databases

    Oracle Studnet wrote:
    Hi if we have a tablespace as a user with all the 4 datafile datafile size 500 MB and unlimited extended auto. My question is how oracle facing datafile. how he fill the data file to move a second if first datafile reaches 500 MB what oracle passes in second mode or extent to which one. If after 500 MB he spends 2nd and 3rd away when I come at first how it measures and the second crossing.
    If we already know our data is so huge and take as much space in the datafile 100 GB or more. What is the size, we have upgraded the datfile. or we used big file of large databases

    Adeel,
    Oracle allocates the data in files in the round-robin way. Means that when the extensions will be allocated, it will be alternately among all the data files. Both files will extend simultaneously by Oracle and if it cannot develop any, it throws the error. See a demo

    Rem--I am creating a tablespace with 2 datafiles which are intially of 5m in size and can grow till 10m.I shall create a big table and I shall move the table into it.
    SQL> create tablespace test_t1 datafile 'd:\test1.dbf' size 5m autoextend on next 1m maxsize 10m;
    
    Tablespace created.
    
    SQL> alter tablespace test_t1 add datafile 'd:\test2.dbf' size 5m autoextend on next 1m maxsize 10m;
    
    Tablespace altered.
    
    SQL> create table t as select * from aman.t;
    
    Table created.
    
    SQL> insert into t select * from t;
    
    68036 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> insert into t select * from t;
    
    136072 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> insert into t select * from t;
    
    272144 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> insert into t select * from t;
    
    544288 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> alter table t move tablespace test_t1;
    alter table t move tablespace test_t1
                *
    ERROR at line 1:
    ORA-01652: unable to extend temp segment by 128 in tablespace TEST_T1
    
    SQL>
    

    In another session, I have the tablespace files listed with the blocks and the bytes in them. You can see that when I moved my table in it, the number of busy blocks is the same in both files. And he went to increase a parallel way. When I got the error, I got it for the entire tablepsce that is mentioned above.

    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> select blocks, bytes,file_id from dba_data_files where tablespace_name='TEST_T1';
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           640    5242880          8
           640    5242880          9
    
    SQL> /
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
           896    7340032          8
           896    7340032          9
    
    SQL> /
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
          1152    9437184          8
          1152    9437184          9
    
    SQL> /
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
          1280   10485760          8
          1280   10485760          9
    
    SQL> /
    
        BLOCKS      BYTES    FILE_ID
    ---------- ---------- ----------
          1280   10485760          8
          1280   10485760          9
    
    SQL>
    

    On the anticipation of the significant increase of the database and file, it actually depends on how you want to manage. In one about 50 TB of data, I had seen the space allocated manually by administrators. They have no use Bigfile. If you want to make things simple, surely, you can go ahead and use it.
    HTH
    Aman...

  • Existing user created tablespaces database query

    Hai all,

    Is it possible to display the user created tablespaces query?

    Thank you

    This one?

    SQL> select dbms_metadata.get_ddl('TABLESPACE','USERS') from dual;
    
    DBMS_METADATA.GET_DDL('TABLESPACE','USERS')
    --------------------------------------------------------------------------------
    
      CREATE TABLESPACE "USERS" DATAFILE
      '/oradata1/TEST11/users01.dbf' SIZE 5242880
      AUTOEXTEND ON NEXT 1310720 MAXSIZE 32767M
      LOGGING ONLINE PERMANENT BLOCKSIZE 8192
      EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT
     NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO
       ALTER DATABASE DATAFILE
      '/oradata1/TEST11/users01.dbf' RESIZE 78643200
    
    SQL>
    
  • Create Tablespace based on ASM diskgroup

    Oracle 11g r2.

    create tablespace test
    DataFile '+ DATA' size 32G
    MaxSize unlimited
    autoextend on
    management of local measure AUTOALLOCATE
    Auto segment space management;


    -error:

    Error report:
    SQL error: ORA-02180: invalid option for CREATE TABLESPACE
    02180 00000 - "invalid option to CREATE TABLESPACE"
    * Cause: An invalid option appeared.
    * Action: Specify one of the valid options
    ONLINE, OFFLINE, FORCE, RETENTION.


    What could be wrong?

    Hello
    If you db_create_file_dest has the value '+ DATA', then you can also use this command.

    create tablespace datafile size 32G autoextend on next 10 M maxsize test extended unlimited local management AUTOALLOCATE
    Auto segment space management;

    If your database is 8 k the size of your data file maximum is 32G, then you must create the bigfile tablespace when you want the size of a file of data beyond 32 G. In this case, the syntax is
    create a bigfile tablespace...

    concerning
    Peter

  • Can u create a tablespace with these settings?

    I use 12.1 DB. I need to create a tablespace with 1 data file (say abc.dbf), initial size is 10 MB, but I need grow no more than 1 GB.

    I tried the user guide. You can give the initial size of the DB using SIZE 10 M, but I couldn't find a way to give an upper limit for the tablespace.

    There are 2 settings in the DBA_TABLESPACES view.

    Maximum default MAX_EXTENTS NUMBER of extensions

    Maximum default size of max_size NUMBER of segments (in Oracle block)

    There is no clause in measure Network Management of the TABLESPACE CREATE & segment management of the sous-clauses to give a maximum number.

    Is how Oracle works is like, if you create a tablespace with a data file of 1 G, with autoextend NO, then it will grow to 1 G and then stops?

    If so, what did MAX_EXTENTS & MAX_SIZE really means?

    The physical limitations of the database for 12 c gives this information:

    Blocks of databaseMaximum per data fileLoad platform; generally 222 - 1 blocks

    So, if my block size is 8 k, then the maximum size for the data file is just 8192) /(1024*1024*1024) ((2^22-1) * = 32 GB, which is very low for a single file of data?)

    SQL > create tablespace foo

    2 datafile 'c:\temp\foo.dbf' size 10 m autoextend on maxsize 1 g;

    Created tablespace.

  • create tablespace temp with parameters

    It's recommended to create tablespace temp with parameter (autoextend, maxbytes, maxblock and increment_by). ?

    If Yes, please help me with the syntax of the command.

    Kind regards.

    Please read the documentation before posting similar questions.

    CREATE TABLESPACE
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/statements_7003.htm#SQLRF01403

    CREATE TABLESPACE: examples
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17120/omf003.htm#ADMIN11501

    Thank you
    Hussein

  • Create tablespace and databasefiles

    I create a tablespace with sets of database files it contains with the following option

    I get the following error:

    CREATE TABLESPACE PETIT_FICHIER "CLAIMS_NEW".
    DATA FILE
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW1. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW2. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW3. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW4. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW5. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW6. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW7. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW8. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW9. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW10. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW11. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW12. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW13. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW14. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M.
    ' D:\ORACLE\PRODUCT\10.2.0\ORADATA\QAIDM2\CLAIMS_NEW15. DBF' SIZE 4096M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE 4096M

    NOLOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

    Error:

    Error in the command line: 1 column: 0
    Error report:
    SQL error: ORA-00059: exceeded maximum number of DB_FILES
    00059 00000 - "maximum number of DB_FILES exceeded."
    * Cause: The value of the DB_FILES initialization parameter has been exceeded.
    * Action: Increase the value of the parameter DB_FILES and hot start.

    I don't know how to rectify this error? Do I have to reduce the number of database files?

    Please notify
    Thank you
    Jay

    Hello

    Is there a way you can tell datbase files are associated with what table?

    You can verify that the data files are used for a Table (a Segment) with the following query:

    select distinct file_id
    from dba_extents
    where owner = ''
    and segment_name = ''
    and segment_type like 'TABLE%';
    

    Then, with the view v$ datafile , you can have the filename of the corresponding FILE_ID.

    I can delete some files from database containing old data, but I don't know how to find these data files hold the data in the table who?

    I don't know it's a nice idea, a Table is likely to be spread over several data files if its Tablespace has several data files.

    Hope this helps.
    Best regards
    Jean Valentine

  • Create tablespace error on ASM

    SQL > CREATE TABLESPACE "SYS-AUDIT_D1.
    2 DATAFILE '+ DATA/LUCMT/SYS_AUDIT ";
    CREATE TABLESPACE "SYS-AUDIT_D1.
    *
    ERROR on line 1:
    ORA-01119: error in creating file of database "+ DATA/LUCMT/SYS_AUDIT".
    ORA-17502: cannot create the file + DATA/LUCMT/SYS_AUDIT ksfdcre:3
    ORA-15173: entry 'SYS_AUDIT' does not exist in the directory "LUCMT".


    ANY IDEA?
    thnx in advance

    Hello

    When creating a tablespace, specify the full path of the data file. This must exist before you create the data file.

    The only way do not specify the no pre-existing path, and the path of the data file is simply mentioning the diskgroup as follows.

    CREATE THE 'SYS_AUDIT_D1' FILE TABLESPACE DATA '+ DATA' SIZE 10 M;

    It will follow OMF and create files.

    If you want to create files in a specific directory with the specific name create as follows

    CREATE TABLESPACE "SYS_AUDIT_D1" FILE DATA '+ DATA/LUCMT/SYS_AUDIT' SIZE 10 M;

    Specify the size clause. This will prevent the error.

    Kind regards
    Rasmussen

  • tablespace with multiple data files

    Hi all

    We have RHEL4 server with oracle 10 g 2 inside.

    can we create a tablespace with multiple data files? I mean while creating a tablespace itself, we should be able to create two or more data files (should not use ALTER tablespace command).

    If possible, please give me the SQL to do this (assume that I need to create a tablespace with two data files).

    Thanks in advance...

    Not so difficult isn't it?

    create tablespace datafile test
    '1.dbf' size 1 m REUSE AUTOEXTEND ON NEXT 32 M MAXSIZE 1500 M,
    '2.dbf' size 1 M REUSE AUTOEXTEND ON NEXT 32 M MAXSIZE 1500 M
    EXTENT MANAGEMENT SEGMENT LOCAL SPACE MANAGEMENT AUTO;

  • Tablespace with a data file name in double and the directory added

    Version Oracle 11.1.0.7
    AIX platform

    I have exactly the same directory for the tablespace even a tablespace with 2 files with exactly the same name.

    I don't think it was possible for Oracle create two data files in the same directory with exactly the same data file for a tablespace name.

    The difference between the two seems to be the sizes - one is 10G, the other is 10 m autoextend on but with maximum size is equal to the size of create.

    It is not possible to table either both are full.

    Please notify.

    Thank you.

    You have a character that is hidden in the name of the file. Use ls for your operating system which shows the special characters (ls - lb or something, man ls).

Maybe you are looking for

  • Unable to connect to the App Store since the upgrade to IOS 10

    Tried to restart App Store and phone. changed the password and recorded out and back in but still unable to connect. We will, get apps but when I try and download it keeps asking for the password and say that it can not connect. Someone at - it advic

  • Satellite L750-A010 - I want to update the nVidia graphics card

    Hey Please, I got Satellite L750-A010 and I want to update my card NVIDIA ge force

  • Group video call does not

    Hello! I recently bought a laptop with Windows 8.1 with Skype application pre-installed. When when I video call to one person, everything works normally, and I am able to see the other person. However, when you make a group call, I'm the only one who

  • concatenate files

    My test will create tables that it progresses - which can be saved in Word / Excel. I generate a summary at the end of the test based on the results of the individual tables. The problem is that the summary should be at the beginning of the report (w

  • Disc playback

    I just picked up a copy of Starship Troopers, and he won't play. It shows the loading bar, and then the screen turns white. The machine still works because if I hit some buttons on the remote, it says that I can not perform this function at the time.