Large Number of Trace Files Generated Every 5 min Under $ORACLE_BASE/grid/cv/log/

Hello all,

Recently, I’ve found that 14GB space was eaten by $ORACLE_BASE/grid/cv/log/.  As I found on metalink, this logging is enabled by default by implicitly setting SRVM_TRACE=”true”.

The reason is that EM Grid Control agent  verifies the status of the cluster  in every 5mins and the logs are being generated in the specified location.

If you don’t want agent to generate logs, do the following:

Modify cluvfy script, located in $ORACLE_BASE/grid/bin, by adding SRVM_TRACE=”false” at top of script(approximate line number is 25).

In addition, you can delete these logs without any problem to free up the space.

That is all.

Oracle Universal Installer: Abnormal Program Termination

After installing/uninstalling Oracle  there may appear the following alert:

Abnormal Program Termination OUI

This is very known error.

To solve this, do the following steps:

Note that I am explaining the steps for installing Oracle, after you read this you will be able to solve the problem during uninstalling Oracle.

1. Find setup.exe file and go to its properties(right click -> properties)

setup_properties

2.  Go to “Compatibility” tab  and check “Run this program in compatibility mode for:“. Then choose “Windows XP (Service pack 3)” or what ever you prefer.

setup_properties_Compatibility

Click ok.

3. Right click “setup.exe” and choose “Run as administrator

That it! Good Luck!

Database Mail – test is OK, but jobs do not notify

  1. Run SQL Server Management Studio.

  2. In Object Explorer, expand the server.

  3. Right-click on the SQL Server Agent and then click its Properties.

  4. Click Alert System.

  5. Check Enable Mail Profile.

  6. In the Mail system list choose Database Mail.

  7. In the Mail profile list select a mail profile.

  8. Restart the SQL Server Agent

Good Luck!

ORA-01017: invalid username/password; logon denied(database link error)

When I was creating database link from Oracle 10g to 11g like that:

SQL> create database link mylink_name connect to myuser_name identified by mypassword using 'MYSID';

Database link created

got ORA-01017 error.

Cause:

This may happen if in 11g database, there is enabled the following parameter:

SQL> show parameter sec_case_sensitive_logon;

NAME                                 TYPE        VALUE
----------------------------------- --------- ------------------------------
sec_case_sensitive_logon             boolean     TRUE

 

Solution:

Recreate database link by the following way:

SQL> drop database link mylink_name;

Database link dropped

SQL> create database link mylink_name connect to "myuser_name" identified by "mypassword" using 'MYSID';

Database link created

To check it:

SQL> select * from dual@mylink_name;

DUMMY
-----
X

Reset root password in CentOS 5.5

If you don’t know the root password and want to login in to the server, follow these instructions:

Picture 1: Press “e” to edit.

Centos 5.5 VirtualBox Reset root Password

Picture 2: Press “e” to edit.

Centos 5.5 VirtualBox Reset root Password

Picture 3: Type “S” at the end of the line. Press Enter.

Centos 5.5 VirtualBox Reset root Password

Picture 4: After pressing Enter, you will see the following picture. Press “b” to boot.

Centos 5.5 VirtualBox Reset root Password

Picture 5: You will see the following picture…

Centos 5.5 VirtualBox Reset root Password

Type “su –” and you will be a root user.

To make it permanent you should edit it in the following file:

vi /boot/grub/menu.lst
default=0
timeout=5
.
.
.
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 S
.
.
.

ORA-01466 unable to read data – table definition has changed

This is a time-based read consistency error, which may occur during flashbacking object.

For example, I was running the following statement:

SELECT text
FROM dba_views AS OF TIMESTAMP to_timestamp('8-SEP-2011 6:14:35','DD-MON-YYYY HH24:MI:SS')

ORA-01466: unable to read data - table definition has changed

 

Let’s check undo_retention parameter:

SQL>  SELECT value/60/60 as Hours
 2    FROM v$parameter
 3    WHERE name='undo_retention';

    HOURS
---------
3.02777777

So my retention period is 3hours…If I want to flashback object to before more than 3 hours I will get ORA-01466.

Oracle 11.2.0.1.0 em.ear file not found

During the installation of Oracle 11.2.0.1.0 you may face the following error:

file not found

%ORACLE_HOME%\oc4j\j2ee\oc4j_applications\applications\em.ear file

image

 

The database installation package consist of two files:

win32_11gR2_database_1of2
win32_11gR2_database_2of2

To solve the problem: You should extract each of them and place win32_11gR2_database_2of2 content into win32_11gR2_database_1of2 folder before running installer.

Send Mail from SQL Server 2005

Hello Geeks,

I am planning to post very very useful thing.

Once at my work, one co-worker asked me to write such thing:

Retrieve query result from SQL Server 2005, save it as a .csv file and sent it to some recipients everyday at some time.

So let’s start it…

1. First of all you should create Profile and Account.

 

SQL Server Configure Database Mail

SQL Server  Database Mail Configuration Wizard

Next>

SQL Server  Database Mail Configuration Wizard_Select Configuration_Task

Next>

SQL Server  Database Mail Configuration Wizard_New_profile

Click Add…

SQL Server Database mail Account

Click OK…

SQL Server Database Mail Configuration Wizard New Profile

Next>

SQL Server Database Mail Configuration Wizard Manage Profile Security

Next>

SQL Server Database Mail Configuration Wizard Configure System Parameters

Next>

SQL Server Database Mail Configuration Wizard Complete the Wizard

Click Finish…

Everything should be successful.

2. We should enable Database Mail on the server. Using Database Mail XPs.

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE
GO
sp_configure 'show advanced options', 0;
GO
RECONFIGURE;
GO

3. Let’s send mail… Using msdb.dbo.sp_send_dbmail procedure… Indicating the following parameters.

EXEC msdb.dbo.sp_send_dbmail @profile_name = 'sqlReport', @recipients = 'mariam.kupa@gmail.com', @subject = 'SQL Report', @body_format = 'HTML',
@body = '.............', @query = 'SELECT * from [testDB].[dbo].[v_Report_Mari] order by [Computer Name]', @attach_query_result_as_file = 1, @query_attachment_filename = 'qry.csv', @query_result_no_padding = 1, @append_query_error = 1, @exclude_query_output = 1, @query_result_header = 1, @query_result_separator=' '

Let’s discuss each parameter:

[ @profile_name = ]  This is the name of the profile from where message will be sent(We set up it before, 1st step)

[ @recipients = ]       This is a semicolon-delimited list of e-mail addresses to send the message to.

[ @subject = ]           This is the subject of the e-mail message.

[ @body_format = ]   This is the format of the message body. Available values are: TEXT (default) and HTML.

[ @body = ]               This is the body of the e-mail message.

[ @query = ]              This is a query to execute. It’s result can be attached as a file, or included as a text message included in the body . Consider that the query is executed in a separate session and local  variables in the script using sp_send_dbmail can not be used.

[ @attach_query_result_as_file = ] Available values are 1 (YES) and 0 (NO).

[ @query_attachment_filename = ] Name of the attached file.

[ @query_result_no_padding = ]     Available values are 0 (padding) and 1 (no padding). If you indicate 1 it possibly reduce the file size,because there will not be any padding. Default value is 0.

[ @append_query_error = ]             Available values are 0 and 1. If any error occurs in the query indicated in [ @query = ] and that parameter value is 1, then mail will be sent appended with the error message. If the value is 0 then mail will not be sent. Default value is 0.

[ @exclude_query_output = ]        When the value is 1, the execution of the sp_send_dbmail does not print any of the query execution messages on the console. For 0 it is vice versa. The default value is 0.

[ @query_result_header = ]           Specifies whether the query results include column headers. Available values are 1 and 0.

[ @query_result_separator = ]       Indicates by which columns should be separated. Default value is ‘ ’(space). In our example, i ‘ve indicated TAB, just type 2 quotation marks place cursor between of them and press desired key, in our case TAB.

4. Increase the mail size limit from Database Mail. You can do it during setting up the account but I prefer to discuss it separately.

SQL Server Configure Database Mail

SQL Server  Database Mail Configuration Wizard

Next>

SQL Server  Database Mail Configuration Wizard View Change system parameters

Next>

SQL Server  Database Mail Configuration Wizard View Change system parameters

Next>

5. Creating job…

SQL Server Create New Job

SQL Server New Job General Tab

SQL Server New Job Steps Tab

Insert our code in the Command field:

SQL Server New Job Steps General Tab

SQL Server New Job Schedules

SQL Server New Job Schedules Job Schedule

It is easy to understand, I will not explain… This window is for to schedule job for the specified time. Click OK..OK…

Usefull view for checking email status:

SELECT *
FROM msdb.dbo.sysmail_event_log

 

That is all..

ORA-20446: The owner of the job is not registered

If you have the following error in EM:

ORA-20446: The owner of the job is not registered ORA-06512: at "SYSMAN.MGMT_JOBS", line 168 ORA-06512: at "SYSMAN.MGMT_JOBS", line 86 ORA-06512: at line 1

It is said to be a bug in  Oracle 11g .

To solve this, you should login as a sys user and run the following command:

execute MGMT_USER.MAKE_EM_USER('USERNAME');

ORA-28221: REPLACE not specified

Very interesting situation. This error occurs, when user’s profile has limit password_verify_function, at the same time user doesn’t have ALTER USER privilege and trying to run the following statement:

ALTER USER my_user IDENTIFIED BY my_password;

* If user doesn’t have that limit in profile, he/she can change its password by this way without any problem.

* If she/he has that limit, it should have ALTER USER privilege to change password by this way without any problem.

 

There is also another way, if you are not able to change password by the previous command, but you must know old password:

ALTER USER my_user IDENTIFIED BY my_password REPLACE my_old_password;

Just one more trick in Oracle, that you should know…