I am very new to dba tasks. I can export PL/SQL packages, functions, procedures from one database to another with expdp and impdp. But I need to export these objects(functions, procedures) by Transporting the tablespace(TTS) . I searched in different threads but didn't get any help. I heard there is a way of exporting packages through TTS (even though I read in many forums that "packages cannot be exported through TTS" ). But how? I already tried TTS but packages were not exported,only tables were exported.
If you have Oracle 10 g or later, then you can use the INCLUDE parameter of the Data Pump to export packages, as below:
expdp system/password#db10g directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log INCLUDE=PACKAGE
References:
Oracle Data Pump (expdp and impdp) in Oracle Database 10g on ORACLE-BASE
Parameters Available in Export's Command-Line Mode on Oracle® Database Utilities
Related
I'm trying to export an Oracle DB using Oracle SQL Developer having tables, sequences, view, packages, etc. with dependencies on each other.
When I use Tools -> Database Export and select all DDL options, unfortunately the exported SQL file does not preserve the other that is some DB objects should be created before some other.
Is there a way to make the DB export utility preserve object dependencies/order? Or Is there any other tool do you use for this task?
Thank you
Normally expdp does a pretty good job. Problems arise when there are dependencies on objects/users that are not part of the dump. This is because the counter part, impdp, does not add grants on objects that are not created by impdp. I call that the 'not created by me syndrome' that impdp has.
If you have no external dependencies (external meaning to schema's that are not part of the dump), expdp/impdp do a good job for you. You might not be able to use it if you can not have access to the database server since expdp writes it's files on the database server.
If you happen to have access to a database server that is able to connect to the original database, you could pull the data over into your local database using a database link.
I want to export below things from SQL developer
1-Only schema (tables structure)
2-Only data in excel form
3-Schema with data
after exporting this i want to import the same to the another database
So what steps should i follow for export and import?
I can not use DATA PUMP as i don't have DBA privilege
As you use Oracle 11g, I'd suggest you to forget about SQL Developer and use the original EXP and IMP utilities. Doing so, you'd avoid DBA-related-problems as these utilities don't require access to the directory (an Oracle object which points to (usually database server's) filesystem directory, and - in order to be able to use it - you'd need to have read/write privileges on it).
So - if you don't already have these, install Oracle Client which contains EXP/IMP and use them.
We need to export an 11g database to get it into an 10g system. But we need to leave out a package, or at least some functions and procedures, that were accidentally implemented using 11g-only features.
Thankfully, the 10g is just a reporting database and we need only a few of the procedures that were implemented in 10g.
Any thoughts? I've seen some options for table-only exports, or selectively exporting certain tables. But we do need some of the procedures to come along.
I would recommend using expdp (data pump export) on the 11g database specifying the VERSION and INCLUDE parameters:
expdp dumpfile=10g.dmp directory=data_pump_dir version=10.2 INCLUDE=PROCEDURE:"LIKE '%XXX'"
This will produce a data pump export file that is compatible with the 10g version of data pump import and includes procedures ending in XXX.
Alternatively, you can use the EXCLUDE parameter instead of include to if you have just a few objects to exclude.
If you use INCLUDE, only those items you specify will be exported.
There are a lot of options for filtering objects using data pump export/import via the INCLUDE/EXCLUDE parameters.
I have an Oracle database on one PC. I have to migrate it to my other PC. Both use separate oracle installations. Now how can I export it from my one PC and then import it into other PC?
What are the commands for exporting and then importing it?
I want structure as well as data to be exported and then imported. I am using Oracle db.
You can export the data from your source database and import it into your new one.
A good link demonstrating the usage of these commands can be found here
It boils down to something like the following for exporting a full database:
%> exp USERID=<username>/<password> FULL=Y FILE=dbExport.dmp
%> imp USERID=<username>/<password> FILE=dbExport.dmp FULL=Y
There are a multitude of options for both commands to tailor it to your needs. For example, you can restrict the import command to only import certain tables via the TABLES parameter or you can move database object between users with TOUSER, FROMUSER parameters. There are also options on whether to export or import constraints, indexes, etc. You can find all the valid parameters for both commands by executing either:
%> exp help=Y
%> imp help=Y
You don't say which version of the database you are using. This is important information, because new features get added to Oracle with every release. For instance, in 10g Oracle introduced a new utility, DataPump, which replaces the older IMP and EXP (those utilities are still included in the install, they are just deprecated).
One of the neat things about DataPump is that we can execute from inside the database as well as from an OS command line. I recently posted an example of using DataPump from PL/SQL in this SO thread. `Oracle provide comprehensive documentation.
edit
Neither old fashioned IMP/EXP nor DataPump generate an SQL file (*). If that is really what you want (as opposed to just porting the schema and data somehow) then things get a bit trickier. Oracle has a package DBMS_METADATA which we can use to generate DDL scripts, but that won't deal with the data. To generate actual INSERT statements, your best bet is to use an IDE; Quest's TOAD will do this as will Oracle's (free) SQL Developer tool. Both IDEs will also generate DDL scripts for us.
(*) A Datapump import can derive the DDL statements from a prior Datapump export file, using the SQLFILE= parameter. But that is just the structure not the data.
Hi I am new and I am used to MS SQL Manager's Attach/Detatch functionality to drop a database into a single file so I can move it to other computers/SQL instances. In a nut shell, this is what I want to do.
I have a large Oracle Express database (instance name Zeus) that I need to move onto other Oracle Express instances (brand new installs) and then later I need to keep them updated with Zeus' database.
How do I do this?
I am not understanding how to export the database/schema - user definition/permission, table definitions, and table data.
Thanks guys
I don't believe you can easily do that with Oracle (especially XE edition).
You would usually do an Import/Export. This would give something like :
expdp system/password#XE DUMPFILE=expfull.dmp FULL=y
impdp system/password#XE DUMPFILE=expfull.dmp FULL=y
The expfull.dmp files would be located in a folder named oradata/dpdump in the Oracle XE
installation.
You could also use Transportable Tablespaces as described here and summarized here.
Another method involves 10 steps and would have to be adapted to Oracle XE. I mention it here for reference.