martes, 21 de septiembre de 2021

Cómo cambiar el nombre del contenedor de facto "XE" en Oracle Database 21c XE.?


Si deseas cambiarle el nombre de facto para el contenedor de base de datos en Oracle Database 21c XE, lo que debes hacer, es editar el archivo de configuración, antes de ejecutarlo con el usuario "root" a nivel de sistema operativo, para el proceso de configuración y cambiar el valor de la variable ORACLE_SID.

Salvas el cambio en el archivo y luego, procedes a ejecutar el archivo de configuración de la instancia.

[root@servidor-pruebas-oracle-db instaladores]# more /etc/init.d/oracle-xe-21c

#!/bin/bash

#

# chkconfig: 2345 80 05

# description: This script is responsible for taking care of configuring the RPM Oracle XE Database and its associated services.

#

# processname: oracle-xe-21c

# Red Hat or SuSE config: /etc/sysconfig/oracle-xe-21c

#

# change log:

# ivalopez 12/13/17 - Creation

# mstalin 04/30/18 - DB configuration changes

# rfgonzal 05/14/18 - Enh 27965960 & 27965939 - Enable service and clean env vars when launching dbca

# mstalin 05/20/18 - 21261445 RTI, disable the checks

# mstalin 05/29/18 - 28121518 password handling and connection string handling

# mstalin 06/07/18 - Add memory distribution logic

# rfgonzal 07/09/18 - Bug 28243127 - Cannot start/stop DB after fresh installation

# mstalin 07/06/18 - Add sample schema to XE

# mstalin 08/02/18 - 28353388 Add delete option to the usage text

# mstalin 08/02/18 - 28242894 Reduce verbose of the script

# mstalin 10/06/18 - 28735641 Fix duplicate success messages and product name

# mstalin 10/14/19 - 28785753 Add db_domain support

# mstalin 10/15/19 - Add ignoreprereqs

# mstalin 10/15/19 - ER 29677762 Configure EM global port

# mstalin 10/15/19 - Skip datapatch

# psainza 12/04/19 - ER 28330482: Adding support to status flag

# mstalin 07/09/20 - 31591395 Remove hr schema in XE

# mstalin 01/12/21 - 32245867 Changes for SLES15

#


# Set path if path not set
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac


# Check if the root user is running this script
if [ $(id -u) != "0" ]
then
echo "You must be root user to run the configure script. Login as root user and then run the configure script."
exit 1
fi

# DB defaults

export ORACLE_HOME=/opt/oracle/product/21c/dbhomeXE
export ORACLE_SID=XE21c
export TEMPLATE_NAME=XE_Database.dbc
export PDB_NAME=XEPDB1
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=true

# General exports and vars
export PATH=$ORACLE_HOME/bin:$PATH
LSNR=$ORACLE_HOME/bin/lsnrctl
SQLPLUS=$ORACLE_HOME/bin/sqlplus
NETCA=$ORACLE_HOME/bin/netca
DBCA=$ORACLE_HOME/bin/dbca
ORACLE_OWNER=oracle
RETVAL=0
CONFIG_NAME="oracle-xe-21c.conf"
CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
ORACLE_HOME_NAME="OraHomeXE"
MINIMUM_MEMORY=1048576
MAXIMUM_MEMORY=2097152
MINIMUM_MEMORY_STR="1GB"
MINIMUM_SPACE=4718592
MINIMUM_SPACE_STR="4.5GB"

# Commands
if [ -z "$SU" ];then SU=/bin/su; fi
if [ -z "$AWK" ];then AWK=/bin/awk; fi
if [ -z "$DF" ];then DF=/bin/df; fi
if [ -z "$GREP" ]; then GREP=/usr/bin/grep; fi
if [ ! -f "$GREP" ]; then GREP=/bin/grep; fi
if [ -z "$TAIL" ]; then TAIL=/usr/bin/tail; fi
if [ ! -f "$TAIL" ]; then TAIL=/bin/tail; fi
HOSTNAME_CMD="/bin/hostname"
MKDIR_CMD="/bin/mkdir"

# To start the DB
...

[root@servidor-pruebas-oracle-db instaladores]# /etc/init.d/oracle-xe-21c configure

Specify a password to be used for database accounts. Oracle recommends that the password entered

should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case

character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:

Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database XE21c.
Enter SYS user password:
******
Enter SYSTEM user password:
******
Enter PDBADMIN User Password:
*******
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
37% complete
40% complete
43% complete
Completing Database Creation
47% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/XE21c.
Database Information:
Global Database Name:XE21c
System Identifier(SID):XE21c
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE21c/XE21c0.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: servidor-pruebas-oracle-database-18c:1522/XEPDB1
     Multitenant container database: servidor-pruebas-oracle-database-18c:1522
Use https://localhost:5505/em to access Oracle Enterprise Manager for Oracle Database XE
[root@servidor-pruebas-oracle-database-18c instaladores]#

[root@servidor-pruebas-oracle-database-18c instaladores]# ps -ef|grep XE
oracle     337     1  0 04:45 ?        00:00:00 xe_qm02_XE21c
oracle     344     1  0 04:45 ?        00:00:00 xe_q002_XE21c
oracle     348     1  0 04:45 ?        00:00:00 xe_q003_XE21c
oracle     350     1  0 04:45 ?        00:00:00 xe_m003_XE21c
oracle     352     1  0 04:45 ?        00:00:00 xe_m004_XE21c
oracle     354     1  0 04:45 ?        00:00:00 xe_m005_XE21c
oracle     356     1  0 04:45 ?        00:00:00 xe_m006_XE21c
oracle     441     1  0 04:45 ?        00:00:00 xe_cl00_XE21c
oracle     445     1  0 04:45 ?        00:00:00 xe_q004_XE21c
oracle     455     1  0 04:45 ?        00:00:00 xe_w005_XE21c
oracle     520     1  0 04:46 ?        00:00:00 xe_w006_XE21c
...

[root@servidor-pruebas-oracle-database-18c instaladores]# su - oracle
Last login: Wed Sep 22 04:38:40 GMT 2021 on pts/0
[oracle@servidor-pruebas-oracle-database-18c ~]$ . oraenv
ORACLE_SID = [oracle] ? XE21c
The Oracle base has been set to /opt/oracle
[oracle@servidor-pruebas-oracle-database-18c ~]$ sqlplus /nolog

SQL*Plus: Release 21.0.0.0.0 - Production on Wed Sep 22 04:53:04 2021
Version 21.3.0.0.0

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

SQL> connect / as sysdba
Connected.
SQL> select banner_full from v$version;

BANNER_FULL
---------------------------------------------------------------------
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0


SQL> show pdbs

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


No hay comentarios:

Publicar un comentario

Te agradezco tus comentarios. Te esperamos de vuelta.

Todos los Sábados a las 8:00PM

Optimismo para una vida Mejor

Optimismo para una vida Mejor
Noticias buenas que comentar