Search: For:
Browsing Single Category
www.dbatoolz.com ORACLE DBA Forums Ask DBA › Question Id: 3293 | Permalink

Req: Need Steps to Create Second Database (Oracle 10g) on Same Unix Box

Question ID: 3293
Created By: 2008-JUL-27 14:58:32 [Amittambe]
Updated By: 2008-JUL-29 11:31:35 [Vitaliy]
Status: Open
Severity: Normal
Read Only: No
9367
2008-JUL-27 14:58:32
User
 
 
Registered On: Jul 2008
Total Posts: 1
Hi Everyone, I am a novice DBA. I have to create a new database manually on my 
Unix Production Box.

We have already software installed and one database is running on server.

I have to carry out same configuration as of First Database.

Anybody, please guide me to carry out this operation.

How and where to start?

I am not using DBCA.

We have one DB already placed at server and software installed on machine.

What I want to know is Like where to start:

Eg: Let me copy pfile of Existing database, do the changes. and then so on.

But as I have no idea, I need advice and steps to follow from the experts and 
experienced DBAs like you.

Please help me out mate.

Thanks
9368
2008-JUL-29 11:31:25
Moderator
 
 
Registered On: Mar 2006
Total Posts: 267
From what I understand you want to clone your existing database onto the same 
server with a different name.  If that's the case then here's the process:

1) CREATE BACKUP CONTROL FILE
      SQLPLUS> alter database backup controlfile to trace;
      SQLPLUS> show parameter user_dump_dest;
      SQLPLUS> shutdown immediate;
      
2) MODIFY BACKUP CONTROL FILE
      UNIX> cd <USER_DUMP_DEST>
      UNIX> ls -lta | head (will give you the latest trace file which 
                            should be the "BACKUP CONTROL FILE")
      UNIX> mv <TRACE_FILE> cr8_ctl.sql
      UNIX> vi cr8_ctl.sql
         CHANGE:
            a) CREATE CONTROLFILE REUSE DATABASE "<OLD_DB_NAME>" NORESETLOGS ARCHIVELOG
               TO:
               CREATE CONTROLFILE SET DATABASE "<NEW_DB_NAME>" RESETLOGS NOARCHIVELOG
            
            b) all path references of <OLD_DB_NAME> to <NEW_DB_NAME>
            
         REMOVE:
            "RECOVER DATABASE"
            "ALTER DATABASE OPEN;"

3) copy datafile, logfile, controlfile DIRECTORIES
   changing all occurrences of <OLD_DB_NAME> for <NEW_DB_NAME> 
   to match cr8_ctl.sql
   
4) rename init<OLD_DB_NAME>.ora to init<NEW_DB_NAME>.ora

5) vi init<NEW_DB_NAME>.ora
      CHANGE:
         a) all occurrences of <OLD_DB_NAME> for <NEW_DB_NAME>
         b) take note of control_files

6) remove all control files listed in control_files see (5.b)

7) CREATE NEW CONTROL FILE
      UNIX> ORACLE_SID=<NEW_DB_NAME>
      UNIX> export ORACLE_SID
      SQLPLUS> connect / as sysdba
      SQLPLUS> @cr8_ctl.sql
      ## ONLY ISSUE NEXT COMMAND IF THERE WERE NO ERRORS
      SQLPLUS> ALTER DATABASE OPEN RESETLOGS;

HTH,
- Vitaliy
[edited by: Vitaliy at 11:31 (CST) on Jul. 29, 2008]