Lesson 8 | Running the CATPROC script |
Objective | Run CATPROC.SQL script against the COIN database. |
connect internal
command has been deprecated and replaced by the use of `sqlplus / as sysdba` for connecting as a privileged user.sqlplus
command to connect as the SYSDBA user:
sqlplus / as sysdbaThis is equivalent to the old
connect internal
command.
@catalog
)
After connecting, run the @catalog
script by specifying its full path if not in the current directory. For example:
@?/rdbms/admin/catalog.sqlHere:
?
is an Oracle substitution variable that refers to the value of the ORACLE_HOME
environment variable.catalog.sql
is typically located in the $ORACLE_HOME/rdbms/admin
directory.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.
SYSDBA
privileges can execute this script. Attempting to run it without appropriate privileges will result in an error.
catalog.sql
, ensure the database is in an open state:
SELECT status FROM v$instance;
STARTUP;
catalog.sql
remains largely unchanged across versions but always ensure you're using the correct script paths specific to Oracle 19c.
$ sqlplus / as sysdba SQL> STARTUP; SQL> @?/rdbms/admin/catalog.sql
CATPROC.SQL
Here's a systematic approach to handling the execution of CATPROC.SQL
in an Oracle database environment:
Before running any significant operations like CATPROC.SQL
, it's crucial to ensure you have a recent backup. This allows you to recover if something goes wrong.
RMAN> BACKUP DATABASE;
Since you mentioned having systems with ample memory and fast SCSI disks, ensure these resources are optimally configured for the operation. Check resource allocation if your database server is shared.
Verify that the version of CATPROC.SQL
matches your Oracle database version. Running an incompatible script might lead to errors or incomplete procedures.
Given CATPROC.SQL
can take over an hour to run, plan this maintenance during a time of low system load or scheduled maintenance windows to minimize impact on users or applications.
Connect to your database as a user with appropriate permissions (usually SYSDBA) and run the script:
SQL> CONNECT / AS SYSDBA SQL> @?/rdbms/admin/catproc.sql
Keep an eye on the process. You can use SQL*Plus or another SQL client to monitor progress or errors:
SQL> SELECT * FROM V$SESSION WHERE PROGRAM LIKE '%catproc%';
Check alert logs for any issues:
tail -f $ORACLE_BASE/diag/rdbms/<your_db_name>/<your_db_instance>/trace/alert_<your_db_instance>.log
After the script completes, check for any errors or warnings in the SQL*Plus output or the alert log.
Validate that all expected packages, procedures, and functions are now available:
SQL> SELECT object_name, status FROM all_objects WHERE object_type IN ('PACKAGE', 'PROCEDURE', 'FUNCTION') AND status = 'INVALID';
Recompile any invalid objects if necessary:
SQL> EXECUTE DBMS_UTILITY.compile_schema(schema => 'SYS', compile_all => TRUE);
If you notice significant performance degradation after running CATPROC.SQL
, consider gathering new statistics or adjusting parameters:
SQL> EXECUTE DBMS_STATS.gather_schema_stats(ownname => 'SYS');
CATPROC.SQL
updates the database's PL/SQL packages and procedures, which is vital for maintaining database functionality,
especially after upgrades or patch installations. Always ensure you have a rollback plan in case something goes awry.