PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/XQUERY/Introduction.md

https://gitlab.com/Guy1394/xml-sample-demo
Markdown | 128 lines | 70 code | 58 blank | 0 comment | 0 complexity | 4db2026e6513fb999b74c5276e4f5d94 MD5 | raw file
  1. Executive Overview
  2. ==================
  3. The XML DB XQUERY example is a browser based demonstration that provides a brief overview of how to write 'pure' XQUery based applications against XMLDB. It shows how the XMLTable operations makes it possible for all of your queries to be expressed as pure XQuery with having to make any additional use of SQL.
  4. Installation Instructions
  5. =========================
  6. Installation is supported for 11.2.0.4.0 and 12.1.0.2.0. For Oracle Database 12c installation, the example can be installed in conjunction with the Oracle Multitenant option, but example must be installed into a Pluggable Database (PDB).
  7. Pre-requisites
  8. --------------
  9. - The XFILES application must be installed prior to installing the example code.
  10. - Interactive installation is only supported under MS-Windows. Script based installation is available for other environments. The target database can be running on any platform as long as that database can be accessed via SQL\*NET.
  11. - For Interactive installations, the installation directory must be a local drive on the installation machine. The use of network or mapped drives can lead to cross-site scripting exceptions being reported by the installation process.
  12. - SQL\*PLUS must be installed on the machine that is being used to perform the installation.
  13. - Credentials are required for two users. The first is a user how has been granted the DBA role. The second is the user who will be used to run the example code. In a multitenant environment these must exist in the PDB that hosts the XFILES application.
  14. Verify that the XFILES application is installed correctly.
  15. ----------------------------------------------------------
  16. Use a browser to verify that the XFILES application has been installed correctly. Start a browser on the installation machine and enter the following URL: HTTP://hostname:port/XFILES. Hostname should be the ip-address of the machine hosting the Oracle Database and port should be the port number allocated to the database’s native HTTP Server. If everything is installed and configured correctly the database should respond with an HTTP page similar to the one shown below.
  17. ![](media/image001.png)
  18. Click the Login Icon[ ![](media/image002.png)]. The browser will request HTTP authentication.
  19. ![](media/image003.png)
  20. Confirm that the user that will be used to run the example code can login to the XFILES applicaiton. Note that the username and password are both case sensitive, and that a database user name is typically uppercase (unless the user was created using as a quoted identifier). If the user cannot login to XFILES ensure that they have been granted XFILES\_USER role.
  21. <span id="_Toc310240961" class="anchor"><span id="_Toc413168751" class="anchor"></span></span>Download and extract the Installation media
  22. -----------------------------------------------------------------------------------------------------------------------------------------
  23. Download the latest version of the application from GitHub. The application can be found [here](https://github.com/oracle/xml-sample-demo/).
  24. ![](media/image004.png)
  25. Use the Download Zip button to download the contents of the GitHub repository. The Zip file will be called xml-sample-demo-master.zip.
  26. <span id="_Toc310240962" class="anchor"><span id="_Toc413168752" class="anchor"></span></span>Windows Installation
  27. ==================================================================================================================
  28. Unzip the archive. This will create a folder called xml-sample-demo-master with a subfolder XQUERY.
  29. ![](media/image005.png)
  30. <span id="_Toc310240963" class="anchor"></span>
  31. Locate the Install Folder
  32. -------------------------
  33. The install folder is a sub-folder of the INSTALLATION folder.
  34. Set correct permissions on the installer files.
  35. -----------------------------------------------
  36. The install folder contains the files needed to perform the installation. The install is performed using a HTML Application file (**install.hta**) which invokes a VBScript (**install.vbs**). In some cases windows may block these files from accessing remote resources. This can prevent the installation from running successfully against a remote database. To ensure that the **install.hta**, and **install.vbs** files are not blocked, right click on each file and select properties
  37. ![](media/image006.png)
  38. If the General Tab of the properties dialog of either file contains an unblock button, click it to allow the file to execute normally.
  39. <span id="_Toc413168755" class="anchor"></span>
  40. Launch the Installer
  41. --------------------
  42. Launch the Installer by typing install.hta at a command prompt or clicking on the install.hta icon. The exact path to the install folder will depend on which example is being installed and which directory was the target for the unzip operation.
  43. ![](media/image007.png)
  44. <span id="_Toc310240965" class="anchor"><span id="_Toc413168756" class="anchor"></span></span>Perform the Installation
  45. ----------------------------------------------------------------------------------------------------------------------
  46. The installer application provides a simple GUI interface that is used to supply parameters to the installation process.
  47. ![](media/image008.png)
  48. Select the correct Oracle Home for the SQL\*PLUS installation. Make sure that all fields contain the appropriate values for your environment, enter the required passwords and click install. The field DBA User must be set to a user who has been granted permissions to connect normally and as DBA. If you are not sure of the correct values for HTTP and FTP port numbers these can be automatically detected using the the Load Ports button. The system will report when the installation is complete.
  49. ![](media/image009.png)
  50. The results of the installation can be found in the XQUERY.log file.
  51. Linux Installation
  52. ==================
  53. A simple install script is provided to allow the example to be installed from a Linux command shell. Unzip the archive generated by GitHub
  54. ![](media/image010.png)
  55. The demonstration is installed using the XQUERY.sh script found in the folder xml-sample-demo-master/XQUERY/install.
  56. To run the installation script first set the current directory to the install directory. Make sure that the environment variables ORACLE\_HOME and ORACLE\_SID are set correctly. Invoke the XQUERY.sh script passing the following arguments on the command line
  57. DBA User. This must be a DBA
  58. The password for the DBA user
  59. The username that will be used to run the example
  60. The password for the user
  61. The URL of the Databases HTTP Listener.
  62. ![](media/image011.png)
  63. Verify the Installation was successful
  64. ======================================
  65. Once the script has completed check the XQUERY.log file for any errors. If there are no errors in the log file verify that the installation completed successfully by opening a browser and navigating to the following URL http://hostname:port/XFILES. Login as the user specified during the installation procedure and click on the “Home” button [![](media/image012.png)].
  66. This will display the users home folder
  67. ![](media/image013.png)
  68. If the demonstration was installed successfully, the home folder contains a folder called demonstrations which inturn contains a folder called XQuery.
  69. Navigate to the XQuery folder and click the index.html file. This should open a new browser tab or window, ready to run the first step of the example.
  70. ![](media/image014.png)