Sunday, 31 March 2019

UNIX and Windows : Command to find a string in a files including sub-directories


Search for ORACLE_HOME in UNIX

grep -H -r "ORACLE_HOME" /home/oracle




Search for ORACLE_HOME in Windows

finstr /M /C:"ORACLE_HOME"  *.*

Saturday, 2 March 2019

ORA-39171: Job is experiencing a resumable wait

ORA-39171: Job is experiencing a resumable wait
                                                 Last update (2012-05-03 06:48:50)
                                                                                                                   Date added (2019-01-25 04:08:20)
Summary
In the datapump import phase you get errors related to tablespace allocation. For example you don't have any more space left at the filesystem. So at the import you have errors:
Import: Release 11.2.0.4.0 - 64bit Production on Wednesday, 25 Jan, 2019 12:06:16

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  HOSPITAL/******** DIRECTORY=DWH_TRANSFER_DIR DUMPFILE=HOSPITAL.dmp parfile=target_bill_par.par
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39171: Job is experiencing a resumable wait.
ORA-01658: unable to create INITIAL extent for segment in tablespace USERS
How to restart Datapump
1. In the IMPDP command line, press CTRL-C to stop the job.
2. At the command line of the import
Import> stop_job=immediate
Are you sure you wish to stop this job ([yes]/no): y
3. Fix the tablespace error
4. Attach again the job. Check sqlplus>SELECT * FROM DBA_DATAPUMP_JOBS;
Use the job name which is something like "SYS_IMPORT_FULL_*"
$impdp system/**** attach=SYS_IMPORT_FULL_01
5. At the command line of the import
Import> start_job
6. Check sqlplus>SELECT * FROM DBA_DATAPUMP_JOBS; It is running again.

Wednesday, 27 February 2019

Oracle Database: Open Wallet Automatically After Starting The Database.

create one trigger which will open the wallet automatically immediately after database opened:


CREATE or replace TRIGGER OPEN_WALLET
AFTER STARTUP ON DATABASE
BEGIN
execute immediate ‘ALTER SYSTEM SET ENCRYPTION WALLET OPEN identified by “xxxxx”’;
END;
/

Tuesday, 26 February 2019

Oracle Database 18c: Check latest applied patches queyr DBA_REGISTRY_SQLPATCH

Check latest applied patches queyr DBA_REGISTRY_SQLPATCH



Upgrading oracle 18.4 to 18.5 opatchauto: Prerequisite check "CheckApplicable" failed

Issue:
[Feb 27, 2019 10:13:52 AM] [INFO]   Patch 28864593:
                                    Copy Action: Source File "/oracle/PATCHES/28828717/28864593/files/bin/ocrcheck.bin" does not exists or is not readable
                                    'oracle.has.crs, 18.0.0.0.0': Cannot copy file from 'ocrcheck.bin' to '/grid/app/18.3/bin/ocrcheck.bin'
                                    Copy Action: Source File "/oracle/PATCHES/28828717/28864593/files/bin/ocrconfig.bin" does not exists or is not readable
                                    'oracle.has.crs, 18.0.0.0.0': Cannot copy file from 'ocrconfig.bin' to '/grid/app/18.3/bin/ocrconfig.bin'
[Feb 27, 2019 10:13:52 AM] [INFO]   Prerequisite check "CheckApplicable" failed.
                                    The details are:


Solution:
Owner of the patch file should be grid home owner, extract the patch with grid user or change file ownership to the user.

Upgrading oracle 18.4 to 18.5 Prerequisite check "CheckActiveFilesAndExecutables" failed.

I faced this issue: 
Following executables are active : libclntsh.so.18.1
                                    /oracle/app/product/18.3/lib/libclntsh.so.18.1
                                    /oracle/app/product/18.3/lib/libsqlplus.so
[Feb 26, 2019 2:47:28 PM] [SEVERE]  OUI-67073:UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.



                                  The details are:


                                    Following executables are active :
                                    /grid/app/18.3/lib/libclntsh.so.18.1
                                    /grid/app/18.3/lib/libasmclntsh18.so
                                    /grid/app/18.3/lib/libskgxp18.so
                                    /grid/app/18.3/bin/oracle


Solution:
1- Stop the oracle emagent.
2- Stop the CRS using "crsctl stop crs -f"
3- Re-run the patch using opatchauto resume


Friday, 15 February 2019

Convert from VirtualBox to VmWare Workstation




Convert from VirtualBox to VmWare Workstation



Export the ova from virtualbox

Open virtualbox, make sure guest you want to export is not running.
Highlight guest, file--> Export Appliance
Select OVF 1.0 and check 'Write Manifest'

rename the file to .zip or .rar and extartct it.




Convert the vmdk file(s):
Open a cmd prompt and navigate into your vmware folder to find the vmware-vdiskmanager.exe
In my case it was in 'c:\program files (x86)\vmware\vmware workstation' folder.
use the vdiskmanager.exe utility to convert the existing vmdk file(s) to a format that vmware likes better...


run this:
vmware-vdiskmanager -r "c:\OVF\Oracle DB Developer VM-disk001.vmdk" -t 2 c:\OVF\VM-disk0001.vmdk
vmware-vdiskmanager -r "c:\OVF\Oracle DB Developer VM-disk002.vmdk" -t 2 c:\OVF\VM-disk0002.vmdk
vmware-vdiskmanager -r "c:\OVF\Oracle DB Developer VM-disk003.vmdk" -t 2 c:\OVF\VM-disk0003.vmdk


Where sourcedisk is in the extracted ova from virtualbox and targetdisk is the location of where you want the export to happen.
I used the same filename for source and target, not sure if this matters or not.
I did get a warning each time I did this but it did not cause any problems for me.
VixDiskLib: Invalid configuration file parameter.  Failed to read configuration file.


After converting the disk:

Create a new virtual machine, advanced and use existing hard disk
point to the converted disk(I selected the larger vmdk file, not the 'flat' version that was 1k)
Make that disk SATA instead of SCSI(SCSI caused bluescreen when it tries to boot in my scenario).
Select 'Convert' rather than 'Keep existing format'


Now launch the VmWare Workstation and start up your image...

Number of Visitors