Hire me on UpWork
Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Monday, July 13, 2015

How to fix all shortcuts (.lnk) back to open with default.

navigate to this key:

 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.lnk >> just delete the keys highlighted in yellow as shown in the photo below. and log off and back on again.. there... should be all fixed ..Hope This Helps..


Friday, May 23, 2014

How to Connect Forms 6i With Database Version 10g XE / 11g XE ?

As salamualikum (islamic greetings), brothers and sisters. :)
Hope you are well with the grace of Almighty Allah (swt).


You just installed Oracle Database XE version (10g or 11g) and try to connect with forms 6i. When you put the connection string and hit ENTER to connect then Forms/Reports builder hang and "Forcefully Closed".

What happen ?

It's just about the CHARACTER SET mismatch.  Typically XE database version most surelly 
11g XE use Unicode CHARACTER SET, which is "AL32UTF8".

Forms/Reports 6i doesn't support this and supports ("UTF8","WE8MSWIN1252")

Moreover,


Oracle Database 11g Express Edition has no provisions to change/use other charactersets than AL32UTF8 as NLS_CHARACTERSET and AL16UTF16 as NLS_NCHAR_CHARACTERSET
The NLS_CHARACTERSET is used for CHAR, VARCHAR2, LONG and CLOB columns;
The NLS_NCHAR_CHARACTERSET is used for NCHAR, NVARCHAR2 and NCLOB columns.
So, if you migrate data from any previous version of Database like 10g with special character, you will see the bellow problem when importing.

SQL> create table t( c varchar2(3) );

SQL> insert into t values( 'abç' );
insert into t values( 'abç' )
*
ERROR at line 1:
ORA-12899: value too large for column "SCH"."T"."C" (actual: 4, maximum: 3)



What to do ?
Simply alter the CHARACTER SET to previously supported one.

[Script]

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>CD C:\oraclexe\app\oracle\product\11.2.0\server\bin

C:\oraclexe\app\oracle\product\11.2.0\server\bin>SET ORACLE_HOME=C:\oraclexe\app
\oracle\product\11.2.0\server

C:\oraclexe\app\oracle\product\11.2.0\server\bin>SET ORACLE_SID=XE

C:\oraclexe\app\oracle\product\11.2.0\server\bin>echo %ORACLE_SID%
XE

C:\oraclexe\app\oracle\product\11.2.0\server\bin>SQLPLUS/NOLOG

SQL*Plus: Release 11.2.0.2.0 Production on Fri May 23 19:53:42 2014

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

SQL> CONN SYS/SYSTEM11g AS SYSDBA
Connected.
SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL>
SQL> STARTUP RESTRICT
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1384760 bytes
Variable Size             272633544 bytes
Database Buffers          255852544 bytes
Redo Buffers                5791744 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE WE8MSWIN1252;

Database altered.

SQL>
SQL>
SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> STARTUP
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1384760 bytes
Variable Size             272633544 bytes
Database Buffers          255852544 bytes
Redo Buffers                5791744 bytes
Database mounted.
Database opened.
SQL>
SQL> select * from v$nls_parameters where parameter like '%CHARACTERSET%';

PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
WE8MSWIN1252

NLS_NCHAR_CHARACTERSET
AL16UTF16


You are Done :)

BUT ORACLE & I DON'T ENCOURAGE THIS, AS

Oracle recommends Unicode AL32UTF8 as the database character set. Unicode is the universal character set that supports most of the currently spoken languages of the world. It also supports many historical scripts (alphabets). Unicode is the native encoding of many technologies, including Java, XML, XHTML, ECMAScript, LDAP. Unicode is ideally suited for databases supporting the Internet and the global economy.

Praise to Almighty Allah(swt). 
Fi amanillah

Sunday, April 27, 2014

How to Connect Oracle Database with Microsoft Access Database?



As salamualikum (islamic greetings), brothers and sisters. :)

Hope you are well with the grace of Almighty Allah (swt) but stuck in a place when you try to connect oracle database with MS Access database.

In short, you are trying to access MS Access data from Oracle DB.

Lets START…

This connectivity calls heterogeneous connectivity.

Important: The init-parameter GLOBAL_NAMES should have value FALSE. Check this parameter first before continuing the procedure.

In this example, I uses,
Database Name: TESTDB
OS User                :Administrator
OS password     :admin123


Setp 1 – Create Database Link via system DNS

Important: use 32-bit odbc driver for 32-version of oracle database and 64-bit odbc driver for 64-bit oracle database.

A 64-bit version of the Microsoft Windows operating system includes the following versions of the
Microsoft Open Database Connectivity (ODBC) Data Source Administrator tool (Odbcad32.exe):

  >>  The 32-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\SysWoW64 folder.
  >>  The 64-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\System32 folder.
           
 if odbc driver not found on the odbc list then click at  C:\Windows\SysWOW64\odbcad32.exe

(32-bit) for 64-bit download link are

  1. On the Oracle server start the ODBC Data Source Administrator. This can be done by using the run command: go to start/run and type odbcad32 and press enter.
  2. In the ODBC Data Source Administrator window go to the System DSN tab and click on Add...
  3. Choose in the Create New Data Source window the Microsoft Access Driver (*.mdb) and click on Finish.
  4. In the ODBC Microsoft Access Setup window enter the data source name (e.g. TESTDB), the description (e.g. Test database) and select the Access database
    1. If the Access database is on the same machine as Oracle is running, you can ignore step 1.5 and step 2!
  5. If the Access database is on another machine in the network, you should use UNC-path notation. In the Map Network Drive window, leave the drive-letter on (none) and select via the UNC-path (e.g. \\192.168.100.10\HAMS_2013\HAMS_2013.mdb) the Access database. Finish the creation of the ODBC Link and close all the ODBC windows.


Step 2 Create Network ID
In order to perform a good connection to the Access database on another machine, you need to follow the following steps:
  1. Create on the network and user id (e.g. TestDbAdmin) and give this UID read rights on the location of the Access files. NOTE: use the appropriate rights, this depends on the actions you want to take on the Access database.
  2. Place this user, TestDbAdmin, in the ORA_DBA group on the Oracle server.
OR
If you want to use Administrator user account. Go to windows service.  Change the Database and TNS service Log On As administrator.
Right click on a services  >> go properties >> go Log On and use this account.





Restart both the services.

Step 3 Create the Oracle TestDb listener (Oracle HS)
Important: Oracle Database Version 10g (known as inithsodbc.ora), Version 11g (known as initdg4odbc.ora)  
Ø  10g file location: ORACLE_HOME\hs\admin\inithsodbc.ora
Ø  11g file location: ORACLE_HOME\hs\admin\ initdg4odbc.ora

Open the file at notepad and, modify the HS init parameters

HS_FDS_CONNECT_INFO = <odbc data_source_name>
HS_FDS_TRACE_LEVEL = <trace_level>
TO
HS_FDS_CONNECT_INFO = TESTDB ( created at setp 1)
HS_FDS_TRACE_LEVEL = OFF

DATABASE LISTNER Configuration
 Open the file listener.ora (%oracle_home%/network/admin) and add the following text, save and close the file (e.g. 11g database listener)
Original configuration
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\Oracle\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
 )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\Oracle\app\Administrator


Modified Configuration
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\Oracle\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =
      (SID_NAME = dg4odbc)
      (ORACLE_HOME = C:\Oracle\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = dg4odbc)
    )

 )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\Oracle\app\Administrator


Stop and start the listener service or from the command line:
C:\> lsnrctl stop
C:\> lsnrctl start





DATABASE TNSNAMES Configuration
Open the file tnsnames.ora (%oracle_home%/network/admin) and add the following text, save and close the file.
TESTDB =
  (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 1521)
  )
  (CONNECT_DATA =
      (SID = dg4odbc)
  )
  (HS=OK)
 )

Final Step- Create Oracle Database Link to TESTDB
Connect to database as SYS user or any user having create database link privilege.

CREATE PUBLIC DATABASE LINK “TESTDB”    
CONNECT TO "Administrator"      --- OS user name
IDENTIFIED BY "admin123"           --- OS password
USING 'TESTDB';

Test the Link

select * from dual@"TESTDB";
If you got a number of rows back, you're done!
Reference.
### http://adf.ly/tm6Da
### http://adf.ly/tm6NA
Metalink Note
1. Document 1195583.1
2. Document 1475507.1
3. Document 234517.1

If it helps, leave your message.

Praise to Almighty Allah(swt). 


Fi amanillah

Saturday, March 29, 2014

How to Install Oracle Database 11g XE (Express Edition) on Windows 64-bit OS (Operation Systems) ?

As salamualikum (islamic greetings), brothers and sisters. :)

 Huhh, Post again after a long time. I'm passing very busy time. Lot's of change around me.

Come to the topic.


Oracle Database lite and free version is XE (Express Edition).
It's only available windows version is 32-bit, Linux 64-bit also available.Oracle Corporation should have plan of 64-bit also.

If you try to install on a 32-bit windows (will be rare in future, i think), you will success without any error.
Happy installing :)

But, if you try on any 64-bit windows, for example windows 7,8 or windows server 2008R2, you will stuck on a error message and if you skip this, your installation will not success.

So, what to do ???

Follow the bellow step by step guide and InshaAllah, your installation wile be fine..

1. After downloading the .zip file and extract, Right Click on setup.exe and click
Run as Administrator.

2. Click Next up to 3rd Stage and when it prompt for password for SYS and SYSTEM, type the password and remember.

3. then carry on the installation.

Within few min (depends on you pc configuration), you will see error like bellow,
Don't worry, the error indicates, path/location shows in the message is missing in the registry.

Don't click the "OK"

So you need to add it in the registry.
For safety, type the path in the windows explorer address bar and confirm the location and hit ENTER to go to the folder.

Go   start Menu at task-bar and click on run.. type regedit and hit enter key.

Registry editor will open.
Expand ...HKey_classes_root >> Installer >> Products >> 266B7A503A089BE4EAD1986A429434C1 >> SourceList 
Under "SourceList" you will see "Media". Click on Media

At right side, you will see a string named 1.  For example

Select 1 and click modify from right mouse click. Replace the value with the error showing path without KEY_XE.reg


Like
C:\Users\Admini~1\AppData\Local\Temp\{8B1B4465-F4B2-4766-851C-05F060AE5F26}\

Close the Registry Editor and NOW click On OK at the error message.

Then installation will go end. You are done.... :)

Happy installation..

Comments to share your thoughts..


End for the day....





Praise to Almighty Allah(swt).  :)


Fi amanillah