Export Oracle dump to remote disk - oracle

So I have this task: export full database. There is a remote machine, on which Oracle 11g server is running. It is low on disk space, so exporting using expdp won't work.
Also, I do not have Oracle server on my local computer, so exporting using network link will not work for me. I used exp instead, but it has already been 4 days since I started export to my local disk (~380 GB already), but I need the dump file of the database.
P.S. I can connect to the remote machine using RDP. So if there are options that would allow me to export database dump using RDP I would appreciate if you could point to where to look.
I tried to search everywhere, even on different languages.

You can create a nfs/cifs share on your system, mount it on the server and use datapump to export the data directly on the mounted share. You will still be limited by the throughput of the network link however.
You should also check the network connectivity between your machine and the server - there is no fast way to transfer 1TB through a 100Mbps network, for example.
Also, when using windows remote desktop, there is a way for the remote machine to mount and access your local drives. This way you can also use datapump export on a mounted drive. Just make sure not to disconnect the remote desktop session. But it will most probably be very slow.
Since you need to move a lot of data, I suggest that you consider using some kind of NAS or SAN storage, if available. And again - the most likely bottleneck will be the network.
Also, in order to speed up the export - consider excluding the statistics and synonyms. In earlier versions of 11g datapump had issues with exporting the statistics and excluding them sped up the process significantly.

Related

How to export/import db?

I have a remote server running a huge Oracle 11g database on a Docker that I need to export/import on my local machine.
I have already tried 2 approaches:
an attempt to copy db through SQLDeveloper led to Time Out exception
save running container into an image and load it after also
didn't help as an initialization error occurred. The size of resulting image.tar made up 10.5GB.
By reason of Oracle is commonly used in production environment and designed to cope with big amounts of data I'm sure there must be clear off-the-shelf solution to export/import a db from one host to another.
Could you give me any ideas, please?

How to use Oracle data pump export utility to create dump file in local machine?

Oracle data pump export utility expect a parameter DIRECTORY (DBA_DIRECTORIES) which exist in DB server. Is it possible to map this directory to local machine or is there any other way to export multiple table to local from oracle database?
If using Data Pump, there is no direct way to store a dump file on your local machine. That is the way how Data Pump designed.
However, there is one of possible ways to achieve what you want. A workaround has two steps:
Run expdp as usual, which creates a dump file on server
Use ocp tool to transfer a dump file from a database server to your local machine (and back, if you want to).
An ocp tool stands for "Oracle Copy" and written exactly for the purpose of copying dump files back and forth from/to a database server. It is available here: https://github.com/maxsatula/ocp/releases/download/v0.1/ocp-0.1.tar.gz That is a source distribution, so once downloaded and unpacked, run ./configure && make
(Hopefully you do not have Windows on a client side, because I never tried to compile it there)
That is a simple command-line tool with a simple syntax. For example, this command will pull a file for you:
ocp <connection_string> DATA_PUMP_DIR:remote_file_name.dmp local_file_name.dmp
The tool uses a database connection and a minimum set of database privileges.
Update:
Finally I was able to adjust the source code and build ocp tool for Windows 32-bit:
https://github.com/maxsatula/ocp/releases/download/v0.1/ocp-0.1-win32.zip
Compiled/tested with 32-bit Instant Client 11.2.0.4 available here: http://www.oracle.com/technetwork/topics/winsoft-085727.html
instantclient-basiclite-nt-11.2.0.4.0.zip (20,258,449 bytes)
I believe it will work with a full Oracle Client installation too (just watch for bits, should be 32), however did not check myself.
Unfortunately, Windows build of ocp does not have a fancy progress meter during file transfer. That piece of code had too much *nix-specific stuff, so I had to cut it off.
Also, since it uses popt and zlib libraries, which are compiled as a part of GnuWin project, and available in 32-bit only, ocp for Windows is 32-bit only too. Hopefully, not having of a 64-bit version is not mission critical to you.
Update 2:
Warning! Make sure you always use DEDICATED server connection when download files from server, otherwise (for SHARED server) the downloaded copy of the file will be corrupted with no error messages!
With a bit of a hack you can get data pump to do what you want, but you need to have a database on your local machine.
What you need to do is create a database link on your local machine to the remote machine.
Then in the datapump options, login to the local database as the db link owner, specify the 'network_link' option to be the name of the database link name you created. That way it should export from the remote database through the local database and create the file on your local instance. For example:
expdp directory=<local_dir_object> network_link=<dblinkname on local instance> dumpfile=.. logfile=.. tables/schema=...
No, data pump sucks that way, but Oracle can get faster throughput using the same server the db sits on, so thats the tradeoff. Other enhancements too, but I still think this is a big disadvantage for data pump. Use old exp/imp or third party tools for this purpose.
You should ask yourself: "Why do I want to keep data outside the database - the most secure place for my data? Where backup,restore and recovery is in place.
If you are going to move data from database A to database B, make sure both databases have access to a common file-area where they can access the datadump-files through their directory-object and use the datapump.
If you still want to export data to client side you can use the good old tools exp and imp.

Selective tables/objects Oracle Backup

I need to automate a selective table / user object backup I currently am doing via PL / SQL Developer.
The way I currently do it is via Tools/Export Tables and Tools/Export User Objects, manually select tables / objects, then set the options, choose destination and export. I do this from a windows laptop and the database is located in a suse linux server, both are in the same LAN. DB is running 24/7 and can not be shutdown. Also currently my oracle programming skills are very basic as I only do maintenance to this solution. I would like to keep doing the backup process in the windows laptop, but I would consider a server side script solution also and then retrieving the .sql files from server.
Thanks in advance
I wouldn't really call it a backup, but look at exp/imp and expdp/impdp (data pump) in the Utilities manual
As Gary implies exp/imp really isn't a backup solution. If this database is important to you or others, figure out how to use RMAN , which is usually configured to run in a mode that doesn't require the database to be shut down. Although it executes on the database host and for non-tape destinations must write its files to a filesystem attached to the host, it can be launched remotely.
RMAN is aimed at restoring/recovering the entire database, so if what you're looking for is only the ability to recover isolated objects it may not be for you.

Oracle datafiles on a Network Share

I have an Oracle 8.1.7 Server running on Windows 2000 Advanced Server in a Virtual Machine. We are currently using MS Virtual Server to host this. (The allocated hardware is powerful enough - we have 3.5GB RAM assigned, and a single 2GHz processor core, more than most servers in 1999)
One of the limitations of Virtual Server i sthe maximum size of Virtual Hard Disk (127GB) and the database I'm trying to import is 143GB.
To get round this problem, I'm trying to create the DB Datafiles on the physical HDD, which has sufficient space.
My problem is that I'm having difficulty creating a database instance on a network share.
Does anyone know how I can do this while retaining my youthful good looks (and hair!)?
Cheers,
Brian
You need the account your Oracle service is started under to have access to the network share.
Can't say it's a good idea to create an Oracle datafile on a network share, but it's a viable solution if you don't mess much with you datafiles and share accessibility.
You say 'import'. If you are using exp/imp, one option may be to only import individual users or tables, and slim them down individually.
Also, the size of an IMP file doesn't correlate to the size of the database. A 140GB exp/imp file may result in a much smaller database (or conversely, it could be larger as the exp/imp file only has the index metadata). Even a database with datafiles totalling 140GB could be smaller if those datafiles contain a lot of unused space.

Oracle: How to setup a database backup to a network drive

Oracle database 11g. What is the easiest way to set up a full nightly database backup to a network drive (ie drive on another computer)?
Read the backup and recovery guide.
Don't just backup... Make sure you test your backup, regularly!!
If you have Grid Control setup the easiest way would be to use the web interface. The interface allows you to specify a unc path (\computer\share name). You will have to create a share on the remote computer.
If you don't have Grid Control you can create a script that uses RMAN. If you need script specifics it would be helpful to know what OS your database is on.
You need a backup strategy. Once you have defined that you will see what options are available to suit your needs.
mount the network drive, use rman to fully backup the db to the network drive. Rman can do it hot. Another method is to export full but you'll have to flush all writes and put the db into restricted mode so no user can make changes while you export to get a full consistent backup.

Resources