Windows to linux convert database 11.2.0.3


Windows to linux convert database 11.2.0.3


select * from v$version;
 select platform_id, platform_name from v$database;
 show parameter compatible;
 select name from v$datafile;
 select name from v$controlfile;
 select member from v$logfile;

2 Check platform compatibility between source and target OS(Make sure ENDIAN_FORMAT are same):

col platform_name format a40
 select * from v$transportable_platform where platform_name = 'Linux x86 64-bit' or platform_name = 'Microsoft Windows x86 64-bit' order by 2;

PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT
----------- ---------------------------------------- --------------
         13 Linux x86 64-bit                         Little
         12 Microsoft Windows x86 64-bit             Little

3 Start the source database in read only mode:

 shutdown immediate;
 startup mount;
 alter database open read only;

4. Check database readiness for transport from Windows to Linux:

 set serveroutput on
 declare
    db_ready boolean;
    begin
    db_ready := dbms_tdb.check_db('Linux x86 64-bit');
    end;
    /
PL/SQL procedure successfully completed.

5. Check if there are any external objects:
 set serveroutput on
 declare
    external boolean;
    begin
    external := dbms_tdb.check_external;
    end;
    /
The following external tables exist in the database:
SH.SALES_TRANSACTIONS_EXT
The following directories exist in the database:
SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR, SYS.XMLDIR, SYS.DATA_FILE_DIR,
SYS.LOG_FILE_DIR, SYS.MEDIA_DIR, SYS.SS_OE_XMLDIR, SYS.SUBDIR
The following BFILEs exist in the database:
PM.PRINT_MEDIA

PL/SQL procedure successfully completed.

6. Create a directory(make sure have enough space)  and save the pfile there

Mkdir C:\to_linux

SQL> create pfile='d:\to_linux\initLINXtestdb.ora' from spfile;

7. Use rman convert database command:
rman target /
 CONVERT DATABASE NEW DATABASE 'linuxdb'
 transport script 'd:\to_linux\script.sql'
 to platform 'Linux x86 64-bit'
 db_file_name_convert 'D:\app\admin\oradata\testdb\' 'd:\to_linux\';

File created

8. Transfer C:\to_linux to your target system and create directory for target database


9. Modify the pfile(initLINXORCL and script.sql to reflect the correct structure in target system.

10. Don't run script.sql directly manaully execute following commands from script.sql and upgrade to 11.2.0.3

STARTUP NOMOUNT PFILE='/u01/app/oracle/admin/LINXORCL/initLINXORCL.ora'
CREATE spfile from pfile='/u01/app/oracle/admin/LINXORCL/initLINXORCL.ora';

CREATE CONTROLFILE REUSE SET DATABASE "LINXORCL" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/admin/LINXORCL/REDO/REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/admin/LINXORCL/REDO/REDO02.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/admin/LINXORCL/REDO/REDO03.LOG'  SIZE 50M BLOCKSIZE 512
DATAFILE
  '/u01/app/oracle/admin/LINXORCL/DATA/SYSTEM01.DBF',
  '/u01/app/oracle/admin/LINXORCL/DATA/SYSAUX01.DBF',
  '/u01/app/oracle/admin/LINXORCL/DATA/UNDOTBS01.DBF',
  '/u01/app/oracle/admin/LINXORCL/DATA/USERS01.DBF',
  '/u01/app/oracle/admin/LINXORCL/DATA/EXAMPLE01.DBF'
CHARACTER SET WE8MSWIN1252
;
ALTER DATABASE OPEN RESETLOGS UPGRADE; (make sure to open database in upgrade mode)

ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/admin/LINXORCL/DATA/TEMP01.DBF'
     SIZE 20971520  AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

SHUTDOWN IMMEDIATE
STARTUP UPGRADE
@catupgrd.sql
SQL> STARTUP
SQL> @utlu112s.sql
SQL> @catuppst.sql
SQL> @utlrp.sql

Verify that all expected packages and classes are valid:

SQL> SELECT count(*) FROM dba_invalid_objects;
SQL> SELECT distinct object_name FROM dba_invalid_objects;

Previous
Next Post »

1 comments:

Click here for comments
Unknown
admin
January 21, 2021 at 8:57 PM ×

Thanks sir helped me a lot sir

Congrats bro Unknown you got PERTAMAX...! hehehehe...
Reply
avatar