迁移数据库——复制所有数据文件,启动数据库
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
首先得在目标服务器上面安装数据库软件,参考:/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
相关文章推荐
- 把数据库中所有的数据复制到一个文件中,值之间放置“,”,每一行数据都另起一行,并且把所有的值都放在“"”之间
- 如何恢复数据库-缺失了数据文件,存在所有的归档
- 针对数据量较大的表,需要进行跨库复制,采用navcat 实现sqlite数据库跨数据库的数据表迁移 [转载]
- 将MSSQL数据库文件从本地机迁移到远程服务器(包括主键、默认值、表内数据)
- 数据库升级后,准备使用原有数据文件启动数据库
- 在UNIX裸设备和文件系统之间双向复制数据库数据文件
- Scripts:报告数据库中所有数据文件使用情况dba_files_all.sql
- mysql 通过拷贝数据文件的方式进行数据库迁移实例
- [置顶] 【mysql 数据迁移】mysql中同一服务器,要从一个数据库里复制一个表到另一个数据库
- windows下用拷贝数据文件的方法复制数据库
- Oracle数据迁移之rman活动数据库复制
- Java遍历文件夹下所有文件,并且将数据保存在数据库当中
- 以用户指定的格式复制一个数据文件至数据库表或视图中。
- 用封装的方法实现从文件夹名下所有的指定类型文件数据导入到数据库
- oracle 重建索引以及导出所有的索引脚本(可以解决还原数据库文件时先还原数据,在重新用脚本创建索引)
- 误删数据文件后,使用bbed修改数据文件头,启动数据库
- Oracle中查询当前数据库中的所有表空间和对应的数据文件语句命令
- 误删数据库所有文件(包括数据文件、控制文件、日志文件等)后恢复
- XX数据库数据文件迁移并作双机冷互备方案
- 复制迁移数据库表数据程序