Create Database   «Prev  Next»

Lesson 7 Running the CATALOG Script
Objective Run the CATALOG.SQL script against the COIN database.

Purpose of Running the CATALOG.SQL script

Now that you have successfully created the COIN database, there are a number of housekeeping tasks that you must complete before you can really use it. The first of these tasks is to execute a script named CATALOG.SQL. This script can be found in the $ORACLE_HOME/admin/rdbms directory. Its purpose is to create the data dictionary views used to obtain information about the database. In a nutshell, CATALOG.SQL creates the following:
  1. Public synonyms for all the V$ views
  2. The V_$ views
  3. The DBA views
  4. The ALL views
  5. The USER views
  6. Comments on all the above views, and on the view columns

It is instructive to look at the CATALOG.SQL script, and I encourage you to do so. You can learn a lot about how Oracle's data dictionary works. But whatever you do, do not modify what Oracle has written.

"svrmgrl" is deprecated at the Oracle Command Prompt

While `svrmgrl` is deprecated, you can achieve its functionality using SQL*Plus commands.
Here are some common tasks and their SQL*Plus equivalents:
  1. Show Current Server Status:
    • svrmgrl: `show server`
    • In SQL*Plus the equivalent is :
      SHOW SESSIONS;
      SHOW PARAMETERS SERVERONLY;
      
  2. Start a Specific Service:
    • svrmgrl: `start service service_name`
    • SQL*Plus:
      START SERVICE service_name;
      
  3. Stop a Specific Service:
    • svrmgrl: `shutdown immediate service service_name`
    • SQL*Plus:
      SHUTDOWN IMMEDIATE SERVICE service_name;
      
  4. View Service Information:
    • svrmgrl: `show services`
    • SQL*Plus:
      SELECT * FROM V$INSTANCE;
      

Additional Notes:
  • Connect to a Specific Instance: Use `CONNECT / AS SYSDBA` in SQL*Plus to connect to a specific instance if needed.
  • Explore Further: SQL*Plus offers a wider range of commands for managing Oracle databases. Refer to the SQL*Plus documentation for more details.

Initiate the script `connect internal` followed by `@catalog` in SQL*Plus

Here are the steps to initiate the script `connect internal` followed by `@catalog` in SQL*Plus using Oracle 12c:
  1. Launch SQL*Plus:
    • Open a command prompt or terminal window.
    • Type `sqlplus` and press Enter.
  2. Connect to the database:
    • If prompted for a username and password, enter those credentials.
    • If you're not prompted, you'll be connected to the default database.
  3. Execute the `connect internal` command:
    • At the SQL*Plus prompt (`SQL>`) type:
      connect internal
      
    • Press Enter. This will connect you to the internal administrative user, which has special privileges.
  4. Execute the `@catalog` script:
    • At the SQL*Plus prompt, type:
      	  @catalog
      	  
    • Press Enter. This will execute the script named `catalog.sql`, assuming it's located in the current directory or a directory accessible to SQL*Plus.

Key points:
  1. The `catalog.sql` script is usually used to recompile system objects after certain database operations. It's generally not recommended to run this script unless instructed by Oracle support or a qualified database administrator.
  2. Executing scripts with `@` only works for scripts in accessible directories. Use full paths if needed.
  3. Ensure you have the necessary privileges to connect internally and run the script.
  4. Be cautious when running administrative scripts as they can have significant impacts on the database.

Execution in Legacy Environment using Server Manager

C:\Oracle\Ora81\RDBMS\ADMIN>svrmgrl
SVRMGR>connect internal
SVRMGR>@catalog

This script takes some time to run. On some systems, the CATALOG script takes upwards of an hour to complete. You have to be patient. Before you proceed, make sure that you run this script against your COIN database.