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.

SQL>connect internal SQL>@catalog in SQL*Plus using Oracle 19c

In Oracle 19c, the `connect internal` command has been deprecated and replaced by the use of `sqlplus / as sysdba` for connecting as a privileged user. Here's how you can initiate the equivalent process in SQL*Plus for Oracle 19c:
Steps to Run the Script
  1. Log in to SQL*Plus as SYSDBA Use the sqlplus command to connect as the SYSDBA user:
          sqlplus / as sysdba
        
    This is equivalent to the old connect internal command.
  2. Run the Script (@catalog) After connecting, run the @catalog script by specifying its full path if not in the current directory. For example:
          @?/rdbms/admin/catalog.sql
        
    Here:
    • ? is an Oracle substitution variable that refers to the value of the ORACLE_HOME environment variable.
    • The script catalog.sql is typically located in the $ORACLE_HOME/rdbms/admin directory.

Notes:
  1. Purpose of the catalog.sql Script: The catalog.sql script creates the Oracle data dictionary views and other necessary database components. This is typically done during database creation.
  2. Ensure SYSDBA Privileges: Only users with SYSDBA privileges can execute this script. Attempting to run it without appropriate privileges will result in an error.
  3. Verify the Database State: Before running catalog.sql, ensure the database is in an open state:
          SELECT status FROM v$instance;
        
    If it's not open, start it:
          STARTUP;
        
  4. Compatibility with Oracle 19c: The process of running scripts like catalog.sql remains largely unchanged across versions but always ensure you're using the correct script paths specific to Oracle 19c.

Complete Example Workflow
$ sqlplus / as sysdba
SQL> STARTUP;
SQL> @?/rdbms/admin/catalog.sql

This will successfully initialize the catalog script in Oracle 19c.

SEMrush Software