I have a requirement to export tables from different schemas using DBMS_DATAPUMP api.
Below script is getting failed after exporting 0.5 GB data with below errors:
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.FETCH_XML_OBJECTS [JOB:"MySchama3"]
ORA-10260: limit size () of the PGA heap set by event 10261 exceeded
ORA-10260: limit size (1048576) of the PGA heap set by event 10261 exceeded
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 11252
Script:
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => exportJobName);
dbms_datapump.set_parallel(handle => h1, degree => 15);
dbms_datapump.add_file(handle => h1, filename => exportLogFile, directory => exportLogDir, filetype => 3);
dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_LIST', value => q'|'MySchema1','MySchema2','MySchema3'|');
dbms_datapump.metadata_filter(handle => h1, name => 'NAME_EXPR', value => q'|in ('Table1','Table2','Table3') |', object_path => 'TABLE');
dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
dbms_datapump.add_file(handle => h1, filename => exportJobName || '_EXPDAT_' || to_char(systimestamp,'dd-mm-yyyy_hh24-mi-ss-FF') || '_%U.DMP', directory => exportStageDir, filetype => 1);
dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
dbms_datapump.set_parameter(handle => h1, name => 'COMPRESSION', value => 'ALL');
dbms_datapump.set_parameter(handle => h1, name => 'ENCRYPTION_ALGORITHM', value => 'AES256');
dbms_datapump.set_parameter(handle => h1, name => 'ENCRYPTION_PASSWORD', value => exportEncryptionPwd);
dbms_datapump.set_parameter(handle => h1, name => 'FLASHBACK_SCN', value => flashbackSCN);
dbms_datapump.Start_job(h1);
dbms_datapump.WAIT_FOR_JOB(h1,job_state);
dbms_datapump.Detach(h1);
exception
WHEN others THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
Could you please supply the database version and patch level? Also, it could be beneficial with details on the memory allocation (SGA/PGA). Have you tried to allocate more PGA?
Regards,
Daniel
Related
I need to disable auth error messages in the application as there are already custom messages that are implemented within the application and auth error messages are duplicating error messages in some places.
Below is the Auth object details
Cake\Controller\Component\AuthComponent Object (
[components] => Array
(
[0] => RequestHandler
[1] => Flash
)
[implementedEvents] => Array
(
[Controller.initialize] => authCheck
[Controller.startup] => startup
)
[_config] => Array
(
[authenticate] => Array
(
[0] => Form
)
[authorize] =>
[ajaxLogin] =>
[flash] => Array
(
[element] => error
[key] => flash
[params] => Array
(
[class] => error
)
)
[loginAction] => Array
(
[controller] => Users
[action] => login
[plugin] =>
)
[loginRedirect] =>
[logoutRedirect] =>
[authError] => You are not authorized to access that location.
[unauthorizedRedirect] => 1
[storage] => Session
[checkAuthIn] => Controller.startup
)
)
I want to disable [authError] => You are not authorized to access that location. this is randomly appearing on the site. is there any way to do this?
You can use this to disable authError in your controller’s beforeFilter() or component settings:
$this->Auth->config('authError', false);
I want to build a custom menu output so I am calling this class:
$pages = \Ip\Menu\Helper::getMenuItems('menu1');
It returns this:
Array
(
[0] => Ip\Menu\Item Object
(
[title:protected] => Home
[pageTitle:protected] =>
[url:protected] => http://porto.gigaweb.me/home
[target:protected] =>
[selected:protected] =>
[current:protected] => 1
[children:protected] => Array
(
[0] => Ip\Menu\Item Object
(
[title:protected] => Lorem ipsum
[pageTitle:protected] =>
[url:protected] => http://porto.gigaweb.me/lorem-ipsumy
[target:protected] =>
[selected:protected] =>
[current:protected] =>
[children:protected] =>
[depth:protected] => 2
[disabled:protected] => 0
[blank:protected] => 0
)
[1] => Ip\Menu\Item Object
(
[title:protected] => about
[pageTitle:protected] =>
[url:protected] => http://porto.gigaweb.me/about
[target:protected] =>
[selected:protected] =>
[current:protected] =>
[children:protected] =>
[depth:protected] => 2
[disabled:protected] => 0
[blank:protected] => 0
)
)
[depth:protected] => 1
[disabled:protected] => 0
[blank:protected] => 0
)
)
I have tried to turn it into an array but it returns value like this [*title].
I want to loop through it and output the values but cant seem to do it.
It is an array of objects. Not an array of arrays. So you have to do something like this:
foreach ($pages as $menuItem) {
$page->getTitle();
}
You can find other methods of $page object here http://www.impresspages.org/menu-item
Please keep in mind, that you are getting MenuItem objects, not Page objects.
I am trying to delete my archive in Amazon Glacier. I'm doing it via PHP with PHP SDK2.
I have a little problem.. I've launched job to get ArchiveID:
$this->client->initiateJob(array(
'accountId' => '-',
'vaultName' => $aValutName,
'Type' => "inventory-retrieval")
);
after a couple of hours a can see that job has finished, so I am trying to get job's using it's ID:
$res = $this->client->getJobOutput(array(
'accountId' => '-',
'vaultName' => $aValutName,
'jobId' => $aJobID,
));
and as a respons I am given such things:
Guzzle\Service\Resource\Model Object
(
[structure:protected] =>
[data:protected] => Array
(
[body] => Guzzle\Http\EntityBody Object
(
[contentEncoding:protected] =>
[rewindFunction:protected] =>
[stream:protected] => Resource id #152
[size:protected] =>
[cache:protected] => Array
(
[wrapper_type] => PHP
[stream_type] => TEMP
[mode] => w+b
[unread_bytes] => 0
[seekable] => 1
[uri] => php://temp
[is_local] => 1
[is_readable] => 1
[is_writable] => 1
)
[customData:protected] => Array
(
[default] => 1
)
)
[checksum] =>
[status] => 200
[contentRange] =>
[acceptRanges] => bytes
[contentType] => application/json
[archiveDescription] =>
)
)
Has enybody idea why "archiveDescription" is empty?
Maybe there is another way to obtain ArchiveID so I would be able to delete my archive....
Thanx for any help ;D
MK.
OK, the solution was too easy...
public function getJobResult($aValutName, $aJobID) {
$res = $this->client->getJobOutput(array(
'accountId' => '-',
'vaultName' => $aValutName,
'jobId' => $aJobID,
));
$body = EntityBody::factory($res['body']);
$body->rewind();
$inventory = stream_get_contents($body->getStream());
$ArchiveList = json_decode($inventory,1)['ArchiveList'];
$res = array();
foreach($ArchiveList as $archive):
$res[]=$archive['ArchiveId'];
endforeach;
return $res;
}
I have these entities in my database
For a given Job, I want to basically get the results in the following form
<Translation>,<ExternalUnit.Text>,<ExternalTranslation.Text>
where the joining condition is that Translation.Unit.Text == ExternalUnit.Text
This is what I have so far, working fine:
var props = session.QueryOver<Translation>(() => translation)
.Select(c => translation.Id, c => externalUnit.Text, c => externalTranslation.Text)
.JoinAlias(() => translation.TranslationUnit, () => unit)
.JoinAlias(() => unit.Job, () => job)
.Where(() => unit.Job == job)
.JoinAlias(() => job.ExternalUnits, () => externalUnit)
.JoinAlias(() => externalUnit.ExternalTranslations, () => externalTranslation)
.Where(() => externalUnit.Text == unit.Text)
.List<object[]>();
var translations = session.QueryOver<Translation>(() => translation)
.JoinAlias(() => translation.TranslationUnit, () => unit)
.JoinAlias(() => unit.Job, () => job)
.Where(() => unit.Job == job)
.JoinAlias(() => job.ExternalUnits, () => externalUnit)
.JoinAlias(() => externalUnit.ExternalTranslations, () => externalTranslation)
.Where(() => externalUnit.Text == unit.Text)
.List<Translation>()
.ToList();
Then I loop through translations, referring to props. However, I don't like this approach since I unnecessarily perform two (almost identical) queries to the database instead of just one.
But I can't get the desired projection working. I was thinking about something like this:
var data = session.QueryOver<Translation>(() => translationAlias)
.JoinAlias(() => translation.TranslationUnit, () => unit)
.JoinAlias(() => unit.Job, () => job)
.Where(() => unit.Job == job)
.JoinAlias(() => job.ExternalUnits, () => externalUnit)
.JoinAlias(() => externalUnit.ExternalTranslations, () => externalTranslation)
.Where(() => externalUnit.Text == unit.Text)
.Select(() => translation, () => externalUnit.Text, () => externalTranslation.Text)
.List()
but, obviously, NHibernate does not like the Select(() => translation...) bit (it does not allow me to project the whole entity).
Ideally I would like to select into anonymous types, like
var data = session.QueryOver<Translation>()
...
.Select(() => new { A = translation, B = externalTranslation })
but I guess NHibernate is not there so far...
Thank you very much for any suggestion.
I've got it! NHibernate's LINQ provider saved me. What's great about it is that it can select into anonymous types, which makes joining so much easier. Just in case someone is curious, here it is for my particular case:
var q =
(from c in
(from b in
(from translation in session.Query<Translation>()
join unit in units on translation.Unit equals unit
where unit.Job == job
select new { Translation = translation, Original = unit.Text })
join extUnit in externalUnits on job equals extUnit.Job
where extUnit.Text == b.Original
select new { Translation = b.Translation, ExternalUnit = extUnit })
join extTranslation in extTranslations on c.ExternalUnit equals extTranslation.Unit
select new { Translation = c.Translation, Suggestion = extTranslation })
.ToList();
The SQL it generates is very reasonable, so I am pretty happy :)
I am currently using a datareader as the source but I want to instead use a dataset.
//datareader
AutoMapper.Mapper.CreateMap<IDataReader, AccountDTO>()
.ForMember(m => m.AccountId, opt => opt.MapFrom (r => r.GetInt32(r.GetOrdinal("AccountId"))))
.ForMember(m => m.ParentAccountId, opt => opt.MapFrom(r => r.GetInt32(r.GetOrdinal("ParentAccountId"))))
.ForMember(m => m.IsInactive, opt => opt.MapFrom(r => r.GetString(r.GetOrdinal("IsInactive"))))
.ForMember(m => m.AccountName, opt => opt.MapFrom(r => r.GetString(r.GetOrdinal("AccountName"))))
//dataset
AutoMapper.Mapper.CreateMap<DataSet, AccountDTO>()
.ForMember(m => m.AccountId, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountId]))
.ForMember(m => m.ParentAccountId, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.ParentAccountId]))
.ForMember(m => m.IsInactive, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.IsInactive]))
.ForMember(m => m.AccountName, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountName]))
.ForMember(m => m.AccountNumber, opt => opt.MapFrom(r => r.Tables[0].Columns[Constants.MappingFields.Accounts.AccountNumber]))
any ideas?
I want to use the dataset instead of the datareader so I dont keep the connection to the database open.
I think I have found the solution;
Create the dataset and close/dispose the connection
create a datatablereader from the datatable and pass the in
This seems to be working.
DataTableReader dataTableReader = ds.Tables[0].CreateDataReader();
conn101.Close();
conn101.Dispose();
List<AccountDTO> accountDto1s = Mapper.Map<IDataReader, List<AccountDTO>>(dataTableReader);