Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Cannot read from V$RMAN_BACKUP_JOB_DETAILS in XE 18c pluggable database

I have a 64bit OracleXE 18c instance, created on a Windows box. I have created a user in the pluggable database, xepdb1, which has DBA role granted (I also tried adding PDB_DBA as well, but it still doesn't work). This user is one that has various functions and packages that can be called to do work that the calling schema doesn't have/need the privileges to do.
Anyway, one of the tasks this user carries out is checking that the RMAN backups have completed. I run a C application (written with OCILIB to do the database stuff) and it runs the following code to get various details, some in HTML format, about the backup(s) that have run in the previous 24 hours:
with taskList as (
SELECT tasks.session_recid,
LISTAGG(
case when tasks.object_type like 'DB%' and tasks.operation = 'BACKUP' then
'<strong>' || tasks.operation || ' ' || tasks.object_type || '</strong>'
else
tasks.operation || ' ' || tasks.object_type
end, '<br>')
WITHIN GROUP (ORDER BY tasks.start_time) AS sub_jobs
FROM V$RMAN_STATUS tasks
where parent_recid is not null
and start_time >= trunc(sysdate) - 1
GROUP BY session_recid
)
------------------------------------------------------------------------------------------
-- Get a list of RMAN jobs that started in the last 24 hours.
------------------------------------------------------------------------------------------
select jobs.session_key as job_id,
to_char(jobs.start_time, 'dd/mm/yyyy') || '<br>' || to_char(jobs.start_time, 'hh24:mi') as start_time,
to_char(jobs.end_time, 'dd/mm/yyyy') || '<br>' || to_char(jobs.end_time, 'hh24:mi') as end_time,
jobs.time_taken_display as run_time,
trim(jobs.input_bytes_display) as input_size,
trim(jobs.output_bytes_display) written_size,
jobs.status,
taskList.sub_jobs as tasks_executed_in_job
from V$RMAN_BACKUP_JOB_DETAILS jobs
join taskList
on (jobs.session_key = taskList.session_recid)
where jobs.start_time >= trunc(sysdate) - 1
order by jobs.start_time desc;
The problem is, while my DBA user can read from V$RMAN_STATUS with no problems, it never sees anything in the V$RMAN_BACKUP_JOB_DETAILS, so my application creates a blank report which implies that there have been no backups (aka RMAN jobs) run in the last 24 hours. A Minor panic!
Investigating further, even SYS cannot see backups details from the view when connected in the pluggable database, while it can when connected in the root database.
I have RMAN backups taken as:
- The root database backing up the entire database,
- The root database backing up the pluggable database,
- The pluggable database backing up the pluggable database.
Nothing shows up when logged in to the pluggable database, only in the root can I see data in the view V$RMAN_BACKUP_JOB_DETAILS.
Does anyone have any clues?
Thanks.
Cheers,
Norm.
Best Answer
-
Have to hit the CDB for backup info- rman will save bits in the controlfile and a PDB session won't see any of that.
Answers
-
Have to hit the CDB for backup info- rman will save bits in the controlfile and a PDB session won't see any of that.
-
Thanks. That's a bit of a bind then.
I'm using XE to practice with containers and pluggables, and so far, so flipping confusing!
Cheers,
Norm.
-
Indeed- the PDBs can make things Much More Interesting
-
For example:
I want to login as root, then move between pluggable databases, the command is:
alter session set CONTAINER = pluggable_database_name;
Go figure. Container? Sigh.
Cheers,
Norm.
-
You don't login as root.
I probably mean you are root on OS level and login into the database as sys without providing credentials.
You should stop that. Take some time to properly setup your database.
Some actions work differently when executed as sys. For example flashback query do not work as sys (has to do with how read consistency works differently for sys).
Create yourself a DBA account in the PDB and use that.I usually store all connections (user+passwort+connectstring) in sqldeveloper. Then when I access the database I simple choose the connection I want (might be sys, but more frequently some DBA account).
-
Morning Sven,
I think you have the wrong end of the stick here. This is XE on Windows - there is no "root" user on the OS. When I said "root" I meant the root database, the container if you like. The one known as "XE".
I was referring to that root, not root on a Linux/Unix server. And yes, I do have my own account etc. :-)
Cheers,
Norm.
-
So any update on this? It is still not possible to do today. In a shared environment, usually the PDB admin does not have access to the Container, so there is no way to quere V$RMAN_BACKUP_JOB_DETAILS...