Skip to Main Content
  • Questions
  • Formating SQL commands output from within RMAN

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Dejan.

Asked: May 25, 2020 - 8:45 am UTC

Answered by: Connor McDonald - Last updated: May 27, 2020 - 1:04 am UTC

Category: Database Administration - Version: 12.1.0.2

Viewed 100+ times

You Asked

Is it possible to format SQL interface commands output in RMAN .. at least some basic like Ā»linesizeĀ« ?

Regards Dejan

and we said...

Sorry but there is not.

If you really need good formatting, you could call out to (say) SQL Plus with a HOST command.

and you rated our response

  (1 rating)

Reviews

May 26, 2020 - 10:53 am UTC

Reviewer: A reader

Thank You for promp answer !
It works fine for me !

Regards Dejan




$ cat 1.sql
select * from v$log;
exit

$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tor Maj 26 12:50:01 2020

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

connected to target database: DEV (DBID=3918566288)

RMAN> RUN
{
select * from v$log;
SQL 'select * from v$log';
host 'sqlplus / as sysdba @1';
}
2> 3> 4> 5> 6>
using target database control file instead of recovery catalog
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE#
---------------- ------------- ------------------- ------------
NEXT_TIME CON_ID
------------------- ----------
1 1 41413 268435456 512 1 YES
INACTIVE 7444982595539 26.05.2020 06:36:14 744498259554
26.05.2020 06:36:14 0

2 1 41414 268435456 512 1 YES
INACTIVE 7444982595548 26.05.2020 06:36:14 744503116427
26.05.2020 12:00:06 0

3 1 41415 268435456 512 1 NO
CURRENT 7445031164271 26.05.2020 12:00:06 281474976710
0


sql statement: select * from v$log


SQL*Plus: Release 12.1.0.2.0 Production on Tor Maj 26 12:50:09 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified Auditing options


GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME CON_ID
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------------- ------------ ------------------- ----------
1 1 41413 268435456 512 1 YES INACTIVE 7,4450E+12 26.05.2020 06:36:14 7,4450E+12 26.05.2020 06:36:14 0
2 1 41414 268435456 512 1 YES INACTIVE 7,4450E+12 26.05.2020 06:36:14 7,4450E+12 26.05.2020 12:00:06 0
3 1 41415 268435456 512 1 NO CURRENT 7,4450E+12 26.05.2020 12:00:06 2,8147E+14 0

3 rows selected.

Elapsed: 00:00:00.00
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified Auditing options
host command complete

RMAN>

Connor McDonald

Followup  

May 27, 2020 - 1:04 am UTC

glad we could help

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.