时间:2021-07-01 10:21:17 帮助过:16人阅读
1.建立测试表(Windows)
create table pp(num int); begin for j in 1 .. 100 loop insert into pp values ( j ); end loop; commit; end; /
2.创建rman用户(Windows)
sql sysdba create tablespace rman datafile ‘e:\app\rman.dat‘ size 100m autoextend on next 10m; create user rman identified by rman default tablespace rman; grant recovery_catalog_owner to rman; grant connect,resource to rman;
rman connect catalog rman/rman create catalog; rman catalog rman/rman@orcl target sys/密码@网络连接服务名; register database;
3.进入只读
run { select PLATFORM_NAME from v$database; select PLATFORM_NAME,ENDIAN_FORMAT from v$transportable_platform order by 1,2; shutdown immediate startup mount alter database open read only; set serveroutput on declare v_check boolean; begin v_check:=dbms_tdb.check_db(‘Linux x86 64-bit‘,dbms_tdb.skip_none); end; / declare v_ext boolean; begin v_ext:=dbms_tdb.check_external; end; / }
4.进入RMAN备份转码(Windows)
rman target / convert database new database ‘orcl‘ transport script ‘e:\bak\trans.sql‘ to platform ‘Linux x86 64-bit‘ db_file_name_convert ‘e:\app\Administrator\oradata\orcl‘ ‘e:\bak‘;
5.将备份导出到
e:\bak 下的所有数据以及INIT_00SDUAAM_1_0.ORA文件上传至Linux服务器中分别的位置/home/oracle/app/oradata/orcl和INIT_00SDUAAM_1_0.ORA对应的目录下
修改INIT_00SDUAAM_1_0.ORA文件中的路径和内存大小
6.导入数据(Linux)
sqlplus / as sysdba STARTUP NOMOUNT PFILE=‘INIT_00SDUAAM_1_0.ORA‘ create spfile from pfile=‘INIT_00SDUAAM_1_0.ORA‘; startup force nomount CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 ‘/home/oracle/app/oradata/orcl/redolog01.log‘ SIZE 50M, GROUP 2 ‘/home/oracle/app/oradata/orcl/redolog02.log‘ SIZE 50M, GROUP 3 ‘/home/oracle/app/oradata/orcl/redolog03.log‘ SIZE 50M DATAFILE ‘/home/oracle/app/oradata/orcl/SYSTEM01.DBF‘, ‘/home/oracle/app/oradata/orcl/UNDOTBS01.DBF‘, ‘/home/oracle/app/oradata/orcl/SYSAUX01.DBF‘, ‘/home/oracle/app/oradata/orcl/USERS01.DBF‘, ‘/home/oracle/app/oradata/orcl/EXAMPLE01.DBF‘ CHARACTER SET ZHS16GBK; ALTER DATABASE OPEN RESETLOGS; ALTER TABLESPACE TEMP ADD TEMPFILE ‘/home/oracle/app/oradata/orcl/temp01.dbf‘ SIZE 20971520 AUTOEXTEND ON; SHUTDOWN IMMEDIATE STARTUP UPGRADE @?/rdbms/admin/utlirp.sql
7.验证(Linux)
sqlplus / as sysdba startup conn mologa/mologa select * from tab; select * from pp;
window2012 oracle 迁移 centos6 oracle
标签:例子 port mit 架构 loop redhat force png dba