- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Copy 8.0.5 Oracle DB on Same Server
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 08:12 AM
тАО01-21-2003 08:12 AM
I have an Orcale 8.0.5 DB running on an NT server that I want to copy. Both DBs will run on the same server. The new DB needs to have the same tables, views, users, etc. The only differences should be the sid and data. I don't want to copy the data.
Is there an easy way to do this rather than create the DB from scratch?
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 08:50 AM
тАО01-21-2003 08:50 AM
Re: Copy 8.0.5 Oracle DB on Same Server
1) COLD backup of your existing database
2) restore to different location
3) clone the database
As you clone the database on same server, you must shut down 1st instance during the cloning operation.
Rgds,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 09:06 AM
тАО01-21-2003 09:06 AM
Re: Copy 8.0.5 Oracle DB on Same Server
sqlplus system/
SQL> alter database backup controlfile to TRACE;
SQL> exit
this will produce a trace file in your user dump directory.
Edit the file and replace database name, database component location.
Comment out "RECOVER DATABASE"
and replace "ALTER DATABASE OPEN" with "ALTER DATABASE OPEN RESETLOGS"
Shutdown 1st instance
change ORACLE_SID
svrmgrl (or whatever it is for NT)
connect internal
@
JL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 10:19 AM
тАО01-21-2003 10:19 AM
Re: Copy 8.0.5 Oracle DB on Same Server
you could do this with a hotbackup of the original database. here is what i would do.
1. take a hotbackup of the primary db
2. backup controlfile to trace via svrmgrl
alter backup controlfile to trace;
3. modify controlfile with the fol.
-- remove header info
-- modify logfiles to point different location
-- modify datafiles to point different location
-- importantly, change
CREATE CONTROLFILE SET DATABASE 2nddb_name RESETLOGS NOARCHIVELOG
or if the database is in archive log mode:
CREATE CONTROLFILE SET DATABASE 2nddb_name RESETLOGS ARCHIVELOG
-- Remove everything from tracefile after the end of the create controlfile statement.
4. Copy primary db's parameter files to 2nd db parameter files by doing the fol.
-- Copy initDB1.ora to initDB2.ora.
-- Modify parameters in initDB2.ora
CONTROL_FILE = new control files names
DB_NAME = new database name
log_archive_dest = to right location
*_dump_* paramterts = to right location
5. Set the following environment variables:
ORACLE_SID = DB2 and ORACLE_HOME
6. Run the trace file script from 3) via SVRMGRL as a privileged user.
7. do a incomplete recovery via
restore database using backup controlfile until cancel
8. open the database with resetlogs
alter database open resetlogs
9. change global name
alter database rename global_name to DB2.xyz.com;
hth,
stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 11:42 AM
тАО01-21-2003 11:42 AM
Re: Copy 8.0.5 Oracle DB on Same Server
Thanks for the quick replies. But I'm a little confused. I'll start with Stan since I have the fewest questions.
Stan:
In your step 1, you want me to "Take a hotbackup of the primary DB." Do you just want me to copy all of DB1 files to another directory? The are currently in ORACLE_HOME\database. Should I copy them to ORACLE_HOME\DB2? Do I use this copy later? Can you give a bit more detail?
In number 5/6 you want me to set ORACLE_SID to DB2. When I call srvmgr30.exe it complains with:
TNS: Unable to connect to destination.
Is the above error normal?
In number 7, you want me to do an incomplete recovery via
restore database using backup controlfile until cancel
Is the above a command? Should it be recover?
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 01:29 PM
тАО01-21-2003 01:29 PM
Re: Copy 8.0.5 Oracle DB on Same Server
If you are really looking for a database with no data, your best option is to create another database from scratch, and run an export with "ROWS=N". This will export just the structure of the tables, which you can import into the new database and populate with data.
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2003 01:40 PM
тАО01-21-2003 01:40 PM
Solution@@ take a loot at http://www.experts-exchange.com/Databases/Oracle/Q_20004248.html for how to take hotbackup a database on NT.
The are currently in ORACLE_HOME\database. Should I copy them to ORACLE_HOME\DB2? Do I use this copy later? Can you give a bit more detail?
@@ where to copy is up to you. assuming if your DB1 dbf files are in $ORACLE_HOME/database/DB1/ then copy them to $ORACLE_HOME/database/DB2 (realistically mount points would be different in a production enviroment so i will leave it you to decide.)
In number 5/6 you want me to set ORACLE_SID to DB2. When I call srvmgr30.exe it complains with:
TNS: Unable to connect to destination.
Is the above error normal?
@@ actually in NT you need to set 'service name' via oradimxx.exe before setting oracle_sid.
for e.g. oradimxx -new -sid
In number 7, you want me to do an incomplete recovery via restore database using backup controlfile until cancel
Is the above a command? Should it be recover?
@@yep. that would do it. i strongly suggest you to take a hotbackup of DB1 and copy to tapes before you start cloning DB2. if you have access to metalink take a look at 73301.1 for complete steps to clone a database on the same NT box however that article takes coldbackup route to clone it but the steps are pretty much same.
stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2003 11:25 AM
тАО01-22-2003 11:25 AM
Re: Copy 8.0.5 Oracle DB on Same Server
Thanks for the details. However, I'm still not clear on #7. Would you please give me the syntax of the recover/restore command?
Thanks again,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2003 01:32 PM
тАО01-22-2003 01:32 PM
Re: Copy 8.0.5 Oracle DB on Same Server
I not sure if I am going to help. But a Createdb isn't that hard to do. You stated that you didn't want to copy the data. I always have a create db script which I use to create my DB. The problem is it gets out sync when I add table spaces. Attahed is a sql script which will create a
script that will create all of the table spaces. If you are on the same system you will have to slight modify the db names.
Steps
1. Run the attached script (cretablespace.sql) on your "from" system.
2 export data from you system
3. Modify the tables space names found in the created sql (tables.sql)
4. Do createdb
5 run the create table spaces script (tabgles.sql) that you modified in step 3.
5 Run the Oracle import. full=y rows=n
I used this techniqe to move a oracle DB from HPUX to NT. In a few weeks, I will be using the same technique to move the DB from NT to a AIX box. The difference is that I also moved the data. rows=y
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2003 10:45 PM
тАО01-22-2003 10:45 PM
Re: Copy 8.0.5 Oracle DB on Same Server
here is syntax.
svrmgrl> recover database using backup controlfile until cancel;
hth,
stan