Search This Blog

Total Pageviews

Saturday, 31 August 2024

Create database via 19c dbca


Create database via 19c dbca ... 


[oracle@ora2 ~]$ hostname
ora2

check below first !!
export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/dell/srvadmin/bin:/home/oracle/.local/bin:/home/oracle/bin:/usr/local/bin:/u01/app/oracle/product/19.0.0/dbhome_3/bin

check this 

which dbca
/u01/app/oracle/product/19.0.0/dbhome_3/bin/dbca



 dbca -silent -nodelist 'ora2,ora3' -createDatabase -responseFile NO_VALUE -gdbName ORCLX -templateName General_Purpose.dbc -characterSet AL32UTF8 -datafileDestination '+DATA' -sid ORCLX -redoLogFileSize 50 -systemPassword welcome1 -sysPassword welcome1 -enableArchive true -createAsContainerDatabase true -pdbName UTIL01 -numberOfPDBs 1 -useLocalUndoForPDBs true -pdbAdminPassword welcome1 -recoveryAreaDestination '+DATA' -recoveryAreaSize 8024  -sampleSchema false -databaseType MULTIPURPOSE -nationalCharacterSet AL16UTF16 -databaseConfigType RAC -automaticMemoryManagement false -initParams SGA_TARGET='5000M' PGA_AGGREGATE_TARGET='200M'


[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

[WARNING] [DBT-06801] Specified Fast Recovery Area size (8,024 MB) is less than the recommended value.
   CAUSE: Fast Recovery Area size should at least be three times the database size (3,328 MB).
   ACTION: Specify Fast Recovery Area Size to be at least three times the database size.


Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
Creating Pluggable Databases
64% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCLX.
Database Information:
Global Database Name:ORCLX
System Identifier(SID) Prefix:ORCLX
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCLX/ORCLX.log" for further details.





INSTANCE_NUMBER.............................................: 1
INSTANCE_NAME...............................................: ORCLX1
HOST_NAME...................................................: ora2 
VERSION.....................................................: 19.0.0.0.0
STARTUP_TIME................................................: 31-08-2024 08:48:58
STATUS......................................................: OPEN
PARALLEL....................................................: YES
THREAD#.....................................................: 1
ARCHIVER....................................................: STARTED
LOG_SWITCH_WAIT.............................................:
LOGINS......................................................: ALLOWED
SHUTDOWN_PENDING............................................: NO
DATABASE_STATUS.............................................: ACTIVE
INSTANCE_ROLE...............................................: PRIMARY_INSTANCE
ACTIVE_STATE................................................: NORMAL
BLOCKED.....................................................: NO

INSTANCE_NUMBER.............................................: 2
INSTANCE_NAME...............................................: ORCLX2
HOST_NAME...................................................: ora3
VERSION.....................................................: 19.0.0.0.0
STARTUP_TIME................................................: 31-08-2024 08:48:59
STATUS......................................................: OPEN
PARALLEL....................................................: YES
THREAD#.....................................................: 2
ARCHIVER....................................................: STARTED
LOG_SWITCH_WAIT.............................................:
LOGINS......................................................: ALLOWED
SHUTDOWN_PENDING............................................: NO
DATABASE_STATUS.............................................: ACTIVE
INSTANCE_ROLE...............................................: PRIMARY_INSTANCE
ACTIVE_STATE................................................: NORMAL
BLOCKED.....................................................: NO



SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
allow_group_access_to_sga            boolean     FALSE
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     TRUE
sga_max_size                         big integer 5008M
sga_min_size                         big integer 0
sga_target                           big integer 5008M
unified_audit_sga_queue_size         integer     1048576


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 UTIL01                         READ WRITE NO

Tuesday, 20 August 2024

Rman duplicate pluggable database


  

Rman duplicate pluggable database ...

on same server !!!!

ORCL:/u01/app/oracle/product/19.0.0/dbhome_1:N  

orclcd:/u01/app/oracle/product/19.0.0/dbhome_1:N





ORCL:/u01/app/oracle/product/19.0.0/dbhome_1:N


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        READ WRITE NO     >>>  aim to duplicate  pluggable database -------------------------------------->

SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0



orclcd:/u01/app/oracle/product/19.0.0/dbhome_1:N

[oracle@ ~]$ . oraenv
ORACLE_SID = [ORCL] ? orclcd
The Oracle base remains unchanged with value /u01/app/oracle


[oracle@ ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Aug 19 12:38:57 2024
Version 19.12.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0

SQL>  show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPBB                        READ WRITE NO <<<<< and plug here  <<<------------------------------------------------------------ be="" end="" like="" result="" sql="" this="" would=""> show pdbs

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




rman

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 20 03:55:26 2024
Version 19.12.0.0.0

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

RMAN> connect target sys/vihaan123@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))

connected to target database: ORCL (DBID=1618442726)

RMAN> connect auxiliary sys/vihaan123@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=orclcd)))

connected to auxiliary database: ORCLCD (DBID=2923364259)

RMAN> DUPLICATE PLUGGABLE DATABASE ORCLPDB as ORCLPDBD TO orclcd FROM ACTIVE DATABASE ;

Starting Duplicate PDB at 20-AUG-24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=855 device type=DISK
current log archived
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
current log archived





contents of Memory Script:
{
   set newname for clone datafile  9 to new;
   set newname for clone datafile  10 to new;
   set newname for clone datafile  11 to new;
   set newname for clone datafile  12 to new;
   restore
   from  nonsparse   clone foreign pluggable database
    "ORCLPDB"
   from service  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))'   ;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20-AUG-24
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 9 to +DATA/ORCLCD/D2909A01684E4D42E053F214A8C08735/DATAFILE/system.335.1177474125
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 10 to +DATA/ORCLCD/D2909A01684E4D42E053F214A8C08735/DATAFILE/sysaux.334.1177474129
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 11 to +DATA/ORCLCD/D2909A01684E4D42E053F214A8C08735/DATAFILE/undotbs1.333.1177474133
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 12 to +DATA/ORCLCD/D2909A01684E4D42E053F214A8C08735/DATAFILE/users.332.1177474133
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 20-AUG-24

contents of Memory Script:
{
   set archivelog destination to  '+DATA';
   restore clone force from service  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))'
           foreign archivelog from scn  78208744;
}
executing Memory Script

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 20-AUG-24
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=+DATA
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=1925
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 20-AUG-24

Performing import of metadata...
Finished Duplicate PDB at 20-AUG-24



===


SQL> show pdbs

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




=======

Error !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


RMAN>  DUPLICATE PLUGGABLE DATABASE ORCLPDB as ORCLPDBD TO orclcd FROM ACTIVE DATABASE SECTION SIZE 400M;   <<<< SECTION SIZE 400M; remove this check output above 

Starting Duplicate PDB at 20-AUG-24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=607 device type=DISK
current log archived
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
current log archived

contents of Memory Script:
{
   set newname for clone datafile  9 to new;
   set newname for clone datafile  10 to new;
   set newname for clone datafile  11 to new;
   set newname for clone datafile  12 to new;
   restore
   from  nonsparse   section size
 400 m   clone foreign pluggable database
    "ORCLPDB"
   from service  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=  anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))'   ;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20-AUG-24
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:13
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473013' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 9 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473013' contains an invalid file number
continuing other job steps, job failed will not be re-run
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:13
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473015' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 10 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473015' contains an invalid file number
continuing other job steps, job failed will not be re-run
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:14
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473017' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 11 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473017' contains an invalid file number
continuing other job steps, job failed will not be re-run
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=anujlab.com)(Port=1521))(CONNECT_DATA=(SID=ORCL)))
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:14
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473019' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 12 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473019' contains an invalid file number
continuing other job steps, job failed will not be re-run
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate PDB command at 08/20/2024 03:50:14
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script

RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:14
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473019' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 12 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:14
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473017' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 11 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:13
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473015' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 10 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/
RMAN-03009: failure of IRESTORE command on ORA_AUX_DISK_1 channel at 08/20/2024 03:50:13
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/DATAFILE/.335.1177473013' contains an invalid file number
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 9 could not be verified
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15122: ASM file name '+DATA/ORCLCD/D





Thursday, 1 August 2024

Unix split command


 Unix split command 




Created 1gb file for testing 

dd if=/dev/urandom of=anuj.trc bs=64M count=16 iflag=fullblock
16+0 records in
16+0 records out
1073741824 bytes (1.1 GB) copied, 65.8006 s, 16.3 MB/s


[oracle@rac01:~] $ls -ltr anuj.trc
-rw-r--r-- 1 oracle oinstall 1073741824 Aug  1 04:46 anuj.trc

[oracle@ibrac01:~] $ls -lhtr anuj.trc
-rw-r--r-- 1 oracle oinstall 1.0G Aug  1 04:46 anuj.trc


Split the file 400m chunks

[oracle@rac01:~] $

tar cz anuj.trc | split -b 400m - anuj.trc_split


rac01:~] $ls -ltrh anuj*

-rw-r--r-- 1 oracle oinstall 1.0G Aug  1 04:46 anuj.trc
-rw-r--r-- 1 oracle oinstall 400M Aug  1 04:49 anuj.trc_splitaa
-rw-r--r-- 1 oracle oinstall 400M Aug  1 04:49 anuj.trc_splitab
-rw-r--r-- 1 oracle oinstall 225M Aug  1 04:50 anuj.trc_splitac

delete the old file to test !!!
rm anuj.trc

To Join 
cat anuj.trc_split* | tar xz


ls -ltrh anuj*

-rw-r--r-- 1 oracle oinstall 1.0G Aug  1 04:46 anuj.trc  <<<<<----Now file is back 
-rw-r--r-- 1 oracle oinstall 400M Aug  1 04:49 anuj.trc_splitaa
-rw-r--r-- 1 oracle oinstall 400M Aug  1 04:49 anuj.trc_splitab
-rw-r--r-- 1 oracle oinstall 225M Aug  1 04:50 anuj.trc_splitac


Oracle DBA

anuj blog Archive