About datafiles...

What is the use of more datafiles in the tablespace..
my question is if we have autoextend on in the datafile it will automatically extend the size of the datafiles... then what is the use of two or more datafiles...

as per my experiance
We should have each 2 gb of datafile if db size is small about 100Gb.. or 4GB of datafile if db is more than 100Gb.
--Girish                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • About datafile...

    My company having big datas in the database ...
    They are having all data in the USERS tablespace...
    The datafile
    size = 2mb
    autoextend = 1208kb
    used= 97%
    remaining = 8.13 kb
    My question is the size , we are having 2mb only and we have to insert more records daily..
    if we insert more records it will automatically extends the size ...
    anyone plz answer my question...

    Hi
    This all depend up on uour database size and data to be inserted in the tables created under USERS tablespaces.
    --Girish                                                                                                                                                                                                                                                                   

  • Datafile extension. Go big or small?

    Oracle 10g v2
    When Oracle does extend the datafile say for the next 20MB, what kind of concurrency happens in single insert intense environment?
    is it better to have several 20MB, or one 100MB from time to time for datafile (im talking about datafile extension, NOT segment)?
    im talking about OLTP, single insert intense environment.
    would value your thoughts

    user10145423 wrote:
    Datafile extension. Go big or small?Neither. IMO, auto extending a tablespace is the DBA admitting that he/she is clueless on how to manage the space for the database.
    When enabling auto extending for tablespaces, who decides on the space allocation for a tablespace? The DBA? Oracle? No, neither.
    That is in the hands of the SQLs executed.. where a single errant SQL can cause temp space or a tablespace to be increased when it is WRONG. When that SQL should have failed with an exception - instead of blowing all available freespace by extending a tablespace to assign space that is NOT needed.

  • Various Data DIctionary VIews

    After posting something here a few days back about the myriad views needing to be digested for the Fund.I Exam, I have just gleaned this lot from the Couchman book. No doubt some of the pros out there may well correct me, but this is simple what I have collected from the book, in the last 3 hours. Cheers.
    Dictionary Views
    Data Dictionary
    Which users are in the database password file:
    V$PWFILE_USERS
    Where values set in the init.ora file can be viewed – all parameters:
    V$PARAMETER
    Script used to create the objects that comprise the data dictionary:
    catalog.sql
    To grant a special role to users so they can look at DBA views:
    SELECT_CATALOG_ROLE
    Information about all database objects in the database:
    DBA_OBJECTS
    Information about all tables in the database:
    DBA_TABLES
    Information about all indexes in the database:
    DBA_INDEXES
    Information about all views (including dictionary views) in the database:
    DBA_VIEWS
    Information about all sequences in the database:
    DBA_SEQUENCES
    Information about all users in the database:
    DBA_USERS
    Information about all constraints in the database:
    DBA_CONSTRAINTS
    Information about all table columns that have constraints on them:
    DBA_CONS_COLUMNS
    Information about all columns that have indexes on them in the database:
    DBA_IND_COLUMNS
    Information about all columns in all the tables in the database:
    DBA_TAB_COLUMNS
    Information about all the roles in the database:
    DBA_ROLES
    Information about all object privileges in the database:
    DBA_TAB_PRIVS
    Information about all system privileges granted to all users in the database:
    DBA_SYS_PRIVS
    Displays all PL/SQL source code in the database:
    DBA_SOURCE
    Information about all triggers in the database:
    DBA_TRIGGERS
    Information about object privileges granted to roles
    ROLE_TAB_PRIVS
    Information about system privileges granted to roles
    ROLE_SYS_PRIVS
    Information about roles granted to roles
    ROLE_ROLE_PRIVS
    Information about all tablespaces in the database:
    DBA_TABLESPACES
    Information about all profiles in the database:
    DBA_PROFILES
    For all parameters?
    V$PARAMETER
    General information about the database mounted to your instance:
    V$DATABASE
    Most information about the performance of the database is kept here:
    V$SYSSTAT
    Most information about the performance for individual user sessions is stored here:
    V$SESSION , V$SESSTAT
    Information about online redo logs (2)
    V$LOG, V$LOGFILE
    Information about datafiles
    V$DATAFILE
    Basic information about control files, and the two columns it has:
    V$CONTROLFILE. STATUS / NAME
    An object you can query to obtain a listing of all data dictionary objects (4)
    CATALOG, CAT, DICTIONARY, DICT.
    When the control file was created, Sequence Number, most recent SCN:
    V$DATABASE
    Information stored in different sections of the control file, Sequence Number:
    V$CONTROLFILE_RECORD_SECTION
    To see the names and locations of all control files in the db? (2)
    V$PARAMETER. V$CONTROLFILE
    Tablespace and Datafiles
    Temporary Segments:
    Name, tablespace location, and owner of temporary segments:
    DBA_SEGMENTS
    Size of temporary tablespaces, current number of extents allocated to sort segments, and sort segment high-water mark information. Space usage allocation for temporary segments:
    V$SORT_SEGMENT
    Types of sorts that are happening currently on the database
    V$SORT_USAGE
    To see the username corresponding with the session:
    V$SESSION
    Information about every datafile in the database associated with a temporary tablespace:
    DBA_TEMP_FILES
    Similar to DBA_TEMP_FILES, this performance view gives Information about every datafile in the database associated with a temporary tablespace:
    V$TEMPFILE
    Storage Structures
    A summary view, contains all types of segments and their storage parameters, space utilization settings:
    DBA_SEGMENTS
    Tablespace quotas assigned to users:
    DBA_TS_QUOTAS
    Segment name, type, owner, total bytes of extent, name of tablespace storing the extent:
    DBA_EXTENTS
    The location and amount of free space by tablespace name:
    DBA_FREE_SPACE
    The location of free space in the tablespace that has been coalesced:
    DBA_FREE_SPACE_COALESCED
    Information about datafiles for every tablespace
    DBA_DATAFILES
    Performance view for information for datafiles for every tablespace
    V$DATAFILE
    To see the total amount of space allocated to a table?
    DBA_EXTENTS
    Table creation timestamp, information about the object ID:
    DBA_OBJECTS
    High water mark, all storage settings for a table, and statistics collected as part of the analyze (for row migration) operation on that table
    DBA_TABLES
    Information about every column in every table:
    DBA_TAB_COLUMNS
    To determine how many columns are marked unused for later removal?
    DBA_UNUSED_COL_TABS
    To find the number of deleted index entries ?
    INDEX_STATS
    To determine the columns on a table that have been indexed:
    DBA_ID_COLUMNS
    The dynamic view to show whether the index is being used in a meaningful way?
    V$OBJECT_USAGE
    To see whether a constraint exists on a particular column?
    DBA_CONS_COLUMNS
    To see the constraints associated with a particular table:
    DBA_CONSTRAINTS
    To find the username, ID number, (encrypted) password, default and temporary tablespace information, user profile of a user, password expiry date:
    DBA_USERS
    To all objects, which objects belong to which users, how many objects a user has created?
    DBA_OBJECTS
    Resource-usage parameters for a particular profile:
    DBA_PROFILES
    Identifies all resources in the database and their corresponding cost:
    RESOURCE_COST
    Identifies system resource limits for individual users:
    USER_RESOURCE_LIMITS
    Shows all system privileges:
    DBA_SYS_PRIVS
    Show all object privileges:
    DBA_TAB_PRIVS
    Shows all privileges in this session available to you as the current user:
    SESSION_PRIVS
    Views for audits currently taking place are created by this script:
    cataudit.sql
    a list of audit entries generated by the exists option of the audit command:
    DBA_AUDIT_EXISTS
    A list of audit entries generated for object audits:
    DBA_AUDIT_OBJECT
    A list of audit entries generated by session connects and disconnects:
    DBA_AUDIT_SESSION
    A list of audit entries generated by statement options of the audit command:
    DBA_AUDIT_STATEMENT
    A list of all entries in the AUD$ table collected by the audit command:
    DBA_AUDIT_TRAIL
    To determine the roles available in the database, the names of all the roles on the database and if a password is required to use each role:
    DBA_ROLES
    Names of all users and the roles granted to them:
    DBA_ROLE_PRIVS
    All the roles and the roles that are granted to them:
    ROLE_ROLE_PRIVS
    Which system privileges have been granted to a role:
    DBA_SYS_PRIVS
    All the system privileges granted only to roles:
    ROLE_SYS_PRIVS
    All the object privileges granted only to roles:
    ROLE_TAB_PRIVS
    All the roles available in the current session:
    SESSION_ROLES
    Which object privilege has been granted to a role:
    DBA_TAB_PRIVS
    To display the value of the NLS_CHARACTERSET parameter:
    NLS_DATABASE_PARAMETERS
    DA

    You can also find a lot of stuff by doing:
    SELECT *
    FROM dictionary;

  • Metric collection error for Oracle 10g(10.2.0.4) database.

    Hi,
    i just confirured OEM11G(11.1.0.1) on my client test machine and installed 11.1.0.1 agent on one target where 10.2.0.4 database is running. OS is windows 2003 R2.
    after installing the agent, i am able to see the database name in the oem --> database tab. but its status is "metric collection error" how ever i am able to see the details about datafiles etc..but in the status sheet it is showing as "metric collection error". i checked the dbsnmp user name and pasword. both are working. i tried to reconfigure the databae manually. it is erroring out with the following error.
    oracle.sysman.emSDK.emd.comm.CommException: IOException in sending Request :: Connection refused: connect
    Can any body help me to take it forward.
    REgards
    DBA.

    I would check the agent trace file (<AGENT_HOME>\sysman\log\emagent.trc) to see if this gives you any information. To give the Log on as batch privilege will not help (to what user?) I think. It will if you start patching using Grid Control.
    Are you sure the target db is 10.2.0.4? Because it was a issue in 10.2.0.3 and cursor_sharing=similar
    Eric

  • Finding watermark: problem in linking dba_free_space and dba_data_files

    Hi all,
    I'm trying to write a very simple (maybe too much simple...) query to find out how much space I can save doing a resize of my datafiles.
    For this purpose, for every datafile, I look for the last free segment in the dba_free_space: if I find a row in dba_free_space such that the value (block_id+blocks-1) matches the one in dba_data_files.blocks, I can find the watermark.
    The problem is that I have an (almost) empty tablespace with the last blocks unused: if I look in the dba_segments or in the dba_extents I can see that the last 5 or 4 blocks are not used, and they are not included in the dba_free_space.
    So, here is my query:
    select t.tablespace_name,
    d.bytes / 1024 / 1024 as file_size_mb,
    (f.block_id - 1) / d.blocks * d.bytes / 1024 / 1024 as space_before_watermark_mb,
    f.bytes / 1024 / 1024 as space_after_watermark_mb,
    d.file_name
    from dba_tablespaces t, dba_data_files d, dba_free_space f
    where t.tablespace_name = d.tablespace_name
    and d.file_id = f.file_id
    and d.blocks = (f.block_id + f.blocks - 1)
    order by tablespace_name;
    There are two problems right now:
    - I have to use a different query to find out if there are datafiles whose last blocks are used
    - I'm not able to find out informations about datafile whose last blocks are not used and are not in the dba_free_space.
    How can I solve that?
    thansk in advance for every comment

    hi,
    try the following to look for the HWM.
    set serveroutput on
    execute dbms_output.enable(2000000);
    declare
    cursor c_dbfile is
    select tablespace_name
    ,file_name
    ,file_id
    ,bytes
    from sys.dba_data_files
    where status !='INVALID'
    order by tablespace_name,file_id;
    cursor c_space(v_file_id in number) is
    select block_id,blocks
    from sys.dba_free_space
    where file_id=v_file_id
    order by block_id desc;
    blocksize binary_integer;
    filesize binary_integer;
    extsize binary_integer;
    begin
    /* get the blocksize of the database, needed to calculate the startaddress */
    select value
    into blocksize
    from v$parameter
    where name = 'db_block_size';
    /* retrieve all datafiles */
    for c_rec1 in c_dbfile
    loop
    filesize := c_rec1.bytes;
    <<outer>>
    for c_rec2 in c_space(c_rec1.file_id)
    loop
    extsize := ((c_rec2.block_id - 1)*blocksize + c_rec2.blocks*blocksize);
    if extsize = filesize
    then
    filesize := (c_rec2.block_id - 1)*blocksize;
    else
    /* in order to shrink the free space must be uptil end of file */
    exit outer;
    end if;
    end loop outer;
    if filesize = c_rec1.bytes
    then
    dbms_output.put_line('Tablespace: '
    ||' '||c_rec1.tablespace_name||' Datafile: '||c_rec1.file_name);
    dbms_output.put_line('Can not be resized, no free space at end of file.')
    dbms_output.put_line('.');
    else
    if filesize < 2*blocksize
    then
    dbms_output.put_line('Tablespace: '
    ||' '||c_rec1.tablespace_name||' Datafile: '||c_rec1.file_name);
    dbms_output.put_line('Has a highwater mark of: '||2*blocksize
    ||' Bytes, actual size: '||c_rec1.bytes||' Bytes');
    dbms_output.put_line('.');
    else
    dbms_output.put_line('Tablespace: '
    ||' '||c_rec1.tablespace_name||' Datafile: '||c_rec1.file_name);
    dbms_output.put_line('Has a highwater mark of: '||filesize
    ||' Bytes, actual size: '||c_rec1.bytes);
    dbms_output.put_line('.');
    end if;
    end if;
    end loop;
    end;
    regards
    Alan

  • Oradata from oracle ee into oracle xe

    hi
    When I shutdown the db and copy the oradata of the oracle10gEnterprise Edition to oracle xe's oradata location, I cannot open the database. Even I make new pfile and start to open with it, it doesnt open.
    Why not?

    Even I make new pfile and start to open with it, it doesnt open.Do You mean you are trying to clone the database from EE to XE? Please elaborate the steps that you are peforming, only Pfile will not work, Control file is the one that stores information about datafiles and log files, that also needs to be recreated in case you are cloning.
    There are certain limitations with Oracle XE.
    http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm
    Use SE or EE.
    XE should be used mostly for learning purpose or teaching purpose.
    Edited by: Manoj Alwani on Sep 9, 2008 10:44 AM

  • Partial Recovery - Skip UNDO Tablespace

    Hi,
    I was performing a partial database recovery using skip tablespace option using RMAN. I was wondering if I can skip undo tablespace.
    I was not able to conclude whether I can do that? If not, why?
    As per my understanding,
    1. Datafiles are restored - If they have any uncommited data, then archive logs which will be applied for media recovery, will have the undo data to perform those roll backward.
    2. While performing media reccovery using archive logs, it will generate it's own undo data.
    Why do we need the stale undo data (generated till datafiles restoration point)?
    Thanks,
    Janak Agrawal

    Soli,
    Thread that you have specified, talks about datafiles which does not have any uncommitted data (As the database was normally shutdown). In this case, we can drop and recreate the undo tablespace.
    But I am talking about a past point-in-time recovery using RMAN, where the datafiles which will be restored may have the uncommitted data. To rollback these uncommited trnasactions, will we have data in next archivelogs, which will be used for media recovery or the data (needed to rollback) will have only in undo tablespace. Let me give you an example.
    At 9 am I want to restore the datbase till 8.15 AM. Full backup is available till 8 AM and then from 8 to 8:15 arvhive logs are available. While doing recovery, datafiles will be restored till 8 AM. If at 8 AM there is some uncommitted data in datafiles, will it require data from undo tablespace to rollback or first archive log after 8 AM w'd take care of roll back? If archive logs can take care of rollback, why can't I skip the undo tablespace while doing recovery?
    Santosh,
    As you mentioned, UNDO data will require for read-consistency. But the same data will be available in archive logs (which will require after datafiles restore) which can generate their own UNDO data.
    Please clarify. I am sorry if I am missing anything here.
    Thanks,
    Janak Agrawal

  • Issue with create controlfile script that was generated from trace file

    Hi All,
    I am racking my brans here as cannot seem to fatham this one out. Having backed up control file to trace, then deleted all datafiles, control files, and redo log files, I then ran the following and received the below error:
    SQL> STATUP NOMOUNT
    ORACLE instance started.
    Total System Global Area 289406976 bytes
    Fixed Size 1248576 bytes
    Variable Size 88081088 bytes
    Database Buffers 192937984 bytes
    Redo Buffers 7139328 bytes
    SQL> CREATE CONTROLFILE SET DATABASE "TEST" RESETLOGS ARCHIVELOG
    2 MAXLOGFILES 16
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 100
    5 MAXINSTANCES 8
    6 MAXLOGHISTORY 292
    7 LOGFILE
    8 GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG' SIZE 50M,
    9 GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO02.LOG' SIZE 50M,
    10 GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO03.LOG' SIZE 50M
    11 DATAFILE
    12 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF',
    13 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOTBS01.DBF',
    14 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAUX01.DBF',
    15 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS01.DBF'
    16 CHARACTER SET WE8MSWIN1252;
    CREATE CONTROLFILE SET DATABASE "TEST" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01565: error in identifying file
    'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF'
    ORA-27041: unable to open file
    OSD-04002: unable to open file
    O/S-Error: (OS 2) The system cannot find the file specified.
    I am able to restore a control file using [RMAN> restore controlfile to '....' ] and then mount the database without problems one the CF restore has taken place, it is just when I attempt to create control file using the able commands that I get the preceding error.
    As this control file statement that is attepting to create a control file has never had any information about datafiles is this why I am seeing the error?
    Have checked metalink & web but yet to find a reason why this is occuring. Please advise.
    Thanks,
    Andrew

    Hi,
    You deletd all the data files that is the issue. So it is complaining that it can not find system tablespace datafile. If you just wanted to recreate the controlfile then just delete control file. Why did you delete data files.
    Regards
    Generetaed control trace flle is used to re-create the control file. This not not a way to create/restore data files. They should exist for control file to be created.
    Edited by: skvaish1 on Nov 5, 2009 4:36 PM

  • Rm ${datafile}; how to force 10g to find out about it?

    Hey;
    I have a small oracle 10g test instance with which I'm hoping to become familiar with backup and recovery - my first topic of study.
    I have a list of backups both copy and backupset. After getting those, I identified the files in the database:
    2 from dba_data_files
    3* order by tablespace_name
    SQL> /
    FILE_NAME FILE_ID STATUS TABLESPACE
    /oracle/oradata/oci1/example01.dbf 5 AVAILABLE EXAMPLE
    /oracle/oradata/oci1/sysaux01.dbf 3 AVAILABLE SYSAUX
    /oracle/oradata/oci1/system01.dbf 1 AVAILABLE SYSTEM
    /oracle/oradata/oci1/undotbs01.dbf 2 AVAILABLE UNDOTBS1
    /oracle/oradata/oci1/users01.dbf 4 AVAILABLE USERS
    then blasted example.dbf;
    $ ls -ld /oracle/oradata/oci1/example01.dbf
    ls: /oracle/oradata/oci1/example01.dbf: No such file or directory
    I was thinking that would start screaming immediately in the alert log... so far, nothing. I then tried a query of the hr schema and that worked. That obviously means the hr schema is in the sga which is curious by itself because I've never queried that table before.
    Finally a report from the v$datafile_header is also showing everything is still there:
    SQL> select file#, status, error, recover, tablespace_name, name
    2 from v$datafile_header;
    FILE# STATUS ERROR REC TABLESPACE NAME
    1 ONLINE NO SYSTEM /oracle/oradata/oci1/system01.dbf
    2 ONLINE NO UNDOTBS1 /oracle/oradata/oci1/undotbs01.dbf
    3 ONLINE NO SYSAUX /oracle/oradata/oci1/sysaux01.dbf
    4 ONLINE NO USERS /oracle/oradata/oci1/users01.dbf
    5 ONLINE NO EXAMPLE /oracle/oradata/oci1/example01.dbf
    I also forced a check point with alter system checkpoint and still nothing in the alert log or v$datafile_header query.
    How long will it be before oracle does the 'holy crap!' thing and/or how can I force it to find out about the missing datafile?
    Thanks for any info..
    Doug O'Leary

    Actually, if, after removing the file from the O/S, you login to the database w/ a new session, this will give you a new server process (assuming you're not running shared server), and that server process would not be able to open that file. If you now do a select and force a full table scan on a table that has extents in the file that you deleted, your process should catch an error.
    -Mark
    Edited by: mbobak on Jul 22, 2009 11:30 AM

  • About automatically extend datafile!

    HI All Experts,
         What is the advantage and disadvantage about using automatically extend on datafile? Any suggestion is welcome!

    I agree with forbrich, I also do not like using autoextend option. In case when you are obligated to use it (i.e. customer requirement) I would advice you to use MAXSIZE option. This will limit the size to which file can autoextend. You should also choose reasonable datafile sizes, you should choose reasonable sizes. You have to remember about data availability. If you place or you data in one datafile and this file will be corrupted you whole application will be not available during restore of for example 32 GB datafile. If you devide your data wisely between tablespaces in case of one datafile corruption many parts of your application can be available to end users.
    Best Regards
    Krystian Zieja / mob

  • Problem about RMAN-06023: no backup or copy of datafile 5 found to restore

    here is the error info when i duplicate database use rman
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 08/19/2011 09:33:39
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 5 found to restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    and following my operate steps
    ==================
    auxiliary instance configure
    1, create password file
    $ orapwd file=/opt/app/oracle/product/10.2.0/db_1/dbs/orapwslavedb password=Myss123456 entries=30
    2,edit tnsname.ora on auxilary so i can connect primary db and auxiliary
    $ vi tnsname.ora (tnsping test pass)
    PRIDB =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.214)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = pridb)
    3,create pfile for auxiliary instance
    $ vi initslavedb.ora
    *.DB_BLOCK_SIZE=8192
    *.DB_NAME=slavedb
    *.CONTROL_FILES='/opt/app/oracle/oradata/slavedb/control01.ctl','/opt/app/oracl
    e/oradata/slavedb/control02.ctl','/opt/app/oracle/oradata/slavedb/control03.ctl'
    *.DB_FILE_NAME_CONVERT='/opt/app/oracle/oradata/primaryd','/opt/app/oracle/oradata/slavedb'
    *.LOG_FILE_NAME_CONVERT='/opt/app/oracle/oradata/primaryd','/opt/app/oracle/oradata/slavedb'
    4,start auxiliary instance nomount and create spfile,then shutdown it,and startup to nomount status again
    5,backup target database
    RMAN> backup database;
    6, create directory on slavedb,and transforer target backupset and archlog to salvedb
    $ mkdir -p /opt/app/oracle/flash_recovery_area/PRIDB/backupset/2011_08_19
    $ mkdir -p /opt/app/oracle/flash_recovery_area/PRIDB/archivelog/2011_08_19
    7,run duplicate commandline on auxiliary
    [oracle@localhost admin]$ rman target sys/Myss123456@pridb auxiliary /
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Aug 19 10:46:05 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: PRIDB (DBID=969477968, not open)
    connected to auxiliary database: SLAVEDB (not mounted)
    RMAN> duplicate target database to 'slavedb'
    2> nofilenamecheck;
    Starting Duplicate Db at 19-AUG-2011 10:46:15
    using target database control file instead of recovery catalog
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: sid=35 devtype=DISK
    contents of Memory Script:
    set until scn 490864;
    set newname for datafile 1 to
    "/opt/app/oracle/oradata/slavedb/system01.dbf";
    set newname for datafile 2 to
    "/opt/app/oracle/oradata/slavedb/undotbs01.dbf";
    set newname for datafile 3 to
    "/opt/app/oracle/oradata/slavedb/sysaux01.dbf";
    set newname for datafile 4 to
    "/opt/app/oracle/oradata/slavedb/users01.dbf";
    set newname for datafile 5 to
    "/opt/app/oracle/oradata/slavedb/example01.dbf";
    restore
    check readonly
    clone database
    executing Memory Script
    executing command: SET until clause
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    Starting restore at 19-AUG-2011 10:46:16
    using channel ORA_AUX_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 08/19/2011 10:46:16
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 5 found to restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    anyone can help?

    use format command with backup.
    eg:-
    backup as compressed backupset database format '/u01/db/backup/%d_%I_%s_%T';
    if it is archivelog mode then
    backup as compressed backupset database format '/u01/db/backup/%d_%I_%s_%T' plus archivelog format '/u01/db/backup/%d_%I_%s_%T';
    then copy the backup to the auxiliary instance server.
    then try again the duplicate command.

  • Doubt about transfering datafiles

    sir/madam,
    as a DBA, i had a requirement for converting a datafile from one> tablespace to another. but for my surprise, i couldn't do it. from user or DBA point of view, i appreciate all the new features and capabilities of Oracle. but this one was quite amazing that how
    could such a feature be overlooked. That is, its possible to move
    objects between tablespaces(here i mean, alter table ...move...).
    but i couldn't move datafile between tablespaces. recently i had
    a requirement, something like this.
    Database is in noarchivelog mode. i have users tablespace with one
    datafile u1.dbf. i created one other datafile u2.dbf for some temporary
    reasons.after my work i offline dropped the datafile(u2.dbf) with alter
    database..command(assume that the tablespace is offline). but now the
    datafile(u2.dbf) is still in recover status from v$datafile(because database
    is in noarchivelog mode). when i try to online the tablespace, its saying
    that datafile is not able to be locked/found as error and action says to
    drop the tablespace itself. but here u1.dbf datafile is having all the users
    information in which case, i cannot drop the tablespace. here, my
    requirement is to move the datafile from users to some other tablespace to
    drop it. but i'm not able to drop it.
    i'm really confused on what to do with this. please recommend necessary
    suggestions so that i can overcome this problem. as a DBA i think this one
    is quite a good question. i request you to please suggest me a solution as
    soon as possible.
    thank you
    sivamurugesh arumugam(DBA)

    Donald has your solution. As far as the "feature" of moving a datafile from one tablespace to another, this makes no sense. Datafiles are the physical (operating system level) implementation of tablespaces. The fact that you can have multiple datafiles per tablespace was originally intended to overcome file size limites due to the size of hard disks (before we could span volumes with RAID 5). Now this construct allows us to have tablespaces (and therefore tables) which are larger than the file size limit of the operating system. Never treat a datafile as a independent entity. It is part of a tablespace. It may contain any part of any table within the tablespace. Always treat all datafiles of one tablespace as a logical unit and you won't break anything.

  • Question about ALTER TABLESPACE add/drop datafile

    Good afternoon,
    As an exercise, I created a tablespace STORETABS and added a datafile to it using the command:
    SQL> alter tablespace storetabs add datafile 'e:/storetabs3.dbf' size 50M;This step succeeded. A new file was created in the root of e: as expected.
    Following that command, I issued:
    SQL> alter tablespace storetabs drop datafile 'e:/storetabs3.dbf';
    Tablespace altered.The command succeeded. However, the file *'e:/storetabs3.dbf'* was not removed. After re-reading the documentation found at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3002.htm, I get the impression that removing the O/S file itself is something that always needs to be done manually.
    The question: Am I correct that there is no option to cause the "alter tablespace <tablespace> drop datafile <datafilename>" to delete the O/S file ? In other words, must the O/S file always be manually deleted as a separate step ?
    Thank you for your help,
    John.

    I believe in windows directory paths used backslash and not forward slash.
    You can argue why oracle does not give error, either while creating or while dropping ;)
    SQL> select * from v$version ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> select tablespace_name, file_name from dba_data_files ;
    TABLESPACE_NAME
    FILE_NAME
    USERS
    /u01/app/oracle/oradata/orcl/users01.dbf
    UNDOTBS1
    /u01/app/oracle/oradata/orcl/undotbs01.dbf
    SYSAUX
    /u01/app/oracle/oradata/orcl/sysaux01.dbf
    SYSTEM
    /u01/app/oracle/oradata/orcl/system01.dbf
    EXAMPLE
    /u01/app/oracle/oradata/orcl/example01.dbf
    SCOTT_TBS
    /home/oracle/scott_f1.dat
    6 rows selected.
    SQL> !ls -l scott_f1.dat   
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    SQL> alter tablespace scott_tbs add datafile '/home/oracle/scott_f2.dat' size 10M ;
    Tablespace altered.
    SQL> !ls -l scott_*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    -rw-r----- 1 oracle oinstall  10493952 Sep 11 21:18 scott_f2.dat
    SQL> alter tablespace scott_tbs drop datafile '/home/oracle/scott_f2.dat' ;
    Tablespace altered.
    SQL> !ls -l scott*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat

  • How can I clean all data in a database but keep all datafile still same nam

    hi,
    How can I get a easy way to clean all data in a database but keep all datafiles still same name and location just like a new created database?
    dbca has two choice: create templet without datafile or with all datafiles but not empty datafiles.
    thanks

    What version is your database? DBCA in 10gR2 allows you to create a template from an existing database using only the structure. From DBCA
    From an existing database (structure only)
    The template will contain structural information about the source database including database options, tablespaces, datafiles, and initialization parameters specified in the source database. User defined schemas and thier data will not be part of the created template.

Maybe you are looking for