MERCADOS FINANCIEROS

miércoles, 29 de abril de 2020

CAMBIAR NOMBRE BASE DE DATOS ORACLE

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
SQL> startup mount;
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size     2293880 bytes
Variable Size   658509704 bytes
Database Buffers   171966464 bytes
Redo Buffers     2334720 bytes

Database mounted.


LA INSTANCIA DEBE ESTAR EN MODO MOUNT


Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost backup]$ nid TARGET=sys/oracle@orcl DBNAME=ERP

DBNEWID: Release 12.1.0.1.0 - Production on Wed Apr 29 21:42:07 2020

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Connected to database ORCL (DBID=1376021099)

Connected to server version 12.1.0

Control Files in database:
    /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_9qwmfso4_.ctl
    /u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_9qwmft02_.ctl


Change database ID and database name ORCL to ERP? (Y/[N]) => 


OTRO PROCESO REALIZADO

[oracle@localhost dbs]$ nid

DBNEWID: Release 12.1.0.1.0 - Production on Thu Feb 28 18:35:11 2019

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Keyword     Description                    (Default)
----------------------------------------------------
TARGET      Username/Password              (NONE)
DBNAME      New database name              (NONE)
LOGFILE     Output Log                     (NONE)
REVERT      Revert failed change           NO
SETNAME     Set a new database name only   NO
APPEND      Append to output log           NO

HELP        Displays these messages        NO


[oracle@bddesarrollo prueba_restauracion]$ nid


DBNEWID: Release 11.2.0.3.0 - Production on Fri Nov 21 13:07:56 2014


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Keyword     Description                    (Default)

----------------------------------------------------

TARGET      Username/Password              (NONE)

DBNAME      New database name              (NONE)

LOGFILE     Output Log                     (NONE)

REVERT      Revert failed change           NO

SETNAME     Set a new database name only   NO

APPEND      Append to output log           NO

HELP        Displays these messages        NO


[oracle@bddesarrollo prueba_restauracion]$ nid TARGET=/ DBNAME=FONPETD


DBNEWID: Release 11.2.0.3.0 - Production on Fri Nov 21 13:08:15 2014


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to database FONPETP (DBID=2150325182)


Connected to server version 11.2.0


Control Files in database:

    +DG_DATA/fonpetd/controlfile/control01.ctl

    +DG_FRA/fonpetd/controlfile/control02.ctl


Change database ID and database name FONPETP to FONPETD? (Y/[N]) => Y

Proceeding with operation

Changing database ID from 2659586623 to 1247841337

Changing database name from FONPED to FONPETD

    Control File +DG_DATA/fonpetd/controlfile/control01.ctl - modified

    Control File +DG_FRA/fonpetd/controlfile/control02.ctl - modified

    Datafile +DG_DATA/fonpetp/datafile/system01.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/sysaux01.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/undotbs101.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/users01.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/indic_fonpet_movim_01.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/indic_fonpet_param.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/indic_fonpet_movim.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/indic_fonpet_movim_reorg0.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_param.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_movim_01.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/indic_fonpet_movim_02.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_movim_02.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_rep.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_movim.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/datafile/ts_fonpet_movim_2.db - dbid changed, wrote new name

    Datafile +DG_DATA/fonpetp/tempfile/temp01.db - dbid changed, wrote new name

    Control File +DG_DATA/fonpetd/controlfile/control01.ctl - dbid changed, wrote new name

    Control File +DG_FRA/fonpetd/controlfile/control02.ctl - dbid changed, wrote new name

    Instance shut down


Database name changed to FONPETD.

Modify parameter file and generate a new password file before restarting.

Database ID for database FONPETD changed to 1247841337.

All previous backups and archived redo logs for this database are unusable.

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database name and ID.

DBNEWID - Completed succesfully.


[oracle@bddesarrollo prueba_restauracion]$ orapwd file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwfonpetd force=Y password=Nuevo123 entries=3

[oracle@bddesarrollo prueba_restauracion]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 21 13:15:46 2014


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


Connected to an idle instance.


SYS@fonpetd> startup nomount;

ORACLE instance started.


Total System Global Area 1402982400 bytes

Fixed Size                  2228304 bytes

Variable Size            1073745840 bytes

Database Buffers          318767104 bytes

Redo Buffers                8241152 bytes

SYS@fonpetd> show parameter db_name


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_name                              string      FONPED

SYS@fonpetd> alter database mount;

alter database mount

*

ERROR at line 1:

ORA-01103: database name 'FONPETD' in control file is not 'FONPED'



SYS@fonpetd> alter system set db_name='FONPETD' scope=spfile;


System altered.


SYS@fonpetd>shu abort;

ORACLE instance shut down.

SYS@fonpetd> startup mount;

ORACLE instance started.


Total System Global Area 1402982400 bytes

Fixed Size                  2228304 bytes

Variable Size            1073745840 bytes

Database Buffers          318767104 bytes

Redo Buffers                8241152 bytes

Database mounted.

SYS@fonpetd> alter database open resetlogs;

SYS@fonpetd> alter database open resetlogs;


Database altered.

No hay comentarios: