RMAN command in  Oracle VSS Writer for  incremental/differential restore

Hello
Working on application to support incermental/differential backup via VSS ( Oracle VSS Writer )
Accoding to documentation about [Performing Database Backup and Recovery with VSS  |http://docs.oracle.com/cd/E11882_01/win.112/e10845/vss.htm]
Oracle VSS Writer does not perform default recovery of Archived redo log or flash recovery component. (This component is defined to contain only log or incremental files)
Nevertheless, the requestor application can invoke required RMAN commands.
What RMAN command is needed to be performed for incermental logs recovery? (This command is set in VssBackupComponents::SetRestoreOptions call and will be performed on PostRertore Phase by Writer)
I have tried RESTORE ARCHIVELOG ALL but did not succeeded .
Thanks

Let we describe my oracle VSS backup/restore proccess in details
Succeeded with full backup/restore only, but failed to to implement differential one.
Oracle VSS Writer support only three components for explicit selection for backup: Oracle Database and it sub-component: Flash Recovery Area/ArchivedLogs.
For full backup stage I explicitly select these components
Why not only Oracle database as ancestor of Flash Recovery Area/ArchivedLogs?
As oracle vss writer uses time stamp mechanism for incremental and differential backups,
I select all these components for full backup stage (to get previous timestamps for Flash Recovery Area/ArchivedLogs on differential backup phase. With explicit selection these components its timestamps will be added to backup component document. )
On diferential backup phase I select Flash Recovery Area/ArchivedLogs only using previous backup stamp(SetPreviousBackupStamp call), loaded from previous backup component document.
Restore perform sequentially:
1. Restore data from full backup phase (select all these three components for Restore), but do SetAdditionalRestore(true) for OracleDatabase component to avoid bringing Oracle database only after full restore phase
2. Restore data from differential phase (select Flash Recovery Area/ArchivedLogs for Restore only( even can't select Database as there is no record in backup component document about it on differential phase backup) and call SetAdditionalRestore(false) for these components
As Oracle Writer does not perform default recovery of this component. Nevertheless, the requester application can run required RMAN commands(via setRestoreOptions VSS call). I tried as RECOVER DATABASE as RESTORE ARCHIVELOG ALL commands , but failed to restore database.
If I restore full backup phase(without differential) only and call SetAdditionalRestore(false) for Oracle Database component, Oracle VSS writer restores data successfully and mount database.
How to restore differential part?

Similar Messages

  • About a trace log level of Oracle VSS Writer.

    I verified the backup using the Oracle VSS Writer of Oracle11gR2.
    In order to check the behavior of the Oracle VSS Writer, I want to output the trace log of Oracle VSS Writer.
    However, there is the following description in the document, there is no description of the trace level.
    oravssw SID [/tl trace_level]
    /tl :Specifies the trace level for a Oracle VSS writer for a specified SID.
    Does somebody know the value?

    I'm not sure whether any version of Oracle -and you don't mention which 4 digit version you are using - is certified against Windows 2012.
    So whatever hack you apply, for sure My Oracle Support will not be able to deal with any issues which may arise from this.
    I'm sure you are aware Microsoft has a very bad track record on downwards compatibility, so I recommend downgrading this system to a certified version of Windows.
    Sybrand Bakker
    Senior Oracle DBA

  • The user account in which the Oracle VSS Writer Service is running does not have the DBA privileges to log in to the Oracle instance.

    VSS-00011: Connection to database instance <instance_name> failed.  
    Cause : The user account in which the Oracle VSS Writer Service is running  does not have the DBA privileges to log in to the Oracle instance.  
    Action : Run the Oracle VSS Writer Service in a user account that can connect to the Oracle instance with DBA privileges.  
    I have assigned ora_dba group to the user that runs the Oracle VSS Writer Service which is the only Oracle solution but still getting
    the above error. Was advised to raise the issue here that it is an OS issue. Pls help

    The user account cannot access Oracle Database instance. And also how do you temporarily disable security software on the server.
    Have you checked what I already asked for? "Try using the user account and access the Database Instance.
    That will let you see if the problem is with the user account permissions or not."
    If this does not help then you can contact Oracle as suggested by Dave.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Oracle VSS Writer in 12c

    I do have backup solution which uses Oracle VSS Writer on 11g successfully.
    However, in 12c, vssadmin list writers does not enumerate Oracle VSS Writer. I followed protocol to install and start Oracle VSS Service using oravssw [SID] /i and oravssw /q /start and service is started and running. However Oracle writer is not listed by Volume Shadow Services.
    Is there something new regarding this feature in 12c?

    I'm not sure whether any version of Oracle -and you don't mention which 4 digit version you are using - is certified against Windows 2012.
    So whatever hack you apply, for sure My Oracle Support will not be able to deal with any issues which may arise from this.
    I'm sure you are aware Microsoft has a very bad track record on downwards compatibility, so I recommend downgrading this system to a certified version of Windows.
    Sybrand Bakker
    Senior Oracle DBA

  • VSS snapshots for DPM 2010 Hyper-V backup conflict with SQL backup on a virtual SQL server

    We currently use DPM 2010 to backup our virtual servers which reside on a 5 node Hyper-V clustered share volume.  DPM uses the hardware VSS writer to backup the Hyper-V guests.   Several of these Hyper-V guests are SQL servers (SQL 2008) and they
    are all configured to run point in time SQL backups using SQL Management Plans.
    The SQL backups are scheduled to run a full database backup on a Friday and differential backups on the other days of the week.  Transaction backups are scheduled to run several times throughout the day.
    However we have recently discovered that there is a conflict between these two methods as it seems as though when a restore is required using a differential SQL backup, it fails as the snapshot created by DPM forces SQL to believe it has had a full backup
    carried out externally from the Management Plan and is therefore unable to perform the restore.
    DPM backs up the Hyper-V guests on a daily basis from 8pm.
    Can anyone provide any advice or guidance on this as we need both types of backup to run successfully.  We are required to backup SQL with point in time backups and we also need to protect the Hyper-V guests in their entirety.

    Thanks Mike,
    I have tried this but unfortunately it has no effect.  The VM has Oracle installed (although not the Oracle VSS Writer).  It is the Oracle application server, not the database server, and the customer has a script that is used to stop and start
    the Oracle application when required.  Through troubleshooting this with them I have noticed that after the WLS_Reports service/process is stopped the backups run successfully but when it is running the backups fail.
    I have also noticed that when I stop the Hyper-V Volume Shadow Copy Requestor the backup runs successfully, which I guess is as expected.
    When the backups fail I get 2 errors in the application log:
    Event Id 12293, VSS - Error calling a routine on a shadow copy provider {GUID for the Hyper-V IC Software Shadow Copy Provider}.  Routine details PreFinalCommitSnapshots ({GUID}, 5) [hr = 0x800705b4, This operation returned because
    the timeout period expired.]
    Event Id 19, vmicvss - Not all the shadow volumes arrived in the guest operating system.
    This is also part of the same problem I have posted here: Backup
    fails for a Hyper-V guest with VSS Writer failures using DPM 2012 R2 - Hyper-V guest has Oracle application installed
    Regards
    Chris

  • Backup fails for a Hyper-V guest with VSS Writer failures using DPM 2012 R2 - Hyper-V guest has Oracle application installed,

    I am trying to backup a VM which before it had Oracle installed backed up with no problems.  It is a Windows 2008 R2 server which sites on an 8 node Hyper-V 2012 R2 cluster (with CSVs).  I am using DPM 2012 R2 to run the backups which have been
    successful for the last few weeks but then Oracle was installed and the backups have failed since then.
    The job fails and a large number of VSS writers go into a 'Failed' state with the 'Last Error' showing as 'Timed out'.  I then get 4 popups appear each referring to a 'temporary' drive which appears briefly in Disk Management with a RAW file system. 
    These pops say "You need to format the disk in drive X: before you can use it.  Do you want to format it?" (where
    X: is replaced by the drive letter assigned to each 'temporary' drive).
    The System event log is populated with a large number of warnings with Event 51, Disk, stating "An error was detected on device \Device\Harddisk<number>\DR<number> during a paging operation".  There are also a
    few warnings for Ntfs (eventid 57) stating that "The system failed to flush data to the transaction log.  Corruption may occur."
    Prior to these warnings there are 5 other warnings for partmgr (eventid 58) stating "The disk signature of disk
    <number x> is equal to the disk signatuire of disk <number y>" and 4 errors (eventid 1, VDS Basic Provider), "Unexpected failure.  Error code: 490@01010004".
    There is a script which is run to stop the Oracle application on the server and if this is run then the backups will complete successfully.  We have been troubleshooting this by running a certain amount of the script and seeing which part affects the
    backup and it seems that if the Weblogic (wls_reports) service is stopped then the backup will succeed but if it is running then the backup will fail and the above symptoms occur.
    Another point which may help is that there is a pre-production server which resides on a Windows 2008 R2 Hyper-V standalone server, has the same scripts and installation of Oracle but backs up without any issues.
    I have experienced VSS writer failures before with VM backups but I have not seen this before.  It is not intermittent and I can find no work around to alleviate the problem of having no backup (except stopping this service or shutting the server down,
    but as it is a production server this is not practical).
    If anyone has experienced this before or have any suggestions / advice it would be much appreciated.
    Thanks
    Chris

    Hi Chris
    I have exactly the same issue.
    2008 R2 Server running Oracle
    6 node 2012 R2 Hyper-V Cluster with CSV
    Exact same errors and popup "format disk" message.
    DPM2012 R2
    I also have some other VM's on the same cluster which do back up through DPM
    The only difference I can see is the server which has the issue has a legacy network adapter.
    Production server so cannot make any changes until later but will add new adapter and report back.
    Interesting about the Weblogic service, may test this also.
    Cheers
    Kev.

  • DAC Commands for Incremental and Full load

    Hi,
    I'm implementing BIApps 7.9.6.1 for a customer. For R12 container, I noticed for 5 DAC tasks the command for Incremental and Full load starts with "@DAC_" and ends with "_CMD". Due to this, the ETL load fails. Is this a bug..?
    Thanks,
    Seetharam

    You may want to look at Metalink note ID 973191.1:
    Cause
    The 'Load Into Source Dimension', has the following definition:
    -- DAC Client > Design > Tasks > Load Into Source Dimension > Command for Incremental Load = '@DAC_SOURCE_DIMENSION_INCREMENTAL'
    and
    -- - DAC Client > Design > Tasks > Load Into Source Dimension > Command for Full Load = '@DAC_SOURCE_DIMENSION_FULL'
    instead of the actual Informatica workflow names.
    The DAC Parameter is not substituted with appropriate values in Informatica during ETL
    This is caused by the fact that COMMANDS FOR FULL and INCREMENTAL fields in a DAC Task do not allow for database specific texts as described in the following bug:
    Bug 8760212 : COMMANDS FOR FULL AND INCREMENTAL SHOULD ALLOW DB SPECIFIC TEXTS
    Solution
    This issue was resolved after applying Patch 8760212
    The documentation states to apply Patch 8760212 to DAC 10.1.3.4.1 according to the Systems Requirements and Supported Platforms Guide for Oracle Business Intelligence Data Warehouse Administration Console 10.1.3.4.1.
    However, Patch 8760212 has been made obsolete, recently, in this platform and language. Please see the reason stated below on the 'Patches and Update' tab on My Oracle Support.
    Reason for Obsolescence
    Use cumulative Patch 10052370 instead.
    Note: The most recent replacement for this patch is 10052370. If you are downloading Patch 8760212 because it is a prerequisite for another patch or patchset, you should verify whether or not if Patch 10052370 is suitable as a substitute prerequisite before downloading it.

  • DAG - Backup failing on 1 DB only with error - The Microsoft Exchange Replication service VSS Writer instance ID failed with error code 80070020 when preparing for a backup of database 'DB012'

    Hi Board,
    i´ve search across the board, technet and symantec sites but did not found a hint about my problem.
    we drive a 2 node DAG (Location1-Ex1-mb1 
    Location2-exc1-mb1), on SP2 RU4 patchlevel with 40 Databases.
    Since some time the backup of one - and only one DB - is failing with these events, logged on the Mailboxserver on which the passive DB is hosted.
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:          28.09.2012 00:37:17
    Event ID:      2112
    Task Category: Exchange VSS Writer
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      Location1-Exc1-MB1
    Description: The Microsoft Exchange Replication service VSS Writer instance 1ab7d204-609a-4aea-b0a7-70afb0db38de failed with error code 80070020 when preparing for a backup of database 'DB012'.
    Followed by
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:         
    01.10.2012 03:33:06
    Event ID:      2024
    Task Category: Exchange VSS Writer
    Level:         Error
    Keywords:      Classic
    User:         
    N/A
    Computer:      Location1-Exc1-MB1
    Description:
    The Microsoft Exchange Replication service VSS Writer (Instance 42916d80-36c1-4f73-86d0-596d30226349) failed with error 80070020 when preparing for a backup.
    The backup Application - Symantec Backup Exec 2010 R3 – states, this error
    Snapshot provider error (0xE000FED1): A failure occurred querying the Writer status.
    Check the Windows Event Viewer for details.
    Writer Name: Exchange Server, Writer ID: {76FE1AC4-15F7-4BCD-987E-8E1ACB462FB7}, Last error: The VSS Writer failed, but the operation can be retried (0x800423f3), State: Stable (1).
    Symatec suggests within http://www.symantec.com/business/support/index?page=content&id=TECH184095
    to restart the MS Exchange Replication Service – BUT the mentioned eventID
    8229 isn´t present on any of the both Mailboxservers.
    The affected Database is active on Location2-Exc1-Mb1 Server and in an overall healthy state. I found during my research, that below Location2-Exc1-Mb1 Server, there are not removed shadow copies present!
    This confuses me, since all Backups are normally taken from the passive copy of a Database.
    So my questions to the board are:
    * Does anyone is facing similar issues?
    * Can someone explain why snapshots are present on the Mailboxserver hosting the Active Database, whilst the errors are logged on the passive one?
    -          * Does someone know the conditions, why shadows copies remain and
    aren´t removed in a proper manner?
    What can cause the circumstance, that only 1 DB is facing such issues?
    Any suggestion is welcome!
    BR
    Markus

    Hi Lenora,
    I´ve encreases VSS / Exchange Backup Log levels to expert, before starting
    those things i´ve all tried now:
    - Backup from passive DB (forced within Symantec Backup Exec)
    - Backup from active DB (forced within Symantec Backup Exec)
    - Backup from passive DB without GRT enabled (forced within Symantec Backup Exec)
    - Backup from active DB without GRT enabled(forced within Symantec Backup Exec)
    All those attempts failed.
    But brought some more details - the backup against the active DB states, that there is still a backup in progress and therefore this backup is cancelled by VSS.
    The Solution was, that i´ve needed to restart the Exchange Replication Service on the Mailbox Server hosting the passive DB.
    Backups are working again on all DBs!
    THX for your replys.
    Best regards
    Markus

  • Write-EventLog from a command line using a variable for -Message

    My apologies for the possibly confusing title of this post, so let me explain...
    My ultimate goal is to capture log information during the execution of a batch script and write it to the Application log.  Simple, you might think?  I couldn't figure it out in batch so gave up and moved on to try using PowerShell via
    the @powershell command.
    I started with the following test, which worked like a charm:
    @PowerShell -NoProfile -command "Write-EventLog -LogName Application -Source MyApp -EntryType Information -EventID 99 -Message "Test1" -ComputerName MyServer"
    Great I thought, now how to capture multiple "events" as my batch script executes so that I can write them all in one go to the Application log using a single @powershell command.  Capturing multiple lines of text in an environment variable
    was a struggle and I wasn't even sure if I could then use the environment variable in the PowerShell command, so I tried writing the events to a text file with the intend of reading that text file using Get-Content, and then writing it to the event log.
    So test #2 went like this:
    @PowerShell -NoProfile -command "$OutText = 'Some text';Write-EventLog -LogName Application -Source MyApp -EntryType Information -EventID 99 -Message $OutText -ComputerName MyServer"
    This worked, and "Some text" was successfully written to the event log entry, so the last step was to read my entries from the text file and write them instead:
    For reference, the text file looked like this:
    Test Entry 1
    Test Entry 2
    Test Entry 3 
    @PowerShell -NoProfile -command "$OutText = Get-Content .\TestLog.txt;Write-EventLog -LogName Application -Source MyApp -EntryType Information -EventID 99 -Message $OutText -ComputerName MyServer"
    Unfortunately I failed at the last hurdle as PowerShell didn't seem to like, I am guessing, the CRLFs in the text file?
    Write-EventLog : Cannot convert 'System.Object[]' to the type 'System.String'
    required by parameter 'Message'. Specified method is not supported.
    At line:1 char:211
    + ... yServer -Message $OutText
    +                    ~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Write-EventLog], Parameter
       BindingException
        + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Comma
       nds.WriteEventLogCommand
    Any suggestions on how to solve my dilemma, either by solving the last step, or maybe by taking a different approach?
    Many thanks, in advance,
    Andy

    Here is how we write to the event log from a batch file.  It is easy and more flexible than howyou are doing this:
    eventcreate /?
    eventcreate /L application /SO MyApp /ID 99 /D %messagetext% /S MyServer
    Adding one big block of text to the event log is not how the EL can work.  The message size is limited.
    The Event Log should not be used as a general tracing log on a regular basis.  It should be used to log errors that are critical and to log critical small pieces of information.
    Why use batch if you have access to PowerShell. It is far less flexible and muc harder to manage.
    ¯\_(ツ)_/¯

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • Free Report Writer for Oracle Database except Crystal Report and Data Vison

    Dear All,
    I want Free Report Writer for Oracle Database except Crystal Report and Data Vision software.
    Wr are working on Linux and windows both platform.
    Any one have direct link or website address for it ?
    Regards,
    Vipul Patel
    Ahmedabad

    Please check the following link -
    http://www.google.co.in/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&q=open+source+report+writer+for+oracle&meta=&btnG=Google+Search
    Regards.
    Satyaki De.

  • RMAN's commands to check the datafiles for any sort of corruptions

    what are RMAN's commands to check the datafiles for any sort of corruptions

    RMAN is check database or backups here? i think its checking backups? and
    You mean to say that its not checking the datafiles but the backup of them for corruption is it?If this is what you meant than I guess you haven't read teh link that I referred.From there,
    When performing a BACKUP... VALIDATE, RMAN reads the files to be backed up in their entirety, as it would during a real backup. It does not, however, actually produce any backup sets or image copies.This command wont check the backups and neither its taking a backup.Its checking it for corruptions.
    [i]
    RMAN>backup validate database ;
    not working when db is in no-archivelog mode
    Are you trying to run it in the open stage ? If you are in Noarchive mode, you can't run backup related commands in open stage.Run it in the mount stage.
    Aman....

  • What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?

    Hi
    What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?
    Thank you

    Aren't the answers given in PL/SQL forum sufficient enough?Well, as the first answer in that forum directed the OP to this forum you can hardly blame them for the repost.
    There is some high-level stuff in the Concepts Guide. If that is insufficient the OP will need to tell us what more details they need to know (and perhaps why).
    Cheers, APC

  • Why it automatically recover current redo log in RMAN command window?

    Firstly, I restore controlfile and datafiles from a backupset.
    Then when I recover database in RMAN command window like below:
    RMAN> recover database;
    Starting recover at 15-AUG-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    starting media recovery
    archive log thread 1 sequence 9 is already on disk as file /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_9_90sd0slz_.arc
    archive log thread 1 sequence 10 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_10_90sd0tsb_.arc
    archive log thread 1 sequence 11 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_11_90sd110b_.arc
    archive log thread 1 sequence 12 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_12_90sd2ksr_.arc
    archive log thread 1 sequence 13 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_13_90sd2mc6_.arc
    archive log thread 1 sequence 14 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_14_90sd2qrm_.arc
    archive log thread 1 sequence 15 is already on disk as file
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_15_90sd2s0w_.arc
    archive log thread 1 sequence 16 is already on disk as file /u01/app/oracle/oradata/lonion/redo03.log
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_9_90sd0slz_.arc thread=1 sequence=9
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_10_90sd0tsb_.arc thread=1 sequence=10
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_11_90sd110b_.arc thread=1 sequence=11
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_12_90sd2ksr_.arc thread=1 sequence=12
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_13_90sd2mc6_.arc thread=1 sequence=13
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_14_90sd2qrm_.arc thread=1 sequence=14
    archive log filename=/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_15_90sd2s0w_.arc thread=1 sequence=15
    archive log filename=/u01/app/oracle/oradata/lonion/redo03.log thread=1 sequence=16
    media recovery complete, elapsed time: 00:00:04
    Finished recover at 15-AUG-13
    RMAN>
    But, when I recover database in SQL*Plus command window like below:
    [oracle@lonion ~]$ uniread sqlplus /nolog
    [uniread] Loaded history (2178 lines)
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 15 19:25:38 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> conn /as sysdba
    Connected.
    SQL>
    SQL> recover database;
    ORA-00283: recovery session canceled due to errors
    ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
    SQL> recover database using backup controlfile;
    ORA-00279: change 2147842454 generated at 08/15/2013 18:34:28 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_9_%u_.a
    rc
    ORA-00280: change 2147842454 for thread 1 is in sequence #9
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    auto
    ORA-00279: change 2147842651 generated at 08/15/2013 18:40:25 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_10_%u_.
    arc
    ORA-00280: change 2147842651 for thread 1 is in sequence #10
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_9_90sd
    0slz_.arc' no longer needed for this recovery
    ORA-00279: change 2147842653 generated at 08/15/2013 18:40:26 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_11_%u_.
    arc
    ORA-00280: change 2147842653 for thread 1 is in sequence #11
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_10_90s
    d0tsb_.arc' no longer needed for this recovery
    ORA-00279: change 2147842656 generated at 08/15/2013 18:40:32 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_12_%u_.
    arc
    ORA-00280: change 2147842656 for thread 1 is in sequence #12
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_11_90s
    d110b_.arc' no longer needed for this recovery
    ORA-00279: change 2147842684 generated at 08/15/2013 18:41:21 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_13_%u_.
    arc
    ORA-00280: change 2147842684 for thread 1 is in sequence #13
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_12_90s
    d2ksr_.arc' no longer needed for this recovery
    ORA-00279: change 2147842686 generated at 08/15/2013 18:41:23 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_14_%u_.
    arc
    ORA-00280: change 2147842686 for thread 1 is in sequence #14
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_13_90s
    d2mc6_.arc' no longer needed for this recovery
    ORA-00279: change 2147842689 generated at 08/15/2013 18:41:27 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_15_%u_.
    arc
    ORA-00280: change 2147842689 for thread 1 is in sequence #15
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_14_90s
    d2qrm_.arc' no longer needed for this recovery
    ORA-00279: change 2147842691 generated at 08/15/2013 18:41:28 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_16_%u_.
    arc
    ORA-00280: change 2147842691 for thread 1 is in sequence #16
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_15_90s
    g0or9_.arc' no longer needed for this recovery
    ORA-00279: change 2147842986 generated at 08/15/2013 19:14:29 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_17_%u_.
    arc
    ORA-00280: change 2147842986 for thread 1 is in sequence #17
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_16_90s
    g0os5_.arc' no longer needed for this recovery
    ORA-00308: cannot open archived log
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_17_%u_
    .arc'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    SQL> recover database using backup controlfile;
    ORA-00279: change 2147842986 generated at 08/15/2013 19:14:29 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_08_15/o1_mf_1_17_%u_.
    arc
    ORA-00280: change 2147842986 for thread 1 is in sequence #17
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /u01/app/oracle/oradata/lonion/redo01.log        ---- Yon see, proceeding this process, it can't automatically apply the current redo log.
    Log applied.
    Media recovery complete.
    SQL>
    Question Coming:
    Now, my question is that 「Why it automatically recover current redo log in RMAN command window but not in SQL*Plus」?
    BTW: Please pay attention to the red font.

    It also seems not work.
    SQL> recover automatic database using backup controlfile;
    ORA-00279: change 2148632889 generated at 09/26/2013 12:45:22 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_.
    arc
    ORA-00280: change 2148632889 for thread 1 is in sequence #48
    ORA-00278: log file
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_
    .arc' no longer needed for this recovery
    ORA-00308: cannot open archived log
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_
    .arc'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    auto
    ORA-00308: cannot open archived log
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_
    .arc'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    ORA-00308: cannot open archived log
    '/u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_
    .arc'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file
    or directory
    Additional information: 3
    SQL>
    It must specify the redo log.
    SQL> recover database using backup controlfile;
    ORA-00279: change 2148632889 generated at 09/26/2013 12:45:22 needed for thread
    1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/LONION/archivelog/2013_09_26/o1_mf_1_48_%u_.
    arc
    ORA-00280: change 2148632889 for thread 1 is in sequence #48
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /u01/app/oracle/oradata/lonion/redo02.log
    Log applied.
    Media recovery complete.
    SQL>

  • New Oracle DBA - Need help with backup & restore procedure via RMAN

    Hello everyone,
    I've been a SQL Server DBA for 12 years now, but new to the Oracle space. My first assignment at work was to refresh our training environment with production. So with that said, I took a full backup of our production database via RMAN and backed up the Control File. I then copied both the Control File and full backup from our production environment to training. I followed the procedures listed in the URL below:
    http://www.dba-oracle.com/t_rman_clone+copy_database.htm
    I then connected to RMAN and executed a 'show all' which is as follows:
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    The CONFIGURE CONTROLFILE AUTOBACKUP was set to ON but received a message that the database needed to be mounted, so, I mounted the database and made the changes, but when I shutdown the database and performed the startup nomount again, the settings were gone. Are these settings valid only when the database is mounted? How can I successfully refresh this training environment with production data? I'm at a standstill here so any help would be very much appreciated.
    Thank you,
    Pete

    The CONFIGURE CONTROLFILE AUTOBACKUP was set to ON but received a message that the database needed to be mounted, so, I mounted the database and made the changes, but when I shutdown the database and performed the startup nomount again, the settings were gone. These settings are persistent settings.So these information retain in control files.To reading information from control files database instance must be MOUNT or OPEN stage.Due to you have mount instance and try SHOW ALL command through RMAN.
    Are these settings valid only when the database is mounted? Not only MOUNT also OPEN stage.
    How can I successfully refresh this training environment with production data? I'm at a standstill here so any help would be very much appreciated.
    There are several ways like duplication.But you take full backup from production database using BACKUP DATABASE through rman.In this case you will get also AUTOBACKUP for controlfiles/spfiles.Then copy these backup files and all available archive logs to training server and perform below steps.
    1) You have set properly ORACLE_HOME and ORACLE_SID environment variable.After that first need restore spfile as
    rman target /
    startup force nomount;
    restore spfile from 'autobackup_location';
    startup force nomount;2) Now you have to restore controlfiie as
      rman>restore controlfile from  'autobackup_location';
    rman>alter database mount;
      3) Now need catalog(it means register) all backup files and archivelogs in new restored controlfile as
       rman>catalog start with 'backuplocation';
       4) Finally you can restore and recover your database as below
       rman>restore database;
    rman>recover database;
    rman>alter database open resetlogs;
       If you want restore database to new location then before executing RESTORE DATABASE command you can use SET NEWNAME FOR DATAFILE clause.Firstly refer backup recovery guide in online documentation.

Maybe you are looking for