您的位置:首页 > 数据库

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

2013-07-02 10:59 351 查看
数据库版本是:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

首先得在目标服务器上面安装数据库软件,参考:/article/8077394.html

复制数据文件等到目标机器(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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐