quarta-feira, 21 de março de 2018

Oracle 18c - ORA-12754: Feature 'startup' is disabled due to missing capability 'Runtime Environment'

Lançado recentemente, o Oracle database 18c atualmente está disponível apenas para a Oracle Cloud e Oracle Exadata, ou seja, nada de binários para on-premises por enquanto, porém assim como muitos outros baixei o binário do 18c para Exadata (V974953-01.zip) do oracle edelivery e fiz o deploy na minha VM (Virtual Machine) com Oracle Linux 7.3 x86_64.


O deploy do binário ocorre sem problemas, porém ao tentar subir uma instancia, tanto pelo DBCA (Database Configuration Assistant) quanto por linha de comando (sqlplus) ocorre o erro ORA-12754: Feature 'startup' is disabled due to missing capability 'Runtime Environment'.


Olhando no arquivo de log do banco de dados (alertlog) é visível que ele realiza algumas checagens ao subir a instancia e como elas não são atendidas (detected : 0) o startup é abortado.

[oracle@localhost ~]$ tail -n 10 /orabin/app/oracle/diag/rdbms/cdb/cdb/trace/alert_cdb.log
Number of processor sockets in the system is 1
Shared memory segment for instance monitoring created
Capability Type : Network
capabilities requested : 1 detected : 0 Simulated : 0
Capability Type : Runtime Environment
capabilities requested : 400000FF detected : 40000000 Simulated : 0
Capability Type : Engineered Systems
capabilities requested : 7 detected : 0 Simulated : 0
Capability Type : Database Test
capabilities requested : 3 detected : 0 Simulated : 0

Para realizar o startup da instance e posterior criação da base de dados, temos alguns métodos como substituir a biblioteca libserver18.a ($ORACLE_HOME/lib/libserver18.a) com uma versão trazida da Oracle Cloud que permitirá que o DBCA suba a instance e crie o database ou podemos utilizar o parâmetro _exadata_feature_on=true nos scripts gerados pelo DBCA, método este que estarei utilizando aqui.


Com os scripts gerados pelo DBCA, vá no diretório scripts e altere todos os inits.ora encontrados, aqui foi gerado apenas um devido as escolhas realizadas na interface do DBCA porém em algumas opções podemos ter até 3 arquivos de init, logo, adicione em todos o parâmetro _exadata_feature_on=true

[oracle@localhost ~]$ cd /orabin/app/oracle/admin/cdb/scripts/
[oracle@localhost scripts]$ ls -lrt
total 56
-rw-r----- 1 oracle oinstall 1975 Mar 21 10:30 init.ora
-rwxr-xr-x 1 oracle oinstall  849 Mar 21 10:30 cdb.sh
-rw-r----- 1 oracle oinstall 1695 Mar 21 10:30 CreateDB.sql
-rw-r----- 1 oracle oinstall  404 Mar 21 10:30 CreateDBFiles.sql
-rw-r----- 1 oracle oinstall 2108 Mar 21 10:30 CreateDBCatalog.sql
-rw-r----- 1 oracle oinstall 1454 Mar 21 10:30 JServer.sql
-rw-r----- 1 oracle oinstall 1167 Mar 21 10:30 context.sql
-rw-r----- 1 oracle oinstall 1008 Mar 21 10:30 CreateClustDBViews.sql
-rw-r----- 1 oracle oinstall 1721 Mar 21 10:30 lockAccount.sql
-rw-r----- 1 oracle oinstall  758 Mar 21 10:30 postDBCreation.sql
-rw-r----- 1 oracle oinstall   93 Mar 21 10:30 PDBCreation.sql
-rw-r----- 1 oracle oinstall  798 Mar 21 10:30 plug_pdb1.sql
-rwxr-xr-x 1 oracle oinstall  901 Mar 21 10:30 cdb.sql
-rw-r----- 1 oracle oinstall 1269 Mar 21 10:30 postPDBCreation_pdb1.sql

Adicionar em todos os inits o parâmetro _exadata_feature_on=true

[oracle@localhost scripts]$ cat init.ora | grep exadata
_exadata_feature_on=true

Agora basta exportarmos as variáveis conforme abaixo e rodarmos o script .sh (neste caso cdb.sh) que tudo será criado. (para acessar o log completo, clique aqui)

[oracle@localhost scripts]$ export ORACLE_HOME=/orabin/app/oracle/product/18.0.0.0/dbhome1
[oracle@localhost scripts]$ export ORACLE_BASE=/orabin/app/oracle
[oracle@localhost scripts]$ export ORACLE_SID=cdb
[oracle@localhost scripts]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@localhost scripts]$ sh cdb.sh
You should Add this entry in the /etc/oratab: cdb:/orabin/app/oracle/product/18.0.0.0/dbhome1:Y

SQL*Plus: Release 18.0.0.0.0 Production on Wed Mar 21 10:42:01 2018
Version 18.1.0.0.0

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Enter new password for SYS:
Enter new password for SYSTEM:

Enter password for SYS:

Connected to an idle instance.
SQL> spool /orabin/app/oracle/admin/cdb/scripts/CreateDB.log append
SQL> startup nomount pfile="/orabin/app/oracle/admin/cdb/scripts/init.ora";
ORACLE instance started.

Total System Global Area  654310184 bytes
Fixed Size                  8899368 bytes
Variable Size             515899392 bytes
Database Buffers          121634816 bytes
Redo Buffers                7876608 bytes
SQL> CREATE DATABASE "cdb"
  2  MAXINSTANCES 8
  3  MAXLOGHISTORY 1
  4  MAXLOGFILES 16
  5  MAXLOGMEMBERS 3
  6  MAXDATAFILES 1024
  7  DATAFILE '/orabin/app/oracle/oradata/CDB/system01.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
  8  EXTENT MANAGEMENT LOCAL
  9  SYSAUX DATAFILE '/orabin/app/oracle/oradata/CDB/sysaux01.dbf' SIZE 550M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
 10  SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/orabin/app/oracle/oradata/CDB/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED
 11  SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE  '/orabin/app/oracle/oradata/CDB/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE UNLIMITED
 12  CHARACTER SET WE8MSWIN1252
 13  NATIONAL CHARACTER SET AL16UTF16
 14  LOGFILE GROUP 1 ('/orabin/app/oracle/oradata/CDB/redo01.log') SIZE 200M,
 15  GROUP 2 ('/orabin/app/oracle/oradata/CDB/redo02.log') SIZE 200M,
 16  GROUP 3 ('/orabin/app/oracle/oradata/CDB/redo03.log') SIZE 200M
 17  USER SYS IDENTIFIED BY "&&sysPassword" USER SYSTEM IDENTIFIED BY "&&systemPassword"
 18  enable pluggable database
 19  seed file_name_convert=('/orabin/app/oracle/oradata/CDB/system01.dbf','/orabin/app/oracle/oradata/CDB/pdbseed/system01.dbf','/orabin/app/oracle/oradata/CDB/sysaux01.dbf','/orabin/app/oracle/oradata/CDB/pdbseed/sysaux01.dbf','/orabin/app/oracle/oradata/CDB/temp01.dbf','/orabin/app/oracle/oradata/CDB/pdbseed/temp01.dbf','/orabin/app/oracle/oradata/CDB/undotbs01.dbf','/orabin/app/oracle/oradata/CDB/pdbseed/undotbs01.dbf') LOCAL UNDO ON;

Database created.

SQL> spool off
SQL> @/orabin/app/oracle/admin/cdb/scripts/CreateDBFiles.sql
SQL> SET VERIFY OFF
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> set echo on
SQL> spool /orabin/app/oracle/admin/cdb/scripts/CreateDBFiles.log append
SQL> CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  '/orabin/app/oracle/oradata/CDB/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL     SEGMENT SPACE MANAGEMENT  AUTO;

Tablespace created.

SQL> ALTER DATABASE DEFAULT TABLESPACE "USERS";

Database altered.

SQL> spool off
SQL> @/orabin/app/oracle/admin/cdb/scripts/CreateDBCatalog.sql
SQL> SET VERIFY OFF
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> set echo on
SQL> spool /orabin/app/oracle/admin/cdb/scripts/CreateDBCatalog.log append
SQL> alter session set "_oracle_script"=true;

Session altered.

SQL> alter pluggable database pdb$seed close;

Pluggable database altered.

SQL> alter pluggable database pdb$seed open;

Pluggable database altered.

SQL> host perl /orabin/app/oracle/product/18.0.0.0/dbhome1/rdbms/admin/catcon.pl -n 1 -l /orabin/app/oracle/admin/cdb/scripts -v  -b catalog  -U "SYS"/"&&sysPassword" /orabin/app/oracle/product/18.0.0.0/dbhome1/rdbms/admin/catalog.sql;
catcon::set_log_file_base_path: ALL catcon-related output will be written to [/orabin/app/oracle/admin/cdb/scripts/catalog_catcon_28581.lst]
...
...
...
SQL> set echo on
SQL> spool /orabin/app/oracle/admin/cdb/scripts/postPDBCreation.log append
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> alter session set container=pdb1;

Session altered.

SQL> set echo on
SQL> spool /orabin/app/oracle/admin/cdb/scripts/postPDBCreation.log append
SQL> select TABLESPACE_NAME from cdb_tablespaces a,dba_pdbs b where a.con_id=b.con_id and UPPER(b.pdb_name)=UPPER('pdb1');

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS

SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> alter session set container=pdb1;

Session altered.

SQL> set echo on
SQL> spool /orabin/app/oracle/admin/cdb/scripts/postPDBCreation.log append
SQL> Select count(*) from dba_registry where comp_id = 'DV' and status='VALID';

  COUNT(*)
----------
         0

SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> exit;
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0
[oracle@localhost scripts]$

Base 18c criada!

[oracle@localhost scripts]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 Production on Wed Mar 21 12:00:16 2018
Version 18.1.0.0.0

Copyright (c) 1982, 2017, Oracle.  All rights reserved.


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.1.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
SQL>

Lembrando que ainda não temos uma versão oficial do 18c para ambientes on-premises, então não utilize isto em ambientes produtivos.

Caso prefira, você também pode utilizar o Oracle Live SQL para  testar novas funcionalidades do Oracle database 18c:


Postagem mais recente Postagem mais antiga Página inicial

0 comentários:

Postar um comentário

Translate

# Suporte

# ACE Program

#Oracle

#Oracle
Disclaimer: The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

#Blog reconhecido

#ARTICULISTA

Marcadores

Postagens populares