linux oracle 恢复到 windows,oracle从linux传输数据库到windows

用于检查外部表和Bfile

SQL>SET SERVEROUTPUT ON

DECLARE

external BOOLEAN;

BEGIN

external := DBMS_TDB.CHECK_EXTERNAL;

END;

/

If you call DBMS_TDB.CHECK_DB and no messages are displayed indicating conditions preventing transport

before the PL/SQL procedure successfully completed message, then your database is ready for transport.

如果没有信息返回(在PL/SQL procedure successfully completed.之前)。说明数据库已经准备好了跨平台迁移。

2、在源数据库上转换数据库

SQL> STARTUP MOUNT;

SQL> ALTER DATABASE OPEN READ ONLY;

SQL> select * from v$db_transportable_platform;

PLATFORM_ID PLATFORM_NAME                                                ENDIAN_FORMAT

----------- ------------------------------------------------------------ --------------

7 Microsoft Windows IA (32-bit)                                Little

10 Linux IA (32-bit)                                            Little

5 HP Tru64 UNIX                                                Little

11 Linux IA (64-bit)                                            Little

15 HP Open VMS                                                  Little

8 Microsoft Windows IA (64-bit)                                Little

13 Linux 64-bit for AMD                                         Little

12 Microsoft Windows 64-bit for AMD                             Little

17 Solaris Operating System (x86)                               Little

9 rows selected.

SQL> SET SERVEROUTPUT ON

SQL> DECLARE

db_ready BOOLEAN;

BEGIN

db_ready := DBMS_TDB.CHECK_DB('Microsoft Windows IA (32-bit)');

END;

/

PL/SQL procedure successfully completed.

SQL> SET SERVEROUTPUT ON

SQL> DECLARE

external BOOLEAN;

BEGIN

external := DBMS_TDB.CHECK_EXTERNAL;

END;

/

The following directories exist in the database:

SYS.DB_FILES_DIRECTORY, SYS.DATA_PUMP_DIR, SYS.WORK_DIR, SYS.ADMIN_DIR

PL/SQL procedure successfully completed.

3、备份源库,并copy所有的pfile、数据文件、scrīpt到目标库

rman >run {

CONVERT DATABASE NEW DATABASE 'sztech'

transport script '/home/oracle/oradata/transportscript'

to platform 'Microsoft Windows IA (32-bit)'

db_file_name_convert '/oracle/app/oracle/oradata/sztech1' '/home/oracle/oradata/';

}

copy /home/oracle/oradata/目录下的数据文件、scrīpt到目标库

channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01

Run SQL script /home/oracle/oradata/transportscript on the target platform to create database

Edit init.ora file /u01/app/oracle/product/11.2.0/db_1/dbs/init_00lh4ff9_1_0.ora.

This PFILE will be used to create the database on the target platform

To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform

To change the internal database identifier, use DBNEWID Utility

Finished backup at 25-JUN-10

创建基础环境

首先创建相关目录:

mkdir d:\oracle\product\11.2.0\admin\sztech\adump

mkdir d:\oracle\product\11.2.0\admin\sztech\bdump

mkdir d:\oracle\product\11.2.0\admin\sztech\cdump

mkdir d:\oracle\product\11.2.0\admin\sztech\dpdump

mkdir d:\oracle\product\11.2.0\admin\sztech\pfile

mkdir d:\oracle\product\11.2.0\admin\sztech\udump

创建Windows数据库服务:

d:\oracle\>oradim -new -sid sztech

实例已创建。

4、在目标库上恢复数据库、并升级数据库

在目标库上运行脚本transportscrīpt (需要根据需要修改该脚本文件,如controlfile的路径)

SQL>@transportscrīpt

该脚本包含步骤如下:

恢复pfile,修改pfile中相应的路径位置。启动数据库

STARTUP NOMOUNT PFILE='D:\oracle\product\11.2.0\db_1\database\initsztech.ora'

CREATE CONTROLFILE REUSE SET DATABASE "sztech" RESETLOGS  ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 SIZE 50M,

GROUP 2 SIZE 50M,

GROUP 3 SIZE 50M

DATAFILE

'D:\oracle\product\11.2.0\oradata\sztech\system01.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\undotbs01.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\sysaux01.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\users01.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\example01.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\tbsaddm.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\tbsaddm2.dbf',

'D:\oracle\product\11.2.0\oradata\sztech\tsp_ts.dbf'

CHARACTER SET ZHS16GBK

;

alter database open resetlogs;   ---不需要升级就可以直接resetlog打开数据库

ALTER TABLESPACE TEMP ADD TEMPFILE 'D:\oracle\product\11.2.0\oradata\sztech\temp01.dbf'

SIZE 26214400  AUTOEXTEND ON NEXT 5242880  MAXSIZE 104857600 ;

附:

D:\oracle\product\11.2.0\db_1\database\initsztech.ora 内容:

# Please change the values of the following parameters:

control_files            = "D:\oracle\product\11.2.0\oradata\sztech/control01_ctl"

db_recovery_file_dest    = "D:\oracle\product\11.2.0\flash_recovery_area"

db_recovery_file_dest_size= 4244635648

background_dump_dest     = "D:\oracle\product\11.2.0\admin\sztech\bdump"

user_dump_dest           = "D:\oracle\product\11.2.0\admin\sztech\udump"

core_dump_dest           = "D:\oracle\product\11.2.0\admin\sztech\cdump"

audit_file_dest          = "D:\oracle\product\11.2.0\admin\sztech\adump"

db_name                  = "sztech"

# Please review the values of the following parameters:

__shared_pool_size       = 104857600

__large_pool_size        = 4194304

__java_pool_size         = 4194304

__streams_pool_size      = 0

__db_cache_size          = 197132288

remote_login_passwordfile= "EXCLUSIVE"

db_domain                = ""

dispatchers              = "(PROTOCOL=TCP) (SERVICE=orclXDB)"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值