8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Misc » Here

Comments for Multitenant : Duplicate a Pluggable Database (PDB) to an existing Container Database (CDB) in Oracle Database 18c


JamesG said...

You mention in this article "From 12.2 onwards, Oracle Managed Files (OMF) should be considered mandatory for CDB instances."
I did some searching but can't find anything outside of this statement. Just wondering what you led you to this and if you have any more info.

Tim... said...

Hi.

It's not documented, but there are some features that just don't work without it. Example: Application Containers. There are others that do work, but in a less efficient manner. I'm not sure if they will ever bother to document it, but if you don't want to hit "unusual" issues, start using OMF. :) It makes life a lot easier too. :)

Cheers

Tim...

Will said...

Hi Tim,

"Only active database duplication is supported."

From what I can see, the recommended way to do a point in time restore of a single-PDB to an *existing* CDB with *existing* PDBs would be to do a PITR of the entire source CDB that includes only your preferred PDB to a *temporary* CDB, then, unplug and plug in the PDB to your existing CDB. Is this really the best way to do it?

Tim... said...

Hi.

I believe so. That's a different task to the process covered in this article though.

Cheers

Tim...

Anonymous said...

Hi Tim,
I found database was down due to below errors.
SQL> startup
ORACLE instance started.
Total System Global Area 3.5433E+10 bytes
Fixed Size 8666312 bytes
Variable Size 5637144576 bytes
Database Buffers 2.9662E+10 bytes
Redo Buffers 125550592 bytes
Database mounted.

ORA-03113: end-of-file on communication channel
Process ID: 22593
Session ID: 4519 Serial number: 28468
I found the below errors logged in the alert log file.
ORA-19502: write error on file "/backup/oracle/arch/demo/archivelog/demo_1505210403040231.arc", block number 819200 (block size=512)
ORA-27061: waiting for async I/Os failed
Linux-x86_64 Error: 28: No space left on device

I then deleted some archive log files on arch location and changed the db to noarchive log mode.
Now the db is up and arch location has got some space back.
Could you please let me know the permanent solution for this issue.

Regards,

Tim... said...

Hi.

The answer is pretty simple. Either:

1) Get more space.
or
2) Start doing backups, including your archived redo logs, so they get cleared down.

Cheers

Tim...

Anonymous said...

Hi Tim,
Thank you. DB and archivelog backup is taken everyday.Could I schedule this job "archivelog.sh"
as a cron job from unix crontab to delete archive log files older than 30 days.

vi delete_archivelog.sh
#/bin/sh
ORACLE_SID=wysheid
export ORACLE_SID
ORACLE_HOME=/wysheid/db_home1
export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin

$ORACLE_HOME/bin/rman

connect target /
run{
allocate channel c1 type disk;
delete force noprompt archivelog until time 'SYSDATE-30';
release channel c1;
}
exit
EOF

Regards,

Tim... said...

Hi.

Why bother. Just delete them as you back them up.

BACKUP DEVICE TYPE disk ARCHIVELOG ALL DELETE ALL INPUT;

No need for the job then.

Cheers

Tim...

Anonymous said...

Hi Tim,
But backups ( incre, full & arch) are already schedule in crontab. I only need to delete the old archive log files to free up space on arch folder.
Also I would like to schedule this job.

Regards,

Tim... said...

Hi.

Yes, but clearly the archivelog backups do not include the deletion of the the backed up archivelogs. This can be done automatically in the backup command for the archivelogs. Adding the "DELETE ALL INPUT" will delete the archivelogs that are backed up. No need for a separate job!

I'm not suggesting adding in a new schedule. I'm saying correct your existing backup script so it manages these files automatically.

Cheers

Tim..

Anonymous said...

Hi Tim,
Thank you for your suggestions. Could you please suggest where to add 'delete all input' in arch backup script.
Here is the script .

else
if [ $BACKUP_TYPE = 'ARCH' ]; then
rman target / > $LOGFILE
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ${CF_BACKUP};

CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET PARALLELISM ${PARALLEL};
run {
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
backup ${COMPRESS} archivelog all $FORMAT_ARCHIVE delete input filesperset 10;
crosscheck archivelog all;
delete noprompt expired archivelog all;

delete noprompt obsolete;
}
exit

Regards,

Tim... said...

Hi.

Change this line.

backup ${COMPRESS} archivelog all $FORMAT_ARCHIVE delete input filesperset 10;

To this (add all).

backup ${COMPRESS} archivelog all $FORMAT_ARCHIVE delete all input filesperset 10;

Cheers

Tim...

Tim... said...

Hi.

Switch the logfiles a few times so you have some archivelogs in your archive log directory.

alter system switch logfile;

Run the backup. The archived redo log files should be gone once the backup completes.

Cheers

Tim...

Anonymous said...

Hi Tim,
I have a query on delete statements in backup script.
When there is a delete statements in the backup script then why do we need to add 'delete all input' to delete all archive log files.
Could you please explain.

delete noprompt expired archivelog all;
delete noprompt obsolete;

Regards,

Tim... said...

Hi.

Adding DELETE ALL INPUT tells the command to delete any copies of the archived redo logs that have been backed up.

DELETE OBSOLETE deletes any backups, archive log backups, backup controlfiles and SPFILEs that are no longer needed to the recovery policy. This is nothing to do with archived redo logs on the file system.

Deleting expired archive logs is irrelevant.

Cheers

Tim...

Anonymous said...

Hi Tim,
Thank you. My query is when there is already delete statements in the backup script why should we add delete all input.
Could you please clarify.

Regards,

Tim... said...

Hi.

This does not do what you think it does.

delete noprompt expired archivelog all;

If deletes archived redo logs that are not part of the recovery window/redundancy policy. So you back up the files, but it does not delete them.

Adding "ALL" means all copies of the archived redo logs will be deleted. This is important if you have multiple archive locations.

Cheers

Tim...

Anonymous said...

Hi Tim,
Thank you. In my db, there is only one archive location. Do I still need delete all input to delete all archive log files in the backup script.

Regards,

Tim... said...

Hi.

In your case DELETE INPUT and DELETE ALL INPUT means the same thing then, but I would always include ALL, as it makes sure someone looking at the script knows your intentions.

Cheers

Tim...

DO NOT ask technical questions here! They will be deleted!

These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!

If you post personal information (name, email address etc.) you are agreeing to them being stored and displayed. Feel free to remain anonymous.