Oracle przebudowa wszystkich indeksów

SELECT ' ALTER INDEX ' || INDEX_NAME || ' REBUILD ; ' FROM USER_INDEXES ;
Reklamy

ORA-01033: ORACLE initialization or shutdown in progress.

SQL> connect / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> alter database mount;
SQL> reover database;
SQL> alter database open;

 

w przypadku pojawienia się ORA-00600: [kcratr_nab_less_than_odr] postepujemy następująco:

> connect sys as sysdba
> startup mount
> alter database recover until cancel using backup controlfile; (i have ignored promtings).
> alter database recover continue default; (until it says “no such file or directory” or there are no more suggestions.)
> alter database recover cancel;
> alter database open resetlogs;

Oracle: pobranie poprzedniego i następnego wpisu

with test as (
select 1 id ,2 ext_id, 1 wartosc from dual union all
select 2 id ,2 ext_id, 2 wartosc from dual union all
select 3 id,2 ext_id, 3 wartosc from dual union all
select 4 id,1 ext_id, 4 wartosc from dual
)

select id, wartosc,
lag(wartosc) over (partition by ext_id order by id) as poprzednie,
lead(wartosc) over (partition by ext_id order by id) as nastepne
from test
order by id;