Datafile resize on primary

Hi
Assume standby file management is manual
If I issue "alter database datafile resize" command, does the command also resizes the corresponding datafile on standby database ?

This sounds so logical, but I have found when resizing a datafile on Primary, the datafile is not resized on Standby. Standby_file_management is set to auto. The Oracle® Data Guard Concepts and Administration,11g Release 1 (11.1),Part Number B28294-03 contains no information on resizing datafiles, only adding, monitoring and renaming. Adding a datafile to Primary does propagate to standby. When searching Oracle Support (Metalink), there is a published document 'Standby Database Behavior when a Datafile is Resized on the Primary Database (ID 123883.1). The only way I can get the resize to propagate to Standby is by issuing 'recover standby database' as described in this document. Perhaps I've overlooked something obvious.
Karen

Similar Messages

  • What is the different DEALLOCATE UNUSED - datafile resize operation ?

    hi everybody,
    i have a question about DEALLOCATE UNUSED.
    what is the different DEALLOCATE UNUSED command and datafile resize operation ?
    Thanks.

    Deallocate unused space clause is used to to explicitly deallocate unused space at "the end" of a segment and makes that space available for other segments within the tablespace. Internally, Oracle deallocates unused space beginning from the end of the objects (allocated space) and moving downwards toward the beginning of the object, continuing down until it reaches the high water mark (HWM).
    Datafile resize add/substracts physical operating system bytes from the datafile .
    Cheers :)
    Renjith Madhavan

  • 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.

  • Error in opening datafile after use of DATAFILE RESIZE command

    Hi Friends,
    I am facing a strange problem here. We got a space problem yesterday ORA-01659: unable to allocate MINEXTENTS beyond 42 in tablespace and I increased the underlying datafiles using resize command. The datafiles were 1G earlier and I have increased them to 2G using the command
    ALTER DATABASE DATAFILE 4 resize 2G;
    It went fine and I saw the free space in my tablespace. But after this when I try to drop a table using a script which connects to this db as a schema owner ( the script just selects all tables from dictionary and drops it using 'drop table x cascade constraints' , It thorws the following error
    ERROR at line 1:
    ORA-01116: error in opening database file 4
    ORA-01110: data file 4: '/SAN/p0/oradb/CBA11/data/avient01CBA11.dbf'
    ORA-27092: size of file exceeds file size limit of the process
    Additional information: 132104
    Additional information: 262145
    On going through metalink, I found that there could be problems with ulimit parameter in the OS. My OS is SunOS 5.8 Generic_117350-28 sun4u sparc SUNW,Sun-Fire-480R and my oracle version is 10.2.0.1.0 . I have set the ulimit parameters for file size to unlimited for both hard limit and soft limit.
    airsun10 oracle [CBA11]:ulimit -aS
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) 8192
    coredump(blocks) unlimited
    nofiles(descriptors) 256
    vmemory(kbytes) unlimited
    airsun10 oracle [CBA11]:ulimit -aH
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) unlimited
    coredump(blocks) unlimited
    nofiles(descriptors) 256
    vmemory(kbytes) unlimited
    airsun10 oracle [CBA11]:ulimit -Ss unlimited
    airsun10 oracle [CBA11]:ulimit -aS
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) unlimited
    coredump(blocks) unlimited
    nofiles(descriptors) 256
    vmemory(kbytes) unlimited
    airsun10 oracle [CBA11]:ulimit -aH
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) unlimited
    coredump(blocks) unlimited
    nofiles(descriptors) 256
    vmemory(kbytes) unlimited
    airsun10 oracle [CBA11]:
    These solutions are suggested as per MOS note ID 271331.1. However the issue is still persisting. I am not getting any clue on whats happening. Any help is appreciated.
    Thanks
    SSN

    Thanks for your hint.
    yes, I did and the following is something more strange. I can't figure out !!
    The ulimit is only different for stack for hard and soft. file size is still unlimited. The same drop table doesn't allow me when I connect as schema owner directly !
    airsun10 oracle [CHANGEME]:whoami
    oracle
    airsun10 oracle [CHANGEME]:ulimit -aS
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) 8192
    coredump(blocks) unlimited
    nofiles(descriptors) 256
    vmemory(kbytes) unlimited
    airsun10 oracle [CHANGEME]:ulimit -aH
    time(seconds) unlimited
    file(blocks) unlimited
    data(kbytes) unlimited
    stack(kbytes) unlimited
    coredump(blocks) unlimited
    nofiles(descriptors) 1024
    vmemory(kbytes) unlimited
    airsun10 oracle [CHANGEME]:cd drop_cts/
    /export/home/oracle/drop_cts
    airsun10 oracle [CHANGEME]:ls
    drop.sql on.lst run_drop.sql sql
    drop_objects recompile_objects run_dropObj.sql
    airsun10 oracle [CHANGEME]:cat drop.sql
    drop table BID_STATUSES cascade constraints;
    drop table BID_TYPES cascade constraints;
    drop table BID_TYPES_IN_SETS cascade constraints;
    airsun10 oracle [CHANGEME]:sqlplus cts_owner/cts_owner@CBA11
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 8 10:02:06 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @drop.sql
    drop table BID_STATUSES cascade constraints
    ERROR at line 1:
    ORA-01116: error in opening database file 4
    ORA-01110: data file 4: '/SAN/p0/oradb/CBA11/data/avient01CBA11.dbf'
    ORA-27092: size of file exceeds file size limit of the process
    Additional information: 132104
    Additional information: 183107
    drop table BID_TYPES cascade constraints
    ERROR at line 1:
    ORA-01116: error in opening database file 4
    ORA-01110: data file 4: '/SAN/p0/oradb/CBA11/data/avient01CBA11.dbf'
    ORA-27092: size of file exceeds file size limit of the process
    Additional information: 132104
    Additional information: 183107
    drop table BID_TYPES_IN_SETS cascade constraints
    ERROR at line 1:
    ORA-01116: error in opening database file 4
    ORA-01110: data file 4: '/SAN/p0/oradb/CBA11/data/avient01CBA11.dbf'
    ORA-27092: size of file exceeds file size limit of the process
    Additional information: 132104
    Additional information: 183107
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    airsun10 oracle [CHANGEME]:export ORACLE_SID=CBA11
    airsun10 oracle [CBA11]:sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 8 10:02:29 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn cts_owner/cts_owner
    Connected.
    SQL> drop table BID_STATUSES cascade constraints;
    Table dropped.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    airsun10 oracle [CBA11]:

  • Query regarding datafile resize

    Hi all,
    Just want to know in my testing server for reporting purpose for each month can i add new datafile to increase the space or resize the exsiting datafile becoz i am trying to maintain month wise tables in a single tablespace.
    Which is beneficial and why.
    Regards,
    Vikas

    Vikas Kohli wrote:
    Kamran,
    Thing is that we need to load daily approx 14 gb of data for the month table and that data is compiled for generating report at the end of the month. from last 4 months we assign a single tablespace the default tablespace for every month table, as space is going to be less in tablespace we add datafile and not resize the datafile. what you recommend and while adding datafile we didn't specify auto extend on existing datafile.
    Regards,
    Vikas KohliIf you DELETE any data from that table in the future, don't forget to shrink table to reclaim unused disk space
    Moreover, if you use 64bit OS, you can create a tablespace and add datafiles and make it autoextendable up to 32G. After the datafile is filled, the new data will be inserted to the next datafile

  • Datafile resize stuck!!

    Hi ,
    I just resize data file on window platform using ‘ alter database resize file’. this command is get stuck on sql prompt also no information showing in alert log but that file physically resized.
    Can any one tell me why is this command stuck on sql prompt???

    user586569 wrote:
    Hi ,
    I just resize data file on window platform using ‘ alter database resize file’. this command is get stuck on sql prompt also no information showing in alert log but that file physically resized.
    Can any one tell me why is this command stuck on sql prompt???Well, there is not much that you have told us about your environment , for example db version so its hard to guess what could have happened. You have mentioned that file got resized so the command actually worked. Try out the same on some datafile and see if it happens and if it does without logging any information anywhere, its better to raise an SR.
    HTH
    Aman....

  • DATAFILE RESIZE

    hi,
    i am using oracle 11gR1(11.1.0.6) in windows 2003 server. i want to resize my datafile which has around 2GB free space and used space in 780 MB. But when i tried to resize the datafile it throws me error. No session is established in schema which is associated with that datafile.
    can anyone tell me y this is happening??????
    Regards,
    007

    Hi,
    The command is very simple:
    ALTER DATABASE DATAFILE ''D:\APP\ADMINISTRATOR\ORADATA\SIPDB\TEST.DBF' resize 800M;
    Have you check the drive space before adding the datafile.Your drive might be not having enough space.
    Check the Tablespace usage details also:
    tablespace usage:
    =================
    SELECT F.TABLESPACE_NAME,TO_CHAR ((T.TOTAL_SPACE - F.FREE_SPACE),'999,999') "USEDMB",
    TO_CHAR (F.FREE_SPACE, '999,999') "FREEMB",
    TO_CHAR (T.TOTAL_SPACE, '999,999') "TOTALMB",
    TO_CHAR ((ROUND ((F.FREE_SPACE/T.TOTAL_SPACE)*100)),'999')||' %' FREE
    FROM (SELECT TABLESPACE_NAME,
    ROUND (SUM (BLOCKS*(SELECT VALUE/1024
    FROM V$PARAMETER
    WHERE NAME = 'db_block_size')/1024) ) FREE_SPACE
    FROM DBA_FREE_SPACE
    GROUP BY TABLESPACE_NAME ) F,
    SELECT TABLESPACE_NAME,
    ROUND (SUM (BYTES/1048576)) TOTAL_SPACE
    FROM DBA_DATA_FILES
    GROUP BY TABLESPACE_NAME ) T
    WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME;
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com
    Edited by: Rafi (Oracle DBA) on Jun 23, 2011 1:45 AM
    Edited by: Rafi (Oracle DBA) on Jun 23, 2011 1:46 AM

  • Resize datafile in standby when its in mount stage

    Hi All,
    Oracle 10.2.0.1
    Linux EL5
    I have configured standby database for testing. Now i have a problem that my users tablespace in standby got filled and its giving error message like
    ORA-01237: cannot extend datafile 4
    ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl/users01.dbf'
    Now i have to autoextend the datafile 4 in standby.how to do it in mount stage?
    When i try to open the database for resizing the datafile, i am getting the below error..
    SQL> alter database open;
    alter database open
    ERROR at line 1:
    ORA-16004: backup database requires recovery
    ORA-01196: file 1 is inconsistent due to a failed media recovery session
    ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
    Any other options ? please advice..
    TIA,

    Hi,
    Thanks for your reply...
    But i cant do that,because the current sequence in the primary is 51. And rite now the sequence in the standby is stuck in 45, now i have to pass this 6 sequences so that the changes made(like resizing the datafile) in the primary will reflect in the standby..
    Now this is the error message i am getting when i start the redo apply in standby..
    MRP0: Background Media Recovery terminated with error 1237
    Thu Aug 27 20:01:33 2009
    Errors in file /u01/app/oracle/admin/orcl/bdump/orclstdby_mrp0_5742.trc:
    ORA-01237: cannot extend datafile 4
    ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl/users01.dbf'
    ORA-19502: write error on file "/u01/app/oracle/oradata/orcl/users01.dbf", blockno 56960 (blocksize=8192)
    ORA-27072: File I/O error
    Linux Error: 11: Resource temporarily unavailable
    Additional information: 4
    Additional information: 56960
    Additional information: 327680
    Managed Standby Recovery not using Real Time Apply
    Some recovered datafiles maybe left media fuzzy
    Media recovery may continue but open resetlogs may fail
    Any other options ?
    Please advice...
    TIA,

  • Syntax to resize datafile in 10g

    syntax to resize datafile in 10g

    the reason is
    in 10g if u want to create tablespace the syntax is
    create tablespace table_name datafile 10M;No, actually. The syntax on how to create a tablespace is exactly the same today as it was in 1999. Create tablespace X datafile '/path/filename' size 10M.
    It is, however, possible to omit both the path and size clause if you want to use Oracle Managed Files (OMF):
    alter system set db_create_file_dest=/path/filename;
    create tablespace X;
    And then it's possible to add back the size clause if you don't like the default 100M autoextend on which OMF gives you:
    create tablespace X datafile size 10M;
    or
    create tablespace X datafile size 10m autoextend off;
    or
    create tablespace X datafile size 10m autoextend on next 10m maxsize 400m;
    Point is, the syntax for creating a tablespace has many different variations and options, but the basic syntax hasn't changed a bit. The other point is: what has creating a tablespace got to do with what you originally asked about, which was resizing an existing datafile?
    to add datafile
    alter tablespace table_name add datafile;
    it will add datafile with default size and with name
    according to its naming convention.Yes, but you are not obliged to let that happen.
    alter system set db_create_file_dest=/path/filename;
    alter tablespace X add datafile '/different/path/myownfilename' size 37M;
    ...you switch on OMF and then decide you don't want to use it for one particular file. The presence/existence of OMF is an addition of features if you want to use them. It doesn't take anything away from you and if you want to specify all the parts of the create or alter tablespace clause yourself, you can do so, no sweat -at which point, your syntax will look incredibly like what you would have issued in 8i or 9i days.
    Analogy time: yes, today, you can build homes out of steel, concrete, carbon-reinforced composites, whereas in the 16th century you might have used timber, wattle and daub. But a house still has rooms, chimney flues, windows, doors. The house I live in would be recognisable to Shakespeare as a house. And what he lived in would be something I could live in too.
    Yeah, well: maybe analogies aren't all they're cracked up to be! But the underlying truth is that Oracle gives you new features in new versions and using them can be highly convenient and useful. Nevertheless, if you understand the underlying principles,the old stuff is still there, still recognisable, still usable.
    thats why i am asking for syntax to resize datafile
    in 10g ,i had fired above sqls with no errors.Again, I am a little at a loss understanding why the fact that the syntax for creating a tablespace has new options should cause you to think anything weird has happened to the syntax for resizing a datafile.
    As others I think have already mentioned: there always were and still remain only three ways of making a tablespace bigger:
    add a datafile
    resize an existing datafile
    switch on autoextension of an existing datafile
    alter tablespace X add datafile ['/path/filename'][size 10m];
    alter database datafile '/path/filename' resize 54m;
    alter database datafile '/path/filename' autoextend on [next Xm] [maxsize Ym];
    None of that syntax is different from what you'd use in version 7. Yes, some commands have optional clauses -and some of the clauses which are optional in 10g were compulsory in 7 or 8. But the general syntax is identical, still.

  • Lock during resize datafile

    Dear all,
    During the execution of an "ALTER DATABASE DATAFILE <FILE#> RESIZE <SIZE> " query does Oracle puts some kind of a lock on that datafile or make it unavaliable for use (till the resize is complete) ? Or is it just possible to use the datafile normally during the execution of the "ALTER DATABASE" statement ?
    Version : 10.1.0.5
    Windows 2003
    Thanks in advance,
    Regards

    Hi,
    I've personally never experienced issues with datafile resizing, even on systems with 1000's of users with many active sessions. Although you may wish to note in the Oracle 10g documentation regarding ALTER DATABASE datafile clause it states:
    "You can use any of the following clauses when your instance has the database mounted, open or closed, and the files involved are not in use."
    Cheers,
    Stuart.

  • DATAFILE SIZE를 줄이는 방법 (resize)

    제품 : ORACLE SERVER
    작성날짜 : 2003-01-21
    DATAFILE SIZE를 줄이는 방법
    =====================
    PURPOSE
    Explanation
    기존의 datafile을 resize하여 늘리거나 줄일 수 있습니다.
    datafile size를 증가하는 경우는 disk에 free space만 있다면 다음과 같이 간단합니다.
    다음과 같이 늘리면 되나 줄일 경우는 계산을 하여 줄여야 합니다.
    <Bulletin No: 10165> 참고
    SQL>alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M;
    줄이실 경우는 주의가 필요합니다. 만일 지정한 size만큼 data가 있다면
    error가 발생되고 resize되지 않습니다.
    SQL> alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M;
    alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M'
    ERROR at line 1:
    ORA-03297: file contains used data beyond requested RESIZE value
    방법1
    1) 줄이고자하는 file id를 확인합니다.
    SVRMGR> select file_id, file_name from dba_data_files;
    2) 얼마를 사용했는지 확인합니다.
    SVRMGR> select block_id, blocks from dba_extents
    2> where file_id='FILE_ID' order by block_id;
    FILE_ID 대신에 줄이려는 file id를 기술합니다.
    3)현재 사용중이 db block size를 확인합니다.
    SVRMGR> show parameter db_block_size
    만일 2048일 경우 다음과 같이 계산합니다.
    2)에서 조회된 마지막의 block_id, blocks 값을 가지고 계산합니다.
    block_id * 2048 + blocks * 2048 의 결과에 한 block더한 값만큼만 줄이는
    것이 가능합니다.
    만일 마지막으로 조회된 값이 block_id가 578261, blocks가 515일 경우
    578261*2048 + 515*2048 =1185333248로 최소한 1.2GB이상은 써야 합니다.
    4) 실제 datafile을 줄입니다.
    svrmgr>alter database datafile '/oracle/dbs/toolsORA.dbf' resize
    1200M;
    방법 2
    1) 기존의 data export
    exp username/password file=filename owner=username log=username.log
    2) tablespace drop
    svrmgr>drop tablespace tbs including contents;
    rm datafile
    tbs대신에 작게 만드시려는 tablespace name을 기술합니다.
    datafile대신에 tablespace와 연계된 모든 datafile을 remove합니다.
    3) tablespace재생성
    svrmgr>create tablespace tbs
    datafile '...' size 100M;
    원하시는 size로 줄입니다.
    4) data import
    imp username/password file=filename fromuser=username touser=username
    commit=y log=imp.log
    Example
    Reference Documents
    -------------------

    제품 : ORACLE SERVER
    작성날짜 : 2003-01-21
    DATAFILE SIZE를 줄이는 방법
    =====================
    PURPOSE
    Explanation
    기존의 datafile을 resize하여 늘리거나 줄일 수 있습니다.
    datafile size를 증가하는 경우는 disk에 free space만 있다면 다음과 같이 간단합니다.
    다음과 같이 늘리면 되나 줄일 경우는 계산을 하여 줄여야 합니다.
    <Bulletin No: 10165> 참고
    SQL>alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M;
    줄이실 경우는 주의가 필요합니다. 만일 지정한 size만큼 data가 있다면
    error가 발생되고 resize되지 않습니다.
    SQL> alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M;
    alter database datafile '/oracle/dbs/toolsORA.dbf' resize 100M'
    ERROR at line 1:
    ORA-03297: file contains used data beyond requested RESIZE value
    방법1
    1) 줄이고자하는 file id를 확인합니다.
    SVRMGR> select file_id, file_name from dba_data_files;
    2) 얼마를 사용했는지 확인합니다.
    SVRMGR> select block_id, blocks from dba_extents
    2> where file_id='FILE_ID' order by block_id;
    FILE_ID 대신에 줄이려는 file id를 기술합니다.
    3)현재 사용중이 db block size를 확인합니다.
    SVRMGR> show parameter db_block_size
    만일 2048일 경우 다음과 같이 계산합니다.
    2)에서 조회된 마지막의 block_id, blocks 값을 가지고 계산합니다.
    block_id * 2048 + blocks * 2048 의 결과에 한 block더한 값만큼만 줄이는
    것이 가능합니다.
    만일 마지막으로 조회된 값이 block_id가 578261, blocks가 515일 경우
    578261*2048 + 515*2048 =1185333248로 최소한 1.2GB이상은 써야 합니다.
    4) 실제 datafile을 줄입니다.
    svrmgr>alter database datafile '/oracle/dbs/toolsORA.dbf' resize
    1200M;
    방법 2
    1) 기존의 data export
    exp username/password file=filename owner=username log=username.log
    2) tablespace drop
    svrmgr>drop tablespace tbs including contents;
    rm datafile
    tbs대신에 작게 만드시려는 tablespace name을 기술합니다.
    datafile대신에 tablespace와 연계된 모든 datafile을 remove합니다.
    3) tablespace재생성
    svrmgr>create tablespace tbs
    datafile '...' size 100M;
    원하시는 size로 줄입니다.
    4) data import
    imp username/password file=filename fromuser=username touser=username
    commit=y log=imp.log
    Example
    Reference Documents
    -------------------

  • Datafile issues in manual standby database

    Hi all,
    oracle - 10gR2
    OS - RHEL 2.6
    We have primary and standby database setup using manual methods('rsync') to send archive logs from primary to standby database and they are applied there. Today I have created a new datafile in primary and seen that the same is not replicated in standby( i was not aware of the functionality of this kind of setup) later I have seen that "standby_file_management parameter is set to MANUAL".
    I have seen the following message in standby alert log(not disabled the archive log application script in satndby),
    "Media Recovery Log /u01/app/oracle/oradata/bmprod/archivelog/1_1761_703415336.arc
    File #6 added to control file as 'UNNAMED00006' because
    the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
    The file should be manually created to continue.
    Some recovered datafiles maybe left media fuzzy
    Media recovery may continue but open resetlogs may fail"
    Later I have copied the required file from primary to standby database(now I have disabled the archive log application script in standby), and renamed the datafile 'UNNAMED00006' to 'desired one' and restarted the archive log application script. I have seen the following messages,
    "ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01194: file 6 needs more recovery to be consistent
    ORA-01110: data file 6: '/u02/app/oracle/oradata/bmprod/BMTEST.dbf'"
    Now I am unable to figure out what I should do to come out of this situation. Atleast tell me this condition is not worse than I thought(I think that the standby database should be recreated).
    Any help is appreciated.......
    regards
    Edited by: techfeud on Jan 18, 2010 11:26 PM

    Hi,
    when you set the standby_file_management parameter as mannual then , if you create any datafile or adding it to the tablespace then you should mannaully run the command on the standby side , if its auto then auto matically it will create the file over in the respective locationa and with the name what you have used to create the datafile on the primary side,
    as the parameter value is mannual ypu need to create the datafile over the standby side and then performt the recovery,
    Farhan.

  • Add Datafile in Logical Standby Database

    Hi,
    I have add one datafile in our primary RAC DB. We had logical standby database with file management is equal to manual. Both the primary RAC and logical standby db have the different storage structure. When the archive applied on the logical standby database its throws the error " error in creating datafile 'path'";
    Would appreciate if come to know the steps to add the datafile in this kind of environment. and how can i overcome from this problem now except skip transaction for that ddl.
    Thanks in advance.
    Dewan

    When the archive applied on the logical standby database its throws the error " error in creating datafile 'path'";Can you post the error message with the number.
    From Manual..
    8.3.1.2 Adding a Tablespace and a Datafile When STANDBY_FILE_MANAGEMENT Is Set to MANUAL
    The following example shows the steps required to add a new datafile to the primary and standby database when the STANDBY_FILE_MANAGEMENT initialization parameter is set to MANUAL. You must set the STANDBY_FILE_MANAGEMENT initialization parameter to MANUAL when the standby datafiles reside on raw devices.
    Add a new tablespace to the primary database:
    SQL> CREATE TABLESPACE new_ts DATAFILE '/disk1/oracle/oradata/payroll/t_db2.dbf'
    2> SIZE 1m AUTOEXTEND ON MAXSIZE UNLIMITED;
    Verify the new datafile was added to the primary database:
    SQL> SELECT NAME FROM V$DATAFILE;
    NAME
    /disk1/oracle/oradata/payroll/t_db1.dbf
    /disk1/oracle/oradata/payroll/t_db2.dbf
    Perform the following steps to copy the tablespace to a remote standby location:
    Place the new tablespace offline:
    SQL> ALTER TABLESPACE new_ts OFFLINE;
    Copy the new tablespace to a local temporary location using an operating system utility copy command. Copying the files to a temporary location will reduce the amount of time the tablespace must remain offline. The following example copies the tablespace using the UNIX cp command:
    % cp /disk1/oracle/oradata/payroll/t_db2.dbf
    /disk1/oracle/oradata/payroll/s2t_db2.dbf
    Place the new tablespace back online:
    SQL> ALTER TABLESPACE new_ts ONLINE;
    Copy the local copy of the tablespace to a remote standby location using an operating system utility command. The following example uses the UNIX rcp command:
    %rcp /disk1/oracle/oradata/payroll/s2t_db2.dbf standby_location
    Archive the current online redo log file on the primary database so it will get transmitted to the standby database:
    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
    Use the following query to make sure that Redo Apply is running. If the MRP or MRP0 process is returned, Redo Apply is being performed.
    SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;
    Verify the datafile was added to the standby database after the archived redo log file was applied to the standby database:
    SQL> SELECT NAME FROM V$DATAFILE;
    NAME
    /disk1/oracle/oradata/payroll/s2t_db1.dbf
    /disk1/oracle/oradata/payroll/s2t_db2.dbf

  • How can I reduce size of the SYSTEM datafile?

    Hi All,
    I recently installed Oracle 9i Enterprise addition on Windows XP Pro. Everything went smoothly. However, I foolishly created a database with large space requirements in the default tablespace (SYSTEM) and this caused the datafile for the SYSTEM tables space to grow to 8 Gig. I dropped the tables and tried to shrink the datafile with the 'alter database datafile resize' command but the command failed indicating that the tablespace had data byond the reize amount. However, this is claerly not true since the OEM indicates that the tablespace is only 4% utilized.
    How can I reset the high water mark for the SYSTEM tablespace so that I can resize the datafile?

    Hi All,
    I recently installed Oracle 9i Enterprise addition on Windows XP Pro. Everything went smoothly. However, I foolishly created a database with large space requirements in the default tablespace (SYSTEM) and this caused the datafile for the SYSTEM tables space to grow to 8 Gig. I dropped the tables and tried to shrink the datafile with the 'alter database datafile resize' command but the command failed indicating that the tablespace had data byond the reize amount. However, this is claerly not true since the OEM indicates that the tablespace is only 4% utilized.
    How can I reset the high water mark for the SYSTEM tablespace so that I can resize the datafile? at one time (perhaps during the install) the extents may have been used and although you see only 4% used those extents have been allocated nonetheless.
    you'll have to rebuild the db if you can't resize the system ts
    to reset the high water mark you would have to truncate the system tables, don't think you want to do that
    steve

  • Recovering primary using standby database

    Hi all,
    Here we have a dataguard environment with db1(db_unique_name) as primary and db2(db_unique_name) as physical standby database. We configured dataguard in 10g environments and we are not using grid control. And now we want to configure rman for incremental backups.After configuring we successfully took full backup in standby plus archive logs. Then as the test case we dropped one datafile from the primary and tried to recover it. It is showing the following error. Also when i tried 'crosscheck backup' from primary it is showing that all the backups taken in standby are 'expired'. But from RMAN connected to standby the same backups are showing as 'available'. Can anyone help to fix this?
    On primary:
    [oracle@db1 NIOS]$ sqlplus / as sysdba;
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Sep 6 02:58:11 2012
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> alter database datafile 4 offline; (after deleting datafile from system level)
    Database altered.
    [oracle@db1 NIOS]$ rman target sys/oracle@db1 catalog rman/oracle@appsdb
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu Sep 6 02:58:58 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: NIOS (DBID=1590630518)
    connected to recovery catalog database
    RMAN> restore datafile 4;
    Starting restore at 06-SEP-12
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=107 devtype=DISK
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00004 to /u01/app/oracle/oradata/NIOS/users01.dbf
    channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp
    ORA-19870: error reading backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp
    ORA-19505: failed to identify file "/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp"
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    failover to previous backup
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00004 to /u01/app/oracle/oradata/NIOS/users01.dbf
    channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp
    ORA-19870: error reading backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp
    ORA-19505: failed to identify file "/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp"
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    failover to previous backup
    channel ORA_DISK_1: restoring datafile 00004
    input datafile copy recid=13 stamp=793208425 filename=/tmp/users01.dbf
    destination for restore of datafile 00004: /u01/app/oracle/oradata/NIOS/users01.dbf
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 09/06/2012 02:59:10
    ORA-19571: datafilecopy recid 13 stamp 793208425 not found in control file
    ORA-19600: input file is datafile-copy 13 ()
    ORA-19601: output file is datafile-copy 0 (/u01/app/oracle/oradata/NIOS/users01.dbf)
    RMAN> crosscheck backup;
    using channel ORA_DISK_1
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdsjlw_.bkp recid=18 stamp=793212040
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdtz6p_.bkp recid=19 stamp=793212087
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp recid=20 stamp=793212132
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793242038_84gdxw5j_.bkp recid=21 stamp=793212180
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T174759_84gjqrtn_.bkp recid=22 stamp=793216080
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp recid=23 stamp=793216082
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793246288_84gjs9h4_.bkp recid=24 stamp=793216129
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1590630518-20120906-00 recid=5 stamp=793238431
    Crosschecked 8 objects
    On Stand-by:
    [oracle@db2 NIOS]$ rman target sys/oracle@db2 catalog rman/oracle@appsdb
    Recovery Manager: Release 10.2.0.3.0 - Production on Wed Sep 5 20:11:58 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: NIOS (DBID=1590630518, not open)
    connected to recovery catalog database
    RMAN> crosscheck backup;
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=91 devtype=DISK
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdsjlw_.bkp recid=18 stamp=793212040
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdtz6p_.bkp recid=19 stamp=793212087
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp recid=20 stamp=793212132
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793242038_84gdxw5j_.bkp recid=21 stamp=793212180
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T174759_84gjqrtn_.bkp recid=22 stamp=793216080
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp recid=23 stamp=793216082
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793246288_84gjs9h4_.bkp recid=24 stamp=793216129
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1590630518-20120906-00 recid=5 stamp=793238431
    Crosschecked 8 objects
    Thanks in advance.

    Hello;
    I would review one of these step by step :
    Using RMAN Backup Files from Standby Database to Recover Primary
    http://oraganism.files.wordpress.com/2009/04/backup-from-physical-standby.pdf
    How to use standby backup to restore primary db
    http://alexzeng.wordpress.com/2008/09/13/how-to-use-standby-backup-to-restore-primary-db/
    Steps to recover the primary database's datafile using a copy of a standby database's datafile.
    http://dbaregistry.blogspot.com/2010/01/steps-to-recover-primary-databases.html
    RMAN in a Data Guard Environment
    http://oracle.su/docs/11g/backup.112/e10642/rcmarchi.htm#CHDIFGFH
    Performing a database clone using a Data Guard physical standby database
    http://gavinsoorma.com/2012/04/performing-a-database-clone-using-a-data-guard-physical-standby-database/
    Best Regards
    mseberg

Maybe you are looking for