-------------------------------------------------------------------------------
Oracle interMedia Frequently Asked Questions
-------------------------------------------------------------------------------
Last Updated:  Dec 21, 1998

Here are some answers to problems that you might encounter while 
installing and using Oracle interMedia.  

-------------------------------------------------------------------------------
SECTION I: Configuration Issues
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
1)	Problem: I can't create a table using the interMedia types.
-------------------------------------------------------------------------------
	Symptom: ORA-00902: invalid datatype

	Answer:  Oracle interMedia was not configured.

 	Solution I: Configure Oracle interMedia.
		Run DBCA to configure Oracle interMedia.

	Solution II:
		If Solution I fails, install interMedia by hand following
		the manual installation instructions in the README.txt file,
		found in <ORACLE_HOME>/ord/im/admin, where <ORACLE_HOME>
                is the location of the Oracle home directory.. On NT, the 
                README.txt file is in <ORACLE_HOME>\ORD\IM\ADMIN.
		
-------------------------------------------------------------------------------
2) 	Problem: I got errors while installing Oracle interMedia.
-------------------------------------------------------------------------------
        The following errors use the ordimg_pkg package and the ordimglibs 
        library as examples.  You may get similar errors for audio or 
        video packages or libraries.

	Symptom: MGR-00072: Warning: PACKAGE BODY ORDIMG_PKG created with
		 compilation errors.

	Symptom: PLS-00201: identifier 'ORDIMGLIBS' must be declared 
        
	Answer:  The shared library doesn't exist.

	Solution: Recreate the library.
	  For UNIX:
	    	create or replace library ordimglibS as 
                       '<ORACLE_HOME>/lib/libordimg8.so';

	    	where <ORACLE_HOME> is the value of the ORACLE_HOME 
	    	environment variable, ordimglibs is the name of the
                library that can't be found, and libordimg8.so is the
                library file.
	  For NT:
	    	create or replace library ordimglibS as 
                       '<ORACLE_HOME>\BIN\ORAORDIMG8.DLL';

	    	where <ORACLE_HOME> is the location of the Oracle home 
                directory, ordimglibs is the name of the library that 
                can't be found, and oraordimg8.dll is the library file.

-------------------------------------------------------------------------------
3)	Problem: The type exists, but I get errors when I try to use it.
-------------------------------------------------------------------------------
        The following errors use the ordimgb type, the ordimg_pkg package 
        and the ordimglibs library as examples.  You may get similar errors 
        for audio or video packages or libraries.

	Symptom: ORA-06520: PL/SQL: Error loading external library
		 ORA-06522: ld.so.1: extprocextproc: fatal: 
                                     /path/libordimg8.so: 
		 can't open file: errno=2
		 ORA-06512: at "ORDSYS.ORDIMG_PKG", line 207
	         ORA-06512: at "ORDSYS.ORDIMGF", line 8

	Answer: The path for the shared library is invalid. 

	Solution: Recreate the library with the full path name of the library.
	  For UNIX:
	    	create or replace library ordimglibS as 
                       '<ORACLE_HOME>/lib/libordimg8.so';

	    	where <ORACLE_HOME> is the value of the ORACLE_HOME 
	    	environment variable, ordimglibs is the name of the
                invalid library, and libordimg8.so is the library file.
	  For NT:
	    	create or replace library ordimglibS as 
                       '<ORACLE_HOME>\BIN\ORAORDIMG8.DLL';

	    	where <ORACLE_HOME> is the location of the oracle home 
                directory, ordimglibs is the name of the invalid library,
                and oraordimg8.dll is the library file.

	Symptom: ORA-04068: existing state of packages has been discarded
	         ORA-04063: package body "ORDSYS.ORDIMG_PKG" has errors
		 ORA-06508: PL/SQL: could not find program unit being called
		 ORA-06512: at "ORDSYS.ORDIMGF", line 8

	Answer:  The library ORDIMGLIBS may not exist (see above) or the 
                 package needs to be recompiled.

	Solution: Recompile the package.
		connect ordsys/<ordsys password>;
		alter package ordimg_pkg compile

                where <ordsys password> is the password for the ordsys
                account and ordimg_pkg is the package with errors.

-------------------------------------------------------------------------------
4) 	Problem: I'm sure I installed interMedia correctly, but I'm
		 getting RPC errors:
-------------------------------------------------------------------------------
	Symptom: ORA-28576: lost RPC connection to external procedure agent    

	Answer:  The connection information in tnsnames.ora and listener.ora
		 is correct, but the program failed. This is due to 
		 conflicting SID_NAME/SID entries in the listener.ora and 
		 tnsnames.ora files. In other words, the extproc SID_NAME
		 in listener.ora is also being used by another entry.

	Solution:Change the SID_NAME for the extproc entry to something 
		 unique, e.g. extproc or extproc2. Be sure to update the
		 SID entry for extproc_connection_data in the tnsnames.ora 
		 file to also refer to extproc or extproc2.

 	Solution:Test using imgdemo with the imgdemo.dat image. If there are 
                 no errors with the imgdemo.dat image, but when you perform
                 the same operations on your custom images you get this error,
                 then you've found a bug. Please notify your support 
                 representative.

	Symptom: ORA-28575: unable to open RPC connection to external 
		 procedure agent
		 ORA-06512: at "ORDSYS.ORDIMG_PKG", line 207
		 ORA-06512: at "ORDSYS.ORDIMGF", line 8

	Answer:  The external callout program 'extproc' in your tnsnames.ora 
		 file is either invalid or not present.

	Answer:  The external callout program 'extproc' in your listener.ora 
		 file is either invalid or not present.

	Solution: Add/edit the extproc entry in tnsnames.ora. 
		  Check the network configuration guide for your platform
		  for details on creating an entry for extproc.
		
		For UNIX: Add this line in 
		          /<ORACLE_HOME>/network/admin/tnsnames.ora

		extproc_connection_data =
		(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=yourkey))
		(CONNECT_DATA=(SID=extproc)))   

		For NT: Add/edit this line in
		        <ORACLE_HOME>\NETWORK\ADMIN\TNSNAMES.ora

		extproc_connection_data.world = (
		(DESCRIPTION = 
			(ADDRESS = 
				(PROTOCOL=ipc) (KEY=yourkey)
			)
			(CONNECT_DATA = (SID=PLSExtProc)
                                        (PRESENTATION = RO))
		)	

	Solution: Add/edit the extproc entry in listener.ora.
		  Check the network configuration guide for your platform
		  for details on creating an entry for extproc.
		  After you edit the listener.ora file, you must stop
		  and restart the listener. 

		For UNIX: Add/edit this line in 
		          /<ORACLE_HOME>/network/admin/listener.ora


		LISTENER = (ADDRESS_LIST=
 			(ADDRESS=(PROTOCOL=ipc)(KEY=yourkey))
		)

		SID_LIST_LISTENER = (SID_LIST=
 		(SID_DESC=(SID_NAME=yourdb)(ORACLE_HOME=youroraclehome))
 		(SID_DESC=(SID_NAME=extproc)(ORACLE_HOME=youroraclehome)
				(PROGRAM=extproc))
		)

		To stop and restart the listener: lsnrctl
		set password oracle
		stop
		start
		quit

		For NT: Add/edit this line in
		        <ORACLE_HOME>\NETWORK\ADMIN\LISTENER.ora
	
		SID_LIST_LISTENER = 
		  (SID_LIST=
 		    (SID_DESC=
		      (SID_NAME=ORCL)
		    )
 		    (SID_DESC=
		      (SID_NAME=PLSExtProc) (PROGRAM=extproc)
		    )
		  )

		To stop and restart the listener: lsnrctl
		set password oracle
		stop
		start
		quit

		OR, open the control panel and open services. Stop and
		restart the OracleTNSListenerXX service.

-------------------------------------------------------------------------------
IMPORTANT NOTES ABOUT NETWORKING FILES:
-------------------------------------------------------------------------------

		If you install the enterprise edition of the server over
		an existing network installation, then your network
		files may not be properly updated with the new external
		procedure entries. In particular, the extproc entries
		in both tnsnames.ora and listener.ora may not be present at 
		all.  If you encounter this problem and the above instructions
                don't work, rename the network directory to something else, 
		like 'onetwork' and install the enterprise 
		edition components again (without creating a database). 
		This will reinstall the networking components. Your new
		network directory should contain valid extproc entries. 
		Add any other entries from the old directories and then 
		you may delete the old directories.
		
-------------------------------------------------------------------------------
5) 	Problem: How do I know when it works? Is there an easy script to run?
-------------------------------------------------------------------------------
	Answer:  The demos shipped with Oracle interMedia should work 
                 without errors. (Read the manual for instructions on how
		 to run the demos)

-------------------------------------------------------------------------------
Section II: Usage Problems
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
1) 	Problem: I have a simple select statement that doesn't seem to work:
                Assume the following 2 tables have been created and populated
                with one row: 
                  create table images (image ORDSYS.ORDIMGF); 
		  create table image (width integer);

	        select width, image.width from image,images;
                
		WIDTH      WIDTH     
		---------- ----------
       		123        123
-------------------------------------------------------------------------------
   	Answer: You should always use a table alias when using types to prevent
	   	naming conflicts.

   	Solution: Rerun the statement using a table alias.
		select width,t.image.width from image,images t;
		WIDTH      IMAGE.WIDT
		---------- ----------
       		123        600

-------------------------------------------------------------------------------
2) 	Problem: Does the Import/Export utility support Oracle interMedia 
		 directly?
-------------------------------------------------------------------------------
   	Answer: Yes. The 8.0.3+ version of the import/export utilities support
		object types, so you don't need to do any extra work.
		Import your tables containing media types as you would any 
		other table.

-------------------------------------------------------------------------------
3) 	Problem: Does SQL*Loader support Oracle interMedia?
-------------------------------------------------------------------------------
	Answer:  Yes.  The 8.1 version of the SQL*Loader will support loading
                 of interMedia objects directly.  

	Solution: Image, Audio and Video objects can be loaded into the 
                  database by using the SQL*Loader BLOB interface.  Image,
                  Audio and Video objects stored as external files can be 
                  loaded by loading the srcLocation, srcName, and srcType 
                  attributes using the SQL*Loader string interface.  

-------------------------------------------------------------------------------
4)	Problem: Does Oracle interMedia support read only media, such as 
                 CDROMs?
-------------------------------------------------------------------------------
	Answer: Yes. Create a directory mapping to your read-only media and
		treat it like any other directory.

	Solution:
		connect sys/change_on_install
		grant create directory to scott;
		connect scott/tiger;
		create directory myreadonlycds as 'E:\MEDIA';

-------------------------------------------------------------------------------
5) 	Problem: How do I extract the full path from a directory object?
-------------------------------------------------------------------------------
	Answer: The full path name may be found in the view named 
		ALL_DIRECTORIES.

	Solution: The following selects the full path for the images directory.
		select directory_path from all_directories 
		where directory_name = 'IMAGES';

