Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

12c Database : RMAN enhancements : use of select and other commands in RMAN Prompt

Starting 12c, from RMAN prompt the SELECT statement can be fired, Lets check some Select on V$ views

	RMAN> select file_name from dba_data_files;

	using target database control file instead of recovery catalog

	FILE_NAME
	--------------------------------------------------------------------------------
	/u01/app/oracle/oradata/DB12c/system01.dbf
	/u01/app/oracle/oradata/DB12c/sysaux01.dbf
	/u01/app/oracle/oradata/DB12c/undotbs01.dbf
	/u01/app/oracle/oradata/DB12c/new/users01.dbf


	RMAN> select username,sid,status from v$session;

	USERNAME                              SID STATUS
	------------------------------ ---------- --------
						2 ACTIVE
						3 ACTIVE
						4 ACTIVE
						5 ACTIVE
						6 ACTIVE
						7 ACTIVE
						8 ACTIVE
						9 ACTIVE
					       10 ACTIVE
					       11 ACTIVE
					       12 ACTIVE
					       13 ACTIVE
					       14 ACTIVE
					       15 ACTIVE
					       16 ACTIVE
					       17 ACTIVE
					       18 ACTIVE
					       21 ACTIVE
					       22 ACTIVE
					       23 ACTIVE
					       25 ACTIVE
					       27 ACTIVE
					       28 ACTIVE
					       30 ACTIVE
					       32 ACTIVE
	SYS                                    34 ACTIVE
					       38 ACTIVE
	SYS                                    39 INACTIVE
					       40 ACTIVE
					       42 ACTIVE
					       44 ACTIVE

	31 rows selected

Select on any table which does not exist

	RMAN> select * from test;

	RMAN-00571: ===========================================================
	RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
	RMAN-00571: ===========================================================
	RMAN-03002: failure of sql statement command at 09/13/2013 21:28:11
	ORA-00942: table or view does not exist

	RMAN>

Connected to the PDB database which was down, and started from RMAN prompt.

	[oracle@Geek DBA12c ~]$ rman target test/test@pdb12c

	Recovery Manager: Release 12.1.0.1.0 - Production on Fri Sep 13 21:28:49 2013

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

	connected to target database: DB12C (DBID=1279089071, not open)

	RMAN> select * from t;

	using target database control file instead of recovery catalog
	RMAN-00571: ===========================================================
	RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
	RMAN-00571: ===========================================================
	RMAN-03002: failure of sql statement command at 09/13/2013 21:29:03
	ORA-01219: database or pluggable database not open: queries allowed on fixed tables or views only

	RMAN> alter database open;

	Statement processed

	RMAN>

Check the DBA views with select

	RMAN> select segment_name,owner from dba_segments where owner='TEST';
	no rows selected
	RMAN>

Create/DROP table and select on custom tables also works

	RMAN> create table t1 as select * from dba_objects;
	Statement processed

	RMAN> select count(*) from t1;

	  COUNT(*)
	----------
	     90776

	RMAN>
	RMAN> drop table t1;
	Statement processed

	RMAN>

however, Connect command does not work

	RMAN> conn test/test@pdb12c

	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: "advise, allocate, alter, analyze, associate statistics, audit, backup, begin, @, call, catalog, change, comment, commit, configure, connect, convert, copy, create, create catalog, create global, create script, create virtual, crosscheck, declare, delete, delete from, describe, describe catalog, disassociate statistics, drop, drop catalog, drop database, duplicate, exit, explain plan, flashback, flashback table, grant, grant catalog, grant register, host, import, insert, list, lock, merge, mount, noaudit, open, print, purge, quit, recover, register, release, rename, repair, replace, report, "
	RMAN-01008: the bad identifier was: conn
	RMAN-01007: at line 1 column 1 file: standard input

Comments are closed.