Oracle手工热备

sys@newtestCDB> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination c:\app\Administrator\virtual\archivelog
Oldest online log sequence 16
Next log sequence to archive 18
Current log sequence 18
sys@newtestCDB> alter pluggable database all open;

Pluggable database altered.

Elapsed: 00:00:13.20
备份表空间
sys@newtestCDB> alter pluggable database all open;

Pluggable database altered.

Elapsed: 00:00:13.20
sys@newtestCDB> alter session set container=clonepdb_plug;

Session altered.

Elapsed: 00:00:00.16
sys@newtestCDB> alter tablespace users begin backup;

Tablespace altered.

Elapsed: 00:00:00.23
拷贝表空间文件到安全区域
sys@newtestCDB> alter tablespace users end backup;

Tablespace altered.

Elapsed: 00:00:00.01
sys@newtestCDB> select * from scott.test;

 EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO

  7399 ALLEN      SALESMAN        7698 1981-02-20 00:00:00       1600        300         30
  7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
  7566 JOnes      MANAGER         7839 1981-04-02 00:00:00       2975                    20
  7654 MARTIN     SALESMAN        7698 1981-09-28 00:00:00       1250       1400         30
  7698 BLAKE      MANAGER         7839 1981-05-01 00:00:00       2850                    30
  7782 CLARK      MANAGER         7839 1981-06-09 00:00:00       2450                    10
  7839 KING       PRESIDENT            1981-11-17 00:00:00       5000                    10
  7844 TURNER     SALESMAN        7698 1981-09-08 00:00:00       1500          0         30
  7900 JAMES      CLERK           7698 1981-12-03 00:00:00        950                    30
  7902 FORD       ANALYST         7566 1981-12-03 00:00:00       3000                    20
  7934 MILLER     CLERK           7782 1982-01-23 00:00:00       1300                    10

 EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO

  7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800                    20
  7499 ALLEN      SALESMAN        7698 1981-02-20 00:00:00       1600        300         30

13 rows selected.

Elapsed: 00:00:00.12
sys@newtestCDB> truncate table scott.test;

Table truncated.

Elapsed: 00:00:00.36
sys@newtestCDB> select * from scott.test;

no rows selected

Elapsed: 00:00:00.02

sys@newtestCDB> shutdown immediate
Pluggable Database closed.
//删除users01.dbf或移动到其他目录造成数据库崩溃。
sys@newtestCDB> startup
ORA-01157: cannot identify/lock data file 43 - see DBWR trace file
ORA-01110: data file 43: 'C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CLONEPDB_PLUG\USERS01.DBF'
//将备份的数据文件复制回目录
sys@newtestCDB> recover datafile 43
Media recovery complete.
sys@newtestCDB> alter database open;

Database altered.

Elapsed: 00:00:04.93
sys@newtestCDB> select * from scott.test;

no rows selected

Elapsed: 00:00:00.11

相关文章

这篇文章主要介绍“hive和mysql的区别是什么”,在日常操作中...
这篇“MySQL数据库如何改名”文章的知识点大部分人都不太理解...
这篇文章主要介绍“mysql版本查询命令是什么”的相关知识,小...
本篇内容介绍了“mysql怎么修改字段的内容”的有关知识,在实...
这篇文章主要讲解了“mysql怎么删除unique约束”,文中的讲解...
今天小编给大家分享一下mysql怎么查询不为空的字段的相关知识...