Create Database   «Prev  Next»

Lesson 8Running the CATPROC script
ObjectiveRun CATPROC.SQL script against the COIN database.

The Purpose of running CATPROC.SQL script

Another critical script that you need to run is CATPROC.SQL. You will find it in the same directory in which you found CATALOG. CATPROC.SQL's purpose is centered around PL/SQL. It creates a number of PL/SQL-related data dictionary views, and an innumerable (well almost) number of built-in PL/SQL packages. Some of the highlights of what CATPROC.SQL creates are:
  1. The DBMS_STANDARD PL/SQL package
  2. PL/SQL related views such as DBA_SOURCE, USER_TRIGGERS, and ALL_TRIGGER_COLS
  3. A myriad of other built-in PL/SQL packages such as DBMS_SESSION, DBMS_UTILITY, and DBMS_SYSTEM
  4. Public synonyms for the above views and packages

How to run the script

If you look in the CATPROC.SQL file, you will see that it mostly just calls a bunch of other script files. Some of those, DBMSUTIL.SQL for example, call other files in turn. You run CATPROC.SQL by using SQL*Plus.

Initiate the SQL>connect internal SQL>@catproc.sql using SQL*Plus in Oracle 12c

Here are the steps on how to initiate the following script SQL>connect internal SQL> using SQL*Plus in Oracle 12c:
  1. Open SQL*Plus:
    • On Windows: Click on the Start menu and type "sqlplus". Then, click on the "SQL*Plus" icon to open the program.
    • On macOS: Open Terminal and type "sqlplus". Press Enter to start SQL*Plus.
    • On Linux: Open Terminal and type "sqlplus". Press Enter to start SQL*Plus.
  2. Connect as SYSDBA:
    • Type the following command to connect to the Oracle database as the SYSDBA user:
      SQL> connect sys as sysdba;
      
    • You may be prompted to enter the SYSDBA user's password. Enter the password and press Enter.
  3. Set the ORACLE_HOME Environment Variable:
    • You need to set the ORACLE_HOME environment variable to point to the directory where Oracle 12c is installed.
    • On Windows: Right-click on the "My Computer" icon and select "Properties". Click on the "Advanced" tab and then click on the "Environment Variables" button. In the "System variables" section, find the "ORACLE_HOME" variable and double-click on it. Set the "Variable value" field to the directory where Oracle 12c is installed.
    • On macOS: Open Terminal and type the following command:
      export ORACLE_HOME=/usr/local/oracle/12c
      

      Replace "/usr/local/oracle/12c" with the actual directory where Oracle 12c is installed on your system.
    • On Linux: Open Terminal and type the following command:

    export ORACLE_HOME=/usr/local/oracle/12c
    

    Replace "/usr/local/oracle/12c" with the actual directory where Oracle 12c is installed on your system.
  4. Run the Script:
    • Type the following commands to run the script:
       
      	SQL> @catproc;
      	
    • This will execute the script named "catproc" in the current directory.
  5. Exit SQL*Plus:
    • To exit SQL*Plus, type the following command:

    SQL> exit;
    
By following these steps, you can initiate the script "catproc" using SQL*Plus in Oracle 12c.

CATPROC takes even longer to run than CATALOG. On the production systems that I manage, where I have plenty of memory and fast SCSI disks, I allow at least 1 hour. On some slower systems, this can take well over two hours. You have to run it, though. Before you proceed, make sure that you run CATPROC.SQL against your COIN database.