Wednesday, September 13, 2017

How to check and kill active file in windows while doing patching?

Issue:

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:

Following files are active :
d:\oracle\product\12.1.0\db_1\bin\oci.dll


Workaround:

D:\oracle\software\Patch>Tasklist /m oci*

Image Name                     PID Modules
========================= ======== ============================================
vmtoolsd.exe                  2288 oci.dll

D:\oracle\software\Patch>net stop "VMTools"

The VMware Tools service was stopped successfully.

D:\oracle\software>Tasklist /m ora*


D:\oracle\software>taskkill /PID 2288 /F

Friday, August 25, 2017

How to get DB ID when database in nomount state?

Issue below command in nomount state.
alter session set tracefile_identifier = DBID_TRACE;

alter system dump datafile 'C:\APP\ORACLE\ORADATA\TESTDB\SYSTEM01.DBF' block min 1 block max 10;

check the trace file

Start dump data block from file C:\APP\ORACLE\ORADATA\TESTDB\SYSTEM01.DBF minblk 1 maxblk 10
 V10 STYLE FILE HEADER:
Compatibility Vsn = 202375680=0xc100200
Db ID=2736190072=0xa316f278, Db Name='TESTDB'
Activation ID=0=0x0

Tuesday, August 15, 2017

ORA-27069: attempt to do I/O beyond the range of the file

Error:

[oracle@cloud1 rdbms]$ sqlplus "/as sysdba"


SQL*Plus: Release 12.1.0.2.0 Production on Mon Aug 14 19:23:07 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ORA-27069: attempt to do I/O beyond the range of the file
Additional information: 479
Additional information: 1
Additional information: 472
ORA-27069: attempt to do I/O beyond the range of the file
Additional information: 479
Additional information: 1
Additional information: 472


Workaround:

trace sqlplus session

strace -o /tmp/problem_strace_sysdba.out -fTtt sqlplus / as sysdba

18885 19:20:43.797919 stat("/u01/app/oracle/audit/test12/", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0 <0 .000011="">
18885 19:20:43.798632 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000010="">
18885 19:20:43.798682 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 14 <0 .000010="">
18885 19:20:43.799524 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000009="">
18885 19:20:43.799578 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000008="">
18885 19:20:43.799622 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 14 <0 .000009="">
18885 19:20:43.799758 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000008="">
18885 19:20:43.799803 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 14 <0 .000009="">
18885 19:20:43.799967 statfs("/u01/app/oracle/audit/test12/ora_audit_00.bin", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=15173137, f_bfree=2119411, f_bavail=1350712, f_files=3858432, f_ffree=3546627, f_fsid={-11706456, 1069661174}, f_namelen=255, f_frsize=4096}) = 0 <0 .000010="">
18885 19:20:43.800015 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 14 <0 .000009="">
18885 19:20:43.800150 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDWR|O_DSYNC) = 14 <0 .000010="">
18885 19:20:43.803933 stat("/u01/app/oracle/audit/test12/", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0 <0 .000011="">
18885 19:20:43.804003 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000012="">
18885 19:20:43.804062 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 15 <0 .000016="">
18885 19:20:43.805632 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000011="">
18885 19:20:43.805691 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000008="">
18885 19:20:43.805735 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 15 <0 .000012="">
18885 19:20:43.805945 stat("/u01/app/oracle/audit/test12/ora_audit_00.bin", {st_mode=S_IFREG|0640, st_size=241664, ...}) = 0 <0 .000009="">
18885 19:20:43.805992 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 15 <0 .000009="">
18885 19:20:43.806076 statfs("/u01/app/oracle/audit/test12/ora_audit_00.bin", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=15173137, f_bfree=2119406, f_bavail=1350707, f_files=3858432, f_ffree=3546626, f_fsid={-11706456, 1069661174}, f_namelen=255, f_frsize=4096}) = 0 <0 .000009="">
18885 19:20:43.806123 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDONLY) = 15 <0 .000009="">
18885 19:20:43.806241 open("/u01/app/oracle/audit/test12/ora_audit_00.bin", O_RDWR|O_DSYNC) = 15 <0 .000009="">


remove or rename ora_audit_00.bin


Tuesday, August 8, 2017

Oracle Support Matrix

Release Schedule of Current Database Releases (Doc ID 742060.1)


Tuesday, April 25, 2017

SQLServer Database Mirroring failed

Error:

TITLE: Database Properties
------------------------------

An error occurred while starting mirroring.

------------------------------
ADDITIONAL INFORMATION:

Alter failed for Database 'foo_copy'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Database&LinkId=20476

------------------------------

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The server network address "TCP://sql02.domain.com:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=1418&LinkId=20476


Workaround

Below grants fixed issue

Grant connect on endpoint::mirroring to public --primary
Grant connect on endpoint::mirroring to public --Mirror

Sunday, April 23, 2017

WARNING OGG-01877 Oracle GoldenGate Manager for Oracle, mgr.prm: Missing explicit accessrule for server collector.

ACCESSRULE, PROG server, IPADDR *, ALLOW
ACCESSRULE, PROG *, IPADDR *, ALLOW


Restart the manager

Monday, April 17, 2017

how to execute dbcc checkdb for all databases in sql server?

exec sp_MSforeachDB 'DBCC CHECKDB (?) WITH ALL_ERRORMSGS, EXTENDED_LOGICAL_CHECKS, DATA_PURITY'

Tuesday, March 21, 2017

exadata cell starting issue


Issue:

Error 18446744073709551605 from io_setup, async ctx = 0x228a8c8
Errors in file /opt/oracle/cell12.1.1.1.0_LINUX.X64_131219/log/diag/asm/cell/cell/trace/svtrc_5110_main.trc  (incident=97):
ORA-00600: internal error code, arguments: [LinuxBlockIO::init], [], [], [], [], [], [], [], [], [], [], []
Incident details in: /opt/oracle/cell12.1.1.1.0_LINUX.X64_131219/log/diag/asm/cell/cell/incident/incdir_97/svtrc_5110_main_i97.trc
Sweep [inc][97]: completed
Mon Mar 20 23:53:45 2017 State dump completed for CELLSRV<5110> after ORA-600 occurred
CELLSRV error - ORA-600 internal error
[RS] Started Service MS with pid 5106
Mon Mar 20 23:54:05 2017
Could not connect to MS socket. Communication with MS may be degraded. errno=110
[RS] monitoring process /opt/oracle/cell12.1.1.1.0_LINUX.X64_131219/cellsrv/bin/cellrsomt (pid: 5103) returned with error: 161


Workaround :

/etc/sysctl.conf

fs.aio-max-nr = 50000000

Thursday, February 23, 2017

Sort by size in linux

du -sk * | sed -e 's_^\([0-9]*\)_\1 KB_' | sort -n

Monday, February 13, 2017

Check OEM threshold settings

select target_name,key_value ,WARNING_THRESHOLD,CRITICAL_THRESHOLD from mgmt$target_metric_settings where metric_column='pctUsed' and target_type='oracle_database' and WARNING_THRESHOLD is not null;

sql query history

SELECT
   h.sample_time,
   u.username,
   h.program,
   h.module,
   s.sql_text
FROM
   DBA_HIST_ACTIVE_SESS_HISTORY h,
   DBA_USERS u,
   DBA_HIST_SQLTEXT s
WHERE  sample_time >= SYSDATE - 60
   AND h.user_id=u.user_id
   AND h.sql_id = s.sql_iD
   and s.sql_text like '%'
   and u.username not in ('SYS')
ORDER BY h.sample_time
/

Thursday, February 2, 2017

Agent is Unreachable (REASON = The agent is running but is currently not ready to accept client requests).

1.) Stop the agent:
emctl stop agent

2.) Set the following properties as shown below:
emctl setproperty agent -allow_new -name MaxInComingConnections -value 150
emctl setproperty agent -allow_new -name _cancelThread  -value 210

3.) Take backup and edit AGENT_INST/sysman/config/emd.properties

Change MaxThreads value to 250

Default
MaxThreads=10

to
MaxThreads=250

4.) Start the agent:
emctl start agent