Copy DB
Copy DB
1. Get a listing of all files currently in the database to be copied. Use ll, for example,
ll /*/oradata/<sid>
where <sid> is the database name, such as, testm, tests, devm, etc.
3. Determine where the new files will be located. The new files must be identical in
number and size to the ones being copied. Use the same naming convention for the
paths, /*/oradata/<sid>, and the files.
4. You will need to have a init<sid>.ora and config<sid>.ora file for the new database.
You might want to copy these from the source database and make the necessary
changes. If one already exists, verify that the parameters are correct. In particular,
the location of the control files in the config<sid>.ora file.
5. Create a new control file of the source database. Enter SQL*PLUS and connect as
system. Enter:
Alter database backup controlfile to trace;
I:\INFO\SOFWARE\FIMS\CopyDB
Page 1
/u14um/archive_old/<sid>
/u13/app/applmgr/common/log<sid>
/u13/app/applmgr/common/out<sid>
I:\INFO\SOFWARE\FIMS\CopyDB
Page 2
where the <session id> is the one obtained in step 4. The listing will
give you the HOST:MOUNT-POINT LABEL needed for the omnir
command. For example,
omnidb -session 1999/02/19-1 -detail
in the listing, you will see
Object name: fims.fims.org:/u14um >hotbackup_prods=
(3) Go to the /etc/opt/omni/restores directory for examples of past restores,
such as restore_soft_diff.sh. This will restore the hotbackup to
/u14um/hotbackup/soft.
(4) Now copy the .dbf and the .log files from /u14/hotbackup/<sid id> to
the correct database locations. Be sure to verify the database=s
current file locations (step 2 above) and modify as needed. For
example, see /home/oracle/copy.prods.soft.sh. Modify the example with
the correct label id and session id, as determined above.
(5) Check that all files have been restored. There have been problems with
OminBack skipping some files.
11. Enter >echo $ORACLE_SID= to confirm that ORACLE_SID is set to the new
database.
12. Make sure that $ORACLE_HOME is set to the oracle home of the database from
which you are copying.
13. The database you are copying from has to be down before the following will work.
I:\INFO\SOFWARE\FIMS\CopyDB
Page 3
ORACLE instance started.
Total System Global Area 38481164 bytes
Fixed Size 38980 bytes
Variable Size 33903816 bytes
Database Buffers 4505600 bytes
Redo Buffers 32768 bytes
Statement processed.
SVRMGR> alter database recover until cancel using backup controlfile;
alter database recover until cancel using backup controlfile
*
ORA-00279: Change 3784194 generated at 02/19/99 01:30:08 needed for thread 1
ORA-00289: Suggestion : /u08/backup/archive/soft/T0001S0000002697.ARC
ORA-00280: Change 3784194 for thread 1 is in sequence #2697
SVRMGR> alter database recover logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC';
alter database recover logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC'
*
ORA-00279: Change 3784294 generated at 02/19/99 01:59:03 needed for thread 1
ORA-00289: Suggestion : /u08/backup/archive/soft/T0001S0000002698.ARC
ORA-00280: Change 3784294 for thread 1 is in sequence #2698
ORA-00278: Logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC' no longer needed for this recovery
SVRMGR> alter database recover logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC';
alter database recover logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC'
*
ORA-00279: Change 3784294 generated at 02/19/99 01:59:03 needed for thread 1
ORA-00289: Suggestion : /u08/backup/archive/soft/T0001S0000002698.ARC
ORA-00280: Change 3784294 for thread 1 is in sequence #2698
ORA-00278: Logfile '/u14um/hotbackup/soft/T0001S0000002697.ARC' no longer needed for this recovery
:
:
SVRMGR> alter database recover cancel;
Statement processed.
11. Alter database open resetlogs;
17. Cancel all >Pending= and >Inactive= concurrent request before starting the
concurrent managers.
19. Change profile system option >Utilities:Diagnotics= to yes for >US HRMS
Manager= and >Marion HRMS Manager=.
I:\INFO\SOFWARE\FIMS\CopyDB
Page 4
20. Deactivate scheduled alert managers. Login with the responsibility of >Alerts Manager
GUI= and navigate to Request / Schedule.
21. In non-production databases, activate the following responsibilities for all FIMS
developers: >System Administrator GUI=, >Application Developer GUI= and
>Alert Manager GUI=. The description will be >Data Center FIMS Support
Staff= or >Contract Programmer=.
22. If you want the database to be in archivelog mode, the perform the following steps:
(1) make sure that ORACLE_SID is set to the right database
(2) shutdown the database normally (not immediate)
(3) svrmgrl
connect internal;
startup mount exclusive;
alter database archivelog;
shutdown normal;
(4) You must take a backup of the database now, because you will not be able
to perform recovery by using a backup taken prior to changing the mode to
or from noarchivelog.
24. If you copy the production APPL_TOP to test or development, first save the current
test or development APPL_TOP. After the copy completes, move back in the
following files / directories from the saved copy:
(1) install/log and install/out directories
(2) the custom (xx..) directories
(3) the APP<sid>.env files
(4) the applptch.txt and applptch.tmp files
(5) recreate the symbolic links (as identified in the
I:\info\software\fims\patches documentation file)
I:\INFO\SOFWARE\FIMS\CopyDB
Page 5