martes, 19 de septiembre de 2017

GLOBAL_NAMES Domain is not going away (forcing a change)

I didn't found solution so I fixed in this way:

db_domain is null
a domain is added and can't be set to null

select * from global_name;
ABVP.WORLD

The domain always stays

alter database RENAME global_name TO XXX;
xxx.world

Changing domain the domain stays again
alter database RENAME global_name TO XXX.com.bo;
select * from global_name;
XXX.com.bo
alter database RENAME global_name TO abvp;
 select * from global_name;
abvp.com.bo

Chaging directly in the sys table, and rexecuting change to get a correct change in the database dictionary:

UPDATE SYS.props$ SET value$='ABVP' WHERE name='GLOBAL_DB_NAME';

  select * from global_name; --ABVP

COMMIT;
  select * from global_name; --ABVP
alter database RENAME global_name TO XXX;  select * from global_name; --XXX
alter database RENAME global_name TO ABVP;
  select * from global_name; --ABVP

martes, 25 de julio de 2017

martes, 18 de julio de 2017

datapatch perl.exe stopped working SOLVED

set oracle_sid variable


set oracle_home=C:\app\product\12.2.0\dbhome_1
set path=C:\app\product\12.2.0\dbhome_1\perl\bin;C:\app\product\12.2.0\dbhome_1\bin;%path%
SET ORACLE_SID=RFOR

C:
cd %ORACLE_HOME%\BIN
sqlplus /nolog
CONNECT SYS/password@RFOR AS SYSDBA
set heading off
select bundle_series from registry$history order by action_time desc;

SHUTDOWN IMMEDIATE
STARTUP upgrade
quit

cd %ORACLE_HOME%\OPatch
datapatch -verbose

SYS
password
-------output

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Patch 26182467 (26182467:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.170718):
  Installed in the binary registry only
Bundle series PSU:
  ID 170718 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    26182467 (26182467:WINDOWS ORACLE JAVAVM COMPONENT BUNDLE PATCH 12.2.0.1.170718)
    26204212 (WINDOWS DB BUNDLE PATCH 12.2.0.1.170718(64bit):26204212)

Installing patches...

lunes, 19 de junio de 2017

Solved: Windows O/S-Error: (OS 5) Access is denied caused by service Log On account

ORA-00221: error on write to control file
ORA-00206: error in writing (block 1, # blocks 1) of control file
ORA-00202: control file:
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.

The problem was in service properties
"Logon as" was not with "Local System Account"

viernes, 26 de mayo de 2017

SOLVED oracle.forms.webutil bean xxx not found when calling in startup trigger

You can't make a call to webutil functions on  PRE-FORM, WHEN-NEW-FORM-INSTANCE, because WebUtil PJCs is not loaded.

But you can use call a non repeteable timer, that calls the code that triggers calls.

You can test the initial time, and a variable to verify if the startup trigger were executed, to avoid some triggers to be executed before the wnfi trigger is fired.

To avoid any interaction of the form with the user,
1) the form can start minimized (without the option to restore and maximize) and restored by code only when the wnfi trigger ends.
2) the items can start disabled and become enabled when the timer startup triggers ends

CREATE_TIMER

martes, 14 de marzo de 2017

ORA-00959: tablespace '_$deleted$' does not exist

ORA-00959: tablespace '_$deleted$' does not exist

I found after renaming the database, the users didn't had specified the temporal tablespaces, I assigned and it solved.

The test is execute sys.utl_recomp.recomp_serial();
gave the error

lunes, 1 de agosto de 2016

The free feature for Oracle to create materialized views in all release, how to update a materialized view from a trigger


It's called a package

First we have the select, of one or more tables; and the table to store it
Second we create a procedure that insert the query in a table
Third we update it
 1) if we want a transactional update, we create a procedure that inserts the values for the new records in the trigger of the tables
 2) if we want a log fast refresh, we create a log that stores id of records we want to be updated
 3) if we want a full update, we create job
Fourth
 For the update process depending the option we have to create a procedure, add to the trigger/job and that all.
Fifth
 Aditionally we have a validation procedure that periodically if he found differences can generate a full or partial refresh.


First
Create a package
XXX.PCK_MV_OWNER_TABLE
 Procedure:FullRefresh
  insert into table
  select from tableA,tableB
  -- note in this refresh you can put
 
 Procedure:PartialRefreshperTrigger
  This must be in a trigger update and or delete
   insert into table
   select from tableA,tableB
    where column=:new.value and column2=:new.value2

 Procedure:PartialRefreshperFunction
   insert into table
   select from tableA,tableB
     where not exists in table

 Procedure:PartialRefreshperFunction using log
  This requires a table that stores ids of modified rows, and a trigger that inserts the rowid when the needed columns of the table are modified, and generates a refresh only of those records in the database.
   insert into table
   select from tableA,tableB
     where not exists in table
   
 Procedure:fast refresh fast
  delete from;
  FullRefresh; 

 Procedure:fast refresh online
  truncate table;
  FullRefresh; 

 Procedure:validation
  with  
    a select from tableA,tableB
    b select fro mtable
  select count(*) from   
  (select from a
   minus
  select from b
  union all
  select from b
   minus
  select from a)
  if count>0 then
   fullrefresh; -fast or online it dependes on you
  end if;
 /
 Jobs
 create job executes validation periodically, depending the tables, etc.
 create job if using log to update the materialized view periodically
 optionally, create jobs makes partial insert, to reinforce validation.
 optionally, makes a full refresh

:)