源庫:OS windows 2003
DB oracle 10.2.0.1.0
目標庫:OS Red Hat 4.1.2-52
DB oracle 10.2.0.5.0
採用expdp/impdp ,操作之前應先查看源庫的tablespace情況,在目標庫相應創建對應的tablespace,
再做全庫導入:
步驟:
DB oracle 10.2.0.1.0
目標庫:OS Red Hat 4.1.2-52
DB oracle 10.2.0.5.0
採用expdp/impdp ,操作之前應先查看源庫的tablespace情況,在目標庫相應創建對應的tablespace,
再做全庫導入:
步驟:
windows OS:
sql '/ as sysdba'
create directory dmp1 as 'E:\dump';
grant read,write on directory dmp1 to public;
select * from dba_directories;
alter system archive log current;
lsnrctl stop
shutdwon immediate;
startup open;
windows os 因與DB字符集不同導出前設置:
set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
expdp system/****** DIRECTORY=dmp1 DUMPFILE=full.dmp full=y logfile=export.log
cp lisnter.ora、tnsname.ora /home/oracle/app/product/10.2.0/STCASRS/network/admin/
cp full.dmp to linux OS下的dump
cd e:\dump
ftp 192.168.51.34
cd /oradata/dump ----mkdir /oradata/dump(在linux創建)
prompt
bin
mput *
by
linux OS:
1.創建新DB
dbca ASRS
2.create tablespace:
sqlplus ' / as sysdba'
startup
alter tablespace users add datafile '/oradata/ASRS/users02.dbf' size 100M AUTOEXTEND on next 100m maxsize unlimited ;
create tablespace SMPASRS datafile '/oradata/ASRS/SMPASRS.dbf' size 100M AUTOEXTEND on next 100m maxsize unlimited EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MANAGEMENT AUTO;
alter tablespace SMPASRS add datafile '/oradata/ASRS/SMPASRS02.dbf' size 100M AUTOEXTEND on next 100m maxsize unlimited;
create tablespace SMPERP_MV datafile '/oradata/ASRS/SMPERP_MV.dbf' size 100M AUTOEXTEND on next 100m maxsize unlimited EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MANAGEMENT AUTO;
create tablespace SMPERP_MV_IDX datafile '/oradata/ASRS/SMPERP_MV_IDX.dbf' size 100M AUTOEXTEND on next 100m maxsize unlimited EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MANAGEMENT AUTO;
alter tablespace temp add tempfile '/oradata/ASRS/temp1_02.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;
------------增加redo.log 6 100MB delete old 3
alter database add logfile group 4 ('/oradata/ASRS/redo04.log') size 100m;
alter database add logfile group 5 ('/oradata/ASRS/redo05.log') size 100m;
alter database add logfile group 6 ('/oradata/ASRS/redo06.log') size 100m;
alter database add logfile group 7 ('/oradata/ASRS/redo07.log') size 100m;
alter database add logfile group 8 ('/oradata/ASRS/redo08.log') size 100m;
alter database add logfile group 9 ('/oradata/ASRS/redo09.log') size 100m;
alter system switch logfile; 6 times
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
shutdown immediate
3.數據導入:
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
sqlplus ' /as sysdba'
startup
create directory dmp1 as '/oradata/dump';
grant read,write on directory dmp1 to public;
impdp system/******* directory=dmp1 dumpfile=FULL.DMP full=y logfile=import.log
sqlplus ' / as sysdba'
startup mount
alter database archivelog;
alter database force logging;
alter database open;
@?/rdbms/admin/utlrp.sql
alter system archive log current; ----7 times
4.配置監聽:
lsnrctl status
lsnrctl stop
cp listener.ora listener.ora.bak
cp win_lisnter.ora /home/oracle/app/product/10.2.0/STCASRS/network/admin/listener.ora
cp win_tnsname.ora /home/oracle/app/product/10.2.0/STCASRS/network/admin/listener.ora
修改oracle_home、IP
vi /home/oracle/app/product/10.2.0/STCASRS/network/admin/listener.ora
lsnrctl start
5.備份創建:
--- 192.168.51.49 創建
create tablespace rman10205 datafile 'D:\ORADATA\ORABAK\RMAN10205.DBF' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MANAGEMENT AUTO;
create user rman10205 identified by rman10205 default tablespace rman10205;
grant dba,resource,connect to rman10205;
grant recovery_catalog_owner to rman10205;
-----linux ASRS
rman target system/manager1 catalog rman10205/
rman10205@orabak
register database;
crosscheck archivelog all;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27646902/viewspace-2089364/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27646902/viewspace-2089364/