Oracle 12C 新特性

來源:互聯網
上載者:User

Oracle 12C 新特性之一,可以線上重新命名資料檔案, 在12c版本之前,如果出現資料檔案建立放錯目錄,或本來是放到asm中,由於漏寫加號等等,而放到了檔案系統中,而不得不申請停機時間來做資料檔案的遷移。 到了12c,這個操作就變的非常簡單了,而且是線上的,對業務沒有任何影響,提高了系統的高可用性。

Oracle 12C 新特性 Temporary UNDO 臨時復原段

Oracle 12c新特性之翻頁查詢
 
 以下是具體實驗操作過程:
 

[oracle@db12c ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.1.0 Production on Fri Dec 6 16:19:18 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
 Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
 With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
 
SQL> select name from v$datafile;

NAME
 --------------------------------------------------------------------------------
 /oradata/orcl/system01.dbf
 /oradata/orcl/pdbseed/system01.dbf
 /oradata/orcl/sysaux01.dbf
 /oradata/orcl/pdbseed/sysaux01.dbf
 /oradata/orcl/undotbs01.dbf
 /oradata/orcl/users01.dbf
 /oradata/ORCL/datafile/pdb1/system01.dbf
 /oradata/ORCL/datafile/pdb1/sysaux01.dbf
 /oradata/ORCL/datafile/pdb1/users01.dbf

9 rows selected.

SQL>

把/oradata/orcl/users01.dbf重新命名到'/oradata/ORCL/datafile/pdb1/users02.dbf';
 
SQL> alter database move datafile '/oradata/orcl/users01.dbf' to '/oradata/ORCL/datafile/pdb1/users02.dbf';
 
Database altered.

SQL> select name from v$datafile;

NAME
 --------------------------------------------------------------------------------
 /oradata/orcl/system01.dbf
 /oradata/orcl/pdbseed/system01.dbf
 /oradata/orcl/sysaux01.dbf
 /oradata/orcl/pdbseed/sysaux01.dbf
 /oradata/orcl/undotbs01.dbf
 /oradata/ORCL/datafile/pdb1/users02.dbf
 /oradata/ORCL/datafile/pdb1/system01.dbf
 /oradata/ORCL/datafile/pdb1/sysaux01.dbf
 /oradata/ORCL/datafile/pdb1/users01.dbf

9 rows selected.

SQL>
 
在資料庫日誌中也會有記錄的
 Fri Dec 06 16:21:30 2013
 alter database move datafile '/oradata/orcl/users01.dbf' to '/oradata/ORCL/datafile/pdb1/users02.dbf'
 Fri Dec 06 16:21:30 2013
 Moving datafile /oradata/orcl/users01.dbf (6) to /oradata/ORCL/datafile/pdb1/users02.dbf
 Move operation committed for file /oradata/ORCL/datafile/pdb1/users02.dbf
 Completed: alter database move datafile '/oradata/orcl/users01.dbf' to '/oradata/ORCL/datafile/pdb1/users02.dbf'。
 

 


在oracle 11g中 這個命令是失效的
 


C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 12月 6 16:37:55 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


串連到:
 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
 With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$datafile;

NAME
 --------------------------------------------------------------------------------
 
C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
 C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
 C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
 C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
 C:\APP\ADMINISTRATOR\ORADATA\ORCL\MACLEAN01.DBF


SQL> alter database move datafile 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
 ' to 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS02.DBF';
 alter database move datafile 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF' to
 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS02.DBF'
                    *
 第 1 行出現錯誤:
 ORA-00905: 缺失關鍵字


SQL>

更多詳情見請繼續閱讀下一頁的精彩內容:

  • 1
  • 2
  • 3
  • 下一頁
【內容導航】
第1頁:線上重新命名資料檔案 第2頁:可以記錄DDL日誌
第3頁:rman命令視窗可以執行sql語句

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.