oracle 12c 新特性三:rman命令視窗可以執行sql語句

paulyibinyi發表於2013-12-09
   在oracle 12c之前的版本中,rman命令視窗中是不可以直接執行sql查詢語句。而在oracle 12c中 rman中是可以直接執行sql語句,

對於資料庫管理員來說,確實方便很多。

以下是具體測試過程 :

[oracle@db12c ~]$ rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Mon Dec 9 21:08:24 2013

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1352607797)

RMAN>

RMAN> select machine from v$session;

MACHINE                                                        
----------------------------------------------------------------
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               
db12c.oracle.com                                               

29 rows selected

RMAN>

而在oracle 11gR2 版本中,則是不可以的

C:\Users\Administrator>rman target /

恢復管理器: Release 11.2.0.1.0 - Production on 星期一 12月 9 21:10:00 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

連線到目標資料庫: ORCL (DBID=1360030053)

RMAN> select machine from v$session;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: 分析輸入命令時出錯
RMAN-01009: 語法錯誤: 找到 "identifier": 應為: "advise, allocate, alter, backup,
 @, catalog, change, configure, connect, convert, copy, create, crosscheck, dele
te, drop, duplicate, exit, flashback, grant, host, import, list, mount, open, pr
int, quit, recover, register, release, repair, replace, report, reset, restore,
resync, revoke, run, send, set, show, shutdown, spool, sql, startup, switch, tra
nsport, unregister, upgrade, validate, {, " 中的一個
RMAN-01008: 錯誤識別符號: select
RMAN-01007: 在第 1 行第 1 列, 檔案: standard input

RMAN

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-1062819/,如需轉載,請註明出處,否則將追究法律責任。

相關文章