Search This Blog

Thursday, March 15, 2007

Shift_Oracle_Server_From_One_Machine_to_Another_Machine

OLD OS WINDOWS 2003 SERVER
NEW OS WINDOWS XP
ORACLE SERVER 10.1.0.2.0
ARCHIVE LOG DISABLED


DATABASE NAME ORAMFE

STEP :
1.TAKE COLD BACKUP OF DATABASE
INCLUDING BELOW FILES
---->All *.dbf Files
---->All *.log Files (REDO LOGS)
---->All *.ctl Files
---->SPFILE.ora,INIT.ora

2.TRANSFER ALL FILES FROM OLD OS SERVER TO NEW OS.

3.ON NEW SERVER.
EDIT INIT.ora FILE BELOW PARAMETERS

1.Change Location of below PARAMETERS according NEW OS SERVER.
1.BDUMP
2.UDUMP
3.CDUMP
4.CONTROL FILES
5.FLASHBACK RECOVERY AREA



Create Oracle Services through ORADIM utility.



C:\>set oracle_sid=oramfe

C:\>orapwd file=c:\oracle\product\10.1.0\db_1\database\pwdoramfe.ora password=or
acle entries=5 force=y

C:\>oradim -new -sid ORAMFE -startmode manual -spfile
Instance created.

C:\>oradim -edit -sid ORAMFE -startmode auto -srvcstart system

C:\>sqlplus /nolog

SQL*Plus: Release 10.1.0.5.0 - Production on

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> conn sys as sysdba
Enter password:
Connected to an idle instance.

SQL> startup mount pfile=c:\oracle\product\10.1.0\db_1\database\initORAMFE.ora
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 788496 bytes
Variable Size 69990384 bytes
Database Buffers 96468992 bytes
Redo Buffers 524288 bytes
Database mounted.




6.Change Location of REDO LOGS and DATAFILES.
NOTE :- FIRST CHANGE DATAFILES LOCATION THEN CHANGE REDO
LOG
LOCATION.
NOTE :- QUERY IN V$DATAFILE , V$LOGFILE FOR PREVIOUS LOCATION OF REDOLOG AND DATAFILES.

SQL>SELECT NAME FROM V$DATAFILE;;

DATAFILES
SQL>ALTER DATABASE
RENAME FILE
'E:\ORAMFE\USERS01.DBF',
'E:\ORAMFE\SYSTEM01.DBF',
'E:\ORAMFE\SYSAUX01.DBF'

TO
'C:\ORAMFE\USERS01.DBF',
'C:\ORAMFE\SYSTEM01.DBF',
'C:\ORAMFE\SYSAUX01.DBF'

;

SQL>SELECT MEMBER FROM V$LOGFILE;

REDOLOGS

ALTER DATABASE
RENAME FILE
'F:\ORAMFE\REDO01.LOG',

TO
'D:\ORAMFE\REDO01.LOG',

;

7.OPEN DATABASE.

SQL>ALTER DATABASE OPEN;

8.CREATE NEW TEMPORARY TABLESPACE AND DROP OLD TEMP TABLESPACES.


SQL>CREATE TEMPORARY TABLESPACE TEMP2
TEMPFILE 'C:\ORAMFE\TEMP02.DBF' SIZE 20M
AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL;


9.Make it Default Temporary Tablespace.

SQL>ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP2;

10.Drop OLD Temporary Tablespace.

SQL>DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;

11.Physically Delete Tempfile From Location.

NOTE> MUST FIRST REALLOCATE DATAFILES BEFORE REDOLOG FILES.
OTHERWISE WE WILL GET BELOW ERRORS.

ORA-00341: log 1 of thread 1, wrong log # 3 in header
ORA-00312: online log 1 thread 1: 'C:\ORAMFE\REDO03.LOG'


If you get above error you should follow below step.


SQL>RECOVER DATABASE UNTIL CANCEL;
SQL>ALTER DATABASE OPEN RESETLOGS;


DATABASE IN NO ARCHIVELOG MODE SO NO PROBLEM WITH DATA LOST.

IF YOU TRYING TO REALLOCATE TEMPFILE THEN YOU WILL BE GET BELOW ERROR MESSAGE.

ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01516: nonexistent log file, datafile, or tempfile
"C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORAMFE\TEMP01.DBF"


AFTER THAT YOU MUST CONFIGURE NETWORK CONFIGURATION THROUGH NETCA
AND ALSO YOU HAVE TO CONFIGURE OEM REPOSITORY

hope this helps
Taj

1 comment:

Nguyễn Minh Quân said...

Hi friend,
if i dont have backup pfile and replace by create 1 database using dbca, you think it will run okay??