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:
- Public synonyms for all the V$ views
- The V_$ views
- The DBA views
- The ALL views
- The USER views
- 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.
While `svrmgrl` is deprecated, you can achieve its functionality using SQL*Plus commands.
Here are some common tasks and their SQL*Plus equivalents:
- Show Current Server Status:
- Start a Specific Service:
- Stop a Specific Service:
- View Service Information:
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.
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
-
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.
-
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:
-
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.
-
Ensure SYSDBA Privileges:
Only users with
SYSDBA
privileges can execute this script. Attempting to run it without appropriate privileges will result in an error.
-
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;
-
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.