@@ -71,12 +71,20 @@ $ expdp system/Syl12345 tables=student directory=dpd dumpfile=exp_student.dmp
71
71
```
72
72
73
73
> - ` system/Syl12345 ` 是执行备份的用户名和密码。
74
- >
75
74
> - ` tables ` 是指定要备份的表。
76
- >
77
75
> - ` directory ` 是指定备份存放的位置。如果不指定参数,则会存放到默认位置 ` DATA_PUMP_DIR ` ,可以使用 ` select * from dba_directories where directory_name='DATA_PUMP_DIR'; ` 查询到。
78
- >
79
76
> - ` dumpfile ` 是指定备份的文件名。
77
+ >
78
+ > 标准版不支持 OLAP ,所以会有类似 ` DBMS_AW_EXP: SYS.AW$EXPRESS: OLAP not enabled ` 这样的警告,这个不影响。
79
+
80
+ 看到类似下面的输出就导出成功了:
81
+
82
+ ``` bash
83
+ Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
84
+ /u01/app/oracle/admin/xe/dpdump/exp_student.dmp
85
+ Job " SYSTEM" ." SYS_EXPORT_TABLE_01" successfully completed at Thu Mar 8 09:52:33 2018 elapsed 0 0
86
+ 0:00:26
87
+ ```
80
88
81
89
除了可以指定上述的参数外,还有很多其他的参数,可参见 [ expdp 命令行输入参数] ( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/oracle-data-pump-export-utility.html#GUID-33880357-06B1-4CA2-8665-9D41347C6705 ) 。
82
90
@@ -90,6 +98,10 @@ $ impdp system/Syl12345 remap_table=student:studentbak directory=dpd dumpfile=ex
90
98
91
99
> - ` remap_table ` 指定在导入时更改表名。冒号左边的是旧表名,冒号右边的是新表名。如果你想直接覆盖 student 表的话可以使用 ` TABLE_EXISTS_ACTION=REPLACE ` 。
92
100
> - ` dumpfile ` 指定要导入备份的文件名。
101
+ >
102
+ > 会看到一个主键存在的 error,因为我们并未删除表空间的 student 表和主键,这个不影响。
103
+
104
+ 导入完成后,登入实例可以查询到我们导入的表。
93
105
94
106
除了可以指定上述的参数外,还有很多其他的参数,可参见 [ impdp 命令行输入参数] ( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/datapump-import-utility.html#GUID-BA74D4F6-2840-4002-A673-0A7D9CBB3D78 ) 。
95
107
@@ -442,6 +454,8 @@ RMAN> restore database until restore point syl_res_scn;
442
454
RMAN> recover database until restore point syl_res_scn;
443
455
```
444
456
457
+ ![ 实验楼] ( https://dn-simplecloud.shiyanlou.com/87971520479289926-wm )
458
+
445
459
### 使用 resetlogs 打开数据库,重建联机重做日志
446
460
447
461
``` rman
@@ -454,6 +468,8 @@ RMAN> alter database open resetlogs;
454
468
RMAN> select * from tab where tname='SYL_RES';
455
469
```
456
470
471
+ ![ 实验楼] ( https://dn-simplecloud.shiyanlou.com/87971520479353681-wm )
472
+
457
473
更多有关 RMAN 备份还原的内容可参考 [ Getting Started withRMAN] ( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/bradv/getting-started-rman.html#GUID-871FF5B2-C82B-462E-8182-FA28CF7B3E3B ) 。
458
474
459
475
0 commit comments