Can’t locate Term/ReadKey.pm in @INC during catcdb.sql in 12.1.0.2
During some playing around with database creation on 12.1.0.2 using several methods, Geert De Paep (find him at @geertdepaep) and I discovered something funny.
Creating the database using dbca, works as expected. But then it was time to create a container database using the create database statement.
The best thing to do is follow the official oracle documentation. Find it here: http://docs.oracle.com/database/121/ADMIN/cdb_create.htm#ADMIN13529 all steps are normal until running the catcdb.sql-script.
When running it from a oel6.5 with a default (non-patched) 12.1.0.2 database installation you might face following error:
[sourcecode]SQL> @?/rdbms/admin/catcdb.sql
Session altered.
Enter new password for SYS:
Enter new password for SYSTEM:
Enter temporary tablespace name: tempts1
Session altered.
Connected.
…
<<< snipped for readability >>>
…
old 1: select ‘&&oracle_home’||’&&slash’||’apex’ as apex_home from dual
new 1: select ‘/u01/app/oracle/product/12.1.0.2/dbhome_1’||’/’||’apex’ as apex_home from dual
Can’t locate Term/ReadKey.pm in @INC (@INC contains: /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/) at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pm line 189.
BEGIN failed–compilation aborted at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pm line 189.
Compilation failed in require at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pl line 94.
BEGIN failed–compilation aborted at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pl line 94.
Can’t locate Term/ReadKey.pm in @INC (@INC contains: /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/) at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pm line 189.
BEGIN failed–compilation aborted at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pm line 189.
Compilation failed in require at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pl line 94.
BEGIN failed–compilation aborted at /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/admin/catcon.pl line 94.
…
<<< snipped for readability >>>
…
Session altered.
BEGIN
*
ERROR at line 1:
ORA-06553: PLS-213: package STANDARD not accessible
Session altered.
Pluggable database altered.
Pluggable database altered.
Session altered.
Session altered.
Session altered.
SQL>[/sourcecode]
This is a pretty strange error and google search returns that you have to install the perlmodule “perl-TermReadKey”.
You can do this using yum as follows (but continue reading):
[sourcecode]yum install perl-TermReadKey[/sourcecode]
But there is an easier (non-internet needed) workaround. If you add the oracle home perl to the path, it works as well. Just do this:
[sourcecode][oracle@labvms01n01 admin]$
[oracle@labvms01n01 admin]$ export PATH=/u01/app/oracle/product/12.1.0.2/dbhome_1/perl/bin:$PATH[/sourcecode]
then run catcdb.sql again:
[sourcecode][oracle@labvms01n01 admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 24 17:03:53 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> @catcdb
Session altered.
Enter new password for SYS:
Enter new password for SYSTEM:
Enter temporary tablespace name: tempts1
Session altered.
Connected.
…
<<< snipped for readability >>>
…
old 1: select ‘&&oracle_home’||’&&slash’||’rdbms’||’&&slash’||’admin’||’&&slash’||’catcon.pl’ as rdbms_admin_catcon from dual
new 1: select ‘/u01/app/oracle/product/12.1.0.2/dbhome_1’||’/’||’rdbms’||’/’||’admin’||’/’||’catcon.pl’ as rdbms_admin_catcon from dual
…
<<< snipped for readability >>>
…
catcon: ALL catcon-related output will be written to catalog_catcon_17707.lst
catcon: See catalog*.log files for output generated by scripts
catcon: See catalog_*.lst files for spool files, if any
catcon.pl: completed successfully
catcon: ALL catcon-related output will be written to catproc_catcon_17901.lst
catcon: See catproc*.log files for output generated by scripts
catcon: See catproc_*.lst files for spool files, if any
[/sourcecode]
and the database creates just fine.
I might have to test on more recent linux versions, so feel free to add comments if it’s fixed in later ones.
As always, questions, remarks? find me on twitter @vanpupi