Moving partioned tables to different tablespaces in oracle 11g.

Dear All,
I need to move the partitioned table to different tablespace. I moved all the partitions individually and also the index.
however i have a issue now, when i check the view user_tables or dba_tables, i see null tablespaces correspomding to the table in the tablespace_name column.
how can i see the tablespace name in these views.

Even thouh Sb has given you the correct answer, I am just showing you below cut and paste sqlplus screen of 11.2.0.1 :
test1@ORCL> create table t (x number)
  2    partition by list (x)
  3    (partition p1 values (10),
  4    partition p2 values (20));
Table created.
test1@ORCL> select table_name,tablespace_name from user_tables;
TABLE_NAME                     TABLESPACE_NAME
T
1 row selected.
---Means tablespace_name.user_tables is always null for partition table(s).
---Ok, then how do I see the tablespace name?
test1@ORCL> select table_name, partition_name,tablespace_name
  2  from user_tab_partitions
  3  where table_name = 'T';
TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME
T                              P1                             USERS
T                              P2                             USERS
2 rows selected.
test1@ORCL> ALTER TABLE T MOVE PARTITION P1 TABLESPACE EXAMPLE;
Table altered.
test1@ORCL> select table_name, partition_name,tablespace_name
  2  from user_tab_partitions
  3  where table_name = 'T';
TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME
T                              P1                             EXAMPLE
T                              P2                             USERS
2 rows selected.
test1@ORCL> select table_name,tablespace_name from user_tables;
TABLE_NAME                     TABLESPACE_NAME
T
1 row selected.Just for your information please.
Regards
Girish Sharma

Similar Messages

  • How to import partitioned tables in different tablespace

    Hi everyone,
    I try to import the partitioned tables in different tablespace.
    Consider the following situation:
    I have a dump file which is created by using "Export" utility. Some data are in partitioned tables, some of them are in non-partitioned tables. Also, all tables are located in "MYTBS" tablesapce. I try to import all data from this dump file to another database. I didn't get error messages when importing the data from non-partitioned tables. However, I got error message when importing the data from partitioned tables. The error message is: tablespace 'MYTBS' does not exist.
    I just want to how I can solve this problem other than create 'MYTBS' tablespace for my new database.
    Thanks in advance.
    Angel

    Hi,
    I got the following error message:
    IMP-00017: following statement failed with ORACLE error 959:
    "CREATE TABLE "FACILITYCONNECTION",....., "CONNECTIONTYPE" "
    "NUMBER(1, 0) NOT NULL ENABLE) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 25"
    "5 PARALLEL ( DEGREE DEFAULT INSTANCES 1) NOLOGGING STORAGE( PCTINCREASE 0) "
    "TABLESPACE "MYTBS" PARTITION BY RANGE ("CONNECTIONTYPE" ) (PARTITION "
    ""EXT" VALUES LESS THAN (1) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 S"
    "TORAGE(INITIAL 65536) TABLESPACE "MYTBS" NOLOGGING, PARTITION "FAC" VA"
    "LUES LESS THAN (2) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(I"
    "NITIAL 65536) TABLESPACE "MYTBS" NOLOGGING )"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'MYTBS' does not exist
    Thanks.
    Angel

  • How to relocate table in new tablespace in Oracle 8i

    Hi all
    I would like to know how to relocate table from one tablespace to another tablespace in Oracle 8i. Currently, I create new table without data in new tablespace and then load data from old table in old tablespace. However, I think it is not efficient at all. Could anyone kindly advise any method to proceed it
    Thanks

    Nick has pointed out the best way to relocate a table. With the alter table move command you do not have to worry about FK or any other kind of constraints, table triggers, or grants. They all remain in place. You just need to rebuild the indexes as Nick pointed out.
    There were some restrictions on the types of tables that could be moved with alter table move when the command first was introduced. I think LOB columns were unsupported at first. The old exp/imp had to be used for those cases.
    HTH -- Mark D Powell --

  • Tables (part or no part) and their tablespaces in oracle 11g

    I need to list all the tables and their table spaces for non part tables along with partition tables, partition name and its table space , I am using the following query to find it however query result is not something what i am looking for as i see null in table space columns.
    tablespace column has null for even non partition table.
    in query result there are cases that null in all the tablespace_name columns.. ..
    tablespace columns have nulls for even part tables in ALL_TAB_PARTITIONS ,ALL_PART_TABLES tables for few part tables ..
    Should we generat object stats to correct name filled in tablespace column.. or am i using wrong tables in my query..? how come null in all the tablespace columns or should i include any other dictionary table?
    select AT.OWNER, AT.TABLE_NAME, AT.TABLESPACE_NAME,AT.PARTITIONED,APT.PARTITIONING_TYPE,ATP.PARTITION_NAME, ATP.TABLESPACE_NAME,APT.DEF_TABLESPACE_NAME
    From ALL_tABLES AT,
    ALL_TAB_PARTITIONS ATP ,
    ALL_PART_TABLES APT
    WHERE AT.OWNER IN ('CISADM')
    AND ATP.TABLE_OWNER(+)=AT.OWNER
    AND APT.OWNER(+)=AT.OWNER
    AND ATP.TABLE_NAME(+)=AT.TABLE_NAME
    AND APT.TABLE_NAME(+)=AT.TABLE_NAME
    ORDER BY ATP.TABLE_NAME,ATP.PARTITION_POSITION;
    could you please suggest what wrong with this query or query to find table space used for both non part and each table partition table space. Thanks in advance..

    For a partitioned table you should get tablespace_name from user_tab_partitions because it's possible to have different partitions stored in different tablespaces. This can't be shown in the single row of user_tables.
    SQL> CREATE TABLE part_test
      2  (part_key    NUMBER
      3  )
      4  PARTITION BY RANGE(part_key)
      5  (PARTITION  part_test1 VALUES LESS THAN (100) tablespace users
      6  ,PARTITION  part_test2 VALUES LESS THAN (200) tablespace example
      7  );
    Table created.
    SQL> select table_name, tablespace_name from user_tables where table_name = 'PART_TEST';
    TABLE_NAME                     TABLESPACE_NAME
    PART_TEST
    SQL> select table_name, partition_name, tablespace_name from user_tab_partitions where table_name = 'PART_TEST';
    TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME
    PART_TEST                      PART_TEST1                     USERS
    PART_TEST                      PART_TEST2                     EXAMPLEEdited by: SomeoneElse on Dec 9, 2012 10:07 AM
    (OK, I see you tried that)

  • Moving indexes to a different tablespace in siebel.

    Hi,
    While installation we gave same SIEBEL tablespace as default tablespace for indexes also , now I would like to move all indexes to a different tablespace. Is there any specifis utility / procedure available to move (or) recreate indexes .. or can we do it in Database using alter index <index_name> command...
    Thank You,
    Sunil.

    You do not move constraints.
    You can use the command:
    ALTER INDEX index_name REBUILD TABLESPACE new_tablespace;

  • Create tablespace in Oracle 11g

    Windows 2008 R2 (64-bit OS)
    Oracle 11g R2 Standard Edition ONE(64-bit database)
    I use the following Oracle command to create tablespace in 11g.
    CREATE TABLESPACE TEST_TBS
    DATAFILE
    'C:\ORACLE\ORADATA\TEST_TBS01.DBF' SIZE 5M
    AUTOEXTEND ON NEXT 5M
    MAXSIZE 50000M;
    - The above command works fine.
    Is there any better commands i need to be using in creating a tablespace w.r.t. performance and management.

    TSharma wrote:
    it is recommended to have small sized blocks for OLTP, and big sized for DSS. The reasons:
    You can try different block sizes in tablespaces...
    On OLTP, a smaller block size reduces contention:
    1. Reduces the possibility of concurrent transaction and locks on the same block.
    2. Provides a better locking mechanism
    3. Less transacction locks possibilities at the block header.
    DSS benefit from big blocks mainly because of IO:
    1. Retrieves in less IO operations more data, which is critical for FTS and index scans.
    2. A higher row density means less IO
    3. Indexes retrieve information on a block per block basis, with big blocks indexes are retrieved with less IO
    4. Reduces the chances of chained rows.
    Check the following link for examples and details information.If johnpau needs a 50G file he has no choice: 16K blocks is the only option.
    But that advice about different blocksizes is very twentieth century. Nowadays, it doesn't matter.

  • How to handle Fact tables with different granularity in OBIEE 11g RPD

    Hello Everyone,
    I have got stuck here and need your help.
    I have two fact tables (Say F1 and F2... F1 is containing data at month-level and F2 is containing data at day level) and one Date DIMENSION TABLE. Date_Code is the PK of Date dimension table.I need to use time-series functions also.
    Can anyone tell me how to model this requirement in the RPD.
    Can we use a single dimension table(Here Date dimension table) with two fact table of different grainularity? What would be the best way to implement this requirement?
    Thanks in advance :)

    Hi Veeravalli,
    Thanks for your reply :)
    Let me explain the problem in more detail. I have one Date dimension(Date_Code,Month_Code,Quarter_Code,Half_Year_Code,Year_Code). Here Date_Code is the PK.
    In F1---->Date (Using Month_Code key)
    F2-------->Date (Using Date_Code Key)
    Level based hierarchy is there starting from Year to Date.Each level has PK defined and chronological key selected.
    F1 has level set to Month and F2 has level set to Day.
    Now if i am using ago() function on measure of F2 (having day level data) then it's working fine but if i am using ago() function on measure of F1...I am getting an error at Presentation service: Date_code must be projected for time-series functions.
    So the whole issue is with time-series functions. As per my research...I think for time series the tables in the physical model containing the time dimension cannot join to other data sources, except at the most detailed level but here i am joining with F1(using Month_Code which is not the most detailed level).
    So kindly let me know how to achieve this in rpd?

  • How to migrate data fSQL server 2005 Tables with image column To ORACLE 11g

    Hi ....
    I am in the middle of migrating our database from sqlserver 2005 version to ORACLE 11g instance, and i'm facing a problem when trying to load data into one of the oracle table which has blob column and some more. The data file was extracted from sql server 2005 table which has image column and some more. All other columns are sinking with the migration as expected but the image column is not getting loaded into oralce blob.
    I tried loading data using sqlloader.
    Is there any other way to migrate data directly between these two versions of database?. Pls help...
    Edited by: user13310523 on 21-Jun-2010 23:48

    Welcome to the forum,
    Hi,
    To link Oracle with SQL Server follow this steps:
    1-Install Oracle ODBC drivers on the server (your local Oracle database) that will access the remote SQL Server database using the database link.
    2. Setup the ODBC connection on the local Oracle database using the Windows ODBC Data Source Administrator
    3. Test the ODBC drivers to ensure that connectivity is made to the SQL Server database.
    4. Ensure that your global_names parameter is set to False.
    5. Configure the Oracle Heterogeneous services by creating an initodbc.ora file within the Oracle database.
    7. Modify the Listener.ora file.
    SID_NAME is the DSN for the remote database.
    ORACLE_HOME is the actual Oracle home file path.
    PROGRAM tells Oracle to use heterogeneous services.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME=Cas30C) -- Enter the DSN on this line
    (ORACLE_HOME = c:\oracle10gdb) -- Enter your Oracle home on this line
    (PROGRAM = hsodbc) ) )
    8. Modify the Tnsnames.ora file. This is the Oracle database installation accessed by the users to connect to the ODBC drivers
    (DESCRIPTION=
    (ADDRESS_LIST=
    (Address=(PROTOCOL=TCP)
    (HOST=
    -- (Server x)
    (PORT=1521))) -- Enter the port on which the server x Oracle installation
    -- is listening
    (CONNECT_DATA=(SID=Cas30c)) - Enter the DSN name
    (HS=OK) -- Enter this value. It tells Oracle to use hetergeneous services
    9. Reload the listener on local Oracle database
    10. Create a database link on the local Oracle installation that accesses the heterogeneous connection, which, in turn, connect to SQL Server.
    11. Run a SQL Server Select statement from the Oracle installation using the database link
    Thanks
    BelMan :)

  • Read tables from different schemas in oracle

    Hi, I'm trying to write a code to run a query to get data from an Oracle server, the problem is that the query refers to multiple tables in multiple schemas... the regular way to do it in oracle (SCHEMANAME.TABLENAME) does not work in excel vba query and
    I cant find a way to so, any help will be really appreciated, below a sample code with one table from WWPP schema.....
    Const DB As String = "Driver={Microsoft ODBC for Oracle};" & _
                         "CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=1526))(CONNECT_DATA=(SERVICE_NAME=MyName)));" & _
                         "Uid=MyID;Pwd=MyPwd*;"
    Sub test()
        Dim cnt As ADODB.Connection, rst As ADODB.Recordset
        Set cnt = New ADODB.Connection
        Set rst = New ADODB.Recordset
        cnt.Open DB
        (I also tried this but didn't work) -> cnt.Execute "ALTER SESSION SET CURRENT_SCHEMA=WWPP"
        rst.Open "SELECT * FROM WWPP.SO_LIFE_CYCLE_BACKLOG_RP", cnt, adOpenDynamic, 2
        If rst.EOF = False Then
            Sheet1.Cells(2, 2).Select
            Selection.CopyFromRecordset rst
        End If
        rst.Close
    End Sub
    Oscar Marquez

    1) Posting the error number (i.e. ORA-00942) in addition to the error message is often quite helpful since that's generally far easier to look up and far less likely to get confused in translation.
    2) Are you using an invoker's rights stored procedure? Or a definer's rights stored procedure? If you're not sure, the default is definer's rights.
    3) How has YFS been granted access to the Y_PS table? My hunch is that it was granted access via a role, not via a direct grant. Privileges granted through a role would be available for ad hoc SQL queries, but those privileges are not available to a definer's rights stored procedure. A definer's rights stored procedure only has access to the privileges granted directly to the owner.
    If my hunch is correct, you'd either have to directly grant YFS access to the table(s) it needs to access in other schemas or you'd need to make the stored procedure use invoker's rights, which may have ripple effects down the line if users other than YFS are going to be running the procedure.
    Justin

  • Want to drop non-system table from system tablespace

    My system tablespace was having some user tables , so I moved those tables to user tablespace. Now that tables are showing in both the tablespaces ex. RET_OFF is showing in system as well as users tablespace I want to drop it from system tablespace only . Can I do it . plz help

    Hi Florian , plz check the below details . I am working on Oracle 11g on Windows platform.
    SQL> alter table REF_VAT_OFF move tablespace vatsoft;
    Table altered.
    SQL> select owner, table_name, tablespace_name
    2 from dba_tables
    3 where table_name='REF_VAT_OFF';
    OWNER TABLE_NAME     TABLESPACE_NAME
    KNVATCEN REF_VAT_OFF     SYSTEM
    OWNER TABLE_NAME     TABLESPACE_NAME
    KNVAT REF_VAT_OFF     VATSOFT

  • How to export a table of data from MS Access 2007 to Oracle 11g

    I have been looking all over trying to find a way to get a table from Access 2007 to Oracle 11g. I tried using the export options in Access but can't get them setup correctly I guess. What are the steps to setting this up correctly or is there another way to export the data?

    MS Access 2007 DB migration To oracle 10g

  • Oracle 11g- Straing behaviour of query after importing from Oracle 10g

    Hi,
    I have a table in Oracle 10g as follows:
    Create Table xyz (col1 varchar2(50), col2 varchar2(50));
    With following Data
    Col1     Col2
    A     320
    A     110
    A     290
    A     380
    B     ABC
    B     256
    B     LMN
    I am running following Query
    select * from xyz
    Where Col1='A' and Col2=110
    It works fine. But when I export this table and import it in Oracle 11g. It says invlid identifier.
    But if I enclose 110 in single quotes. It works fine.
    Also If I recreate this table in Oracle 11g like
    Create table xyz1
    as select * from xyz;
    Now alos I am able to run this query smoothly.
    select * from xyz1
    Where Col1='A' and Col2=110
    What is wrong exporting this table from 10g to 11g.
    Any comments/suggestion??
    Aarbi

    The check in your where clause
    Col2=110Is comparing a string (Col2 is defined as a VARCHAR) with a numeric literal, so there will be an implicit conversion taking place from character to number. The query then fails due to the B LMN row when 'LMN' fails number conversion.
    I'm guessing there was there an index on the table in your 10g installation which would allow the query to be satisfied without checking the B ABC or B LMN rows but is not present or not used in the 11g installation so a full table scan results in an attempt to convert 'ABC' and 'LMN' to a number. Check the explain plans.
    Or it could even just be a difference in the order in which the two conditions in the where clause are evaulated between the two versions.
    The solution, as you have already found is to do a string comparision
    Col2='110'Edited by: Cyn on Dec 7, 2009 12:38 PM

  • DW sees no Oracle 11g procs

    PropertyManager.Application.Databases lists the tables and
    views for my Oracle 11g CF Data Source, but lists "None" under the
    Stored Procedure node. User is owner of these procs. I am already
    calling these procs with ColdFusion cfcs from Flex. TIA,
    Mic.

    crzymnmchl wrote:
    > PropertyManager.Application.Databases lists the tables
    and views for my Oracle
    > 11g CF data source and for MySQL5 data source, but lists
    "None" under the
    > Stored Procedure node.
    MySQL has supported stored procedures only since MySQL 5.
    Dreamweaver's
    server behaviors were developed in pre-MySQL 5 days, and have
    not been
    substantially revised since then.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Moving sys.aud$ to a different tablespace other than system

    Hi,
    I have a 10g RAC database system with a high volume of activity and would like to monitor a large slice of it using audit.
    I have reviewed all options of audit trails and chose “db, extended” to be the most suitable for my purposes!
    I’ve noticed that all audit data goes to sys.aud$ table in system tablespace.
    I have 3 questions:
    1. What is the logic behind putting this table in systems tablespace and not sysaux (10g)?
    2. Can I move sys.aud$ table to a different tablespace (should I expect trouble for doing so)?
    3. Is there any RAC implication if I move sys.aud$ table to a different tablespace?
    Regards,
    Tal Olier
    [email protected]

    That's true, it's not recommanded to move a sys table... but we can find some good explanation for this one for aud$ table.<br>
    See Metalink Note 72460.1 : Moving AUD$ to another tablespace and adding triggers to AUD$<br>
    Or google search give some good results.<br>
    Nicolas.

  • 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

Maybe you are looking for

  • BI IP Bex - Comment

    Hi, I am working on BI IP project in  BEx environment. One of the top priorities from the user is to enable  input of comments on the layout and also report on comments. I have created a characteristic on comment 'without text and master data' like I

  • New Airport express not finding wireless network

    I just got a new AX plugged it in it was recognized did the set up and said to update. It went through the update but the amber light kept flashing. After the update I also lost my internet connection. I have to re-establish my internet connection ea

  • Ultimate 3B Monitoring Prorated Upgrade Questions!?

    I recently enrolled in the 3 Credit Bureau Monitoring for $24.99/Month on June 24 (almost 3 weeks ago). I got a message at the bottom of my Dashboard saying I could upgrade to the 3B Ultimate at a prorated price, since it hasn't been a month. It says

  • SQL query works in SSIS, SSMS/SQL server but fails in deployment?

    The SQL query in my execute sql task is correct. It works in SSIS and SSMS also. But, it fails when I deploy my package. The error - Code: 0xC002F210 Source: MySQLTask Execute SQL Task Description: Executing the query "UPDATE [MyTable] SET MyCol..."

  • How to create an Area and place main windows in scripts

    How to create an Area and place main windows in scripts ?