Publicado por agostinhojr em 21 Março, 2007
Após identificado o SID do processo no ambiente R/3 (ST04), por exemplo 120, conecte no oracle em ambiente SAP utilizando o sqlplus ou o svrmgrl ou outra ferramente que permita execução de comandos SQL.
Execute o comando abaixo para verificar qual é o SID e o Serial para o processo.
select SERIAL# from v$session where SID = 120;
Execute o comando abaixo para derrubar a sessão ativa.
ALTER SYSTEM KILL SESSION ’sid,serial#’;
Onde sid é o SID identificado no ambiente SAP via transação ST04 e o serial# é o SERIAL# resultado do select anterior.
Enviado em oracle | Deixar um comentário »
Publicado por agostinhojr em 21 Março, 2007
Abrir o oracle com mount.
archive log list; => informações sobre o log
alter database archivelog; => habilitar
alter database noarchivelog; => desabilitar
mudar destino:
alter system archive log stop;
alter system archive log start to ‘destino’;
Enviado em oracle | Deixar um comentário »
Publicado por agostinhojr em 21 Março, 2007
SQL para verificar se o indice possui estatística.
Estatísticas de uma tabela
select table_NAME, num_rows, AVG_ROW_LEN, tablespace_name, pCT_FREE, PCT_USED, MAX_EXTENTS, TO_CHAR ( LAST_ANALYZED, ‘YYYYMMDDHH24MI’ ) from dba_tables where owner = ‘SAPR3′ AND TABLE_NAME = ‘VBFA’
Estatísticas de indices de uma tabela:
select INDEX_NAME, UNIQUENESS, BLEVEL, LEAF_BLOCKS, DISTINCT_KEYS, AVG_LEAF_BLOCKS_PER_KEY,AVG_DATA_BLOCKS_PER_KEY, CLUSTERING_FACTOR, SAMPLE_SIZE, TO_CHAR ( LAST_ANALYZED, ‘YYYYMMDDHH24MI’ ) from dba_indexes where table_owner = ‘SAPR3′ AND TABLE_NAME = ‘BKPF’
Pode-se forçar uma estatistica com o seguinte comando:
sapdba -analyze BKPF~7 -u system/password -force (Se não resolver utilize o brconnect)
Para tablespace
brconnect -u system/password -c -f stats -t psapbtabd -f allsel
Para table/index
brconnect -u system/password -c -f stats -t BKPF~7 -f allsel
Para melhorar a performance pode acrescentar os seguintes comandos:
-p 4 stats_parallel_degree = 4
Enviado em oracle | Deixar um comentário »
Publicado por agostinhojr em 21 Março, 2007
The data file must be created and recovered again. For this, the data file is first set offline and the following steps carried out. A requirement for the recovery is that all Redo log files exist since the tablespace extension:
Caution:
The following note is valid as of Oracle Release 7.2.3
- alter database datafile ‘file name’ offline;
- shutdown
- startup mount
- alter database create datafile ‘file name’;
> Datafile is created at operating system level.
- alter database datafile ‘file name’ online;
- recover datafile ‘file name’;
The ORACLE database now asks for all Redo log files since the first time the data file was created. You must inform the database of this by specifying the fully qualified path name.
- alter database open; (nach the recovery has terminated)
Enviado em oracle | Deixar um comentário »
Publicado por agostinhojr em 21 Março, 2007
o if the database is open
If you loose a datafile, you will see error messages in the user logs (syslog) and in the alert-file, if somebody tries to read or write from this file. In V$datafile the status will change to ‘OFFLINE’ or ‘RECOVERY’ and the datafile is no longer available.
In this case, the database can still be up while you are performing the recover.
Set the datafile offline (if oracle has not done that automatically )
SVRMGR> alter database datafile ‘path/filename ‘ offline;
restore the missing datafile and all necessary archived redologfiles from a backup tape.
SVRMGR> recover datafile ‘path/filename’;
SVRMGR> alter database datafile ‘path/filename’ online;
Enviado em oracle | Deixar um comentário »