Can we create backup job on Oracle PDB instance? - oracle

Can anyone help me on the below?
Is it possible to create backup jobs in oracle pluggable databases or the backup jobs can be created only on the root container database?

RMAN can execute on a PDB as well. You need a user with SYSBACKUP privileges to connect directly to the PDB. See this link for specifics:
https://oracle-base.com/articles/12c/multitenant-rman-backup-recovery-cdb-and-pdb-12cr1#:~:text=

Related

Oracle database recovery

I was living in Ukraine, Kharkov. Now moved to another place due to war with Russian. Back there in Kharkov I had HP ProLiant server with Oracle database. Before escape city I did copy of file system to my laptop. Oracle Linux installed on laptop.
Is it possible to restore/run database instance with all my database schemas/users from that copy of filesystem?
I'm Java and PL/SQL developer. But I'm not Oracle administer, Oracle is quite complex system and it hard to run it for me from copy of filesystem.
As well, I managed to get all 4 SAS drives from server and took them with me. But I do not have a server here, I'll try to find someone who has one.
Please guide me or give some ideas what could I do to run database again. Or export and import data to new database.
The following will work if you have the same file paths as on your original Oracle database.
Create new database.
Shutdown immediate;
Change your command window to the same directory that the backups are in.
Launch RMAN with new database as target
The following are the rman commands you will be issuing:
startup nomount;
restore controlfile from '<<file path to control file>>';
shutdown immediate;
startup mount;
restore database;
recover database;
alter database open resetlogs;

Get pluggable databases in a stopped Oracle container database?

I'm trying to write a script that gets the Oracle container databases and their pluggable databases on a given server. I can get these handily enough when the CDB is open - but is there a way to get the PDB's of a closed/stopped container database? The databases are on Windows and I'm writing the script in PowerShell.
Any help would be much appreciated.

Oracle Database Backup in DBeaver

I am new to Oracle databases. I have installed DBeaver (never used this before too) to connect to the database.
I have created a connection (which I believe is called database) and now I am able to see the database tables and everything. How do I take the backup of the Oracle Database in DBeaver so I can use it locally for test purposes before making any change on live database?
I can't find any option to take the backup of connection/database.
To do a proper backup of your Oracle Database, you should use the oracle provided utility, Recovery Manager. It's a command line interface that's called from your DB server shell prompt via 'RMAN'
You can also use Data Pump to export all or part of a database that can be used to import to another database...not really used for recovery of an existing database.
I'm not aware of your tool having interfaces for either of these Oracle features.
You might not need a backup at all for your needs, take a look at Oracle Flashback Technology.
DBeaver does not support oracle database export import. See details here:
https://dbeaver.com/docs/wiki/Backup-Restore/
You need to run the sqlplus tool to create a folder where oracle is going to import/export database dumps. Login should happen as sys as sysdba and enter the password you previously entered during database server installation. Example:
sqlplus sys/[your password] as sysdba
After you successfully logged into sqlplus run the following command (don't forget to set to a different folder that you prefer to use):
create or replace directory DATA_PUMP_DIR as 'D:\Database Backups';
Once this is done exit from sqlplus and enter the following command into the command line (again no sqlplus should be used here)
expdp sys/[your password]#localhost:1521/[listener name] file=your-database-dump-file.dmp owner=[your schema]
Once this is done and finished you can zip your database dump if you would like to upload it somewhere else. (I had 9 GB dump and the zipped size was 1.6 GB)

Backup pluggable database

I have a pluggable database and I want to backup.Now,I did this in windows:
set ORACLE_SID=ORE(My pdb name)
echo ORACLE_SID
rman target /
But,I ran into these errors:
RMAN-06171(Not connected to target database)
Can anyone please advice what my target db should be? I want to backup my pdb and not container db.
You should connect to the container database in order to perform backups. After that you can run
BACKUP PLUGGABLE DATABASE pdb_name;
Refer to the official documentation:
Backing Up PDBs with RMAN
Also, your connection does not work, because there is no database instance with name of the pluggable database - only the container instance is running and pdbs are stored in it.
Restoration and Recovery of PDB (Pluggable database), we need to ensure that valid rman backup available.
SQL>restore pluggable database PDBORCL1;
refer the useful post: -
https://readmeout.com/restore-and-recover-pluggable-database-pdb-from-rman-backup/

Can I export dmp file with Oracle jobs?

Now I'm too keen to know how can I export dmp file with Oracle jobs? It's because of I'm very new to Oracle and don't know how to backup Oracle with jobs like MsSQL bachup with schedule. That's why I want to know what I asked.
You can fairly easy setup a backup scheduled by the database. Best approach for this is to install the Oracle Scheduler Remote Job Agent - local to the database - and configure that agent in the database that holds your backup schedule. This can be the database itself, it can also be a central backup schedule database, all a matter of taste.
Oracle Scheduler is very powerful and can execute tasks in the local database, in remote database[s], on the local server and on remote servers. If using OS type of jobs, best is to use the 11g Remote Scheduler Agent. Don't use the old fashioned 10g style External Jobs. Use remote jobs with defined credentials.
For help look at my blog where you also find pointers to docu.
After you installed and configured the job agent to be a valid target for the database that performs the scheduling, easiest is to use dbconsole to define the jobs. If you configure the dbconsole, it also gives an option to generate auto backup jobs. Maybe this is already enough. You asked for export and there expdp with the Oracle Scheduler does a wonderful job.
You can run an OS process from Oracle Job using Java Stored Procedure or a C program.
See this blog entry,
Instead of exporting dump using the old imp/exp utilities to generate dmp files, look at Oracle Datapump, especially since from the tags I infer you're using Oracle 11g.
Data pump supports table-level, tablespace-level, schema-level & full export modes and is kown to be consdirably faster than the previous imp/emp tools.
Further reading:
Export/import with Oracle Data pump
Oracle Documentation on Data pump
know how can I export dmp file with Oracle jobs?
That's not possible. The emp tools runs outside the database, while jobs run within. if you want scheduled exports perhaps you could use a cronjob/scheduled task.

Resources