Showing posts with label data pump. Show all posts
Showing posts with label data pump. Show all posts

Thursday, 26 June 2014

How to handle a subset of data with Data Pump (external link)

Lately I found a great article in the theme http://dataworks-inc.com/import-a-subset-of-table-columns-using-oracle-data-pump, which nicely fulfils a common sense ways like creating mviews (or even views when 12c is in context) or load firstly to temporary tables and then copy to or exchange with the target objects.

Friday, 13 June 2014

Fun with parameter file and VIM

Here small anecdote rather than something dealing with technical problems.
I had created a parameter file in VIM (which is important) with a QUERY parameter specified. Nothing fancy. I opened ready file in one VIM and copied to another
dumpfile=REQ_N2521_01.DMP 
logfile=REQ_N2521_01.log 
 
tables= 
[some tables]
 
query= 
[some limits]
~                                                                               
~                                                                               
~         
I've run it and got:
ORA-39001: invalid argument value
ORA-39035: Data filter SUBQUERY has already been specified.
and started to look for error. And did it for some time. Initially without success - it is simple, right?

The reason was the addition of tilda characters at the end of file - because this way are represented non existent lines in the VIM if the file content is shorter than the terminal, I did not spot it at once, while had copied them beforehand unintentionally to the new file - thus it seemed perfectly normal.

Wednesday, 7 August 2013

Data Pump, SYS account and non working jobs

Lately I have had an issue with a load framework, which stopped working after moving the whole thing to a test environment. From the beginning it was not clear why it does not work. The reason provided in the DBA_SCHEDULER_JOB_RUN_DETAILS was exactly that the job was stopped because it was terminated, so not really helpful :-).
However, every trace indicated that jobs throw the ORA-28031 exception (maximum of 148 enabled roles exceeded).

The only role with such a number of roles was the SYS account. Apparently a job process during a piece of its lifetime is run on the SYS privileges. So the processes had been started and almost immediately terminated. And this actually explains everything. The only mystery left was why the SYS account get so many roles.
I am not sure of the exact scenario, but:
  • we have on these databases the quite numerous quantity of custom roles and exactly those roles were assigned to the SYS account
  • the migration was done with the Data Pump tools
  • the import was done on the SYS privileges and apparently then all those roles were assigned
  • there was no explicit operation of assigning those roles to the SYS schema
  • it is possible in the impdp parameters there was added the exclusion of default roles, which are enabled on the SYS by default
The main solution was to revoke all those unnecessary roles. To make the framework work other adjustments were also required, but rather obvious.

Thursday, 10 May 2012

Data Pump and db links

The environment I work here with heavily relies on db links due to integration efforts. At the same time we create numerous test/dev environments for projects' needs. Usually for test/dev environment we are not able to provide all the connections or data, while trying to provide 1 to 1 metadata structure. Of course part of it becomes INVALID, but that is ok. The point is to do an import at the lowest cost (in terms of time and writing), thus keep with a good principle, the IT staff should be lazy. The problem is that during Data Pump imports the worker hangs on views built upon non-existing db links, possibly due to firewalling connections.
  1. one may exclude schemas with db link (EXCLUDE=SCHEMA:" IN ('[username]')"
  2. one may define TNS aliases - in our case due to firewalls there was a need to indicate true databases (no matter that there was no proper schemas on them)