понедельник, 26 декабря 2011 г.

Отмена двойных кавычек в Apache Tomcat


Часто возникает ошибка двойных кавычек <some:tag title=”<%=(String)request.getAttribute(\”title\”)%>”>
Лечится это добавлением строки org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false в конец файла $TOMCAT_HOME/conf/catalina.properties.

вторник, 27 сентября 2011 г.

Host Credentials ERROR Invalid username - Oracle

Setting Credentials for the Job System to Work with Enterprise Manager

Windows systems require that you set the correct credentials for the Jobs system to work properly in Enterprise Manager. By default, the Management Agent service is installed as a LocalSystem user. When submitting jobs, such as stopping or starting the database, the operating system user submitting the job must have the Log on as a batch job privilege enabled.
Perform the following steps to establish that privilege for any operating system user who needs to submit an Enterprise Manager job.
  1. Start the Local Security Policy tool:
    • Windows 2000: From the Start menu, select Control Panel, Administrative Tools, then Local Security Policy.
    • Windows 2003: From the Start menu, select Administrative Tools, then Local Security Policy.
    • Windows XP: From the Start menu, select Control Panel, Administrative Tools, then Local Security Policy.
    • Windows Vista: From the Start menu, select Programs, Administrative Tools, then Local Security Policy.
  2. Under the Security Settings list, expand the list to Local Policies.
  3. Under Local Policies, double-click User Rights Assignment.
  4. Under Policy, search for the Log on as a batch job policy.
    If the Management Agent service is installed as any other user (that is, not LocalSystem), then, in addition to granting the Log on as a batch job privilege, you must grant the "Windows service" user the following three privileges:
    • Act as part of the operating system
    • Adjust memory quotas for a process (This setting is named Increase memory quotas on Windows 2000.)
    • Replace a process level token
      The service under the "Windows service" user runs at the operating system level.
  5. With each policy, perform the following steps:
    1. Double-click the policy name.
    2. In the Properties dialog box, click Add User or Group.
    3. In the Select Users or Groups dialog box, enter the name of the user (for example, jsmith, administrator, and so on.)
      Note:
      On Windows Vista, the name of the dialog box is Select Users, Computers, or Groups.
    4. Click Check Names to check that you have entered the name correctly.
    5. Click OK.
  6. Click OK to exit the Properties dialog box, then exit Local Security Settings and Administrative Tools.
  7. Restart your computer.
If a user exists locally and at the domain level, Windows gives the local user precedence. To use the domain user, qualify the user name with the domain name. For example, to use the user joe in the ACCOUNTS domain specify the user name as ACCOUNTS\joe.

Взято с http://download.oracle.com/docs/cd/B28359_01/install.111/b32006/postcfg.htm#BABFAEIG

понедельник, 28 марта 2011 г.

Размер базы MySQL

Запрос возвращает размер всех баз данных MySQL:
SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024 
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
 
Запрос возвращает размер каждой из таблиц для базы данных:
SELECT table_name, table_rows, data_length, index_length, 
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "schema_name"
 
Также размер базы данных можно узнать, узнав размер файла ibdata1.

среда, 23 марта 2011 г.

Timezone в CentOS

Часто бывает необходимо выставить на сервере часовой пояс (timezone), отличный от текущего. Например, команда date возвращает нечто вроде Mon 17 Jan 2005 12:15:08 PM PST. В данном случае PST - это текущий timezone для сервера. Это не совсем верно, т.к. время должно быть в соответствии с тем часовым поясом, где физически установлен сервер.

Предположим, что нужно изменить timezone на Московский (MSK). Для этого сначала делаем копию настроек текущего timezone'а сервера:
mv /etc/localtime  /etc/localtime-old

Далее переходим в директорию /usr/share/zoneinfo/Europe/ и просматриваем доступные timezone'ы.
Находим в списке Moscow.

Теперь необходимо создать симлинк на этот timezone:
ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime

Проверяем корректность времени сервера и timezone через date. Все работает!

вторник, 15 марта 2011 г.

План запросов в Oracle

--
-- Просмотр плана выполнения SQL запроса по его sql_id
--
select hash_value,
child_number,
lpad(' ',2*depth)||operation||' '||options||decode(id, 0, substr(optimizer,1,6)||' Cost='||to_char(cost)) operation,
object_name object,
cost,
cardinality,
round(bytes / 1024) kbytesfrom,
id,
depth,
access_predicates,
filter_predicates
from v$sql_plan
where sql_id = '...'
order by hash_value, child_number, id;

суббота, 26 февраля 2011 г.

Когда перестают открываться сайты

Если сайты не открываются по прежнему, заходим в реестр, находим HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes и удаляем всё оттуда на фиг! Перезагружаем и радуемся жизни.

суббота, 5 февраля 2011 г.

Полезные утилиты Linux


# shutdown -h 19:30 [сообщение]
Команда завершит работу системы в 19:30 и отправит linux-пользователям [сообщение]

# shutdown -h now
Если нужно завершить работу системы прямо сейчас, вместо времени необходимо указать now.

# shutdown -г now
Команда используется для перезагрузки системы.