迁移数据库——复制所有数据文件,启动数据库

数据库版本是:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

首先得在目标服务器上面安装数据库软件,参考: http://blog.csdn.net/zq9017197/article/details/7219567

复制数据文件等到目标机器(10.10.10.9)上:
[root@db u01]# scp -r root@10.10.10.8:/u01/app/oradata /u01/app
The authenticity of host '10.10.10.8 (10.10.10.8)' can't be established.
RSA key fingerprint is 9d:59:1d:a9:55:99:a8:0b:b7:1e:71:29:3e:f1:4d:b8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '10.10.10.8' (RSA) to the list of known hosts.
root@10.10.10.8's password: 
tab1.ora                                    100% 1091MB  12.1MB/s   01:30    
sysaux.ora                                  100%  560MB   3.5MB/s   02:40    
undotbs1.ora                                100% 1000MB   4.8MB/s   03:29    
assm.ora                                    100%  100MB  12.5MB/s   00:08    
o1_mf_1_795_8wjn7n64_.arc                   100%   44MB  43.6MB/s   00:01    
o1_mf_1_796_8wjn96v9_.arc                   100%   42MB   8.4MB/s   00:05    
group_5.ora                                 100%   50MB  10.0MB/s   00:05    
rman_tb.ora                                 100%   50MB  10.0MB/s   00:05    
tab2.ora                                    100%   91MB  13.0MB/s   00:07    
users.ora                                   100% 1835MB  10.1MB/s   03:01    
group_4.ora                                 100%   50MB   5.6MB/s   00:09    
temp.ora                                    100% 5120MB  30.1MB/s   02:50    
init+ASM.ora                                100%  239     0.2KB/s   00:00    
mssm.ora                                    100%  100MB  14.3MB/s   00:07    
spfile.ora                                  100% 3584     3.5KB/s   00:00    
controlfile.ora                             100%   10MB   9.9MB/s   00:00    
system.ora                                  100%  770MB  15.4MB/s   00:50    

配置oracle用户环境变量:
export ORACLE_SID=orcl  
export ORACLE_BASE=/u01/app  
export ORACLE_HOME=/u01/app/oracle  
export LD_LIBRARY_PATH=$ORACLE_HOME/lib  
export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin
umask 022  
stty erase ^h

把参数文件spfile转换成pfile,编辑pfile,创建必要的目录,然后nomount数据库:
SQL> startup nomount pfile='/u01/app/oradata/pfile.ora'
SQL> create spfile from pfile='/u01/app/oradata/pfile.ora';
SQL> startup force nomount
SQL> show parameter spfile
SQL> alter database mount;
SQL> show parameter control
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: ????/?????? 9 - ??? DBWR ????
ORA-01110: ???? 9: '/u01/app/oracle/dbs/DG'
SQL> alter database datafile '/u01/app/oracle/dbs/DG' offline drop;
SQL> alter database open;
SQL> drop tablespace PERFSTAT including contents and datafiles;
SQL> startup force

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值