⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 installation.htm

📁 Oracle PL/SQL procedure generator (second generator type)
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<HTML>
<HEAD>
<TITLE>PL/Generator Installation</TITLE>
</HEAD>
<BODY bgcolor="white" background="bar_products.gif">

<table border=0 cellspacing=0 cellpadding=0 valign=top  width=750>
<tr><td width="51" valign=top>

<br>

<td valign="top" width="699">


<IMG SRC="generator.gif" WIDTH=285 HEIGHT=48>


<br>
<hr>
<P>


<FONT SIZE=4><B>Part 2. Installation</B></FONT>
<P>
These steps detail the process that you should follow to install the
PL/Generator back-end. We highly recommend that you read through all of the steps in order before you begin your installation. 
<P>
Installing PL/Generator into Oracle requires SQL*Plus as all installation scripts use the START or @ command to execute operating system files to install packages and tables.<h2><font size="3">

<A HREF="#Requirements">Requirements</A><BR>

<A HREF="#Server">Server-Side Install of PL/Generator</A> 



</font></h2>



<DIR>

<P>

<A HREF="#Step1">Step 1. Create the PL/Generator Account and Grant Privileges</A><BR>

<A HREF="#Step2">Step 2: Install PL/Generator Objects</A><BR>

<A HREF="#Step3">Step 3: Install Demonstration Software</A> </DIR>



<h2>

<font size="3">

<A HREF="#PLG">Removing PL/Generator</A><BR>

<A HREF="#Objects">Removing Objects from Database</A><BR>

<A HREF="#Software">Removing Software from Disk</A>

</font></h2>

<P>

<HR>

<P>

  



<B><FONT  SIZE=4><A NAME="Requirements">Requirements</A></B></FONT>

<P>

To run the PL/Generator server-side component, you will need to be running Oracle 7.3 or above. The source code for PL/Generator will require approximately five megabytes of storage in the Oracle data dictionary. 

<P>

To run code generated by PL/Generator, you will need to be running Oracle 7.1 or above (note: some options will require Oracle 7.3 or above, but not all generated code will necessarily include that restriction). 



<B><FONT  SIZE=4><P><A NAME="Server">Server-Side Install of PL/Generator</A>  </FONT>
  </B>
<P>
<B><I><A NAME="Step1"> Step 1: Create the PL/Generator Account And Grant Privileges </A> </B></I>
<P>
The first step in installing PL/Generator is to choose or create an Oracle user account into which the code and tables will be installed, hereafter referred to as the PL/Generator account. You can use a pre-existing account, but you are probably better off installing all software in a "fresh" account. 
<P>
The recommended name for the PL/Generator account is PLGENERATOR. You should not use PLGGEN or the name of any PL/Generator package name as your schema name. You should also avoid any schema names that start with PLV to avoid conflicts with PL/Vision objects. Any of those names could cause compile errors and inconsistent behavior. 
<P>
The PL/Generator account must have the following privileges:
<P>
  CONNECT role<BR>
  RESOURCE role (or the individual privileges required to create tables, indexes, synonyms and PL/SQL code).<BR>
  DROP PUBLIC SYNONYM privilege<BR>
  CREATE PUBLIC SYNONYM privilege<BR>
  SELECT ANY TABLE privilege<BR>
  EXECUTE ON DBMS_PIPE<BR>
  EXECUTE ON DBMS_SQL
<P>
Note that the individual privileges must be granted explicitly and not through a role. The file plggrant.sql will execute these individual commands (all except the GRANT CONNECT); you must, however, run it from the SYS account (it owns the DBMS_PIPE package), as in:
<PRE>
  SQL&gt; connect sys/change_on_install
  SQL&gt; @plggrant PLGENERATOR
</PRE>
In addition, if you want PL/Generator to automatically compile your generated code, you will need to grant the following privileges to the PL/Generator account (and the PL/Vision account if you have a licensed version of PL/Vision already installed in a different schema):
<P>
  CREATE ANY PROCEDURE
  ALTER ANY PROCEDURE 
<P>
Note that these privileges must be granted explicitly and not through a role. 
<P>
<B>Please confirm that all roles and privileges have been successfully assigned to the PL/Generator account before continuing with the installation.</B>


<P>
<B><I><A NAME="Step2"> Step 2: Install PL/Generator Objects </A> </B></I>
<P>

PL/Generator's files will also, by default, be stored in a directory called c:\Program Files\Quest Software\PLGenerator\Source. If your database server is on a different computer, you may need to copy the files to that location. 
<P>
When running Oracle 7, connect to the PLGENERATOR schema and run the following script:
<PRE>
   SQL&gt; @plginst7 
</PRE>
When running Oracle 8, connect to the PLGENERATOR schema and run the following script: 
<PRE>
   SQL&gt; @plginst8 
</PRE>

These scripts will create all the necessary objects (leaving your existing Object Information Repository information in place). It will also confirm the installation and show you any problems that had been encountered during the installation<P>

<B><I>Set Up UTL_FILE </B></I>

<P>

You will also need to make sure that UTL_FILE is enabled in your database (this allows you to read/write operating system files). The init.ora file must have at least one utl_file_dir parameter in it for this to work. 

<P>

UTL_FILE lets you read and write files accessible from the server on which your database is running. So, theoretically, you could use UTL_FILE to write right over your tablespace data files, control files and so on. That is, of course, a very bad idea. Server security requires the ability to place restrictions on where you can read and write your files. 

<P>

UTL_FILE implements this security by limiting access to files that reside in one of the directories specified in the init.ora file (parameter initialization file) for the database instance on which UTL_FILE is running. 

<P>

When you call UTL_FILE.FOPEN to open a file, you must specify both the location and the name of the file, in separate arguments. This file location is then checked against the list of accessible directories.  

<B>

<P>

Note:</B> with PLVfile, you can as an option set a default directory and then not have to provide a location each time you want to open a file. 

<P>

The format of the parameter for file access in the init.ora file is: <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = &lt;directory&gt; </DIR>

</DIR>



</FONT>

<P>

Include a parameter for utl_file_dir for each directory you want to make accessible for UTL_FILE operations. The following entries, for example, enable four different directories in Unix: <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = /tmp<BR>

utl_file_dir = /ora_apps/hr/time_reporting<BR>

utl_file_dir = /ora_apps/hr/time_reporting/log<BR>

utl_file_dir = /users/test_area </DIR>

</DIR>



</FONT>

<P>

To bypass server security and allow read/write access to all directories, you can use this special syntax: <DIR>

<DIR>





<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = * </DIR>

</DIR>



</FONT>

<P>

You should not use this option on production systems. In a development system, this entry certainly makes it easier for developers to get up and running on UTL_FILE and test their code. You should, however, only allow access to a few specific directories when you move the application to production. 

<P>

Some observations on working with and setting up accessible directories with UTL_FILE: 

<P>

Access is not recursive through subdirectories. If the following lines were in your init.ora file, for example, <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = c:\group\dev1<BR>

utl_file_dir = c:\group\prod\oe<BR>

utl_file_dir = c:\group\prod\ar </DIR>

</DIR>



</FONT>

<P>

then you would not be able to open a file in the c:\group\prod\oe\reports subdirectory. 

<P>

Do not include the following entry in Unix systems: <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = . </DIR>

</DIR>



</FONT>

<P>

This would allow you to read/write on the current directory in the operating system. 

<P>

Do not enclose the directory names within single or double quotes.  

<P>

In the UNIX environment, a file created by UTL_FILE.FOPEN (and therefore with PLVfile.fopen as well) has as its owner the shadow process running the Oracle instance. This is usually the oracle owner. If you try to access these files outside of UTL_FILE, you will need to have the correct privileges (or be logged in as oracle) to access or change these files. 

<P>

You should not end your directory name with a delimiter, such as the forward slash in Unix. The following specification of a directory will result in problems when trying to read from or write to the directory: <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

utl_file_dir = /tmp/orafiles/ </DIR>

</DIR>



</FONT>

<P>

After you modify your parameter initialization file, you will need to stop and then restart your database instance. 

<B><I>

<P>

Test UTL_FILE Access 

</B></I>

<P>

The PLGadmin package provides the test_fileIO procedure you can use to confirm that UTL_FILE is configured properly. Here is the header for this procedure: <DIR>

<DIR>



<CODE>

<P>

PROCEDURE PLGadmin.test_fileIO (<BR>

  loc IN VARCHAR2,<BR>

  nm IN VARCHAR2 := 'plgen.tst'); </DIR>

</DIR>



</CODE>

<P>

So if you have enabled UTL_FILE access to the 'tmp/code' directory, then if you execute these commands in SQL*Plus: <DIR>

<DIR>



<FONT FACE="Courier New" SIZE=2>

<P>

SQL&gt; set serveroutput on<BR>

SQL&gt; exec plgadmin.test_fileIO ('tmp/code') </DIR>

</DIR>



</FONT>

<P>

you should find a file named 'plgen.tst' in that directory containing the single line "hello world". If an error occurs, it will be displayed on your screen (note: the "set serveroutput on" is not required for UTL_FILE to work, but simply to display any errors which might occur). 

<B><I>

<P>



<A NAME="Step3">Step 3: Install Demonstration Software</A> 



</B></I>

<P>

This is an optional step. To make it easier to understand PL/Generator and how it works, Quest Software provides a set of demonstration tables, calls to the PL/Generator API and the resulting, generated code.  

<P>

To install the tables and also set up the PL/Generator OIR as necessary to produce the code you find in the demonstration directory, take the following steps: 

<P>

1. Connect to a schema that does <I>not</I> own the PL/Generator code. 

<P>

2. Run the tedemo.sql script (located by default in the c:\Program Files\Quest Software\PLGenerator\Demo subdirectory). This script creates the database objects (several tables, along with indexes and sequences) and then makes the calls to the PLGdoir package necessary to populate the Object Information Repository. 

<P>

3. Copy the *.gdr files from Demo subdirectory to the same directory containing all the other driver files.



<TABLE BORDER=1 CELLSPACING=1 BORDERCOLOR="#000000" CELLPADDING=7 WIDTH=700>

	<TR>

		<!-- Row 1 Column 1 -->

		<TD>

			<B>Note: </B>As you will see in the tedemo.sql script, the loc table encapsulator package uses a function to retrieve the next primary key. This function is defined in the PL/Vision PLVdyn package. Here is the relevant line in tedemo.sql:



   PLGdoir.setpkyfunc (PLGte.driver, 'loc', 'PLVdyn.nextseq(''loc_id_seq'')');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -