Command to view tablespace & datafile

Hi
please adv command to view and change tablespace and datafile of a table.
Wishes
Jawad

to view the tablespace which is associated with the table .
select tablespace_name from user_tables where table_name like 'MYTABLE'
but you cannot get the data file.
To view the datafile associated with the tablespace login with SYS or SYSTEM
and issue this sql.
select file_name from dba_data_files where tablespace_name like 'USERS'
to change the tablespace of a table, you have to move the data.
alter table test move tablespace users;
see the documentation for all the possible options of moving the data, take care of your indexes.

Similar Messages

  • Creating tablespace,datafiles,logfiles, controlfiles etc on ASM

    What is command to create tablespace,datafiles,logfiles, controlfiles etc on ASM disk group? Send me few example sql commands plz.

    You might find Chapter 12 of the Administrators Guide to be some help in understanding ASM. The chapter has many examples.
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/storeman.htm#i1021337

  • Command to add multiple datafiles in multiple tablespace in one time.

    Send me command to
    command to add multiple datafiles in multiple tablespace in one time.

    Just list the files separated by a comma.
    SQL> alter tablespace example
    2 add datafile 'e:\oradata\scratch\example02.dbf' size 100m,
    3 'e:\oradata\scratch\example02.dbf' size 100m;
    Tablespace altered.
    SQL>
    You will have to use more then one command to add datafiles to multiple tablespaces.

  • How to move a specific tablespace datafile from one directory to another

    Database: 10.2.0.1
    OS : Generic
    Problem Description : How to move a specific tablespace datafile from one directory to another considering that the database is on Oracle Dataguard setup
    ** Oracle is working on this issue, but in parallel is opening the topic to the Community so that Community members can add their perspective, experience or knowledge. This will further enhance all knowledge bases including My Oracle Support and My Oracle Support Communities **
    Edited by: ram_orcl on 16-Aug-2010 21:21

    Dear ram_orcl,
    Please follow the procedures here;
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1034172
    8.3.4 Renaming a Datafile in the Primary Database
    When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
    The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
       1.
          To rename the datafile in the primary database, take the tablespace offline:
          SQL> ALTER TABLESPACE tbs_4 OFFLINE;
       2.
          Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf
          /disk1/oracle/oradata/payroll/tbs_x.dbf
       3.
          Rename the datafile in the primary database and bring the tablespace back online:
          SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE      2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            3>  TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
          SQL> ALTER TABLESPACE tbs_4 ONLINE;
       4.
          Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
          SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
          SEQUENCE# APP
          8 YES
          9 YES
          10 YES
          11 YES
          4 rows selected.
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
       5.
          Shut down the standby database:
          SQL> SHUTDOWN;
       6.
          Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
       7.
          Start and mount the standby database:
          SQL> STARTUP MOUNT;
       8.
          Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
          SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
       9.
          On the standby database, restart Redo Apply:
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
            2> DISCONNECT FROM SESSION;
    If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
    ORA-00283: recovery session canceled due to errors
    ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
    ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'Hope That Helps.
    Ogan

  • RMAN duplicate target database for standby from active fails to create newname for system tablespace/datafile

    When executing 'duplicate target database for standby from active'  the system tablespace/datafile (datafile 1)  is not cloned.  All other datafiles clone successfully.  The RMAN process aborts with the following errors while attempting to clone the system tablespace/datafile.
    ORA-19558: error de-allocating device
    ORA-19557: device error, device type: DISK, device name:
    ORA-17627: ORA-01041: internal error. hostdef extension doesn't exist
    ORA-17627: ORA-01041: internal error. hostdef extension doesn't exist
    ORA-03135: connection lost contact
    Here are the details:
    Primary is 11.2.0.2 RAC database  on an Exadata platform
    Standby is 11.2.0.2 Single Instance database (same patch level as primary) on a Red Hat Linux box
    This is an ASM to ASM duplication.
    This is not unique to this database.  We tried another database and go the same behavior - all datafiles clone successfully with the exception of the system tablespace/datafile.
    We have traced the RMAN execution and it seems to fail when it is trying to assign a NEWNAME to the system tablespace/datafile.
    We even issued an explicit SET NEWNAME command but RMAN ignored it.
    We also shutdown the primary and started is up in mount mode thinking that something had ahold of the System Tablespace/datafile.
    We also opened up the network firewall to allow permit any,any traffic.
    We increased the max_server_processes
    and added TCP.NODELAY=yes to the sqlnet.ora file.
    There seems to be some artifact present in our Primary System tablespace/data file that is preventing it form being cloned.
    checked all alert files grid, asm,  and dbhome - no abnormal messages.
    We are in the process of restoring the database from a backup but we would prefer to get this working using the 'Active Database' methodology

    I successfully created the standby database using RMAN backup and recovery.
    I started the managed recovery.  Archive logs are being sent from the primary to the standby ( I can see them in ASM), but the standby is not applying them.
    I get the following messages in the standby alert log...
    Fetching gap sequence in thread 2, gap sequence 154158-154257
    Tue Nov 26 16:19:58 2013
    Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST
    Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST
    Tue Nov 26 16:20:01 2013
    Fetching gap sequence in thread 2, gap sequence 154158-154257
    Tue Nov 26 16:20:11 2013
    Fetching gap sequence in thread 2, gap sequence 154158-154257
    Tue Nov 26 16:20:22 2013
    Fetching gap sequence in thread 2, gap sequence 154158-154257
    Tue Nov 26 16:20:32 2013
    Fetching gap sequence in thread 2, gap sequence 154158-154257
    I don't see any MRP processes:
    select process,
    status,
        thread#,
        sequence#,
       block#,
      blocks
      7     from v$managed_standby;
    PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS
    ARCH      CLOSING               2     154363          1        132
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    ARCH      CONNECTED             0          0          0          0
    RFS       IDLE                  0          0          0          0
    RFS       IDLE                  1     145418        121          1
    RFS       IDLE                  0          0          0          0
    PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS
    RFS       IDLE                  0          0          0          0
    12 rows selected.
    SQL>  SELECT THREAD#, SEQUENCE#, APPLIED FROM V$ARCHIVED_LOG;
       THREAD#  SEQUENCE# APPLIED
             2     154356 NO
             2     154357 NO
             1     145411 NO
             2     154358 NO
             2     154360 NO
             2     154361 NO
             1     145414 NO
             1     145415 NO
             2     154362 NO
             2     154363 NO
             1     145416 NO
    11 rows selected.
    I do have the archive logs that cover sequences 154158-154257
    Crosschecked 38 objects
    Crosschecked 62 objects
    Finished implicit crosscheck backup at 26-NOV-13
    Starting implicit crosscheck copy at 26-NOV-13
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    Crosschecked 2 objects
    archived log file name=+RECO_XORA/nmuasb00/archivelog/2013_11_26/thread_2_seq_154377.344.832521989 RECID=29 STAMP=832521990
    validation succeeded for archived log
    archived log file name=+RECO_XORA/nmuasb00/archivelog/2013_11_26/thread_2_seq_154378.346.832521991 RECID=31 STAMP=832521993
    Crosschecked 31 objects

  • Recover Database vrs Recover Tablespace & Datafile

    Traditionally when I have been recovering a database either to point of failure or point in time I have issued
    RECOVER DATABASE AUTO;
    (or I have specified the point in time I wish to recover to ).
    I see now in 11gR2 there is also a RECOVER TABLESPACE and a RECOVER DATAFILE command
    Why would you use those instead of the RECOVER DATABASE ? You would have to be pretty sure it is only that tablespace or data file you wanted to apply archive logs to, otherwise would your recovery not risk putting the contents of that tablespace or datafile out of logical sync with the data in other tablespaces ( eg potentially viloating referential integrity etc ) ?
    I am presuming these commands also only apply the contents of archive logs that effect the specified tablespace or datafile ?
    thanks,
    Jim

    If I issue a RECOVER TABLESPACE or RECOVER DATAFILE for a Tablespace or Datafile that is current and does not need recovery, Oracle does nothing to the Tablespace / Datafile. It won't be out of logical sync with the rest of the database.
    >>>
    Can you recover the data file or the tablespace to a point in time before the current time ? If that is the case then surely it is possible that the recovered tablespace could have a table in it that has referential integrity to another table in a different ( unrecovered ) tablespace and that the referential integrity could then be compromised ?
    Jim

  • Tablespace Datafile Resize ORA-03297

    Hi,
    In one of our tablespace constituting 4 datafiles, has got some data which is
    as follows :
    SEGMENT_NAME SEGMENT_TYPE
    SYS_C004044 INDEX
    SYS_C004315 INDEX
    PROJECTRELEASE_INDEX1 INDEX
    SYS_C0019289 INDEX
    XAK1WBSHIERARCHY INDEX
    SYS_IL0000033038C00047$$ LOBINDEX
    SYS_IL0000033086C00013$$ LOBINDEX
    SYS_IL0000033305C00013$$ LOBINDEX
    SYS_IL0000033431C00005$$ LOBINDEX
    SYS_IL0000033487C00006$$ LOBINDEX
    SYS_IL0000033492C00002$$ LOBINDEX
    SYS_IL0000033065C00009$$ LOBINDEX
    SYS_IL0000033427C00006$$ LOBINDEX
    SYS_IL0000033305C00014$$ LOBINDEX
    SYS_IL0000033110C00015$$ LOBINDEX
    SYS_IL0000033104C00014$$ LOBINDEX
    SYS_LOB0000033038C00047$$ LOBSEGMENT
    SYS_LOB0000033427C00006$$ LOBSEGMENT
    SYS_LOB0000033065C00009$$ LOBSEGMENT
    SYS_LOB0000033492C00002$$ LOBSEGMENT
    SYS_LOB0000033487C00006$$ LOBSEGMENT
    SYS_LOB0000033431C00005$$ LOBSEGMENT
    SYS_LOB0000033305C00014$$ LOBSEGMENT
    SYS_LOB0000033086C00013$$ LOBSEGMENT
    SYS_LOB0000033104C00014$$ LOBSEGMENT
    SYS_LOB0000033110C00015$$ LOBSEGMENT
    SYS_LOB0000033305C00013$$ LOBSEGMENT
    FORUMMESSAGE_H TABLE
    SITEADMIN TABLE
    We can move these indexes to different tablespaces, but since these tables have columns with LONG datatypes, we can't move these tables. But we can export the data, drop these tables and import the data in different tabelspaces. But for these lobsegment, how can I move these segments. I believe these got created as a result of indexing of LOB columns. The sizes of these datafiles of this tablespace is in terms of GBs, and I want to reduce the sizes of the same, therefore I tried to use resize command of alter database datafile '***' resize **m, but it thrown ora-03297 error message. I thought it has raised may because of fragmentation of tablespace. I found the blocks were free_space is available using dba_free_space. But after coalescing the tablespace, still I got same no of records in free space. That means the tablespace is not getting coalesced. What is the reason for this. Plz let me know why tablespace data is not getting moved so as to enable me to resize the datafiles.
    Thanx,
    Kamlesh C

    In older versions of Oracle on Windows platforms if you accepted the default names for your datafiles .ora was used. I think beginning in 8.1.x .dbf became the default, which was more like the standards used on other operating systems.
    As already pointed out .ora is most commonly used for configuration files like init.ora.

  • Recovery with some tablespaces/datafiles excluded

    Hi,
    I want to restore/recover my db on a new host with some tablespaces/datafiles excluded...
    I have backups on tape but don't have enough disk space on my new host to restore database fully, is it possible I exclude/skip some tablespaces/datafiles?
    Thanks

    thanks tychos,
    I run the sql you told brefore restore database but It seems It's going to restore datafiles that I don't need again... I don't have enough space to restore all datafiles. My rman script looks like this:
    run {
    ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';
    SET NEWNAME FOR DATAFILE 1 TO '+DATA/oradata/test/system01.dbf';
    SET NEWNAME FOR DATAFILE 2 TO '+DATA/oradata/test/undotbs01.dbf';
    SET NEWNAME FOR DATAFILE 3 TO '+DATA/oradata/test/cwmlite01.dbf';
    #SET NEWNAME FOR DATAFILE 4 TO '+DATA/oradata/test/drsys01.dbf';
    #SET NEWNAME FOR DATAFILE 5 TO '+DATA/oradata/test/example01.dbf';
    #SET NEWNAME FOR DATAFILE 6 TO '+DATA/oradata/test/indx01.dbf';
    sql 'alter database datafile 4,5,6 offline drop';
    SET UNTIL SCN 123456;
    RESTORE DATABASE;
    SWITCH DATAFILE ALL;
    RECOVER DATABASE;
    }

  • Command to View LDAP Password on Cisco ASA 5520

    Hello
    I am migrating from a Cisco ASA 5520 (ASA version 8.4(6)5 to a Cisco ASA 5585. We have LDAP issues logging into to our vpn client software. I assume the LDAP password may be incorrectly entered on the new 5585. No service password- encryption or more running:config won't show the encrypted LDAP password. What is the command to view that?
    Thanks!
    Matt

    Thankyou Jennifer for the responds.
    Could you please help me on how to enable "memberOf" attribute on AD to be pushed to ASA for the OU matching.
    i have already set the "Remote Dialin" property of user account name "testvendor" in AD as "Allow Access" .It can be shown in the debug output as below.
    [454095] sAMAccountName: value = testvendor
    [454095] sAMAccountType: value = 805306368
    [454095] userPrincipalName: value = [email protected]
    [454095] objectCategory: value = CN=Person,CN=Schema,CN=Configuration,DC=abc,DC=local
    [454095] msNPAllowDialin: value = TRUE
    [454095] dSCorePropagationData: value = 20111026081253.0Z
    [454095] dSCorePropagationData: value = 20111026080938.0Z
    [454095] dSCorePropagationData: value = 16010101000417.0Z
    Is their any other settings that i need to do it on AD ?
    Kindly advice
    Regards
    Shiji

  • Db2 command for create tablespaces of DB2 V9.1.3

    Dear All,
    Currently, I’ve run prepare for upgrade SAP form 4.6C/DB2 9.1.3 to ECC6.
    But, I don’t know to db2 command for create tablespaces as below.
    Could you please example the DB2 command for create tablespaces as below.
    ERROR> Insufficient free space in the database as follows:
    Please refer to file DBFPLUSD.RES for more details and dditional  information about the results of the free space check on DB6 !!!
    ERROR> Create tablespace PSAPDIMD with 120 MB
    ERROR> Create tablespace PSAPDIMI with 120 MB
    ERROR> Create tablespace PSAPODSD with 130 MB
    ERROR> Create tablespace PSAPODSI with 130 MB
    ERROR> Create tablespace PSAPFACTD with 120 MB
    ERROR> Create tablespace PSAPFACTI with 120 MB
    ERROR> Create tablespace PSAPEL700D with 420 MB
    ERROR> Create tablespace PSAPEL700I with 220 MB
    ERROR> Create tablespace PSAPES700D with 21290 MB
    ERROR> Create tablespace PSAPES700I with 5420 MB
    Thanks in advance
    Regards,
    Jaturong P.

    Hi,
    During the PREPARE phase normally it creates a script which you can run for the creation of these Tablespaces,this script can be found in the Upgrade directory(eg:/usr/sap/put/log/DB6TBSXT.CLP - this script will have the command to create the tablespaces).Just run this script,it will create all the tablespaces based on the requirement.
    Regards,
    Sam
    Edited by: Cheriyan Sam on Apr 22, 2008 9:12 AM

  • Command for view i/o rate cisco nexus

    Hi
    I need a command for view input and output rate on all interface for device nexus 7000 and nexus 5000
    The command sh interface show more information, I only need view rx and tx
    on switch 3750, 2960 i use sh interface summary and in nexus do not exist
    Regards

    Hi,
    Show interface xxx | inc rate will give you in /out rate.
    For example -sh int e1/1 | i rate
    For show interface summary you can use grep feature on nexus multiple Include and exclude are possible.
    show interface E1/1 | inc rate|MTU | exclude pps
    Just to see interface counters -
    show interface counters detailed all
    Hope this helps.
    Thanks
    Ajay

  • I have Adobe Acrobat XI (ver 11.0.07).  Adobe Help instructs me to find the document comparison command at "View Compare Documents," however, this command does exist on my screen. My View drop-down list does not include a command for Compare Documents.

    I have Adobe Acrobat XI (ver 11.0.07).  Adobe Help instructs me to find the document comparison command at "View > Compare Documents," however, this command does exist on my screen. My View drop-down list does not include a command for Compare Documents.  Where else can I find this command?

    What version of Acrobat do you have? This feature is only available in the Pro version, not in the Standard version.

  • Tablespace/datafiles--howto

    Hi all,
    Wanna ask you a question on tablespace/datafiles.
    I want to load 7.5 million records into a table using sqlloader.
    The directory for datafiles looks like following:
    -rw-r----- 1 oracle dba 1497088 Nov 19 19:46
    control01.ctl
    -rw-r----- 1 oracle dba 1497088 Nov 19 19:46
    control02.ctl
    -rw-r----- 1 oracle dba 1497088 Nov 19 19:46
    control03.ctl
    -rw-r----- 1 oracle dba 104859648 Nov 19 19:27
    rbs01.dbf
    -rw-r----- 1 oracle dba 512512 Nov 19 19:46
    redoORCL01.log
    -rw-r----- 1 oracle dba 512512 Nov 19 19:07
    redoORCL02.log
    -rw-r----- 1 oracle dba 512512 Nov 19 19:27
    redoORCL03.log
    -rw-r----- 1 oracle dba 104859648 Nov 19 19:42
    system01.dbf
    -rw-r----- 1 oracle dba 131074048 Nov 19 19:27
    temp01.dbf
    -rw-r----- 1 oracle dba 314574848 Nov 19 19:42
    tools01.dbf
    -rw-r----- 1 oracle dba 314574848 Nov 19 19:46
    tools02.dbf
    -rw-r----- 1 oracle dba 104859648 Nov 19 19:27
    users01.dbf
    This is the only table I want to load. But when I try to load
    using SQL Loader, I get following message,
    ORA-02356: The database is out of space. The load cannot
    continue
    ORA-01653: unable to extend table SYSTEM.URLS by 92169 in
    tablespace TOOLS
    Load completed - logical record count
    3538680.
    It loaded only half of the number of rows.
    How would I be able to resolve this. Any help would be greatly
    appreciated.
    Thanks in advance.
    null

    Hi namnan,
    namnan (guest) wrote:
    : Hi all,
    : Wanna ask you a question on tablespace/datafiles.
    : I want to load 7.5 million records into a table using
    sqlloader.
    How can you be sure that 7.5 Mio records fit into your
    tablespace?
    Have you considered the size of your tables, the overhead, the
    indexes?
    You can do it a priori if you know how oracle stores data, but it
    is easier to load 100000 records into a dedicated tablespace,
    then sum up the consumed space (select ... from dba_segments).
    Don't do that as user system unless you have a very good reason
    to do so.
    null

  • My TEMPORARY TABLESPACE DATAFILE was lost

    I completely lost temporary tablespace datafile,
    what should I do?
    (there is no backup)

    It is just a temporary tablespace, who cares. Just drop the tablespace and re-create it.

  • What are the following tablespaces / datafiles?

    I have the following tablespaces and corresponding datafiles ... hoping someone can help me identify the application for it. Or what was the previous DBA doing?
    tablespace / datafile
    CONSTANT_GROW_INDEXES / SCM_CGIND.DBF
    etc ..
    DEPENDENCY_INDEXES / SCM_DEPIND.DBF
    etc...
    RAPID_GROW_INDEXES / SCM_RAPID_GROW_IND.DBF
    etc ...
    SYSTEM_META_INDEXES / SCM_SYS_META_IND.DBF
    etc ...

    apex_disco wrote:
    I have the following tablespaces and corresponding datafiles ... hoping someone can help me identify the application for it. Or what was the previous DBA doing?
    tablespace / datafile
    CONSTANT_GROW_INDEXES / SCM_CGIND.DBF
    etc ..
    DEPENDENCY_INDEXES / SCM_DEPIND.DBF
    etc...
    RAPID_GROW_INDEXES / SCM_RAPID_GROW_IND.DBF
    etc ...
    SYSTEM_META_INDEXES / SCM_SYS_META_IND.DBF
    etc ...On the face of it, there is no way for anyone outside your organization to be able to answer a question like that. However, I thought the name of the TS looked familiar, and so it was.
    http://lmgtfy.com/?q=CONSTANT_GROW_INDEXES

Maybe you are looking for

  • Video doesnt play audio

    i just uploaded a movie to my ipod, but when i played the movie on my ipod, the audio did not play. Does any one know how to fix this

  • I just paid for tech support through Firefox and it did not work. How do I get back to the technician without paying twice?

    Something called Plasmoo.com is attached to Firefox 4. It cannot be removed and I can't uninstall Firefox. I followed the tech support advice. When I tried to delete Firefox, it told me that I needed permission from myself to change the folder. I am

  • Turn off HTML e-mail

    HTML e-mail is all very well but, when abroad, it would be much more convenient (not to say cheaper) if my iPhone only received the text content of the e-mail (no formatting, no images, nothing except a link to the download if required). Is it possib

  • [solved] no email notification from subscribed topics

    Recently, in the last 2-3 weeks I don't get any notification from topics, however there were new posts and I have subscriptions. I checked my junk folder, but nothing. From bugs.archlinux.org I keep getting emails. Any idea what is wrong? Last edited

  • Inconsistent loading with loadmovie, whats a trick for this?

    loadMovie(imagePath,"loadImage"); the imagePath value is dynamically set to an image on the server based on the users interaction. loadImage is an empty movie clip sitting on that timeline that receives the loadMovie command. one frame after the load