Dynamically automating all database backups with known filenames.

I need to know the name of the full database backup, so I can restore to another server. I came up with this basic script for backing up (script 1) but I want to do this dynamically, and began to play with cursors, which did not go so well. The second script
seems to create an infinite loop or some nasty Cartesian. If anyone can point me in a direction to getting my peanut butter to mix with my chocolate I'd appreciate it.
FWIW, the end goals are to know the db name and do this in a dynamic way so anytime a db is dropped or added we do not have to remember to update backup jobs. Up till now maintenance plans worked, but now we want to know the backup name so we can restore
db's to a preprod environment. Any suggestions/guidance/links would be appreciated.
declare @dbname varchar(100)
declare @backupdate varchar(25)
SET @backupdate = convert(varchar(25), GETDATE(), 112)
declare @backupfilename varchar(150)
declare @backupSQL varchar(MAX)
Set @dbname = 'master'
Set @backupfilename = @dbname + @backupdate + '.bak'
SET @backupSQL = 'BACKUP DATABASE '+@dbname+' TO DISK = N''\\delos\SQL_Live_Backup\PreProd_BackupRestore\'+@backupfilename+'''
WITH FORMAT, INIT, NAME = N'''+@backupfilename+''', SKIP, NOREWIND, NOUNLOAD, STATS = 10, CHECKSUM, CONTINUE_AFTER_ERROR'
EXEC(@backupSQL)
declare @dbname varchar(100)
declare @backupdate varchar(25)
SET @backupdate = convert(varchar(25), GETDATE(), 112)
declare @backupfilename varchar(150)
DECLARE db_cursor CURSOR
FOR SELECT name FROM sys.databases WHERE NAME NOT LIKE 'zz_%' AND [state]=0 AND is_read_only=0 AND user_access in (0,1)
OPEN db_cursor
FETCH NEXT FROM db_cursor
INTO @dbname
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @dbname + @backupdate + '.bak'
END
CLOSE db_cursor;
DEALLOCATE db_cursor;

I keep the names of the databases need to be backup in the separate table and then run the query.
This create creates a folder (name of the database)  and keeps the files for 6 days old IIRW.
CREATE PROCEDURE [dbo].[sp_DatabasesToBackup1] @LocalBackupPath AS VARCHAR(8000)
AS
DECLARE @name AS SYSNAME
DECLARE @CommandString AS VARCHAR(8000)
DECLARE @SQL AS VARCHAR(8000)
DECLARE  @FS SMALLINT
SET NOCOUNT ON
CREATE TABLE #t(dbname VARCHAR(8000))
BEGIN TRY
;WITH cte
AS
SELECT  [name],ROW_NUMBER() OVER (ORDER BY name) rn
FROM sysdatabases INNER JOIN
DatabasesToBackup ON
sysdatabases.dbid = DatabasesToBackup.dbid
WHERE  DATABASEPROPERTYEX ( [name] , 'status' )='ONLINE'
) INSERT INTO #t SELECT [name] FROM cte 
ORDER BY rn
DECLARE sysdatabasesCursor CURSOR FOR
SELECT dbname FROM #t
OPEN sysdatabasesCursor
FETCH NEXT FROM sysdatabasesCursor
INTO @name
SELECT  @FS =  @@FETCH_STATUS
WHILE (@FS <>-1)-- 0 ---=<>-1
BEGIN
  PRINT 'Start Backup ' + @name + ' database. '
  SET @CommandString = 'IF NOT EXIST "' + @LocalBackupPath + '\' + @name + '" MD "' + @LocalBackupPath + '\' + @name + '"'
  EXEC xp_cmdshell @CommandString
  PRINT 'Create Local Dirctory Complete.'
  SET @SQL = 'BACKUP DATABASE [' + @name + '] TO DISK = N''' + @LocalBackupPath + '\' + @name + '\' + @name + CONVERT(VARCHAR, GETDATE(), 112) + '.bak'' WITH INIT, NOUNLOAD, NAME = N''' + @name + ' backup'', SKIP, STATS = 10, NOFORMAT'
  EXEC(@SQL)
  FETCH NEXT FROM sysdatabasesCursor INTO @name
  SELECT @FS =  @@FETCH_STATUS
  SELECT @@FETCH_STATUS  AS '@@FETCH_STATUS'
  SELECT @FS AS '@FS'
END
CLOSE sysdatabasesCursor
DEALLOCATE sysdatabasesCursor
END TRY
BEGIN CATCH
       SELECT ERROR_MESSAGE()
       ---INSERT INTO Errors(ERRMSG,CommandString) SELECT ERROR_MESSAGE(),@CommandString
END CATCH;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Database backup with lost archive logs

    How can I get a database backup when all the archive logs have been lost?

    here's the full test of the backup:
    Recovery Manager: Release 9.2.0.7.0 - 64bit Production
    Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
    RMAN>
    connected to target database: ESKHDEV1 (DBID=4075873486)
    using target database controlfile instead of recovery catalog
    RMAN>
    echo set on
    RMAN> run {
    2> allocate channel oem_backup_disk1 type disk format '/sbdbarc/backups/eskhdev1/%U' maxpiecesize 2000 M;
    3> backup filesperset = 3 tag 'BACKUP_ESKHDEV1_00_101008022533' database;
    4> backup filesperset = 3 tag 'BACKUP_ESKHDEV1_00_101008022533' archivelog all not backed up;
    5> release channel oem_backup_disk1;
    6> }
    allocated channel: oem_backup_disk1
    channel oem_backup_disk1: sid=18 devtype=DISK
    Starting backup at 10-OCT-08
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00013 name=/spte/oracle/oradata/ESKHDEV1/leafdat02.dbf
    input datafile fno=00011 name=/spte/oracle/oradata/ESKHDEV1KLXTEMP.dbf
    input datafile fno=00001 name=/spte/oracle/oradata/ESKHDEV1/system01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2jjsq87q_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:00:45
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00002 name=/spte/oracle/oradata/ESKHDEV1/undotbs01.dbf
    input datafile fno=00008 name=/spte/oracle/oradata/ESKHDEV1/tools01.dbf
    input datafile fno=00005 name=/spte/oracle/oradata/ESKHDEV1/example01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2kjsq897_1_1 comment=NONE
    channel oem_backup_disk1: starting piece 2 at 10-OCT-08
    channel oem_backup_disk1: finished piece 2 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2kjsq897_2_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:01:20
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00017 name=/spte/oracle/oradata/ESKHDEV1/parentidx01.dbf
    input datafile fno=00015 name=/spte/oracle/oradata/ESKHDEV1/lral3201.dbf
    input datafile fno=00010 name=/spte/oracle/oradata/ESKHDEV1/xdb01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2ljsq8bn_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:01:05
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00012 name=/spte/oracle/oradata/ESKHDEV1/leafdat01.dbf
    input datafile fno=00006 name=/spte/oracle/oradata/ESKHDEV1/indx01.dbf
    input datafile fno=00003 name=/spte/oracle/oradata/ESKHDEV1/cwmlite01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2mjsq8dp_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:01:15
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00014 name=/spte/oracle/oradata/ESKHDEV1/leafidx.dbf
    input datafile fno=00009 name=/spte/oracle/oradata/ESKHDEV1/users01.dbf
    input datafile fno=00004 name=/spte/oracle/oradata/ESKHDEV1/drsys01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2njsq8g4_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:01:15
    channel oem_backup_disk1: starting full datafile backupset
    channel oem_backup_disk1: specifying datafile(s) in backupset
    input datafile fno=00016 name=/spte/oracle/oradata/ESKHDEV1/parentdat01.dbf
    input datafile fno=00007 name=/spte/oracle/oradata/ESKHDEV1/odm01.dbf
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2ojsq8if_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:01:35
    Finished backup at 10-OCT-08
    Starting backup at 10-OCT-08
    current log archived
    channel oem_backup_disk1: starting archive log backupset
    channel oem_backup_disk1: specifying archive log(s) in backup set
    input archive log thread=1 sequence=1260 recid=1236 stamp=667755183
    channel oem_backup_disk1: starting piece 1 at 10-OCT-08
    channel oem_backup_disk1: finished piece 1 at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/2pjsq8lf_1_1 comment=NONE
    channel oem_backup_disk1: backup set complete, elapsed time: 00:00:02
    Finished backup at 10-OCT-08
    Starting Control File and SPFILE Autobackup at 10-OCT-08
    piece handle=/sbdbarc/backups/eskhdev1/c-4075873486-20081010-02 comment=NONE
    Finished Control File and SPFILE Autobackup at 10-OCT-08
    released channel: oem_backup_disk1
    RMAN> delete noprompt obsolete device type disk;
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 1
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=18 devtype=DISK
    Deleting the following obsolete backups and copies:
    Type Key Completion Time Filename/Handle
    Backup Set 2 17-MAR-08
    Backup Piece 2 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_10_1_649591917.rbp
    Backup Set 6 17-MAR-08
    Backup Piece 6 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_14_1_649594217.rbp
    Backup Set 7 17-MAR-08
    Backup Piece 7 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_16_1_649594217.rbp
    Backup Set 8 17-MAR-08
    Backup Piece 8 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_17_1_649594353.rbp
    Backup Set 9 17-MAR-08
    Backup Piece 9 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_19_1_649595236.rbp
    Backup Set 10 17-MAR-08
    Backup Piece 10 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_18_1_649595236.rbp
    Backup Set 11 17-MAR-08
    Backup Piece 11 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_20_1_649595236.rbp
    Backup Set 12 17-MAR-08
    Backup Piece 12 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_21_1_649595381.rbp
    Backup Set 13 17-MAR-08
    Backup Piece 13 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_24_1_649595445.rbp
    Backup Set 14 17-MAR-08
    Backup Piece 14 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_22_1_649595445.rbp
    Backup Set 15 17-MAR-08
    Backup Piece 15 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_23_1_649595445.rbp
    Backup Set 16 17-MAR-08
    Backup Piece 16 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_25_1_649595471.rbp
    Backup Set 17 17-MAR-08
    Backup Piece 17 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_27_1_649604714.rbp
    Backup Set 18 17-MAR-08
    Backup Piece 18 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_26_1_649604714.rbp
    Backup Set 19 17-MAR-08
    Backup Piece 19 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_28_1_649604714.rbp
    Backup Set 20 17-MAR-08
    Backup Piece 20 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_29_1_649604850.rbp
    Backup Set 21 17-MAR-08
    Backup Piece 21 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_31_1_649604923.rbp
    Backup Set 22 17-MAR-08
    Backup Piece 22 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_30_1_649604923.rbp
    Backup Set 23 17-MAR-08
    Backup Piece 23 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_33_1_649606774.rbp
    Backup Set 24 17-MAR-08
    Backup Piece 24 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_32_1_649606774.rbp
    Backup Set 25 17-MAR-08
    Backup Piece 25 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_34_1_649606774.rbp
    Backup Set 26 17-MAR-08
    Backup Piece 26 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_35_1_649606900.rbp
    Backup Set 27 17-MAR-08
    Backup Piece 27 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_37_1_649606970.rbp
    Backup Set 28 17-MAR-08
    Backup Piece 28 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_36_1_649606970.rbp
    Backup Set 29 17-MAR-08
    Backup Piece 29 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_39_1_649607591.rbp
    Backup Set 30 17-MAR-08
    Backup Piece 30 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_38_1_649607591.rbp
    Backup Set 31 17-MAR-08
    Backup Piece 31 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_40_1_649607591.rbp
    Backup Set 32 17-MAR-08
    Backup Piece 32 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_41_1_649607707.rbp
    Backup Set 33 17-MAR-08
    Backup Piece 33 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_43_1_649607785.rbp
    Backup Set 34 17-MAR-08
    Backup Piece 34 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_42_1_649607785.rbp
    Backup Set 35 17-MAR-08
    Backup Piece 35 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_45_1_649609650.rbp
    Backup Set 36 17-MAR-08
    Backup Piece 36 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_44_1_649609650.rbp
    Backup Set 37 17-MAR-08
    Backup Piece 37 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_46_1_649609650.rbp
    Backup Set 38 17-MAR-08
    Backup Piece 38 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_47_1_649609777.rbp
    Backup Set 39 17-MAR-08
    Backup Piece 39 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_49_1_649609840.rbp
    Backup Set 40 17-MAR-08
    Backup Piece 40 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_48_1_649609840.rbp
    Backup Set 41 17-MAR-08
    Backup Piece 41 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_51_1_649611229.rbp
    Backup Set 42 17-MAR-08
    Backup Piece 42 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_50_1_649611229.rbp
    Backup Set 43 17-MAR-08
    Backup Piece 43 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_52_1_649611229.rbp
    Backup Set 44 17-MAR-08
    Backup Piece 44 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_53_1_649611355.rbp
    Backup Set 45 17-MAR-08
    Backup Piece 45 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_55_1_649611419.rbp
    Backup Set 46 17-MAR-08
    Backup Piece 46 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_54_1_649611419.rbp
    Backup Set 47 17-MAR-08
    Backup Piece 47 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_57_1_649612920.rbp
    Backup Set 48 17-MAR-08
    Backup Piece 48 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_56_1_649612920.rbp
    Backup Set 49 17-MAR-08
    Backup Piece 49 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_58_1_649612920.rbp
    Backup Set 50 17-MAR-08
    Backup Piece 50 17-MAR-08 /spte/oracle/backups/eskhdev1/df_ESKHDEV1_59_1_649613075.rbp
    Backup Set 51 17-MAR-08
    Backup Piece 51 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_61_1_649613158.rbp
    Backup Set 52 17-MAR-08
    Backup Piece 52 17-MAR-08 /spte/oracle/backups/eskhdev1/al_ESKHDEV1_60_1_649613158.rbp
    Backup Set 66 10-OCT-08
    Backup Piece 68 10-OCT-08 /sbdbarc/backups/eskhdev1/2bjsppct_1_1
    Backup Set 67 10-OCT-08
    Backup Piece 69 10-OCT-08 /sbdbarc/backups/eskhdev1/2cjsppea_1_1
    Backup Piece 70 10-OCT-08 /sbdbarc/backups/eskhdev1/2cjsppea_2_1
    Backup Set 68 10-OCT-08
    Backup Piece 71 10-OCT-08 /sbdbarc/backups/eskhdev1/2djsppgq_1_1
    Backup Set 69 10-OCT-08
    Backup Piece 72 10-OCT-08 /sbdbarc/backups/eskhdev1/2ejsppir_1_1
    Backup Set 70 10-OCT-08
    Backup Piece 73 10-OCT-08 /sbdbarc/backups/eskhdev1/2fjsppl6_1_1
    Backup Set 71 10-OCT-08
    Backup Piece 74 10-OCT-08 /sbdbarc/backups/eskhdev1/2gjsppnh_1_1
    Backup Set 72 10-OCT-08
    Backup Piece 75 10-OCT-08 /sbdbarc/backups/eskhdev1/c-4075873486-20081010-00
    Backup Set 73 10-OCT-08
    Backup Piece 76 10-OCT-08 /sbdbarc/backups/eskhdev1/c-4075873486-20081010-01
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2bjsppct_1_1 recid=68 stamp=667739549
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2cjsppea_1_1 recid=69 stamp=667739594
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2cjsppea_2_1 recid=70 stamp=667739639
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2djsppgq_1_1 recid=71 stamp=667739674
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2ejsppir_1_1 recid=72 stamp=667739739
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2fjsppl6_1_1 recid=73 stamp=667739814
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/2gjsppnh_1_1 recid=74 stamp=667739889
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/c-4075873486-20081010-00 recid=75 stamp=667739965
    deleted backup piece
    backup piece handle=/sbdbarc/backups/eskhdev1/c-4075873486-20081010-01 recid=76 stamp=667742372
    Deleted 9 objects
    RMAN-06207: WARNING: 48 objects could not be deleted for DISK channel(s) due
    RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
    List of Mismatched objects
    ==========================
    Object Type Filename/Handle
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_10_1_649591917.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_14_1_649594217.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_16_1_649594217.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_17_1_649594353.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_19_1_649595236.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_18_1_649595236.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_20_1_649595236.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_21_1_649595381.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_24_1_649595445.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_22_1_649595445.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_23_1_649595445.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_25_1_649595471.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_27_1_649604714.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_26_1_649604714.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_28_1_649604714.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_29_1_649604850.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_31_1_649604923.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_30_1_649604923.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_33_1_649606774.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_32_1_649606774.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_34_1_649606774.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_35_1_649606900.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_37_1_649606970.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_36_1_649606970.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_39_1_649607591.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_38_1_649607591.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_40_1_649607591.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_41_1_649607707.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_43_1_649607785.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_42_1_649607785.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_45_1_649609650.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_44_1_649609650.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_46_1_649609650.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_47_1_649609777.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_49_1_649609840.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_48_1_649609840.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_51_1_649611229.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_50_1_649611229.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_52_1_649611229.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_53_1_649611355.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_55_1_649611419.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_54_1_649611419.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_57_1_649612920.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_56_1_649612920.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_58_1_649612920.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/df_ESKHDEV1_59_1_649613075.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_61_1_649613158.rbp
    Backup Piece /spte/oracle/backups/eskhdev1/al_ESKHDEV1_60_1_649613158.rbp
    RMAN> release channel;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of release command at 10/10/2008 15:33:09
    RMAN-06474: maintenance channels are not allocated
    RMAN> exit;
    Recovery Manager complete.

  • Possible to Get Database backup with java program

    Hello
    Is it possible to Get or Create Database Backup on runtime with java program using some sql statements
    How could i do that
    '

    Cross posted and multi-posted.
    Hey jackass why don't you look where I already answered this question.
    http://forum.java.sun.com/thread.jspa?threadID=654902&messageID=3849575

  • Privileges required for database backup with RMAN

    Hello,
    We have 10g R2 on Solaris box. We use RMAN for backup and use the SYS account on the database to connect and take the backup.
    Are there specific privileges that are required to take the database backup , so that I do not use the SYS account or the syspassword in the RMAN script.
    I want to create an account and give only the privileges required to take the database backup and recover .
    Thanks

    I think RMAN needs the SYSDBA privilege, so you won't gain much by switching from SYS to another user.
    You don't need to store sys/password in a script. You can just :-
    rman target / catalog xxx/yyy@catalog

  • FTP-Sender Adapter ignores files with "known filenames"

    Hello experts,
    the scenario is FTP -> XI -> IDOC and we have problems with the polling of the files. In communication channel monitoring everything is working fine, but in the FTP folder some files are ignored, although the communication channel is set up for all *.txt-files.
    My question is, is it possible that the FTP sender adapter ignores files, if it already has processed a file with the same filename? After renaming the files they all were picked up and archived into another folder. How can I configure the communication channel to pick up ALL *.txt-files in the out-folder?
    Best regards
    David

    Hi David,
    What I have observed is, XI always reads files in a certain order (possibly alphabetical or reverse alphabetical). If it finds a file in the source directory that already exists in the archive directory, it will not attempt to read/process the next file (even if the next filename is completely new).
    So, if any of the files in the source directory exist in the archive directory, there is a possibility that certain files may get processed and certain wont.
    Make sure that none of the files that you put in source directory exist in the archive directory (i.e. all the files are new) and see the output. Let me know if this helps.
    PS: I used FTP protocol
    Regards,
    Riyaz

  • Display all database results with URL variable?

    Hi,
    I am using PHP MySQL
    I have a database that is Alphabetically ordered. I am trying to create a dynamic page that will only show A, B, C, ... and so on. I do this by Creating links named after the letters in the Alphabet. I have a recordset that filters the table using a URL variable that uses Type. Unfortunately when I click on the link it only displays the first record that contains an A. Not all the records that contain  A.
    For example:
    I have a link that is just "A". Its link is ?Type=A. In the database table their are 3 records that contain A under Type, but when I click on it only one record containing A is displayed. I hope you are following this.
    If you want a direct reference to what I am doing go to:
    http://cwhazzoo.com/gamelinktesting.php
    This is how my database is designed:
    ID (primary key)
    Name
    Letter
    0001
    Example A
    A
    I want to be able to show only the selected letter of records using only one page. Thanks!

    >Should I use the repeat region?
    Yep. That's what it's for.

  • Check Backup with Database Studio

    Hi there,
    I have a question about recover_check with the Database Studio.
    We have a SAP MaxDB 7.7.04.28 and use the Database Studio 7.7.07.12.
    We use Networker as external backuptool.
    The backup seems to be ok, in the log file and in the history the external backup state is available and the external backup id is displayed and I can find this in the log file u201CHave updated external backup history successfullyu201D.
    When I try to check the database backup with Database Studio, I choose the backup from history, but I get an error message: u201CAn external backup id is needed, but not suppliedu201D.
    When I look on the Tab Data Carriers the Parameter External Backup ID isnu2019t filled.
    What can I do to check the Backup with the Database Studio?
    Thanks for help
    Heiko

    > We have a SAP MaxDB 7.7.04.28 and use the Database Studio 7.7.07.12.
    > We use Networker as external backuptool.
    >
    > The backup seems to be ok, in the log file and in the history the external backup state is available and the external backup id is displayed and I can find this in the log file u201CHave updated external backup history successfullyu201D.
    >
    >
    > When I try to check the database backup with Database Studio, I choose the backup from history, but I get an error message: u201CAn external backup id is needed, but not suppliedu201D.
    > When I look on the Tab Data Carriers the Parameter External Backup ID isnu2019t filled.
    >
    > What can I do to check the Backup with the Database Studio?
    Hmm... with my 7.9er DB Studio this works with external backups as well...
    Anyhow - there are certain features that are not fully implemented/supported until DB Studio >=7.8....
    So maybe you need to use DBMGUI a while longer...
    Do you have the checkbox "Show information for external backup tools" on your backup history screen?
    regards,
    Lars

  • Backup with Exp,  Can  It used in DB with Archive Log Mode ??

    I need information about if When I activate Archive log mode in my database ,after This I will use all before backups with Exp in full,Table,user ...recovery mode .
    any advice are welcome
    thanks
    Jimmy

    If you are using archive log mode, you should back up your database by regularly backing up
    your data files. If you lose a tablespace due to a defecitve disk or need to do a point-in-time recovery due to a user error, you restore your latest copy (if doing point-in-time the latest copy before the
    user error) of the relevant data files an then roll forward using the archived log.
    You can not restore your database from an export and then roll forward using the archived
    logs.
    HTH
    Marcus Geselle

  • How to backup all database settings and data for SOA suite to file(s) ?

    During the installation of the SOA Suite a couple of tables and schemas are created
    in Oracle database through the irca.bat script.
    Later the tables are filled with content by all the servers and services of the
    SOA Suite.
    How can I backup all these tables and SOA related stuff to one (or more)
    files (for a possible later restore)?
    This backup should contain only SOA Suite related tables and data.
    Possible other tables (for other applications) should not be considered.
    Is there a script (e.g. for sqlplus) or menu which does the
    SOA database backup job for me ?
    If there is no official backup script maybe someone in this forum
    wrote a personal script.
    Thank you
    Peter

    I am facing the same problem.
    I have spend a few days to configure and train my Sony tablet to configure for all my remotes such as aircon and lighting. I did a backup using the Sony companion to my PC. When my tablet was faulty and serviced. But the backup did not recover the IR remote settings and codes which I programmed previously. I also tried your backup restore app but it also does not save the configuration.
    It is VERY IMPORTANT for me to backup the settings.
    Please provide the folders and path of where the IR REMOTE settings and personal configuration and codes trained were kept so that I could back them up. Are these path protected area that required rooted access?
    Hope that Sony could update the app to include backup of new trained codes and settings and in the meantime to provide a procedure of how to backup the setting and trained IR codes with or without rooting the device.

  • I formatted my harddrive, did not backup my mozilla (on accident), but I was wondering if there might be an online backup with your database?

    I was hoping there might be some information that's sent to an online database, because I had literally forgot to backup that specific file, and now I'm hoping to find out if there is anyway to recovery what I lost in the formatting of my harddrive.

    This is rather hard to follow, and figuring out just what went wrong and when won't really help much, as all you want to do now is be sure you've got everything.
    If I understand it correctly, you now have all the right data, much copied via the Finder. If so, check for permissions problems that can occur if you do this, especially in a multi-user environment. If there are many problems, you might do better by using the normal TM interface to select and restore the files & folders.
    If all you're now missing are separate Applications folders for each user, use the TM interface to restore them, also.
    Note that you probably won't see the backups you want via +Enter Time Machine.+ TM keeps the backups for each Mac separate, and normally only shows the ones for the Mac it's running on, even if there are other Macs' backups on its disk/partition.
    To see these "other" backups, you need the (badly named) +Browse Other Time Machine Disks+ option. It's available by holding down the Option key while selecting the TM icon in your Menubar, or by control-clicking (right-clicking) the TM icon in your Dock.
    You'll see a selection screen showing all the disks/partitions that have TM backups on them. Select the one you want, and you'll be taken to the normal TM "Star Wars" interface, where you should see all the backups on that disk/partition. You can restore from such backups to an alternate location, by selecting the desired items, clicking the "gear" icon in the TM Finder window's toolbar, and selecting the +Restore <item> to ...+ option.
    Also note that when you start doing TM backups from the new Mac, the old ones will be "stranded" -- TM won't delete the oldest ones when it needs room for backups of your new Mac. It will delete the oldest backups from the NEW Mac instead. So your best bet may be, once you're sure you've got everything, to erase your TM disk with Disk Utility and let TM start fresh with the new Mac.

  • COLD BACKUP DATABASE CLONING with +ASM

    Hi,
    I need some help to clone the database using Cold backup with +ASM. Can somebody help me on this
    Here is the steps we did on Source Database.
    1. Copied all the $ORACLE_HOME from Source to TARGET.
    2. Created pfile from spfile.
    3. Created backup control file on the Source.
    Questions:
    =======
    1. Source has 3 diskgroups, do we need to create new 3 disk groups on the TARGET ?
    2. If we needed 3 new disk groups on TARGET, how can we move all the data from SOURCE diskgroup to TARGET disk group, Do we need to use RMAN?
    Please let me know what else need to do to bring up the TARGET database.
    Thanks
    Dheeru.

    Hi,
    1. Source has 3 diskgroups, do we need to create new 3 disk groups on the TARGET ?Not necessarily.
    2. If we needed 3 new disk groups on TARGET, how can we move all the data from SOURCE diskgroup to TARGET disk group, Do we need to use RMAN? Yes, use RMAN to clone/duplicate the database.
    Rapid Clone Documentation Resources, Release 11i and 12 [ID 799735.1]
    Cloning ASM database using RMAN Duplicate
    http://oracleandme.blogspot.com/2007/08/cloning-e-biz-using-rman-duplicate.html
    Thanks,
    Hussein

  • RMAN-06067: RECOVER DATABASE required with a backup or created controlfile

    Hi,
    DB:9.2.0.8
    OS: AIX 5.3
    I am restoring DB with until time(12/06/2012) for needed tablespaces.
    I restored the 12th date controlfile ,which is backed up with archivedlogs. I also have one more controlfile which backed up with full DB..
    Restore of tablespaces are completed..
    When recovery is going , failed with following error..
    allocated channel: c7
    channel c7: sid=22 devtype=SBT_TAPE
    channel c7: VERITAS NetBackup for Oracle - Release 5.1 (2006040520)
    allocated channel: c8
    channel c8: sid=21 devtype=SBT_TAPE
    channel c8: VERITAS NetBackup for Oracle - Release 5.1 (2006040520)
    executing command: SET until clause
    Starting recover at 23-06-2012 02:00:15
    released channel: c1
    released channel: c2
    released channel: c3
    released channel: c4
    released channel: c5
    released channel: c6
    released channel: c7
    released channel: c8
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 06/23/2012 03:36:57
    RMAN-06067: RECOVER DATABASE required with a backup or created controlfile
    RMAN>
    Restore Script:
    connect target /
    connect catalog rmanc/recom@lgn_rmanc
    run {
    allocate channel c1 type 'SBT_TAPE';
    allocate channel c2 type 'SBT_TAPE';
    allocate channel c3 type 'SBT_TAPE';
    allocate channel c4 type 'SBT_TAPE';
    allocate channel c5 type 'SBT_TAPE';
    allocate channel c6 type 'SBT_TAPE';
    allocate channel c7 type 'SBT_TAPE';
    allocate channel c8 type 'SBT_TAPE';
    allocate channel c9 type 'SBT_TAPE';
    allocate channel c10 type 'SBT_TAPE';
    allocate channel c11 type 'SBT_TAPE';
    allocate channel c12 type 'SBT_TAPE';
    set until time '12-06-2012 00:01:26';
    restore tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    release channel c5;
    release channel c6;
    release channel c7;
    release channel c8;
    release channel c9;
    release channel c10;
    release channel c11;
    release channel c12;
    Recover Script:
    connect catalog rmanc/recom@lgn_rmanc
    connect target /
    run {
    allocate channel c1 type 'SBT_TAPE';
    allocate channel c2 type 'SBT_TAPE';
    allocate channel c3 type 'SBT_TAPE';
    allocate channel c4 type 'SBT_TAPE';
    allocate channel c5 type 'SBT_TAPE';
    allocate channel c6 type 'SBT_TAPE';
    allocate channel c7 type 'SBT_TAPE';
    allocate channel c8 type 'SBT_TAPE';
    set until time '12-06-2012 00:01:26';
    recover tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;
    release channel c5;
    release channel c6;
    release channel c7;
    release channel c8;
    Any suggestion in this is helpful to me..
    Thanks in advance,

    Hello;
    I read your post and here's the thoughts that came to mind : ( my largest concern is you might restore something that damages your current system )
    1. So you want to restore the whole DB back to 12/06/2012 to get some tablespaces from then right?
    2. Are you restoring to a different system?
    3. How did you start the database ( NOMOUNT, MOUNT )
    4. If you are restoring the whole DB back to 12/06/2012 how did you restore the control file?
    5. Your command shows :
    restore tablespace SYSTEM,UNDO_GEN01,UNDO_GEN02,TAB_80K_GENCON,TAB_25M_GENCON;
    COMMENT : Generally I use recover tablespace for point in time recovery and use an auxilary destination.
    Meaning I don't use restore at all, in fact using restore may cause an issue.
    SUMMARY : I don't see how this will work as is.
    It seems you want data from five tablespaces from about six months ago including the SYSTEM tablespace.
    This is an Incomplete Recovery. I believe I would rethink this completely.
    Give the time that has past I would consider restoring the whole database to a different server where cannot damage anything.
    Once this is done I would decide how to get the data I need.
    Or I would check for a daily export file and recover the tablespace data that way.
    So you have some good details on your question but it seems the plan is either missing something or you need to add a few more details.
    Example
    I'm recovering old tablespaces into a test system.
    Here's how I'm not damaging my current production system.
    I don't have an export from that date.
    So take a step back and either rethink or give a few more details on how this is safe.
    Best Regards
    mseberg

  • Rman backup with  standby database

    Hi All,
    I am looking for some suggestions for rman backup with standby  database with datagaurd but no active DG. I wanted to do a rman tablespace backup. but I am stuck at  sql 'alter system archive log current' in rman  with standby as target. which gives following errors  with or without noswitch clause
    RMAN> sql 'alter system archive log current noswitch';
    sql statement: alter system archive log current noswitch
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of sql command on default channel at 10/05/2013 18:15:12
    RMAN-11003: failure during parse/execution of SQL statement: alter system archive log current noswitch
    ORA-01109: database not open
    Recovery Manager: Release 11.2.0.1.0
    Oracle databaes  Release 11.2.0.1.0 64 bit
    OS:RHEL 6 x86-64 bit
    Secondly, do I need to cancel manged recovery while taking rman backups on standby.
    I scanned thru MOS but could find solutions for rman with active DG.
    Thanks in advance

    726d07e6-b870-431f-8c22-a499c3ec4e0c wrote:
    Hi All,
    I am looking for some suggestions for rman backup with standby  database with datagaurd but no active DG. I wanted to do a rman tablespace backup. but I am stuck at  sql 'alter system archive log current' in rman  with standby as target. which gives following errors  with or without noswitch clause
    RMAN> sql 'alter system archive log current noswitch';
    sql statement: alter system archive log current noswitch
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of sql command on default channel at 10/05/2013 18:15:12
    RMAN-11003: failure during parse/execution of SQL statement: alter system archive log current noswitch
    ORA-01109: database not open
    Recovery Manager: Release 11.2.0.1.0
    Oracle databaes  Release 11.2.0.1.0 64 bit
    OS:RHEL 6 x86-64 bit
    Secondly, do I need to cancel manged recovery while taking rman backups on standby.
    I scanned thru MOS but could find solutions for rman with active DG.
    Thanks in advance
    "I scanned thru MOS but could find solutions for rman with active DG."
    Howto make a consistent RMAN backup in an Standby database in Active DataGuard mode (Doc ID 1419923.1)

  • Can I use tape drive for backup with win 2012 OS & Sybase database?

    I have installed enhancement package 6 for SAP ERP 6.0 with OS windows 2012 and database sybase ASE(15.7.050). I am facing problem while taking database backup on tape drive. I want to know how to initialize tape drive in case of sybase DB and is it possible to take back-up on same. I failed to schedule backup from DB13 so now I am doing that activity by command line. So please help me to solve these issues.
    Here I am attaching some files related with backup commands that presently I am using. My SAP system ID is DQS.

    That output actually looks pretty good, it was dumping to the tape drive, it just ran out of tape because the drive apparently doesn't automatically detect when it is reaching the end.
    For the next step, try adding a CAPACITY parameter to your dump command as discussed at these places in the documentation.
    Specifying tape capacity for dump commands
    Set the Maximum Capacity for a Tape Drive
    Your output above shows it was able to dump 87565594 KB before it ran out of tape,
    so lets be a little conservative and try
    dump database DQS to TAPE1 with   capacity = 87000000, init
    go
    When the dump reaches that point, ASE should prompt you to pop in another new tape
    and then issue the sp_volchanged procedure from a second session (it will tell you what parameters to use for sp_volchanged).
    Note: once we get the dump working successfully, we can then create a logical dump device that would store the capacity value, and create a full dump configuration so you gain all the new functionality like dump history, etc.
    Enhancements to dump and load
    -bret

  • Database restore with just one backup set

    Hallo experts,
    I got a big problem with restoring my XE database. I have a newly created full backup from my XE. While saving the flashback_area I got a hard crash on my system but I saved the last backup set file on a server. Unfortunately I was not able to save other backup sets and I think, there was a special backup of my control files. The restore on another system does not work because of invalid piece.
    The data of this database is necessary for my work. Is there anybody out there who can help to restore the data with the existing backup set.
    I did not change the entire structure of my original XE database. I only created to schemas with data in. is there any solution to restore the data.
    Thanks for any help.
    Holger

    Hi you all,
    I think that somebody will be interested in the solution of my problem,so I post it here and in german on my website (www.datacubus.de).
    My XEdatabase is successfully restored and I walked through some undocumented and not supported features of ORACLE to win the challenge.
    The first fact is, that ORACLE XE has a very static structure if you use it as is. The datafiles are predefined and so a manual restore with a foreign backup piece seems to be possible.
    Here is my way:
    Create a backup of your controlfile
    ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    Shutdown your database
    shutdown immediate
    Start the database in nomount mode
    [holger@MSA04071]$ rman nocatalog target /
    RMAN> startup force nomount;
    RMAN> quit
    Restore the datafiles
    I used the following script to restore the datafiles from the backup piece without any check:
    declare
    devtype varchar2(256);
    v_file varchar2(255);
    done boolean;
    begin
    v_file:='/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/backupset/o1_mf_nnndf_TAG20070420T234848_32lfb0w9_.bkp';
    devtype:= dbms_backup_restore.DeviceAllocate(type => '',ident => 'D1');
    dbms_backup_restore.RestoreSetDatafile;
    dbms_backup_restore.RestoreDatafileTo(dfnumber => 1,toname=>'/usr/lib/oracle/xe/oradata/XE/system.dbf');
    dbms_backup_restore.RestoreDatafileTo(dfnumber => 2,toname=>'/usr/lib/oracle/xe/oradata/XE/undo.dbf');
    dbms_backup_restore.RestoreDatafileTo(dfnumber => 3,toname=>'/usr/lib/oracle/xe/oradata/XE/sysaux.dbf');
    dbms_backup_restore.RestoreDatafileTo(dfnumber => 4,toname=>'/usr/lib/oracle/xe/oradata/XE/users.dbf');
    dbms_backup_restore.RestoreBackupPiece(done => done,handle => v_file,params => null);
    dbms_backup_restore.DeviceDeallocate;
    end;
    Start this script as sysdba. But by carefull. This only works if no entire change of datafiles had taken place!
    Reset DBID
    Because of the saved DBID within the datafile, the database can't be opened. But there is a little trick for resetting the DBID.
    shutdown;
    startup mount;
    execute dbms_backup_restore.zeroDbid(0);
    shutdown normal;
    Delete or rename existing Controlfile
    Edit trace file
    You have to modify your controlfile script as follows:
    1. Only use the CREATE CONTROLFILE... block
    2. Delete RECOVER DATABASE block
    3. Replace REUSE with SET
    4. Replace NORESETLOGS with RESETLOGS
    Create new control file
    Use the CREATE CONTROLFILE block for creation of a new control file.
    Open Database
    alter database open resetlogs;
    Much work but all my data is back and now I will backup the whole flashback_area to avoid further nightmares.
    Bye
    Holger

Maybe you are looking for

  • BI Publisher Enterprise 11g prevent users from scheduling reports

    Hi there I have created an intranetreptuser that I would like only to have access to running reports in BI publisher and not scheduling them. I also created an application policy that only has the one policy: runreportsonline and granted that policy

  • Read filenames from jar-file

    Hi, I want to read image names in a jar-file directory in a web start application. This used to work in previous versions of jdk, but when I use jdk 1.6.0_20 I get this errormessage: "http:\server:8080\test\client.jar The filename, directory name, or

  • Full outer join query giving error

    Hi I have written the below query to get the fields below as an out put but am getting the error missing keyword..am not understanding where did i missed..i have done step by step query analysis..but could not find the error. Please help me in resolv

  • Crystal Reports 2008 - saving to Business Objects Edge

    Post Author: GWilks CA Forum: Crystal Reports Hi, When trying to Open or Save a report in Crystal Reports 2008 to the Business Objects Edge server, the following message is received: Access denied. You cannot log on to an older version of the CMS. Do

  • [SOLVED] bin32 applications won't run

    I have problems with running bin32 apps. $ skype bash: /usr/bin/skype: No such file or directory $ ls -l /usr/bin | grep skype -rwxr-xr-x 1 root root   18567888 Feb 22 00:13 skype $ /usr/bin/wine bash: /usr/bin/wine: No such file or directory $ googl