Wednesday, February 14, 2018

How to check the user last login detail on the netezza database?

Here is the script to check the user last login detail.

connect to history DB and execute this query.

select username, max(time) from "$v_hist_log_events" where op_type ='session create' group by username order by 1;  

Thursday, February 1, 2018

oracle database manual upgrade failed with below error




Issue:
oracle database manual upgrade failed with below error 

when I tried to upgrade oracle database to 11.2.0.4  had issues during the upgrade.

catupgrade ran almost  70% and come out from the SQL prompt and trowed the below error.



catupgrad failed with below error.


RROR at line 1:
ORA-04063: package body "SYS.DBMS_STATS_INTERNAL" has errors
ORA-06508: PL/SQL: could not find program unit being called:
"SYS.DBMS_STATS_INTERNAL"
ORA-06512: at "SYS.DBMS_STATS", line 385
ORA-06512: at line 2



Solution:

when I check with oracle and they suggested us to validate these packages and re-run the catupgrade again.



drop table sys.WRI$_OPTSTAT_SYNOPSIS$;

create table wri$_optstat_synopsis$
( bo# number not null,
group# number not null,
intcol# number not null,
hashvalue number not null
) partition by range(bo#)
subpartition by hash(group#)
subpartitions 32
(
partition p0 values less than (0)
)
tablespace sysaux
pctfree 1
enable row movement;
descr sys.WRI$_OPTSTAT_SYNOPSIS$

--- check if the desc command shows:
Name Null? Type
----------------------------------------- -------- ----------------------------
BO# NOT NULL NUMBER
GROUP# NOT NULL NUMBER
INTCOL# NOT NULL NUMBER
HASHVALUE NOT NULL NUMBER

catalog
catproc
@?/rdbms/admin/prvtstas.plb
@?/rdbms/admin/prvtstat.plb

Can we add space to table space when we the oracle DB in upgrade mode?

Can we add space to table space when we the oracle DB in upgrade mode?

I came to the situation where I need to add some space to during the oracle database upgrade .
checked with oracle and we can add the space during the DB upgrade with just altering the data-file size.But oracle recommended to resize the data-file instead of adding new data file.