Показаны сообщения с ярлыком 11g. Показать все сообщения
Показаны сообщения с ярлыком 11g. Показать все сообщения

четверг, 23 мая 2013 г.

Включение/выключение режима архивных логов в Oracle DB

перепост http://vistababa.wordpress.com/2008/06/12/how-to-turn-archivelog-mode-on-and-off-in-oracle/

Включение режима архивных логов
Вначале убедимся, что БД не в режима архивных логов

SQL> select log_mode from v$database;
LOG_MODE
————
NOARCHIVELOG

или
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /archivelog
Oldest online log sequence 7193
Current log sequence 7194
SQL>

Переводим в режим архивных логов:
SQL> shutdown immediate;
SQL> startup mount exclusive;
SQL> alter database archivelog;
SQL> alter database open;

Проверяем:
SQL> select log_mode from v$database;
LOG_MODE
———-
ARCHIVELOG
SQL>

Убеждаемся:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /archivelog
Oldest online log sequence 7194
Next log sequence to archive 7195
Current log sequence 7195
 
Чтобы работало после перезагрузки запишем в файл параметров: 
SQ> alter system set log_archive_start=TRUE scope=spfile;
и перезагрузим БД
(параметр LOG_ARCHIVE_START является устаревшим с 10.1. Автоматическое архивирование достигается переводом базы в ARCHIVELOG состояние (http://docs.oracle.com/cd/E18283_01/server.112/e17222/changes.htm)

Note1: Необходимо сразу снять резервную копию.
Note2: Желательно установить параметры init.ora: log_archive_dest, log_archive_dest_1, log_archive_format

Выключение режима архивных логов  
Убеждаемся, что БД в режиме архивных логов:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /archivelog
Oldest online log sequence 7194
Next log sequence to archive 7195
Current log sequence 7195
SQL>
Выключаем:
SQL> startup mount excluseve;
SQL> alter database noarchivelog;
SQL> alter database open;
Проверяем:
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /archivelog
Oldest online log sequence 7194
Current log sequence 7195
SQL>
Note1: Все предыдущие копии архивных логов идут в /dev/null.

понедельник, 29 апреля 2013 г.

Ensure CELL_OFFLOAD_PROCESSING is FALSE in Non-Exadata

перепост http://cgswong.blogspot.ru/2011_06_01_archive.html


Ensure CELL_OFFLOAD_PROCESSING is FALSE in Non-Exadata

A colleague of mine recently brought to my attention a curious wait event that they were experiencing for 'ASM file metadata operation' which occurs when doing operations such as a DROP TABLESPACE, or in this case when using Data Pump. Though the server was basically not doing anything the CPU usage was 100% and there was the strange wait event on 'ASM file metadata operation' with high waits on 'ksv master wait'. So to Oracle Support they went via opening an SR.

It seems that upon applying a PSU to 11.2.0.2 (as of this writing PSU 2 is that latest so likely this will not occur in PSU 3 but that is only my guess) the parameter cell_offload_processing is set to TRUE. In an Exadata environment this is the appropriate setting, however, in a non-Exadata environment, which it was in this case, this causes performance issues to arise as processes on the RDBMS side await on a reply from the ASM side which is trying to delivery smart-scan results.

The quick fix is of course to simply reset the parameter to FALSE, i.e. 'ALTER SYSTEM SET cell_offload_processing = FALSE scope=both'. If you prefer you can instead apply patch 11800170. Per the MOS note, "High 'ksv master wait' And 'ASM File Metadata Operation' Waits In Non-Exadata 11g [ID 1308282.1]" this issue is fixed in 11.2.0.2 PSU 3, 11.2.0.3 and 12.1.

пятница, 22 марта 2013 г.

Отсылка почты из Oracle 11g R2 с помощью utl_mail и utl_smtp


repost http://blogdaprima.com/2012/install-configure-utl_mail-and-utl_smtp-on-oracle-11g-r2/

Install / Configure utl_mail and utl_smtp on Oracle 11g R2

Установим необходимые пакеты и раздадим гранты:
[host@oracle]$ cd $ORACLE_HOME/rdbms/admin
[host@oracle]$sqlplus / as sysdba
SQL> @utlmail
SQL> @utlsmtp
SQL> @prvtmail.plb
SQL> GRANT EXECUTE ON utl_mail TO PUBLIC;
SQL> GRANT EXECUTE ON utl_smtp TO PUBLIC;
SQL> alter system set smtp_out_server='dmits10' scope=both;


Раздадим соответствующие привилегии (тут RMS13DEV - пользователь БД, который будет отсылать почту, DMITS10 - доменное имя smtp-сервера):

begin
  dbms_network_acl_admin.create_acl (
    acl => 'utl_mail.xml',
    description => 'Allow mail to be send',
    principal => 'RMS13DEV',
    is_grant => TRUE,
    privilege => 'connect'
  );
  commit;
end;

/

begin
  dbms_network_acl_admin.add_privilege (
    acl => 'utl_mail.xml',
    principal => 'RMS13DEV',
    is_grant => TRUE,
    privilege => 'resolve'
  );
  commit;
end;
/


begin
  dbms_network_acl_admin.assign_acl(
    acl => 'utl_mail.xml',
    host => 'dmits10'
  );
  commit;
end;

/

Ярлыки