源库:10.20.20.*
查看控制文件、参数文件、备份文件所在位置
```bash
[oracle@redhat6 gxerp]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Fri Aug 21 11:01:24 2020
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: GXERP (DBID=2558337661)
RMAN> list backup of spfile;
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1559 Full 18.13M DISK 00:00:01 18-AUG-20
BP Key: 1559 Status: AVAILABLE Compressed: NO Tag: TAG20200818T230208
Piece Name: /u01/app/oracle/product/12.2.0/db_1/dbs/c-2558337661-20200818-00
SPFILE Included: Modification time: 21-APR-20
SPFILE db_unique_name: GXERP
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1559 Full 18.13M DISK 00:00:01 18-AUG-20
BP Key: 1559 Status: AVAILABLE Compressed: NO Tag: TAG20200818T230208
Piece Name: /u01/app/oracle/product/12.2.0/db_1/dbs/c-2558337661-20200818-00
Control File Included: Ckp SCN: 49351405 Ckp time: 18-AUG-20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1560 Full 18.13M DISK 00:00:00 19-AUG-20
BP Key: 1560 Status: AVAILABLE Compressed: NO Tag: TAG20200819T174020
Piece Name: /u01/app/oracle/GXERP/autobackup/2020_08_19/o1_mf_s_1048873220_hmsww4v1_.bkp
Control File Included: Ckp SCN: 49584715 Ckp time: 19-AUG-20
拷贝密码文件、创办pfile、控制文件备份、数据文件备份到目标库
密码文件
[oracle@redhat6 dbs]$ scp orapwgxerp oracle@10.20.20.163:/u01/app/oracle/product/12.2.0/db_1/dbs/
oracle@10.20.20.163's password:
orapwgxerp 100% 3584 3.5KB/s 00:00
pfile
oracle@redhat6 dbs]$ sqlplus / as sysdba;
SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 21 11:26:02 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> create pfile='/tmp/pfile' from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@redhat6 dbs]$ scp /tmp/p
pfile pulse-Fq7to1EQ9iqp/ pulse-RgkuwUEUQmRg/
[oracle@redhat6 dbs]$ scp /tmp/pfile oracle@10.20.20.163:/tmp/
oracle@10.20.20.163's password:
pfile
控制文件
[oracle@redhat6 dbs]$ scp c-2558337661-20200818-00 oracle@10.20.20.163:/u01/app/oracle/product/12.2.0/db_1/dbs/
oracle@10.20.20.163's password:
c-2558337661-20200818-00 100% 18MB 18.1MB/s 00:00
数据备份、归档文件并在目标库解压
[root@storage1 10.20.20.147]# scp rmanbk20200818.tar.gz oracle@10.20.20.163:/u01/bk
oracle@10.20.20.163's password:
rmanbk20200818.tar.gz 100% 2069MB 111.5MB/s 00:18
[root@redhat6 ~]# su - oracle
[oracle@redhat6 ~]$ cd /u01/app/oracle/backup/
[oracle@redhat6 backup]$ ls
arch_GXERP_20200818_1651_1 full_GXERP_20200818_1645_1 full_GXERP_20200818_1648_1
full_GXERP_20200818_1643_1 full_GXERP_20200818_1646_1 full_GXERP_20200818_1649_1
full_GXERP_20200818_1644_1 full_GXERP_20200818_1647_1 full_GXERP_20200818_1650_1
目标库:
创建和源库相同的目录
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/adump
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/dpdump
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/pfile
[oracle@redhat6 adump]$ mkdir -p /u01/app/oracle/admin/gxerp/xdb_wallet
[oracle@redhat6 gxerp]$ mkdir -p /u01/app/oracle/oradata/gxerp
[oracle@redhat6 gxerp]$ mkdir -p /u01/app/oracle/arch