参考文档:https://www.modb.pro/doc/270
实验环境:redhat 5.5
数据库版本:10.2.0.5
1.在同平台安装相同版本的数据库软件,配置好环境变量,建立相应的目录
需要注意的地方就是,审计目录也需要提前创建好
2.在原库中创建pfile文件,用户打开新库
sqlplus / as sysdba
create pfile='/home/oracle/init.ora' from spfile;
3.关闭原库
停掉应用,关闭数据库
alter system switch logfile;
shutdown immediate
4.拷贝文件到新服务器上
这里我直接将文件全部scp,临时文件是可以不传输的,之后重建
[oracle@oracle10 orcl10]$ scp * 192.168.56.10:/oradata/orcl10
The authenticity of host '192.168.56.10 (192.168.56.10)' can't be established.
RSA key fingerprint is 70:f8:c6:e4:e8:52:e9:be:e9:3e:61:82:6e:93:3c:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.10' (RSA) to the list of known hosts.
oracle@192.168.56.10's password:
control01.ctl 100% 6896KB 6.7MB/s 00:01
control02.ctl 100% 6896KB 6.7MB/s 00:01
control03.ctl 100% 6896KB 6.7MB/s 00:00
redo01.log 100% 50MB 25.0MB/s 00:02
redo02.log 100% 50MB 12.5MB/s 00:04
redo03.log 100% 50MB 50.0MB/s 00:01
sysaux01.dbf 100% 250MB 10.4MB/s 00:24
system01.dbf 100% 500MB 11.9MB/s 00:42
temp01.dbf 100% 31MB 15.5MB/s 00:02
undotbs01.dbf 100% 550MB 16.7MB/s 00:33
users01.dbf 100% 5128KB 5.0MB/s 00:01
5.对部分pfile文件参数进行调整
部分报错:启动过程中显示闪回路径问题,直接将闪回参数删除,后期在添加
SQL> startup pfile='/home/oracle/init.ora';
ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory
6.启动数据库,并创建spfile文件
SQL> startup pfile='/home/oracle/init.ora';
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 213912640 bytes
Database Buffers 377487360 bytes
Redo Buffers 6287360 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile='/home/oracle/init.ora';
File created.
SQL>
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 213912640 bytes
Database Buffers 377487360 bytes
Redo Buffers 6287360 bytes
Database mounted.
Database opened.