Creating a test database from backups of the production
Hello Experts,
I am a newbie with very much new in Oracle. I have been provided with the inc0 backup(which comprises even the controlfile backup) of the production database (PROD) taken through RMAN and asked to create a new test database (TEST) using the backup. Can anyone please provide me the steps on how to restore it and create the new database ?
Database version 10.2.0.4
I am aware of duplicate database concept using RMAN, but I have been asked to not to connect to the target (PROD) database while duplicating. So, I need to create the test database by using the backup of prod database without connecting to PROD database. Please guide me.
Refer
http://arjudba.blogspot.in/2008/05/restore-and-recover-database-to-new.html
RMAN restore database from another backup of different database name
When you are restoring using the backup of the production database, the db_name would be same on the auxiliary database. Once you restore and recover the database in your test server, you can change the db_name from prod to test by recreating the controlfile
Similar Messages
-
Create test database from standby without some data
Hi. I want to create test database from my standby database using rman.
But i have some some tables and where information is too large i dont want backup all data from this tables. because i dont have enough space on my test server.
Have u any idea for solution this problem.
ThanksBut have suggestion.
You can create duplicate database on based your target database (to new host) and skip undesired tablespaces...
bash# rman target /
RMAN> ....
your code should be like :
run {
allocate auxiliary channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=my,OB2BARLIST=MY DAILY)';
allocate auxiliary channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=my,OB2BARLIST=MY DAILY)';
allocate auxiliary channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=my,OB2BARLIST=MY DAILY)';
allocate auxiliary channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=my,OB2BARLIST=MY DAILY)';
SET UNTIL SCN 7769764681915;
DUPLICATE TARGET DATABASE TO MYTS SKIP TABLESPACE TOOLS_IDX,TOOLS,ARCHIVE,IDX;
Edited by: Ulfet Tanriverdiyev on Dec 21, 2010 3:42 AM -
Creating a duplicated database from active database
I'm having problem trying to duplicate a database from a target database (PROD) to the auxiliary one (AUX).
This is what I've configured:
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = PROD)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1/)
(SID_NAME = PROD)
(SID_DESC =
(GLOBAL_DBNAME = AUX)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1/)
(SID_NAME = AUX)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_ip)(PORT = 1521))
ADR_BASE_LISTENER = /u01/app/oracletnsnames.ora
AUX =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = my_ip)(PORT = 1521)))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = AUX)
PROD =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = my_ip)(PORT = 1521)))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)/u01/app/oracle/product/11.2.0/db_1/dbs/initAUX.ora
db_name='AUX'
cp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwPROD /u01/app/oracle/product/11.2.0/db_1/dbs/orapwAUX- Started PROD database (open and in archive log mode)
- Started AUX database (in nomount mode and usinf pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initAUX.ora')
But when I issue the following command I get connected to auxiliary database (not started) :
rman target sys/oracle@PROD auxiliary sys/oracle@AUX
connected to target database: PROD (DBID=196032563)
connected to auxiliary database (not started)And executing the duplicate command it returns:
RMAN> duplicate target database to AUX from active database spfile parameter_value_convert '/DATA/PROD/','+DG_DATA_AUX' set db_create_file_dest='+DG_DATA_AUX';
Starting Duplicate Db at 2010-09-28:13:36:50
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/28/2010 13:36:50
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directorylsnrctl stopped and restarted several times. This is the output of lsnrctl status command:
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-SEP-2010 13:45:14
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=my_ip)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 28-SEP-2010 12:44:50
Uptime 0 days 0 hr. 1 min. 22 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/my_ip/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=my_ip)(PORT=1521)))
Services Summary...
Service "PROD" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
Service "PRODXDB" has 1 instance(s).
Instance "PROD", status READY, has 1 handler(s) for this service...
Service "AUX" has 2 instance(s).
Instance "AUX", status UNKNOWN, has 1 handler(s) for this service...
Instance "AUX", status BLOCKED, has 1 handler(s) for this service...
The command completed successfullyI have already created a duplicated database from a backup of the target one and the configuration was quite the same: the differences are that using active database duplication I needed to use orapw files (and they need to have the same password) and that I needed to connect using Oracle Net service name to connect to the auxiliary instance.. otherwise I got:
export ORACLE_SID=AUX
rman target sys/oracle@PROD auxiliary sys/oracle
connected to target database: PROD (DBID=196032563)
connected to auxiliary database: AUX (not mounted)
RMAN> duplicate target database to AUX from active database spfile parameter_value_convert '/DATA/PROD/','+DG_DATA_AUX' set db_create_file_dest='+DG_DATA_AUX';
Starting Duplicate Db at 2010-09-28:12:27:21
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/28/2010 12:27:21
RMAN-06217: not connected to auxiliary database with a net service nameWhere am I wrong?Thanks for your support. My instance was and is still in nomount mode. But I'm not able to connect this instance as auxiliary and in the right expected mode:
connected to auxiliary database: AUX (not mounted)
[oracle@my_ip oracle]$ env|grep SID
ORACLE_SID=AUX
[oracle@my_ip oracle]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 29 10:28:44 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
idle> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
idle> startup nomount pfile=/u01/app/oracle/product/11.2.0/db_1/dbs/initAUX.ora
ORACLE instance started.
Total System Global Area 217157632 bytes
Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes -
How to clone database from backup without access to original DB
I want to create a new database from existing backup files and rolling forward some of the archivelogs (preferably with a new name and with different directory layout).
How can I achieve the task on a separate test server (without access to the original database)? I found a lot of sources ( e.g. http://www.oracle-base.com/articles/11g/DuplicateDatabaseUsingRMAN_11gR2.php ) but all with connection to original DB (e.g. entries in tnsanmes.ora)
Backup runs a simple
BACKUP DATABASE PLUS ARCHIVELOG;
DB Version is 11.2.0.2 on Linux.Many thanks to your help. Finally I was able to restore the DB. The steps I used (similiarly also mentioned in some of the links above).
1.) Copy backup (backupset, autobackup, archivelog) to the new server into directories
/export/restore/autobackup/2012_03_01
/export/restore/autobackup/2012_03_02
/export/restore/archivelog/2012_03_01
/export/restore/backupset/2012_03_01
2.) create pfile initDBREST.ora
DB_NAME=DBREST
3.) Mount DB
ORACLE_SID=DBREST; export ORACLE_SID
sqlplus / as sysdba
STARTUP NOMOUNT;
4.) Connect to auxiliary DB
ORACLE_SID=DBREST; export ORACLE_SID
rman AUXILIARY /
5.) Create directories for new DB for datafiles in e.g. /export/oradata/DBREST/
6.) Duplicate DB and reset parameter if necessary (e.g. memory_max as test server is lower on RAM)
DUPLICATE DATABASE TO DBREST
until time "to_date('02.03.2012 15:00:00','DD.MM.YYYY hh24:mi:ss')"
DB_FILE_NAME_CONVERT '/export/fs1/oradata/oldDB/','/export/oradata/DBREST/', '/export/fs2/oradata/oldDB/','/export/oradata/DBREST/'
SPFILE
SET MEMORY_TARGET '2G'
SET MEMORY_MAX_TARGET '2G'
SET db_recovery_file_dest '/export/oradata/'
SET db_recovery_file_dest_size '100G'
BACKUP LOCATION '/export/restore'
NOFILENAMECHECK;
7.) create temporary tablespace -
Creating a .jpg image from with in the J2ME app
Hi,
I want to send a document to the printer over bluetooth to print.
For that I searched on net, but couldn't find any APIs supported by J2ME to print it. I also found a link http://www.hcilab.org/documents/tutorials/Brother/ where I found that I can send the data by creating an image and then writing data (text or image ) in to it, and then sending that image to print.
Image img = Image.createImage(816, 40);
Graphics g = img.getGraphics();
g.setColor(0, 0, 0);
g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD,Font.SIZE_LARGE));
g.drawString("Printing test from "
+ System.getProperty("microedition.platform") + " on "
+ new Date(), 10, 10, 0);
driver.print(img, btAddr);This code is working fine on this printer.
I am using HP 460cb printer, and I tried the same thing, but am not getting any results. Can any one of you tell me what mistake am I making.
Image blankImage = Image.createImage(SpotBilling.MAX_IMG_WIDTH, SpotBilling.MAX_IMG_HEIGHT);
Graphics g = blankImage.getGraphics();
g.setColor(0,0,0);
g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_SMALL));
g.drawString("Printing test on Wednesday - 18th Jan, 2006", 10, 50, Graphics.TOP|Graphics.LEFT);
g.drawImage(imgTest, 60, 150, Graphics.HCENTER | Graphics.VCENTER);
int width = blankImage.getWidth();
int height = blankImage.getHeight();
int y = 0;
os.write(CMD_UNIVERSAL_EXIT);
for(int i = 1; i<=height; i++){
blankImage.getRGB(temp, 0, width, 0, y, width, 1);
byte[] pixels = new byte[width];
for (int x = 0; x < temp.length; x++) {
pixels[x] = (byte) ((((temp[x] & 0x00FF0000) >> 16)
+ ((temp[x] & 0x0000FF00) >> 8) + (temp[x] & 0x000000FF)) / 3);
// Transfer Raster Graphics
os.write(TRANSFER_RASTER_DATA);
byte[] len = numToDecimal(pixels.length);
os.write(len);
os.write(DATA);
os.write(pixels);
y++;
}I have another query, if I can not do this. Is there any way I can create a .jpg image from with in the J2ME application.
I have some text and an image that I get by invoking camera from the code and then capturing a picture. I need to combine them both, and then send it to the printer.
If there is any way, I can convert this blankImage mentioned above (containing both text and Image), please provide me the solution.
Any document or any source code is appreciated.
regards,
AshishI have succeeded in creating a mutable image that contains text and image (.png), through
Image img;
img = Image.createImage(50, 60);
protected void paint(Graphics g){
g.drawImage(img, getWidth()/2, getHeight()/2, Graphics.HCENTER | Graphics.VCENTER);
Graphics graph = img.getGraphics();
graph.setColor(0, 0, 0);
graph.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD,
Font.SIZE_LARGE));
graph.drawString("Printing test from "
+ System.getProperty("microedition.platform") + " on ", 10, 10, 0);
graph.drawImage(image, img.getWidth()/2, img.getHeight()/2,Graphics.HCENTER|Graphics.VCENTER);
graph.fillArc(0,0,10,10,0, 360);
}Now I want to create a .jpg image of this img image(Mutable image).
What I am doing is that,
1. I am converting this image in to int array, using getRGB() method.
2. Then I am converting int array in to byte array.
3. And then I am opening a file(extension is .jpg)
4. Then I am sending this byte array in to the file which is .jpg
The .jpg file is getting created, but the data in it is very absurd, like yyyyyyyyyyyyyyyyyyyyyyyy.
Please help me in this matter.
Regards,
Ashish -
How to create an Excel file from XML in the Receiver File Adapter Comm Ch
How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
I saw this blog, but I don't know how to create a XSLT transformation.
/people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
Any help would be appreciated. Thanks.Here are the steps I took to create an XSLT transformation in XI 3.0:
1. I created my source and target XSDs using XMLSpy.
2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
3. I created another XSLT mapping to format the target into Excel XML.
4. Import the source and target XSDs in the IR's External Definitions
5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
6. Reference the XSL mappings in the Interface Mapping -
Create New Test Database with all permissions
Hi all,
We have a Oracle9i database running on Linux platform . Currently 40 users working on it. Now i want to create another test database with giving all permissions to it. Give your valuable suggestions.
Regards,
SudarshanamThe answer to your question as I understand now would be,
grant DBA to <user>;
But I think you mean something else. Please be more clear -
ihone 4s lost all contacts. I tried to restore from backup but the error message now says there is not enough room. I have deleted all the apps without making any more room on iphone. Why did contact disappear and how do I get them back?
In the simplest sense, archiving a file means making a copy that you never change and never discard. You already know how to do that.
iPhoto has built-in archival features, in the sense that it saves all versions of an image that you've modified. As long as you have adequate backups, you don't necessarily have any reason to archive an iPhoto library. If you want to delete images from the working library but still have access to them in case you change your mind, then you do need to archive those images. I don't have a specific suggestion as to how you should do that. You might post a question in the iPhoto forum. -
I want to create a Pdf file - do i misunderstand the product? I thought i could create a PDF similar to excel or word file or do i have to create there and convert to PDF? I bought the pack for $89.PDF Pack!
Hi Brian,
You can create it in Word or excel and then you can Convert it into .pdf Format
Here's a feature list that depicts benefits of PDF pack: Convert Word to PDF, Convert PDF to Word & Merge PDFs | Adobe PDF Pack
Please revert back if you have any other questions or need any help.
Regards,
Rahul -
I would like to buy Adobe Acrobat pro 9 from ebay. The product was not deactivated, since the pc and the company no longer exists. Can I buy and activate the product ?
(There is no possibility to ask Adobe. The chats are not working. No other contact is available.)
http://www.ebay.de/itm/Adobe-Acrobat-9-PRO-Win-Vollversion-/141450672967?pt=Software&hash= item20ef1dfb47http://helpx.adobe.com/x-productkb/policy-pricing/transfer-product-license.html describes what must be done by the buyer AND the vendor. If you both cannot comply, the license cannot be transferred.
-
Duplicate from standby database to create a test database?
Hello!
Would it be possible to use backup-based duplication FROM a physical standby database to create another database to be used for testing? If I performed RMAN backup of the standby database, moved the backup to another test server, and then ran duplicate?
Anyone know if this would be possible? If possible, would the new test database's controlfile be "standby" or "primary".
(version 11.2.0.2)
thanks..Yes it works ! I've tried that recently on 10g so I think on 11g will not be a problem.
You can do it with or without duplicate. If you want to use duplicate, you don't need to copy the backup. Actually, on 11g you don't need no backup at all, since now you have 'from active database' option for duplicate command !
Also, duplicate will rebuild the controlfile so it will not be "standby" or "primary" ...
Gabriel -
Creating a standbay database from an rman backup
hi,
I have a situation that a standby database has a large gap in archive log files, the primary server does not now have those files. I understand that you can create a standby from an rman backup of the primary but all reading I have done shows thatn you have to have a recovery catalog to carry this out. The system I am on does not have such a catalog so is there any other way to do this?
regards
AlanRequirement 'You must have a recovery catalog in a standby requirement' is a little bit misleading. In fact you can do what you want : creating a standby from RMAN backups without having a recovery catalog. 'Duplicate target database for standby' does not require a connection to a recovery catalog.
You need mandatorily a recovery catalog, when you plan to take backups from the standby later on in order to free the primary from this task. The reason for that is it's not possible to transfer backup records from the standby controlfiles to the primary ones directly. After a backup on the standby you resync the catalog with the standby controlfile. Then you connect to the catalog and the primary,resync again and have actual backup informations in the primary controlfiles. When there's a media recovery problem, you easily can restore/recover the primary.
Werner -
How to create new database from backup.
Hi !
i have backup of a database, i do not want to restore, i want to create new database from the backup.
i am using oracle 11g xe.
yours sincerelyIf the Location of the datafiles is similar to that of source database then you can consider below steps
Create Oracle Service using oradim
set ORACLE_SID=NEWDB
oradim -new -sid NEWDB -intpwd passwordofthesys -startmode M
Connect to the RMAN
rman>rman target /
restore spfile/pfile and control file from backup
rman>restore spfile to pfile '_localtion of the initNEWDB.ora_' from '_location of the SPFILE Backuppiece_';
rman>startup nomount pfile='localtion of the initNEWDB.ora';
rman>restore controlfile from 'file location of the controlfile Backuppiece';
rman>alter database mount;
Catalog the RMAN backuppiece of source database
rman>catalog backuppiece '_location of the rman backuppiece of source database_ ';
resotore & recover database
rman>restore database;
rman>recover database;
open the database with reset logs
rman>alter database open resetlogs;
rman>create spfile from pfile;
rman>shutdown immediate;
rman>startup;
==================
If you have access to source database then you can clone using below rman command:
+rman target _<source database>_ auxiliary _<new database>_+
rman>duplication target database to _<your new database name>_;
==========
If the location of the datafiles and logfiles are different from source database then you need to add db_file_name_convert and log_file_name_convert to the pfile before starting the recovery process. -
Create a test DB from the export DMP file
Hi Gurus,
I was able to create the DMP file by export and transfer it to the test machine. It is a Windows OS.
Now in this machine I recently installed Oracle 11g. And I have this export *.DMP file in a dir.
I need to import the DMP file which into this newly created database to give a test database in 11g.
I also created the user for which the export is done.
I need to know how to import the DMP file. I am new to this import-export business.
Thanks
Amitava.Hi,
Use IMPDP:
impdp username/password@dbname full=Y directory=<location of the dmp file> dumpfile=<dumpfile name> logfile=<logfile name to be created>
Check the below link for more information:
ORACLE-BASE - Oracle Data Pump (expdp and impdp) in Oracle Database 10g -
Create Unit Test Vectors From The Unit Test Configuration Window
I have recently been using more test vectors in the unit test framework.
The principle works well but if you are in a unit test and decide you need a test vector you must:
Close the unit test configuration
Create a test vector
Set up your vector (entering values and data types, which is much easier if you could see the actual unit test case)
Close the vector configuration window
Open the unit test configuration
Assign the new vector file to the unit test
Now you can assign vectors to test inputs
This seems convoluted and forces unnecessary context switchs.
I propose that at a minimum, you should be able to create a new vector file and launch it's configuration without leaving the unit test configuration window. I suspect that the whole process could be streamlined even further though.
James Mc
========
CLA and cRIO Fanatic
wiresmithtech.com/blogOops supposed to be ideas exchange, sorry!
James Mc
========
CLA and cRIO Fanatic
wiresmithtech.com/blog
Maybe you are looking for
-
Saving screenshots to a different location?
Somewhere, there is a preference to set the default location to save screenshots... I can't find it now! I have one of my machines set to save screenshots to a folder on my desktop, so I know this is possible. But I can't seem to find that preference
-
I just got my a new iphone 4 from O2. i plugged in my phone to my computer(windows 7). itunes doesnt open automatically. when i opened the itunes,its still not detecting my phone. on the phone it only shows the cable and itunes logo. please help
-
Help with Editable Regions and Image Swap
I need some assistance for a project I am working on, and I don't know a short way to describe. Hang with me, here it goes.... I am working with the sites 'Navigation' links. I want to use a MouseOver behavior so that the image swaps when moused ov
-
Set a autocounter for file saving
Hi I was wondering if anybody had a quick solution for autofile naming with a look-up so lab-view can deduce what the next file should be named. A counter would be the perfect example where if the last file stored in the directory was 001, the next f
-
Table excise information in AP invoice
Hi all, From which AP invoice table we can retrieve ECC No.,CE Range,CE Division etc ? Thanks, With regards, Jeyakanthan