Making atabase clone (but without data=rows) from hot-backup

Hi,
I am newbie in Oracle administration. I am using Oracle 10g database. I would like to clone database i.e. make an exact copy of tablespaces, tables, indexes, triggers, functions etc. but without data.
What is the most efficient way to do it.? I am having the full hot backup of another database. Is it possible to restore a that backup using rman but without data (=rows) on the fresh installed oracle database
Thanks for any advice
Groxy

I don't think RMAN has the feature you are looking for.
For this purpose, it could be easier to use:
- either old export with FULL=Y ROWS=N
- or new data pump export with CONTENT=METADATA_ONLY.
However in both cases you would need to recreate the empty database before importing the export file.
Message was edited by:
Pierre Forstmann

Similar Messages

  • How to execute procedure returning data rows from sql plus

    Hi,
    I want to execute a stored procedure that returns data rows from sql plus. please let me know the syntax for the same.
    Thanks,
    YG

    user13065317 wrote:
    Even if i get the result set into the cursor, do i have to do normal fetch into all the coumn variables within a loop
    But suppose no of columns in my result set varies depending on a parameter to the stored procedure.
    Is there any straightforward way to retrieve all the data irrespective of no of columns in the result set.There is no such thing as a "+result set+". Oracle does not create a temporary data set in memory that contains the results of your query. What would happen if this result set is a million rows and is too large to fit into memory? Or there are a 100 clients each with a 100,000 row result set?
    This is not scalable. You will be severely limited in the number and sizes of these "+result sets+" that can be created in server memory.
    A cursor is in fact a "program" that is created by compiling the SQL source code that you provide. This source code is parsed and compiled into what Oracle calls an execution plan. This is nothing but a series of instructions that the cursor will execute in order to return the rows required.
    Thus the result set is actually the output from a cursor (a program). Likewise, bind variables are the input parameters to this program.
    All SQLs are parsed and compiled as cursors and stored in the SQL Shared Pool. Oracle gives you handle in return to use to address this cursor - bind values to it, execute it, describe the output structure returned by the cursor, and fetch the output from the cursor.
    On the client side, this handle is used in different ways. In PL/SQL alone, this cursor handle can be used as an implicit cursor (you do not even see or use the cursor handle in your PL/SQL code). Or you can use a PL/SQL cursor variable. Or a DBMS_SQL cursor variable. Or a reference cursor variable.
    Why so many different client structures for the very same SQL cursor handle returned by Oracle? Because to allow you, the programmer, all kinds of different features and flexibility.
    The ref cursor feature is the ability to pass this cursor handle around, not only between PL/SQL code, but also from PL/SQL to the actual client process (Java. VB, SQL*Plus, TOAD, etc).
    The primary thing to remember - irrespective of what the client calls this (e.g. ref cursor, SQL statement handle, etc), this all refers to the same SQL cursor in the Shared Pool. And that this SQL cursor is a program that outputs data, and not a result set in itself.

  • How can I delete songs stored in the Cloud but without deleting them from my mac?

    How can I delete songs stored in the Cloud but without deleting them from my mac?

    You can do it, but you need another library signed in to iTunes match. That second library shouldn't have any local files stored.
    Delete the entry from that second library and it will ask you to confirm that you want to remove the file from the cloud. Confirm that you do.
    Now, as long as you don't delete the file from your main library it will have an iCloud status of "removed" and won't be in the cloud or try add it again.
    However, if you sign out of match on that computer and then sign in again it will then re-add it to the cloud, so this isn't a method to use if you tend to turn match on and off much.
    I have had the Beatles Mono albums in my main library, but not in the cloud, for a while now without any problems.

  • Recovery from hot backup

    I have a problem with recovery hot backup from production database to test database and open it to use.
    I have 'hot backup' without temporary tablespace and roll tablespace, I cant shut down production database (24x7), please give me a regulations how to recover database from hot backup, without online redo logs, temp tablespace, roll tablespace only with archive logs, and.....after this ..rename database sid.
    Every time when I recovered database, it's still want to recover...and recover from archive logs and I cant open it, it's still inconsistent.Please send me an answer for [email protected]
    thanks!

    Hi,
    What is the OS and version of Oracle?
    Do you have all the archivelogs after the hot backup? Is the backup a valid backup? Is it a RMAN backup or normal file system backup of the datafiles?
    Regards,
    Badri.

  • Build view with data rows from one of two views.

    Hello. I've got problem with PL/SQL.
    I have built two PL/SQL views. Now I have to write a third
    view based on the data from "view_1" or "view_2". "view_2" contains all data rows
    but "view_1" contains special information. If the needed data rows (it's
    always a tupel of two rows) are available in "view_1" i have to use these data.
    Are they not available in "view_1" i have to get it from the second view.
    I've tried it with the DECODE function and a procedure I've written but I think it's
    the completly wrong way because I have to search for a tour_id and there are always
    two shipments for one tour.
    It looks something like:
    >
    SELECT
    DECODE(FNC_OPERATION_INSTRUCTION_EXISTS(T1.TOURNO),0,
    (SELECT SHIPPING_NO
    FROM VIEW_SHIPPINGADRESS
    WHERE TOUR_ID=TO_CHAR(T1.TOURNO)),
    (SELECT SHIPPING_NO
    FROM VIEW_SHIPPINGADRESS_OPERATION_INSTRUCTION
    WHERE TOUR_ID=TO_CHAR(T1.TOURNO)) "SHIPPING_NO"
    FROM
    TB_TOURS     T1
    WHERE
    But for sure I've got the error "ORA-01427: single-row subquery returns more than one row."
    because there are always two rows for one T1.TOURNO.
    I think that it's a standard problem but I also think that I'm on the wrong way.
    I will be very thankful for any hint.
    Thanx,
    Christoph

    select col1,
           col2,
           col3
      from  (select (select decode(count(*),0,0,1) cnt
                       from view_1
                      where ...)) chk,
                     col1,
                     col2,
                     col3
               from view_1
              where ...) tab1
    where tab1.chk = 1
    union all
    select col1,
           col2,
           col3
      from  (select (select decode(count(*),0,0,1) cnt
                       from view_1
                      where ...)) chk,
                     col1,
                     col2,
                     col3
               from view_2
              where ...) tab1
    where tab1.chk = 0note: untested.

  • Clone from hot backup failing with ORA-19870, 19505 unable to find backup

    Ok, the steps I am taking worked previously, the only thing that I know changed was the underlying file system and I am perplexed but then again I am not the most experienced dba so please forgive if I miss something obvious.
    My steps are: create backup using:
    backup database tag= tagname format '/archive/stage/DBNAME/%U';
    backup archivelog all format '/archive/stage/DBNAME/%U';
    backup current controlfile '/archive/stage/DBNAME/%U';
    Then on the new server, I copy the files over to the new server and:
    connect target username@prod
    connect auxillary
    set until time
    duplicate target database to "PRODSBX"
    etc...
    The problem is the duplicate is not looking at my '/archive/stage/DBNAME' directory for the backup. It's looking in the normal backup directory on that prod box that it can't connect to... can anyone give me clues as to what I should be looking at to figure out why? I looked at file permissions in case it couldn't access this directory, I looked at id, group etc... and I am not seeing anything. These exact same scripts worked before... the only thing I have edited is the set until time so I just can't figure out why it's not going to the /archive/stage.
    Any light shed in my general direction would be greatly appreciated.
    Thanks!
    Va.

    I have no way to copy the output of the files as this is on a closed network. If there is any particular information you are looking for I'd be happy to post it.
    The restore is looking for the default backup location as specified in my rman configuration but in my backup script, I specify a different location that I do the hot backup to. The first time it took this location and successfully cloned to the new server and now it seems to be ignoring it. I am not sure why, any suggestions in what I should look at, if this is a possible configuration issue on my clone server or on my primary?
    Thanks,
    Va.

  • Using Data Guard and hot backups - 9.2.0.6.0

    Hi all,
    I have an existing 9.2.0.6.0 database that is setup in a DataGuard environment - one primary database with a physical standby in a separate datacenter. It is all setup and it works beautifully. On our primary database, we currently have 2 different types of backups we are doing - we do an export of the main schema (all of the application data is all in this one schema) 4 times a day, and we do a full database hot backup once a night.
    My question is in regards to the hot backup - I don't know that it is even worth doing a hot backup of this database? I am trying to think of a situation where we would actually want to restore a hot backup of the primary database... If we ran into some kind of a data issue, it would probably be quickest and easiest to restore data from one of the exports, and when we did that restore (import), I assume that data change would be replicated through DataGuard to the standby site. But if there was some kind of situation where we wanted to restore a recent hot backup of the primary database, that would essentially break the Data Guard configuration, and I assume that after the hot backup was restored, we would have to somehow re-instantiate Data Guard on the standby site.
    Does anyone have any input on this? If you are running with DataGuard, is it even worth it to be doing hot backups? What kind of situation would call for restoring a hot backup, instead of just failing over to the standby?
    Thanks!
    --Brad                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    If we ran into some kind of a data issue, it would probably be quickest and easiest to restore data from one of the exportsIt would be quickest to failover to stand by database than restroing from dump file. After all you maintaing stand by db for that reason.
    How can you restore database up to the latest changes using export/import ? You may have to restore using rman and apply the logs.
    You can backup from stand by database. You do not need to back up primary.

  • Question on recovery from Hot backup

    Whenever I tried to recover from my hot backup using recover database untill cancel (or any other until option)..
    I get messages similar to the following :
    SQL> recover database using backup controlfile until cancel ;
    ORA-00279: change 212733060 generated at 11/18/2008 23:50:58 needed for thread
    1
    ORA-00289: suggestion : /d01/oradata/devl/arc/1_282_667362770.dbf
    ORA-00280: change 212733060 for thread 1 is in sequence #282
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /d01/oradata/devl/arc/1_282_667362770.dbf
    ORA-00279: change 212733060 generated at needed for thread 2
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /d01/oradata/devl/arc/2_257_667362770.dbf
    ORA-00279: change 212733060 generated at needed for thread 3
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /d01/oradata/devl/arc/3_258_667362770.dbf
    ORA-00279: change 212733060 generated at needed for thread 4
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    I have all my archive files in the archive dest location.
    Is there any way to prevent this warning messages and let oracle find all the archive files?
    As you can see from the messages, Oracle is finding the correct file, then why there is an error message and why we have to provide the file names one-by one.
    Please help !!!

    Oracle will look for needed archive logfile from your log archive destination.
    If you are sure all these files are under /d01/oradata/devl/arc/, you can input AUTO, Oracle will work down the list until done.

  • How can I upgrade iPhoto from 8.1.2 but without upgrading OSX from 10.6.8?

    I have an iMac ca. 2008 vintage which is currently running OSX 10.6.8. Due to various problems I had to do a restore and everything worked OK afterwards except iPhoto (v. 8.1.2.). When I try to launch it I get the error message "iPhoto cannot be opened because of a problem" - Error log below.
    As I understand it I cannot reinstall the original version of IPhoto that came ready loaded on the iMac. On the App Store the only version of iPhoto available requires Yosemite and I don't want to upgrade to that.
    Any advice?
    Process:         iPhoto [447]
    Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Identifier:      com.apple.iPhoto
    Version:         ??? (???)
    Build Info:      iPhotoProject-4240000~8
    Code Type:       X86 (Native)
    Parent Process:  launchd [104]
    Date/Time:       2015-01-03 17:36:58.711 +0100
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          690571 sec
    Crashes Since Last Report:           13
    Per-App Crashes Since Last Report:   13
    Anonymous UUID:                      8FE359CD-0F74-45E2-BE7F-98ECD39BBDF5
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Crashed Thread:  0
    Dyld Error Message:
      Library not loaded: /System/Library/PrivateFrameworks/iLifeSlideshow.framework/Versions/A/iLifeSlid eshow
      Referenced from: /Applications/iPhoto.app/Contents/MacOS/iPhoto
      Reason: image not found
    Binary Images:
    0x8fe00000 - 0x8fe4163b  dyld 132.1 (???) <4CDE4F04-0DD6-224E-ACE5-3C06E169A801> /usr/lib/dyld
    Model: iMac9,1, BootROM IM91.008D.B08, 2 processors, Intel Core 2 Duo, 2.66 GHz, 4 GB, SMC 1.45f0
    Graphics: NVIDIA GeForce 9400, NVIDIA GeForce 9400, PCI, 256 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8E), Broadcom BCM43xx 1.0 (5.10.131.42.4)
    Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: ST31000342ASQ, 931.51 GB
    Serial ATA Device: PIONEER DVD-RW  DVRTS08
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8502, 0x24400000 / 3
    USB Device: Keyboard Hub, 0x05ac  (Apple Inc.), 0x1006, 0x24300000 / 2
    USB Device: Apple Optical USB Mouse, 0x05ac  (Apple Inc.), 0x0304, 0x24330000 / 5
    USB Device: Apple Keyboard, 0x05ac  (Apple Inc.), 0x0221, 0x24320000 / 4
    USB Device: USB 2.0 Drive, 0x13fd  (Initio Corporation), 0x1840, 0x26200000 / 2
    USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x06100000 / 2
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x8215, 0x06110000 / 4
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0x04500000 / 2

    Not sure why you "understand" that you can not reinstall the original version - you can reinstall from the original source
    Could be
    1 - the restore disks that came with the computer - if it came with CDs and you do not know where they are then contact Apple to see if they can be replaced
    or
    2 - the iLife DVD that you purchased
    or
    3 - the app store - log in under the Apple id used to purchase the software or to set up the computer - look under purchases - you might have to unhide or accept the Application first
    But the error looks like you may need to reinstall the OS as you are missing sme required system elements
    Dyld Error Message:
      Library not loaded: /System/Library/PrivateFrameworks/iLifeSlideshow.framework/Versions/A/iLifeSlid eshow
      Referenced from: /Applications/iPhoto.app/Contents/MacOS/iPhoto
      Reason: image not found
    LN

  • Create database base on another database .but. without data

    Hi :
    I have a database DB1, I want to create another database DB2 having all the tables of DB1 but with NO data. All tables should be blank.
    I have around 80 tables in DB1, can you please suggest me a way do this.
    Thanks

    HI, Umesh98
    pls try this
    --create a new database
    CREATE DATABASE sss_replica
    GO
    --and then execute bellow script
    --use the source database
    USE [sss] --★Do
    DECLARE @fromdb VARCHAR(100)
    DECLARE @todb VARCHAR(100)
    DECLARE @tablename VARCHAR(100)
    DECLARE @columnnames NVARCHAR(max)
    DECLARE @isidentity NVARCHAR(30)
    DECLARE @temsql NVARCHAR(max)
    DECLARE @sql NVARCHAR(max)
    SET @fromdb = 'SSS' --source database name
    SET @todb = 'sss_replica' --target database name
    IF (OBJECT_ID('#MyTempTable') IS NOT NULL)
    drop table #MyTempTable
    CREATE TABLE #MyTempTable (names varchar(500))
    insert into #MyTempTable
    SELECT name from sys.tables WHERE type='U' AND name not in (select OBJECT_NAME(parent_object_id) 'name' from sys.objects where type='F')
    insert into #MyTempTable
    select OBJECT_NAME(parent_object_id) 'name' from sys.objects where type='F' order by object_id
    --游标
    DECLARE @itemCur CURSOR
    SET @itemCur = CURSOR FOR
    SELECT names from #MyTempTable
    OPEN @itemCur
    FETCH NEXT FROM @itemCur INTO @tablename
    WHILE @@FETCH_STATUS=0
    BEGIN
    SET @sql = ''
    PRINT ('--'+@tablename)
    PRINT ('--表名 '''+@tablename+'''')
    --INSERT
    SET @sql = @sql+'SELECT * INTO ['+@todb+'].[dbo].['+@tablename+']
    FROM ['+@fromdb+'].[dbo].['+@tablename+'] WHERE 1=0'
    --返回SQL
    PRINT(@sql)PRINT('GO')+CHAR(13)
    FETCH NEXT FROM @itemCur INTO @tablename
    END
    CLOSE @itemCur
    DEALLOCATE @itemCur
    copy the result to the new tab window
    at last,Performing  the copied code
    USE [sss_replica] --use the target database name
    --MSsubscription_agents
    --表名 'MSsubscription_agents'
    SELECT * INTO [sss_replica].[dbo].[MSsubscription_agents]
    FROM [SSS].[dbo].[MSsubscription_agents] WHERE 1=0
    GO
    --myTable
    --表名 'myTable'
    SELECT * INTO [sss_replica].[dbo].[myTable]
    FROM [SSS].[dbo].[myTable] WHERE 1=0
    GO
    --dba_replicationMonitor
    --表名 'dba_replicationMonitor'
    SELECT * INTO [sss_replica].[dbo].[dba_replicationMonitor]
    FROM [SSS].[dbo].[dba_replicationMonitor] WHERE 1=0
    GO
    you will find the table already lying in the target  database
    thanks

  • Duplicate date datas (rows) from the view

    Hi friends,
    My purpose is to get the duplicate date datas from the view.
    The following select (1) works well (according to the employee_id). But, the select (2) doesn't work when want to get the duplicate date datas from the view and it gives me an error such as: ORA-00979: not a GROUP BY expression.
    Can you please help... Thanks in advance!
    --- 1 ---
    SELECT   id,
               state,
               insert_timestamp,
               update_timestamp,
               update_status,
               staff_including_date,
               company_name,
               position,
               position_name,
               release_date,
               notes,
               update_user_id,
               employee_id,
               fk_org_structure_id,
               fk_staff_position_id,
               fk_document_id,
               document_date,
               document_number,
               d_order_date,
               fk_activity_operation_type,
               activity_operation_name,
               fk_military_type,
               military_type_name,
               fk_activity_type,
               activity_type_name
        FROM   fhn_staff.v_fs_labor_activity
       WHERE   employee_id = :p_employee_id AND state = 1
    ORDER BY   fk_activity_type, staff_including_date, id;--- 2 ---
    SELECT id,
             state,
             insert_timestamp,
             update_timestamp,
             update_status,
             staff_including_date, COUNT (staff_including_date),
             company_name,
             position,
             position_name,
             release_date,
             notes,
             update_user_id,
             employee_id,
             fk_org_structure_id,
             fk_staff_position_id,
             fk_document_id,
             document_date,
             document_number,
             d_order_date,
             fk_activity_operation_type,
             activity_operation_name,
             fk_military_type,
             military_type_name,
             fk_activity_type,
             activity_type_name
        FROM fhn_staff.v_fs_labor_activity
       WHERE state = 1
    GROUP BY staff_including_date
      HAVING COUNT (staff_including_date) > 1
    ORDER BY fk_activity_type, staff_including_date, id;

    The first four columns? What about the other ones as well.
    If you to fetch a different set of columns than you want to group on, then you should look at an analytic function, i.e
    COUNT(*) OVER (PARTITION BY... )Assuming that you do only want to group by the date (seems a bit odd but I know nothing about what you're trying to do with your data), then it sould be something like this:
    SELECT *
    FROM (
    SELECT id,
             state,
             insert_timestamp,
             update_timestamp,
             update_status,
             staff_including_date, COUNT (*) OVER (PARTITION BY staff_including_date) cnt,
             company_name,
             position,
             position_name,
             release_date,
             notes,
             update_user_id,
             employee_id,
             fk_org_structure_id,
             fk_staff_position_id,
             fk_document_id,
             document_date,
             document_number,
             d_order_date,
             fk_activity_operation_type,
             activity_operation_name,
             fk_military_type,
             military_type_name,
             fk_activity_type,
             activity_type_name
        FROM fhn_staff.v_fs_labor_activity
       WHERE state = 1)
    WHERE cnt  > 1
    ORDER BY fk_activity_type, staff_including_date, id;

  • Brand new 5s - set up as new but will not restore from icloud backup

    Hi, all. I received a new 5s today as a present. It was set up at the Sprint store by the staff. I asked what I would need to do to get all of my.apps, photos, etc. and they told me to do an cloud restore when I got home. So I got home and tried to figure out how to do this. I made sure to back up the 4s last night but my new phone says it has never been backed up which I suppose makes sense... so I have several questions:
    1) Why would an old apple ID show up all of a sudden?
    When I couldn't figure out restore, I erased all settings and tried to set up again from an cloud back up. But it showed me my original apple is from 2005 when email addresses weren't required (my ID then was edavies988) and I only had an iPod. It kept telling me I had an incorrect ID or password when I tried to set up as cloud backup restore. And I checked to make sure my apple ID is my current email address not my old ID. It is the email address. So any idea why this would have happened?
    And since that didn't work, I went back and set it up as a new phone again. So....
    2) Is there any way to access the cloud back up and restore it without having to reset the phone? I have pictures and apps, etc. that I would like to have on the new phone....I have no idea how to fix this.
    Any help would be appreciated. Thank you!!!

    No, photos and apps aren't on my computer. Only in the cloud. I back up to the cloud only. I have a very old computer.
    And no, I don't have anything loaded on the new phone. I apologize if I wasn't clear. I am unable to reset the phone and do a restore on the new phone because of the apple ID problem I mentioned. (Old, no longer used ID is what pops up when I try to restore. And since it isn't the current apple ID it doesn't accept my password. And it will not let me update to the current apple ID during set up. And, yes. I checked online. The current ID is all that shows online.)
    What I clumsily was trying to ask was is there a way to do a restore on a new phone without resetting so that I can get the stuff from the old phone to the new phone? (Again, the reset didn't work when trying to reset/restore. So I had to set the phone up as a new phone.)
    Does that make sense? Or is it clear as mud?

  • NEED HELP with contact/data recovery from restore backup before current

    My girlfriend synched her iphone 5 to itunes 6 months after purchasing it and wiped all of her data. Instead of clicking "restore backup", she chose "Backup now", which replaced the version we needed. Is there anyway of retrieving the data from that restore?

    No, not unless she had a backup of the data she loss.

  • Making a Mac OS 9 installer CD from a backup...?

    Hello! I have a MacBook Pro with Leopard, and a PowerBook G3 Wallstreet with OS 8.6. I am trying to upgrade the Powerbook to OS 9. The problem is, I have misplaced my OS 9 Installer CD which I got new with another Mac a few years back. Luckily, I did make a copy from that CD which I still have on my computer. Is there a way that I can take this copy .dmg and make a new OS 9 installer CD from it? I've spent the past 3 days trying to figure it out, and I have had no luck. Thank you!

    I've tried this already, the G3 rejects everything. Even when I put other things on the CD-R (like applications). When put the CD in the drive, it pops up with a message that the disk can't be used because it is locked or something, and it has to be initialized. When I click "Initialize," it tells me that it has to erase the disk. When I agree to that, it immediately spits the disk out. I think that my MacBook is putting the CD's in a format that the G3 can not read, but I have no idea how to write the CD in a format that the G3 will accept.

  • Two lost iphones.  How to get the data back from icloud backup/.

    Icloud shows my backup data in storage from two lost iphones. YesI was having too much of a good time.   How do I download this data to my Mac?  I didnt back up the data to itunes previsouly.?

    You cannot download data from an icloud backup (of a device) to a mac.  You can buy a new device and while doing the initial setup in itunes, be sure to perform a restore from the icloud backup.

Maybe you are looking for