Skip to content

Running SQL commands in RMAN without SQL keyword

September 18, 2013

Pre 12c
========
rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Sep 14 11:42:26 2013

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

connected to target database: D041 (DBID=375228231)

RMAN> alter system switch logfile;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "database"
RMAN-01008: the bad identifier was: system
RMAN-01007: at line 1 column 7 file: standard input
RMAN> sql ‘alter system switch logfile’;         ==> SQL Key word before command.
 
using target database control file instead of recovery catalog
sql statement: alter system switch logfile
 
 
From 12c
================
ora12crac1:/export/home/oracle: rman target /
 
Recovery Manager: Release 12.1.0.1.0 – Production on Sat Sep 14 11:43:50 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: D041 (DBID=375915797)
 
RMAN> alter system switch logfile;                                   ==> SQL Key word Not Required before command anymore
 
using target database control file instead of recovery catalog
Statement processed
 
RMAN> select username from dba_users where username like ‘M%’;
 
using target database control file instead of recovery catalog
USERNAME
——————————————————————————–
MTEST
 
RMAN> create table mtest.memp ( ename varchar2(20));
 
Statement processed
 
RMAN> insert into mtest.memp values (‘Insert from Rman’);
 
Statement processed
 
RMAN> commit;
 
Statement processed
 
RMAN> select * from mtest.memp;
 
ENAME
——————–
Insert from Rman
 
RMAN> drop table mtest.memp;
 
Statement processed
 
RMAN> desc v$tablespace
  Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 TS#                                                NUMBER
 NAME                                               VARCHAR2(30)
 INCLUDED_IN_DATABASE_BACKUP                        VARCHAR2(3)
 BIGFILE                                            VARCHAR2(3)
 FLASHBACK_ON                                       VARCHAR2(3)
 ENCRYPT_IN_BACKUP                                  VARCHAR2(3)
 CON_ID                                             NUMBER
Advertisements

From → 12c

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: