Duplicating a Database
RAC11g
Hi
I am duplicating a database with RMAN duplicate.
I set the parameters db_file_name_convert, log_file_name_convert on both instances of target database. The target database is a production database. I know I have to shutdown both instances and after start them for having the parameters on both. Accidentaly I shutdown one of them and up to I shutdown the another the instance1 is not going to be started because the instance tell me that the parameters have to be equal on both. I know that If I shutdown instance2, after both instances are going to be fine but I can not do it because I can not close the database.
Instance1 have the parameters originaly so:
SQL> show parameters convert
NAME TYPE VALUE
db_file_name_convert string
log_file_name_convert string
and the instance1 has these parameters with values that I set.
What I want ?. Clear these parameters on instance1 again for starting it again.
I know I can modify parameters of instance1 from instance2 but the values seems to be bad....
for example:
when I tro to clear the parameters from instance1 I get the following error:
SQL> alter system set db_file_name_convert='','' scope=spfile sid='instance1';
alter system set db_file_name_convert='','' scope=spfile sid='COFASADB1'
ERROR at line 1:
ORA-01078: failure in processing system parameters
LRM-00117: syntax error at ',' at the start of input
SQL>
what is the correct value to clear the parameter ?
Thanks
Hi
I removed the parameters with alter system reset <parameter name> scope=spfile sid='*';
Now I have set the parameters only in auxiliary database but it seems... it is looking for to retore on production dbfiles....
Both databases are RAC databases and they are on the same hosts.
I have done several duplicates in RAC enviroment from RAC Database to single instance inside these hosts without any problem.
I am doing the duplicate from node2 connecting to the production database instance2 and auxiliary database in instance2 as well.
Thanks
Similar Messages
-
TIP 04: Duplicating a Database in 10g by Joel Pèrez
Hi OTN Readers!
Everyday I get connection on Internet and one of the first issues that
I do is to open the OTN main page to look for any new article or any
new news about the Oracle Technology. After I open the main page of
OTN Forums and I check what answers I can write to help some people
to work with the Oracle Technology and I decided to begin to write some
threads to help DBAs and Developers to learn the new features of 10g.
I hope you can take advantage of them which will be published here in
this forum. For any comment you can write to me directly to : [email protected] . Apart from your comments you can suggest to me any topic to write an article like this.
Please do not replay this thread, if you have any question related to
this I recommend you to open a new post. Thanks!
The tip of this thread is: Duplicating a Database in 10g
Joel Pérez
http://otn.oracle.com/expertsStep 6: Editing the file generated
The file generated is going to be like this:
Dump file f:\ora9i\admin\copy1\udump\copy1_ora_912.trc
Thu May 20 16:27:37 2004
ORACLE V9.2.0.1.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Instance name: copy1
Redo thread mounted by this instance: 1
Oracle process number: 10
Windows thread id: 912, image: ORACLE.EXE
*** SESSION ID:(9.38) 2004-05-20 16:27:37.000
*** 2004-05-20 16:27:37.000
# The following are current System-scope REDO Log Archival related
# parameters and can be included in the database initialization file.
# LOG_ARCHIVE_DEST=''
# LOG_ARCHIVE_DUPLEX_DEST=''
# LOG_ARCHIVE_FORMAT=ARC%S.%T
# REMOTE_ARCHIVE_ENABLE=TRUE
# LOG_ARCHIVE_MAX_PROCESSES=2
# STANDBY_FILE_MANAGEMENT=MANUAL
# STANDBY_ARCHIVE_DEST=%ORACLE_HOME%\RDBMS
# FAL_CLIENT=''
# FAL_SERVER=''
# LOG_ARCHIVE_DEST_1='LOCATION=f:\ora9i\RDBMS'
# LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
# LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM SYNC'
# LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
# LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED'
# LOG_ARCHIVE_DEST_STATE_1=ENABLE
# Below are two sets of SQL statements, each of which creates a new
# control file and uses it to open the database. The first set opens
# the database with the NORESETLOGS option and should be used only if
# the current versions of all online logs are available. The second
# set opens the database with the RESETLOGS option and should be used
# if online logs are unavailable.
# The appropriate set of statements can be copied from the trace into
# a script file, edited as necessary, and executed when there is a
# need to re-create the control file.
# Set #1. NORESETLOGS case
# The following commands will create a new control file and use it
# to open the database.
# Data used by the recovery manager will be lost. Additional logs may
# be required for media recovery of offline data files. Use this
# only if the current version of all online logs are available.
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "COPY1" NORESETLOGS NOARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 'C:\COPY1\COPY1\REDO01.LOG' SIZE 10M,
GROUP 2 'C:\COPY1\COPY1\REDO02.LOG' SIZE 10M,
GROUP 3 'C:\COPY1\COPY1\REDO03.LOG' SIZE 10M
-- STANDBY LOGFILE
DATAFILE
'C:\COPY1\COPY1\SYSTEM01.DBF',
'C:\COPY1\COPY1\UNDOTBS01.DBF',
'C:\COPY1\COPY1\CWMLITE01.DBF',
'C:\COPY1\COPY1\DRSYS01.DBF',
'C:\COPY1\COPY1\EXAMPLE01.DBF',
'C:\COPY1\COPY1\INDX01.DBF',
'C:\COPY1\COPY1\ODM01.DBF',
'C:\COPY1\COPY1\TOOLS01.DBF',
'C:\COPY1\COPY1\USERS01.DBF',
'C:\COPY1\COPY1\XDB01.DBF'
CHARACTER SET WE8ISO8859P1
# Recovery is required if any of the datafiles are restored backups,
# or if the last shutdown was not normal or immediate.
RECOVER DATABASE
# Database can now be opened normally.
ALTER DATABASE OPEN;
# Commands to add tempfiles to temporary tablespaces.
# Online tempfiles have complete space information.
# Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\COPY1\COPY1\TEMP01.DBF'
SIZE 41943040 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
# End of tempfile additions.
# Set #2. RESETLOGS case
# The following commands will create a new control file and use it
# to open the database.
# The contents of online logs will be lost and all backups will
# be invalidated. Use this only if online logs are damaged.
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "COPY1" RESETLOGS NOARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 'C:\COPY1\COPY1\REDO01.LOG' SIZE 10M,
GROUP 2 'C:\COPY1\COPY1\REDO02.LOG' SIZE 10M,
GROUP 3 'C:\COPY1\COPY1\REDO03.LOG' SIZE 10M
-- STANDBY LOGFILE
DATAFILE
'C:\COPY1\COPY1\SYSTEM01.DBF',
'C:\COPY1\COPY1\UNDOTBS01.DBF',
'C:\COPY1\COPY1\CWMLITE01.DBF',
'C:\COPY1\COPY1\DRSYS01.DBF',
'C:\COPY1\COPY1\EXAMPLE01.DBF',
'C:\COPY1\COPY1\INDX01.DBF',
'C:\COPY1\COPY1\ODM01.DBF',
'C:\COPY1\COPY1\TOOLS01.DBF',
'C:\COPY1\COPY1\USERS01.DBF',
'C:\COPY1\COPY1\XDB01.DBF'
CHARACTER SET WE8ISO8859P1
# Recovery is required if any of the datafiles are restored backups,
# or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
# Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
# Commands to add tempfiles to temporary tablespaces.
# Online tempfiles have complete space information.
# Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\COPY1\COPY1\TEMP01.DBF'
SIZE 41943040 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
# End of tempfile additions.
#As you can see, you have there different ways to recreate the controlfile. In Our case, We are going to recreate the controlfiles so:
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "COPY2" RESETLOGS NOARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 'C:\COPY2\COPY2\REDO01.LOG' SIZE 10M,
GROUP 2 'C:\COPY2\COPY2\REDO02.LOG' SIZE 10M,
GROUP 3 'C:\COPY2\COPY2\REDO03.LOG' SIZE 10M
-- STANDBY LOGFILE
DATAFILE
'C:\COPY2\COPY2\SYSTEM01.DBF',
'C:\COPY2\COPY2\UNDOTBS01.DBF',
'C:\COPY2\COPY2\CWMLITE01.DBF',
'C:\COPY2\COPY2\DRSYS01.DBF',
'C:\COPY2\COPY2\EXAMPLE01.DBF',
'C:\COPY2\COPY2\INDX01.DBF',
'C:\COPY2\COPY2\ODM01.DBF',
'C:\COPY2\COPY2\TOOLS01.DBF',
'C:\COPY2\COPY2\USERS01.DBF',
'C:\COPY2\COPY2\XDB01.DBF'
CHARACTER SET WE8ISO8859P1
Note: two important issues to denote in the sentence above is the word "SET" instead of "REUSE" and the controlfiles must be recreated in RESETLOG mode because the database must be opened in RESETLOG mode.
If you use the word "REUSE" instead of "SET" the opening of the database is going to request recovery of the datafile of the tablespace system.
So, apply this to recreate the controlfiles:
- Start the service in windows for the database COPY2
- Get connection through SQL*Plus as system
- Shut down the database with shutdown abort
- Start the database up in nomount stage
- apply the sentence to recreate the controlfile.
C:\>SET ORACLE_SID=COPY2
C:\>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Thu May 20 16:46:49 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn sys as sysdba
Enter password:
Connected.
SQL>
SQL> shutdown abort
ORACLE instance shut down.
SQL>
SQL>
SQL> startup nomount
ORACLE instance started.
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
SQL>
SQL>
SQL> CREATE CONTROLFILE SET DATABASE "COPY2" RESETLOGS NOARCHIVELOG
2 -- SET STANDBY TO MAXIMIZE PERFORMANCE
3 MAXLOGFILES 50
4 MAXLOGMEMBERS 5
5 MAXDATAFILES 100
6 MAXINSTANCES 1
7 MAXLOGHISTORY 226
8 LOGFILE
9 GROUP 1 'F:\COPY2\COPY2\REDO01.LOG' SIZE 10M,
10 GROUP 2 'F:\COPY2\COPY2\REDO02.LOG' SIZE 10M,
11 GROUP 3 'F:\COPY2\COPY2\REDO03.LOG' SIZE 10M
12 -- STANDBY LOGFILE
13 DATAFILE
14 'F:\COPY2\COPY2\SYSTEM01.DBF',
15 'F:\COPY2\COPY2\UNDOTBS01.DBF',
16 'F:\COPY2\COPY2\CWMLITE01.DBF',
17 'F:\COPY2\COPY2\DRSYS01.DBF',
18 'F:\COPY2\COPY2\EXAMPLE01.DBF',
19 'F:\COPY2\COPY2\INDX01.DBF',
20 'F:\COPY2\COPY2\ODM01.DBF',
21 'F:\COPY2\COPY2\TOOLS01.DBF',
22 'F:\COPY2\COPY2\USERS01.DBF',
23 'F:\COPY2\COPY2\XDB01.DBF'
24 CHARACTER SET WE8ISO8859P1
25 ;
Control file created.
SQL>Joel Pérez
http://otn.oracle.com/experts -
Duplicating a Database with RMAN
Hi,
When Duplicating the database using RMAN,
does it build the auxilary database from the existing rman backups of the target database
or
will it build direcly from the open / mount stage of the target dabase (where there is no concept of rman backups)
Please advice.
Thanks
Naveen.>
When Duplicating the database using RMAN,
does it build the auxilary database from the existing rman backups of the target database
or
will it build direcly from the open / mount stage of the target dabase (where there is no concept of rman backups)
>
That depends on the version- Before 11g, RMAN took a previous created backup to duplicate. In 11g, we introduced the new command
RMAN> duplicate target database *from active database* ;that does it "on the fly" without backup needed.
Kind regards
Uwe
http://uhesse.wordpress.com -
Error Duplicating Target Database
Dear DBA's
RH 4
Oracle 9.2.0.8
When I start duplicating my target database with script below everything goes fine until the recover :
RMAN> run
2> {
3> allocate auxiliary channel ch1 type sbt;
4> set newname for datafile 1 to '/u02/oradata/SIEBDEV/system/system01.dbf';
5> set newname for datafile 2 to '/u02/oradata/SIEBDEV/system/undotbs01.dbf';
6> set newname for datafile 3 to '/u03/oradata/SIEBDEV/index/tbs_igd_index01.dbf';
7> set newname for datafile 4 to '/u01/oradata/SIEBDEV/data/dm_casebase_docbase_01.dbf';
8> set newname for datafile 5 to '/u01/oradata/SIEBDEV/data/dm_imdoc_audit_01.dbf';
9> set newname for datafile 6 to '/u01/oradata/SIEBDEV/data/dm_imdoc_docbase_01.dbf';
10> set newname for datafile 7 to '/u01/oradata/SIEBDEV/data/tbs_siebdw_data_01.dbf';
11> set newname for datafile 8 to '/u01/oradata/SIEBDEV/data/tbs_dwhview_01.dbf';
12> set newname for datafile 9 to '/u01/oradata/SIEBDEV/data/tbs_igd_01.dbf';
13> set newname for datafile 10 to '/u01/oradata/SIEBDEV/data/igd_eim_01.dbf';
14> set newname for datafile 11 to '/u01/oradata/SIEBDEV/data/TBS_SIEBEL_EMPTY.dbf';
15> set newname for datafile 12 to '/u01/oradata/SIEBDEV/data/tbs_siebel_data_01.dbf';
16> set newname for datafile 13 to '/u01/oradata/SIEBDEV/data/tools_01.dbf';
17> set newname for datafile 14 to '/u01/oradata/SIEBDEV/data/users_01.dbf';
18> set newname for datafile 15 to '/u01/oradata/SIEBDEV/data/perfstat_01.dbf';
19> set newname for datafile 16 to '/u03/oradata/SIEBDEV/index/tbs_siebdw_index_01.dbf';
20> set newname for datafile 17 to '/u03/oradata/SIEBDEV/index/tbs_siebbig_index01.dbf';
21> set newname for datafile 18 to '/u03/oradata/SIEBDEV/index/dm_casebase_index_01.dbf';
22> set newname for datafile 19 to '/u03/oradata/SIEBDEV/index/dm_imdoc_index_01.dbf';
23> set newname for datafile 20 to '/u03/oradata/SIEBDEV/index/tbs_siebel_index_01.dbf';
24> set newname for datafile 21 to '/u01/oradata/SIEBDEV/data/dm_casebase_audit_01.dbf';
25> set newname for datafile 22 to '/u01/oradata/SIEBDEV/data/tbs_siebview_01.dbf';
26> set newname for datafile 23 to '/u01/oradata/SIEBDEV/data/invoice_app_data01.dbf';
27> set newname for datafile 24 to '/u03/oradata/SIEBDEV/index/tbs_invoice_index01.dbf';
28> DUPLICATE TARGET DATABASE TO SIEBDEV
29> NOFILENAMECHECK
30> PFILE = $ORACLE_BASE/admin/SIEBDEV/initSIEBDEV.ora
31> LOGFILE GROUP 1 ('/u01/oradata/SIEBDEV/rdo/sibdevredog1m1.log',
32> '/u02/oradata/SIEBDEV/rdo/sibdevredog1m2.log',
33> '/u03/oradata/SIEBDEV/rdo/sibdevredog1m3.log') SIZE 104857600,
34> GROUP 2 ('/u01/oradata/SIEBDEV/rdo/sibdevredog2m1.log',
35> '/u02/oradata/SIEBDEV/rdo/sibdevredog2m2.log',
36> '/u03/oradata/SIEBDEV/rdo/sibdevredog2m3.log') SIZE 104857600,
37> GROUP 3 ('/u01/oradata/SIEBDEV/rdo/sibdevredog3m1.log',
38> '/u02/oradata/SIEBDEV/rdo/sibdevredog3m2.log',
39> '/u03/oradata/SIEBDEV/rdo/sibdevredog3m3.log') SIZE 104857600;
40> }
executing command: SET until clause
Starting recover at 20-APR-10
starting media recovery
archive log thread 1 sequence 19 is already on disk as file /u03/archive/SIEBTEST/SIEBTEST_19.arc
archive log thread 1 sequence 20 is already on disk as file /u03/archive/SIEBTEST/SIEBTEST_20.arc
archive log thread 1 sequence 21 is already on disk as file /u03/archive/SIEBTEST/SIEBTEST_21.arc
channel ch1: starting archive log restore to default destination
Finished recover at 20-APR-10
printing stored script: Memory Script
shutdown clone;
startup clone nomount pfile= '$ORACLE_BASE/admin/SIEBDEV/initSIEBDEV.ora';
executing script: Memory Script
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 3410991136 bytes
Fixed Size 747552 bytes
Variable Size 1040187392 bytes
Database Buffers 2348810240 bytes
Redo Buffers 21245952 bytes
input datafilecopy recid=23 stamp=716818426 filename=/u03/oradata/SIEBDEV/index/tbs_invoice_index01.dbf
printing stored script: Memory Script
Alter clone database open resetlogs;
executing script: Memory Script
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
RMAN-10039: error encountered while polling for RPC completion on channel clone_default
RMAN-10006: error running SQL statement: select act from x$ksusex where sid=:1 and serial=:2
RMAN-10002: ORACLE error: ORA-03113: end-of-file on communication channel
RMAN-03002: failure of Duplicate Db command at 04/20/2010 12:13:53
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database:
ORA-01092: ORACLE instance terminated. Disconnection forced
I don't understand what is wrong?
When I check the Alert.log it shows the tablespace UNDOTBS1 doesn't exist !!!!!!!
Tue Apr 20 12:13:51 2010
SMON: enabling cache recovery
Tue Apr 20 12:13:52 2010
Errors in file /u01/app/oracle/admin/SIEBDEV/udump/siebdev_ora_14220.trc:
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Tue Apr 20 12:13:52 2010
Error 30012 happened during db open, shutting down database
USER: terminating instance due to error 30012
Instance terminated by USER, pid = 14220
ORA-1092 signalled during: alter database open resetlogs...
Please Help...
This dupliaction took me 1 week and crashed me the Test Databases.
Thxs if you can Help.
Bests CarlosBut The UNDOTBS1 is in the ispfile
SQL> startup mount
ORACLE instance started.
Total System Global Area 3410991136 bytes
Fixed Size 747552 bytes
Variable Size 1040187392 bytes
Database Buffers 2348810240 bytes
Redo Buffers 21245952 bytes
Database mounted.
SQL> show parameters undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 18000
undo_suppress_errors boolean TRUE
undo_tablespace string UNDOTBS1
SQL>
SQL>
SQL> select INSTANCE_NAME,STATUS,DATABASE_STATUS,INSTANCE_ROLE from v$instance;
INSTANCE_NAME STATUS DATABASE_STATUS INSTANCE_ROLE
SIEBDEV MOUNTED ACTIVE PRIMARY_INSTANCE
SQL> select NAME,CREATED,OPEN_MODE,ACTIVATION# from v$database;
NAME CREATED OPEN_MODE ACTIVATION#
SIEBDEV 20-APR-10 MOUNTED 2834443258
SQL> r
1* select FILE#,STATUS,ENABLED,NAME from v$datafile
FILE# STATUS ENABLED NAME
1 SYSTEM DISABLED /u02/oradata/SIEBDEV/system/system01.dbf
2 ONLINE DISABLED /u02/oradata/SIEBDEV/system/undotbs01.dbf
3 ONLINE DISABLED /u03/oradata/SIEBDEV/index/tbs_igd_index01.dbf
4 ONLINE DISABLED /u01/oradata/SIEBDEV/data/dm_casebase_docbase_01.dbf
5 ONLINE DISABLED /u01/oradata/SIEBDEV/data/dm_imdoc_audit_01.dbf
6 ONLINE DISABLED /u01/oradata/SIEBDEV/data/dm_imdoc_docbase_01.dbf
7 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tbs_siebdw_data_01.dbf
8 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tbs_dwhview_01.dbf
9 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tbs_igd_01.dbf
10 ONLINE DISABLED /u01/oradata/SIEBDEV/data/igd_eim_01.dbf
11 ONLINE DISABLED /u01/oradata/SIEBDEV/data/TBS_SIEBEL_EMPTY.dbf
FILE# STATUS ENABLED NAME
12 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tbs_siebel_data_01.dbf
13 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tools_01.dbf
14 ONLINE DISABLED /u01/oradata/SIEBDEV/data/users_01.dbf
15 ONLINE DISABLED /u01/oradata/SIEBDEV/data/perfstat_01.dbf
16 ONLINE DISABLED /u03/oradata/SIEBDEV/index/tbs_siebdw_index_01.dbf
17 ONLINE DISABLED /u03/oradata/SIEBDEV/index/tbs_siebbig_index01.dbf
18 ONLINE DISABLED /u03/oradata/SIEBDEV/index/dm_casebase_index_01.dbf
19 ONLINE DISABLED /u03/oradata/SIEBDEV/index/dm_imdoc_index_01.dbf
20 ONLINE DISABLED /u03/oradata/SIEBDEV/index/tbs_siebel_index_01.dbf
21 ONLINE DISABLED /u01/oradata/SIEBDEV/data/dm_casebase_audit_01.dbf
22 ONLINE DISABLED /u01/oradata/SIEBDEV/data/tbs_siebview_01.dbf
FILE# STATUS ENABLED NAME
23 ONLINE DISABLED /u01/oradata/SIEBDEV/data/invoice_app_data01.dbf
24 ONLINE DISABLED /u03/oradata/SIEBDEV/index/tbs_invoice_index01.dbf
As you can see datafiles are there.
I don't get why the recover Fails.
Any clues?
thxs -
Error while duplicating a Database
Hi,
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
OS:Solaris10.
I am trying to create a replica of one of my Production DB for test envoirment...
The steps I followed are....
sql>connect /as sysdba
sql>alter system enable restricted session;
sql>alter database backup controlfile to trace;
Shutting down the Primary Instance....
sql>shutdown immediate
Moving the Datafiles and Logfiles to the respective Partitions of the New Test Database
Moving the init<oracle_sid>.ora files to new DB partition
Connecting to the sqlplus in the newdb and executing the create database execution script...
Now the Test Database is created and is in mounted Mode
SQL> select open_mode from v$database;
OPEN_MODE
MOUNTED
Now when I am trying to open the Database with Resetlogs option its showing me the Following Error........
sql> alter database open resetlogs;
alter database open
ERROR at line 1:
ORA-01190: control file or data file 5 is from before the last RESETLOGS
ORA-01110: data file 5: '/u09/oradata/nnm8i/indx01.dbf'
How to recover from this error...........
Any Help Appreciated.........
Regards,
Prosenjit Mukherjee.
Edited by: Prosenjit on Nov 9, 2008 5:49 PMWell I issued the ...*Recover Database* Command..
I got some input regarding this error from this particular Thomas Kyte Thread thread...
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:318216852435
Regards,
Prosenjit Mukherjee -
Error while Duplicating the Database
Hi All;
I am trying to duplicate a database and when run this command I get the below error....
RMAN> duplicate target database to rmdupl1 nofilenamecheck;
Starting Duplicate Db at 26-NOV-07
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=11 devtype=DISK
printing stored script: Memory Script
set until scn 53262;
set newname for datafile 1 to
"C:\ORACLE\ADMIN\PROD\DATAFILE\SYSTEM01.DBF";
set newname for datafile 2 to
"C:\ORACLE\ADMIN\PROD\DATAFILE\UNDOTBS.DBF";
restore
check readonly
clone database
executing script: Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 26-NOV-07
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to C:\ORACLE\ADMIN\PROD\DATAFILE\SYSTEM01.DBF
restoring datafile 00002 to C:\ORACLE\ADMIN\PROD\DATAFILE\UNDOTBS.DBF
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/26/2007 07:09:44
RMAN-03015: error occurred in stored script Memory Script
ORA-19504: failed to create file "C:\ORACLE\ADMIN\PROD\DATAFILE\SYSTEM01.DBF"
ORA-27086: skgfglk: unable to lock file - already in use
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.
RMAN>I think Peter is right. You are probably erroneously attempting to overwrite the original, source database.
See: rman duplicate command fails?
Virtually the same error message! -
Duplicating a Database using RMAN
Hi All,
RMAN> run {
2> allocate auxiliary channel ch1 type disk;
3> duplicate target database to aux;
4> }
using target database control file instead of recovery catalog
allocated channel: ch1
channel ch1: sid=157 devtype=DISK
Starting Duplicate Db at 04-NOV-09
contents of Memory Script:
set until scn 502618;
set newname for datafile 1 to
"/home/10g/oracle/product/10.2.0/oradata/aux/system01.dbf";
set newname for datafile 2 to
"/home/10g/oracle/product/10.2.0/oradata/aux/undotbs01.dbf";
set newname for datafile 3 to
"/home/10g/oracle/product/10.2.0/oradata/aux/sysaux01.dbf";
set newname for datafile 4 to
"/home/10g/oracle/product/10.2.0/oradata/aux/users01.dbf";
set newname for datafile 5 to
"/home/10g/oracle/product/10.2.0/oradata/aux/example01.dbf";
restore
check readonly
clone database
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 04-NOV-09
released channel: ch1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/04/2009 14:04:20
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
Please can any 1 help me out.NBOSS wrote:
released channel: ch1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/04/2009 14:04:20
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
Please can any 1 help me out.As you're using 10g Release, it means that you need to copy backup files to auxiliary destination
If you use 11g, you shouldn't do it. In 11g, you can even duplicate database without taking any backup -
Duplicating a database restored to disk instead of ASM
Hello, I have the primary database, a RAC and it has all the archivers on ASM. When I do a duplicate command, archivers are restored to $ORACLE_HOME/dbs
datafile 20 switched to datafile copy
input datafile copy RECID=26 STAMP=778627959 file name=+DGDATELO/elo_stby/datafile/pki_idx.270.778627255
datafile 21 switched to datafile copy
input datafile copy RECID=27 STAMP=778627959 file name=+DGDATELO/elo_stby/datafile/tnf_locanales.274.778626923
datafile 22 switched to datafile copy
input datafile copy RECID=28 STAMP=778627959 file name=+DGDATELO/elo_stby/datafile/idx1.271.778627219
datafile 23 switched to datafile copy
input datafile copy RECID=29 STAMP=778627959 file name=+DGDATELO/elo_stby/datafile/monitorizacion.313.778627547
datafile 24 switched to datafile copy
input datafile copy RECID=30 STAMP=778627959 file name=+DGDATELO/elo_stby/datafile/users.312.778627555
contents of Memory Script:
set until scn 6561078671424;
recover
standby
clone database
delete archivelog
executing Memory Script
executing command: SET until clause
Starting recover at 22-MAR-12
starting media recovery
archived log for thread 1 with sequence 72 is already on disk as file /opt/oracle/soft/elo_stby/11.2.0/db_1/dbs/arch1_72_777745261.arc
archived log for thread 2 with sequence 70 is already on disk as file /opt/oracle/soft/elo_stby/11.2.0/db_1/dbs/arch2_70_777745261.arc
archived log file name=/opt/oracle/soft/elo_stby/11.2.0/db_1/dbs/arch1_72_777745261.arc thread=1 sequence=72
archived log file name=/opt/oracle/soft/elo_stby/11.2.0/db_1/dbs/arch2_70_777745261.arc thread=2 sequence=70
media recovery complete, elapsed time: 00:00:01
Finished recover at 22-MAR-12
Finished Duplicate Db at 22-MAR-12
released channel: prmy1
released channel: prmy2
released channel: prmy3
released channel: prmy4
released channel: stbyHow can I make them get restored to the FRA ASM?This is the init used to mount the database, before the duplicate
ELO_2.__db_cache_size=1744830464
ELO_1.__db_cache_size=1795162112
ELO_2.__java_pool_size=16777216
ELO_1.__java_pool_size=16777216
ELO_2.__large_pool_size=16777216
ELO_1.__large_pool_size=16777216
ELO_1.__oracle_base='/opt/oracle/soft/elo_stby'#ORACLE_BASE set from environment
ELO_2.__oracle_base='/opt/oracle/soft/elo_stby'#ORACLE_BASE set from environment
ELO_2.__pga_aggregate_target=1728053248
ELO_1.__pga_aggregate_target=1728053248
ELO_2.__sga_target=2566914048
ELO_1.__sga_target=2566914048
ELO_2.__shared_io_pool_size=0
ELO_1.__shared_io_pool_size=0
ELO_2.__shared_pool_size=754974720
ELO_1.__shared_pool_size=704643072
ELO_2.__streams_pool_size=0
ELO_1.__streams_pool_size=0
*.audit_file_dest='/opt/oracle/soft/elo/admin/elo/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DGDATELO/elo_stby/controlfile/current.278.778408803','+DGFRAELO/elo_stby/controlfile/current.276.778408803'#Set by RMAN
*.db_block_size=8192
*.db_create_file_dest='+DGDATELO'
*.db_domain=''
*.db_name='elo'
*.db_recovery_file_dest='+DGFRAELO'
*.db_recovery_file_dest_size=48330964992
*.db_unique_name='ELO_STBY'#Is standby
*.diagnostic_dest='/opt/oracle/soft/elo'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=eloXDB)'
*.fal_server='ELO'#Is primary
*.log_archive_config='DG_CONFIG=(ELO,ELO_STBY)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ELO_STBY'
*.log_archive_dest_2='SERVICE=ELO ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ELO'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=30
*.memory_target=4294967296
*.open_cursors=1000
*.processes=1024
*.remote_listener='scan-cludbr02.ca.es:1556'
*.remote_login_passwordfile='exclusive'
*.standby_file_management='AUTO' -
Duplicating a database using FRA
Hello,
I'm trying to duplicate a database using a backupset stored in FRA.
However, I thought rman would go take the most recently backupset that I'd backed up but isn't what's happening.
It's trying read backup piece from tape and this is what I don't want to.
How can I do to rman read backupset stored in FRA ?
Here a excerpt from script I'm using:
[oracle@oradell01 scripts]$ rman target / rcvcat rman10g_pd01@sf01 auxiliary sys@bpd01
Recovery Manager: Release 10.2.0.4.0 - Production on Seg Fev 8 09:41:41 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PD01 (DBID=4238933412)
recovery catalog database Password:
connected to recovery catalog database
auxiliary database Password:
connected to auxiliary database: BPD01 (not mounted)
RMAN>
run {
allocate auxiliary channel c1 type sbt;
set newname for datafile 1 to '+DG1/bpd01/datafile/system.441.699983113';
set newname for datafile 2 to '+DG1/bpd01/datafile/undotbs1.442.699983125';
set newname for datafile 3 to '+DG1/bpd01/datafile/sysaux.443.699983133';
set newname for datafile 4 to '+DG1/bpd01/datafile/users.432.699983141';
set newname for datafile 5 to '+DG1/bpd01/datafile/drsys.430.699985041';
set newname for datafile 6 to '+DG1/bpd01/datafile/ifsdados.428.699985051';
set newname for datafile 7 to '+DG1/bpd01/datafile/ifsindex.429.699985179';
set newname for datafile 8 to '+DG1/bpd01/datafile/pergaindex.427.699985261';
set newname for datafile 9 to '+DG1/bpd01/datafile/pergamarc.426.699985397';
duplicate target database to bpd01
logfile
group 1 ('+DG1/bpd01/onlinelog/redo01a.log','+DG1/bpd01/onlinelog/redo01b.log') size 50m reuse,
group 2 ('+DG1/bpd01/onlinelog/redo02a.log','+DG1/bpd01/onlinelog/redo02b.log') size 50m reuse;
Thank you very much
Marcelo SinniIt's trying read backup piece from tape and this is what I don't want to.That's because you allocate manually a tape channel inside the RUN block:
allocate auxiliary channel c1 type sbt;For Duplicate use the same settings you used for the backup to the FRA.
Werner -
Duplicating a database for tests
I need to be able to re-create the same database, with the same content of datafiles, to conduct several stress tests. Is it possible to just back-up the entire Oracle Home directory, do the first series of tests, and then restore the entire directory to go back to the initial state?
As this seems unlikely, what would be the best approach to quickly "reset" the database to its initial physical state? For instance, if the datafiles got extended because of the large amount of data loaded in the first test, the next test should start with the initial configuration of everything.Actually, it doesn't seem to work. First, I had to shutdown the database to be able to move the datafiles directory. I was able then to replace this directory and startup the database. But there is an error that prevents me from logging in again:
Agent Connection to Instance
Status Failed
Details ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)
The listener status is UP, only the agent connection to instance is down. As I am not able to connect, I cannot restart the database.
Fortunately, I can fix it be putting back the original datafiles directory.
Is there a step that I am missing, which would enable me to swap directories? -
Duplicating a database - metadata only
Hi
I want to create an automated script that will run weekly and will duplicate our production database but WITHOUT data
I know there are several ways to do it - but they are quite combersome
I would like to be able to change the datafile path ( similar to the convert we have in RMAN duplicate )
Is there an elegant way this can be done ?
or am I destined to the import datapump option ?
We are running Oracle 10.2.0.4 Sun Solaris
Thanks
OrnaOrna Weisman wrote:
Hi
I want to create an automated script that will run weekly and will duplicate our production database but WITHOUT data
I know there are several ways to do it - but they are quite combersome
I would like to be able to change the datafile path ( similar to the convert we have in RMAN duplicate )
Is there an elegant way this can be done ?
or am I destined to the import datapump option ?
We are running Oracle 10.2.0.4 Sun Solaris
Thanks
OrnaHi Orna
As it was said above, it's impossible to duplicate only metadata of database using RMAN
You have two choices:
- Using Data Pump, backup only structure of objects of your database
- Write an automatic script which generates bulk of scripts using DBMS_METADATA package
P.S. The first is simplest and suggested -
Errors during duplicating database.
Hello,
I'm duplicating my database (using RMAN) and I get the following error:
contents of Memory Script:
shutdown clone;
startup clone nomount;
executing Memory Script
database dismounted
Oracle instance shut down
RMAN-00571(...)
RMAN-04006:error from auxiliary database: ORA-12514: TNS: listener doesn not currently know of service requested in connect descriptor.
It's 10.2 database on Linux. Auxiliary database is named 'aux'
Tnsnames.ora and listener.ora seems to be ok, since I could connect to this instance (while it was in nomount state, before duplicating in RMAN) using
sqlplus sys/***@aux as sysdba
After I got the error I connected to aux using Bequeath, and checked it's status. It is shutdown since I got the error:
ORA-01034: ORACLE not available.
What can I do?
Thx. in advance
Aliq.On 9i, Oracle registers itself with the database when the database is opened.
This means in any other state you need to use SID= in your tnsnames.ora.
From your post it looks like this still applies to 10g.
I would try changing my tnsnames.ora.
You could of course, immediately after receiving the error, run lsnrctl services and check whether the service_name of the aux database is listed.
Sybrand Bakker
Senior Oracle DBA -
How to get the last SCN number from catalog database
Hi All,
I have a catalog database where my PROD database is registered. Evereyday at 12AM rman takes the hot backup of PROD.
Now I want to create a auxillary database using the last RMAN backup, for this I want to restore using the SCN from the catalog views.
Please help me to get the SCN number from the RC_ views.
Regards,
Bikramasifkabirdba wrote:
Current SCN:
Use the dbms_flashback package to get the current SCN. This value will be used during instantiation at the destination site, as well as by RMAN when duplicating the database.
SET SERVEROUTPUT ON
DECLARE
until_scn NUMBER;
BEGIN
until_scn:=
DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER;
DBMS_OUTPUT.PUT_LINE('Until SCN: ' || until_scn);
END;
Regards
Asif KabirHello,
i am a bit confused,
SELECT CURRENT_SCN FROM V$DATABASE;
6272671324
and from your package
SET SERVEROUTPUT ON
DECLARE
until_scn NUMBER;
BEGIN
until_scn:=
DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER;
DBMS_OUTPUT.PUT_LINE('Until SCN: ' || until_scn);
END;Until SCN: 6272671267
why are they different, and why first result is lower than yours? can you explain please, thank you
Ugur MIHCI -
How do i create a database template from the command line?
Hi,
As part of implementing a backup and recovery strategy for a client (including disaster recovery) I want to automate the creation of a database template From an Existing Database (Structure as well as data) via a script that will run every night.
The background to this is that we will also be using RMAN to take backups of the database concerned but the client does not want to wait while an RMAN backup is restored and so wants an additional level of insurance in the form of a ‘standby’ clone database.
The idea is that nightly we will run a script that creates a database template from the Existing Database (Structure as well as data) and then transfers the 2 files involved e.g. DB_data_included.dbc and DB_data_included.DFB across to a standby server where they can be used to recreate the database in the event of us needing to after e.g. a complete server failure.
So I have a couple of questions about this that I would be very grateful if something could answer for me:
1) Is it possible? That is, can a database template be created from some utility by supplying a series of parameter=value pairs on the command line?
2) If yes how do I go about it, what utility do I use (the emca utility?). and what parameters do I need to supply on the command line to create the template?
3) The intention is that the script to create the template will run in the early hours of the morning when no-one is using the database but what state does the database need to be in when the template creation script runs i.e. up, down, mounted and does the creation of a template affect the state of an already up database i.e. if I kick off the template creation script and the database is up will it switch it into mount mode or anything like that? My concern here is that I want to make sure I understand exactly what is going on so that no users or connected external systems are affected?
Thanks in anticipation of someone being able to guide me on what to do or what documentation to read.
Also if you require any clarification on what i'm asking please post up your query and i'll respond ASAP.
Kind Regards,
George Johnston
OCP 9i DBASybrandb,
Firstly thanks for you reponse.
However, I don’t agree that dbca only creates empty databases otherwise why does the option to create a template from an existing database (structure as well as data) exist in the dbca wizard?
I have performed a test case where I have a created a database template including data on one 10g server. I have then used the files generated to recreate that database on a separate server. When the new database is started it is an exact copy of the original. So it’s not empty at all , it’s exactly what the client wants.
So I don’t agree that I’m gaining zero.
Why is this approach doomed to fail?
There a number of reasons why I “just set up a proper standby database”
1. Time – I’m on a customer site in a tight engagement where the customer wants maximum value for money. I don’t have standby database skills and the customer isn’t willing to pay for me to learn on the job so please understand the tight circumstances I’m working in.
2. Availability – As far as I know the client is running 10.2.0.3.0 standard edition. Correct me if I’m wrong but is standby db available in that edition. Where do I look to check V$OPTION.
On the RMAN duplicating a database front it’s an area I haven’t used before but I will take a look at it.
Also please revisit the context of my original posting where I state
The background to this is that we will also be using RMAN to take backups of the database concerned but the client does not want to wait while an RMAN backup is restored and so wants an additional level of insurance in the form of a ‘standby’ clone database.
So please understand that this a quick fix that the client wants developed in the minimum time possible in ADDITION to a full nightly RMAN backup being taken.
In an ideal world I’d have the time to follow best practice but in the real world of on-site customer support I just need to get the job done operating under the customer imposed constraints.
Many Thanks,
George Johnston
OCP 9i DBA -
Hi all,
Can any one tell me how to clone oracle 9i database. I am new in DBA post plz help me. Or plz give me any document ID in metalink.You could use RMAN to clone a database:
Steps for Creating Duplicate Database using Rman:
• Create an Oracle Password file for the Auxiliary (Duplicate) db.
• Create an entry for the duplicate db in listener.ora & tnsnames.ora
• Create an Initialization file for the Duplicate db & modify the following parameters:
DB_FILE_NAME_CONVERT='/u01/oradata','/u01/oradata1/' [ specify primary db dbf location & duplicate db dbf location ]
LOG_FILE_NAME_CONVERT='/u02/oradata/','/u02/oradata1/' [ specify primary db redolog location & duplicate db redolog location] CONTROL_FILES=(/dup/oracle/oradata/trgt/control01.ctl)
• Create spfile for the duplicate db
• Startup nomount - - - duplicate db
• Mount or open the primary db
• Take a backup of primary db including archivelogs using rman
• Duplicating a Database on a Remote Host with the Same Directory Structure: rman catalog=rman/17rman05@t920_ant target=/ auxiliary=sys/dbsys@dupdb
run { DUPLICATE TARGET DATABASE TO dupdb NOFILENAMECHECK; }
• Duplicating a Database on a Remote Host with the Different Directory Structure: DUPLICATE TARGET DATABASE TO dupdb
Maybe you are looking for
-
How to display a folder with files in an apex page
Hi, Is there a way to display a folder with the files uploaded by me and also i should be able to add new folder in the page.Is it possible??? Thanks in Advance, Balaji.
-
Java.lang.NullPointerException with OracleXMLParser V2
Hi, I am getting java.lang.NullPointerException with OracleXMLParser V2. Following is some of the code snippet. I am not sure where I am going wrong. I am using the SAXParser. I tried both FileReader as well as URL InputSources But I am getting the s
-
My nokia 500 gets off on starting it
on starting my phone nokia 500 it gets off. i tried it even with different battery but still the problrm persists. my phone runs nokia belle refresh. suggest some measures.
-
Hello All, how can we display the label of the drives in the system? we could get the list of drives available in the system using File.listRoots(), but it returns drives as A:\ , c:\ etc. i'm looking for an option to display the labels of each
-
T2000 drops to ok during OS install
This has been seen in two separate sites to my knowledge. While setting up the OS on brand new T2000's, a laptop attached to the serial management port as console goes into its screensaver. When the laptop is brought out of the screensaver back to it