IMPDP full tablespace [message #457701] |
Tue, 25 May 2010 12:14 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
I'm trying to move a complete tablespace, with all associated schemas/users and data.
The command that I'm using is as follows:
impdp DP_USER/DP_USER directory=datapumps network_link=backup tablespaces=SDE
DP_USER has the IMP/EXP_FULL_DATABASE, as does the target of the database link.
The error that I get is the following:
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39083: Object type TABLE:"SDE"."VERSION" failed to create with error:
ORA-01918: user 'SDE' does not exist
The SDE tablespace has objects from the SDE schema, but the SDE schema does not seem to be created along with the tablespace. How do I cause it to be?
|
|
|
|
|
|
Re: IMPDP full tablespace [message #457706 is a reply to message #457705] |
Tue, 25 May 2010 12:32 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
Seems to be a chicken and egg deal.
I can't import the schema without the tablespace and I can't import the tablespace without the schema.
The schemas have relatively involved permissions and grants etc, so I don't want to create those from scratch.
If I have to create something from scratch I suppose I'd take the tablespaces.
From my reading it seems to be possible to do both within the database pump framework, but it seems either I'm mistaken or you don't know.
|
|
|
|
Re: IMPDP full tablespace [message #457711 is a reply to message #457708] |
Tue, 25 May 2010 12:51 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
And then afterwards I'd need to setup all the permissions and assigned tablespaces?
i.e.
DROP USER SDE CASCADE;
CREATE USER SDE
IDENTIFIED BY <>
DEFAULT TABLESPACE SDE
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
-- 15 System Privileges for SDE
GRANT CREATE SESSION TO SDE;
GRANT ADMINISTER DATABASE TRIGGER TO SDE;
GRANT CREATE TYPE TO SDE;
GRANT CREATE PROCEDURE TO SDE;
GRANT DROP PUBLIC SYNONYM TO SDE;
GRANT CREATE SEQUENCE TO SDE;
GRANT CREATE PUBLIC SYNONYM TO SDE;
GRANT CREATE TABLE TO SDE;
GRANT CREATE OPERATOR TO SDE;
GRANT CREATE INDEXTYPE TO SDE;
GRANT CREATE VIEW TO SDE;
GRANT CREATE LIBRARY TO SDE;
GRANT CREATE TRIGGER TO SDE;
GRANT SELECT ANY TABLE TO SDE;
GRANT UNLIMITED TABLESPACE TO SDE;
-- 2 Object Privileges for SDE
GRANT DELETE, INSERT, SELECT, UPDATE ON SDE_MDR.SERVER_CONFIG TO SDE;
GRANT DELETE, INSERT, SELECT, UPDATE ON SDE_WEBMAP.SERVER_CONFIG TO SDE;
Perhaps instead of TABLESSPACES=... I should instead use FULL=Y and INCLUDE statements to specify the tablespaces and users? Playing with that syntax now.
[Updated on: Tue, 25 May 2010 12:56] Report message to a moderator
|
|
|
Re: IMPDP full tablespace [message #457715 is a reply to message #457701] |
Tue, 25 May 2010 13:09 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
It appears that this syntax does exactly what I want:
impdp DP_USER/DP_USER directory=datapumps network_link=backup full=y INCLUDE=TABLESPACE:\"LIKE \'SDE\'\" INCLUDE=USER:\"LIKE \'SDE\'\" remap_datafile=\'D:\ORACLE\ORADATA\NETECHORATEST\SDE.DBF':\'C:\app\tmcallister\oradata\tmcall11gr2\SDE.DBF\'
Remapping the datafiles is slightly frustrating, especially since they appear to be case sensitive, but obviously required in this case due to a different disk structure. Oracle should be able to handle tablespaces & users, and it does.
|
|
|
Re: IMPDP full tablespace [message #457718 is a reply to message #457715] |
Tue, 25 May 2010 13:48 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
... or not. It runs so it must work ...
This created the base structures (schema & tablespace) but none of the permissions, objects, etc. I probably need to flesh out the INCLUDE statements a little more. Any tips appreciated.
|
|
|
Re: IMPDP full tablespace [message #457723 is a reply to message #457718] |
Tue, 25 May 2010 14:20 |
tmcallister
Messages: 107 Registered: December 2007
|
Senior Member |
|
|
Looks like I should of just kept researching myself , anyway for anyone for whom this happens to come up in a search with I suggest:
(0) INCLUDE SCHEMAS as opposed to USERS. Using USERS seems to result in only the most basic user being created with that name/password(no objects, permissions [not even connect]).
(1) using a parfile (removes the need to add in escape characters for quotes).
Here is the final parfile that I used:
directory=datapumps
network_link=backup
full=y
INCLUDE=TABLESPACE:"IN ('SDE','SDE_WEBMAP_GEODB')"
INCLUDE=SCHEMA:"IN ('SDE','WEBMAP_XBROKER')"
remap_schema=USERS:SDE_WEBMAP_GEODB
remap_datafile=D:\ORACLE\ORADATA\NETECHORATEST\SDE.DBF:C:\app\tmcallister\oradata\tmcall11gr2\SDE.DBF
remap_datafile=D:\ORACLE\ORADATA\NETECHORATEST\SDE_WEBMAP_GEODB:C:\app\tmcallister\oradata\tmcall11gr2\SDE_WEBMAP_GEODB.DBF
|
|
|