Posts

Showing posts from 2023

[FATAL] [DBT-50000] Unable to check for available memory and [FATAL] [DBT-50001] Unable to check the value of kernel parameter {0}

  I faced an error [FATAL] [DBT-50000] Unable to check for available memory and [FATAL] [DBT-50001] Unable to check the value of kernel parameter {0}. Then terminated operation when I was going to create 12c instance in silent mode.   ERROR: [FATAL] [DBT-50000] Unable to check for available memory. [FATAL] [DBT-50001] Unable to check the value of kernel parameter {0}   REASON:   It’s a bug. Can find details about this in the following document.   DBCA fails with errors: [FATAL] [DBT-50000] Unable to check for available memory in “Specify configuration option” (Doc ID 2631718.1)   SOLUTION: Run dbca with “-J-Doracle.assistants.dbca.validate.ConfigurationParams=false”   ACTION: dbca -J-Doracle.assistants.dbca.validate.ConfigurationParams=false -createDatabase -silent -responseFile ./dbca.rsp   OUTPUT: Prepare for db operation 10% complete Copying database files 40% complete Creating and starting Oracle instance 42% ...

[FATAL] [DBT-10503] Template file is not specified

I faced an error [FATAL] [DBT-10503] Template file is not specified and terminated operation when I was going to create 12c instance in silent mode .   ERROR: [FATAL] [DBT-10503] Template file is not specified.   REASON: This is due to the you are not set the “templateName” in response file.   SOLUTION: Set templateName=General_Purpose.dbc and execute the dbca again   ACTION: 1.        Open the dbca.rsp and set templateName as General_Purpose.dbc 2.        Save the dbca.rsp 3.        Execute the instance create statement again (dbca)

[FATAL] [INS-30060] Check for group existence failed

  I faced an error [FATAL] [INS-30060] Check for group existence failed and terminated operation when I was going to install 12c binary in silent mode.   ERROR: [FATAL] [INS-30060] Check for group existence failed.    CAUSE: Unexpected error occurred while trying to check for group existence.    ACTION: Refer to the logs or contact Oracle Support Services. Note for advanced users: Launch the installer by passing the following flag '-ignoreInternalDriverError'. Moved the install session logs to:   REASON: The source and the target filesystems are not mounted with the same ACL options so the copy fails as the permissions cannot be preserved on the target filesystem.   SOLUTION: Export the TMPDIR to the suitable location and execute the runInstaller again.   ACTION: export TMPDIR=/path/to/temp

ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type

I faced an error last night when I was going to start my 12c database on upgrade mode   to upgrade 19c.   ERROR: ORA-01092: ORACLE instance terminated. Disconnection forced ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type Process ID: 3714866 Session ID: 434 Serial number: 1850 ORA-00603: ORACLE server session terminated by fatal error   REASON: ORA-30012 means that the default UNDO tablespace you specified in SPFILE or PFILE does not exist, or it's not an UNDO tablespace essentially. Therefore, the database fails to startup. SOLUTION: We should identify and set the correct undo tablespace name.   ACTION: 1. log in the database on mount mode   SQL> startup mount; ORACLE instance started.   Total System Global Area 1.2482E+10 bytes Fixed Size                   8939000 bytes Variable Size      ...

ORA-00379: no free buffers available in buffer pool DEFAULT for block size 16K

I faced an error last night when I was going to recover my 12c database after restoration new environment.   ERROR: RMAN-03002: failure of recover command at 11/28/2023 06:12:57 RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/path/to/recovery file destination/o1_mf_1_235860_lpbxjrbh_.arc' ORA-00379: no free buffers available in buffer pool DEFAULT for block size 16K   REASON: There has been no memory allocated to 8K or 16K or 32K block buffers cache. Explicitly allocating memory to the non-default block buffers will resolve the ORA-00379: no free buffers available in buffer pool DEFAULT for block size 8K or 16K or 32K errors   ACTION: 1. log in the database 2. check parameter DB_16K_CACHE_SIZE and set value   SQL> show parameter DB_16K_CACHE_SIZE;   NAME                       ...

How check archivelog count and the total size

select to_char(COMPLETION_TIME,'DD/MON/YYYY') Day, trunc(sum(blocks*block_size)/1048576/1024,2) "Size(GB)",count(sequence#) "Total Archives" from (select distinct sequence#,thread#,COMPLETION_TIME,blocks,block_size from v$archived_log) group by to_char(COMPLETION_TIME,'DD/MON/YYYY') order by to_date(to_char(COMPLETION_TIME,'DD/MON/YYYY'),'DD/MON/YYYY'); select trunc(COMPLETION_TIME,'DD') LOG_Day, thread#, round(sum(BLOCKS*BLOCK_SIZE)/1024/1024/1024) LOG_SIZE_GB, count(*) CNT_LOG_Generated from v$archived_log group by trunc(COMPLETION_TIME,'DD'),thread# order by 1;

Test the Unified Audit Policy

  Test the Unified Audit Policy SELECT DBUSERNAME, SQL_TEXT, EVENT_TIMESTAMP FROM UNIFIED_AUDIT_TRAIL WHERE DBUSERNAME = 'SYS' and event_timestamp like '12-JAN%' and sql_text like 'ALTER%';

STEPS : POSTFIX CONFIGURATION

1. Install Mail Packages    yum install postfix mailx cyrus-sasl cyrus-sasl-plain -y 2. Create GMail Account    a) Generate App Password 3. Edit sasl_password file and add gmail account details    vi /etc/postfix/sasl_passwd    [smtp.gmail.com]:587 <emailid>@gmail.com:********** 4. Generate DB file    postmap /etc/postfix/sasl_passwd 5. Edit main.cf    relayhost = [smtp.gmail.com]:587    myhostname = oracle-vm.com    # Enable SASL authentication for postfix    smtp_use_tls = yes                                                                                     smtp_sasl_auth_enable = yes       smtp_tls_security_level = encrypt    smtp_tls_CAfile = /et...

How to Increase the Size of the Datafile of oracle database

----------------------------------------------------------------------------------------------------------------------------- To increase the size limit of the Datafile, use the following SQL command: Increasing the Size Limit ALTER DATABASE DATAFILE '/U01/ORADATA/SANGA.DBF' AUTOEXTEND ON MAXSIZE 4096M; In this command, we are adjusting the maximum size of the Datafile to 4096MB (4GB). This change ensures that the Datafile can automatically extend its size up to the specified limit when it reaches capacity.   Removing the Size Limit In certain scenarios, you may want to remove the size limit altogether to allow the Datafile to grow without any restrictions. To achieve this, use the following SQL command in Oracle Database Enterprise Manager: ALTER DATABASE DATAFILE ‘/U01/ORADATA/SANGA.DBF’ AUTOEXTEND ON MAXSIZE UNLIMITED; With this command, the size limit on the Datafile is set to "UNLIMITED," allowing it to grow dynamically without any predefined rest...

MySQL Cluster vs MySQL Master-Slave replication

  MySQL Cluster and MySQL Master-Slave replication are two different approaches to achieve high availability and scalability in a MySQL database environment. Table 1: Summary of MySQL Cluster vs MySQL Master-Slave   MySQL Cluster MySQL Master-Slave Architecture:   It is a distributed, shared-nothing architecture where multiple nodes (data nodes and management nodes) work together to provide high availability and data distribution. Data is automatically partitioned and replicated across nodes.   It follows a traditional master-slave replication model where one server acts as the master, handling both read and write operations, while one or more slave servers replicate data from the master to handle read operations.   High Availability:   Provides automatic data distribution, data redundancy, and built-in failover mechanisms, making it highly avail...

How to resolve ORA-06540: PL/SQL: compilation error ORA-06553: PLS-252: reference to the wrong copy of package STANDARD

There was an issue regarding expired archives did not clear  at standby  as scheduled and following error was raise. RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of delete command at 07/09/2023 16:00:03 ORA-06540: PL/SQL: compilation error ORA-06553: PLS-252: reference to the wrong copy of package STANDARD Recovery Manager complete. SOLUTION: 1. Restart the standby database 2. Flush shared pool t o clear the whole shared pool you would issue the following command from a privileged user. ALTER SYSTEM FLUSH SHARED_POOL;

How to resolve RMAN-06429: TARGET database is not compatible with this version of RMAN

In my case I was tried to get RMAN full backup from my prod database. While connecting with RMAN Command window getting the following errors: RMAN-06438: error executing package DBMS_RCVMAN in TARGET database RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ============= RMAN-00571: =========================================================== RMAN-00554: initialization of internal recovery manager package failed RMAN-06429: TARGET database is not compatible with this version of RMAN Cause “SYS.DBMS_RCVMAN” package has error which causing the problem. May be package is in-valid state. Solution 1. We tried to check in target database if it’s invalid. select OWNER, STATUS, substr(OBJECT_NAME,1,40), OBJECT_TYPE from DBA_OBJECTS where OBJECT_NAME IN ('DBMS_RCVMAN', 'DBMS_BACKUP_RESTORE' ) ; 2. Try to recompile it and check the status. @$ORACLE_HOME/rdbms/admin/utlrp.sql 3. If 2nd steps is not worki...

How to resolve RMAN-06035: wrong version of recover.bsq, expecting 11.2.0.4, found 11.2.0.2

In my case there are two oracle homes. so when I schedule a cron job for archive clearing following error was raised. Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 17 13:41:49 2023 Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00554: initialization of internal recovery manager package failed RMAN-03000: recovery manager compiler component initialization failed RMAN-06035: wrong version of recover.bsq, expecting 11.2.0.4, found 11.2.0.2 SOLUTION: I have added following line to the oraenv file.  export PATH=$ORACLE_HOME/bin:$PATH

How to create log and standby log files manually in standby database after primary backup restoration

STANDBY LOGS Get relevant details from primary side SQL> select GROUP#,BLOCKSIZE,THREAD# from v$standby_log;     GROUP#  BLOCKSIZE    THREAD# ---------- ---------- ----------          9        512          1         10        512          1         11        512          1         12        512          1         13        512          1         14        512          2         15        512          2         16        512          2   ...

Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux

Install the following packages if they are not already present. yum install binutils-2*x86_64* yum install glibc-2*x86_64* nss-softokn-freebl-3*x86_64* yum install glibc-2*i686* nss-softokn-freebl-3*i686* yum install compat-libstdc++-33*x86_64* yum install glibc-common-2*x86_64* yum install glibc-devel-2*x86_64* yum install glibc-devel-2*i686* yum install glibc-headers-2*x86_64* yum install elfutils-libelf-0*x86_64* yum install elfutils-libelf-devel-0*x86_64* yum install gcc-4*x86_64* yum install gcc-c++-4*x86_64* yum install ksh-*x86_64* yum install libaio-0*x86_64* yum install libaio-devel-0*x86_64* yum install libaio-0*i686* yum install libaio-devel-0*i686* yum install libgcc-4*x86_64* yum install libgcc-4*i686* yum install libstdc++-4*x86_64* yum install libstdc++-4*i686* yum install libstdc++-devel-4*x86_64* yum install make-3.81*x86_64* yum install numactl-devel-2*x86_64* yum install sysstat-9*x86_64* yum install compat-libstdc++-33*i686* yum install compat-libcap*

How to Solve ORA ERRORS - 01119,27054

WARNING: File being created with same name as in Primary Existing file may be overwritten Errors in file /home/oradata/DB/DB_pr00_12979.trc: ORA-01119: error in creating database file '/home/oracle/oradata/data_TS_FNO-62' ORA-27054: NFS file system where the file is created or resides is not mounted with correct options Linux-x86_64 Error: 13: Permission denied File #64 added to control file as 'UNNAMED00064'. Originally created as:'/home/oracle/oradata/data_TS_FNO-62' Recovery was unable to create the file as:'/home/oracle/oradata/data_TS_FNO-62' MRP0: Background Media Recovery terminated with error 1274 Errors in file /home/oradata/DB/DB_pr00_12979.trc: ORA-01274: cannot add datafile '/home/oracle/oradata/data_TS_FNO-62' - file could not be created Managed Standby Recovery not using Real Time Apply SOLUTION: alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00064' as '/home/oracle/oradata/data_TS_FNO...

What are the packages required to Oracle Database 12c Release 2 (12.2) Installation On Oracle Linux

The following packages are listed as required, including the 32-bit version of some of the packages.  # OL6 and OL7 (RHEL6 and RHEL7) yum install binutils -y yum install compat-libcap1 -y yum install compat-libstdc++-33 -y yum install compat-libstdc++-33.i686 -y yum install glibc -y yum install glibc.i686 -y yum install glibc-devel -y yum install glibc-devel.i686 -y yum install ksh -y yum install libaio -y yum install libaio.i686 -y yum install libaio-devel -y yum install libaio-devel.i686 -y yum install libX11 -y yum install libX11.i686 -y yum install libXau -y yum install libXau.i686 -y yum install libXi -y yum install libXi.i686 -y yum install libXtst -y yum install libXtst.i686 -y yum install libgcc -y yum install libgcc.i686 -y yum install libstdc++ -y yum install libstdc++.i686 -y yum install libstdc++-devel -y yum install libstdc++-devel.i686 -y yum install libxcb -y yum install libxcb.i686 -y yum install make -y yum install nfs-utils -y yum install net-tools -y yum install ...

How To Create a Control File for the Standby Database

On the primary database, create the control file for the standby database, as shown in the following example: SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/stby.ctl'; Note: You cannot use a single control file for both the primary and standby databases. The filename for the newly created standby control file must be different from the filename of the current control file of the primary database.  The control file must also be created after the last time stamp for the backup datafiles.

How to find users in PostgreSQL

In PostgreSQL, there is a system table called  pg_user . You can run a query and get the information about these Users. SELECT * FROM pg_user; The  pg_user  table contains the following columns: Column Explanation usename User name (ie: postgres, techonthenet, etc) usesysid User ID (number assigned by PostgreSQL) usecreatedb Boolean value indicating whether user can create databases (t or f) usesuper Boolean value indicating whether user is a superuser (t or f) usecatupd Boolean value indicating whether user can update system catalogs (t or f) userepl Boolean value indicating whether user can initiate replication (t or f) passwd Password for user displayed as ******** valuntil Time when password will expire useconfig Session defaults for run-time configuration variables

How to use ALTER USER command in PostgreSQL

ALTER USER changes the attributes of a PostgreSQL user account.  Examples 1.Change a user's password:   ALTER USER davide WITH PASSWORD 'hu8jmn3'; 2.Change the expiration date of the user's password:   ALTER USER manuel VALID UNTIL 'Jan 31 2030'; 3.Change a password expiration date, specifying that the password        should expire at midday on 4th May 2005 using the time zone which is    one hour ahead of UTC:    ALTER USER chris VALID UNTIL 'May 4 12:00:00 2005 +1'; 4.Make a password valid forever:   ALTER USER fred VALID UNTIL 'infinity'; 5.Give a user the ability to create other users and new databases:   ALTER USER miriam CREATEUSER CREATEDB;

How to CREATE USER in PostgreSQL

CREATE USER  adds a new user to a  PostgreSQL  database cluster. You must be a database superuser to use this command. Examples 1. Create a user with no password:    CREATE USER jonathan; 2. Create a user with a password:    CREATE USER davide WITH PASSWORD 'jw8s0F4'; 3. Create a user with a password that is valid until the end of        2004. After one second has ticked in 2005, the password is no        longer valid.   CREATE USER xen WITH PASSWORD 'jw8s0F4' VALID UNTIL '2005-01-01'; 4. Create an account where the user can create databases:    CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB; Compatibility The CREATE USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation.

Start the Managed recovery process (MRP) on standby server - ORACLE DATAGUARD

  What is MRP in Oracle database? Managed recovery process (MRP) The managed recovery process (MRP) applies information from the archived redo logs to the standby database.  When performing managed recovery operations, log apply services automatically apply archived redo logs to maintain transactional synchronization with the primary database. Start the apply process on standby server. # Foreground redo apply. Session never returns until cancel.  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE; # Background redo apply. Control is returned to the session once the apply process is started. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; If you need to cancel the apply process, issue the following command. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; If you prefer, you can set a delay between the arrival of the archived redo log and it being applied on the standby server using the following commands. ALTER DATABASE RECOVER MANAGED STANDBY ...

How To Unlock a User in Oracle

To unlock a user in Oracle, you need to follow these steps:    1. log in to the Oracle Database as a SYS user.    2. use ALTER USER statement to unlock the user:        ALTER USER <username> IDENTIFIED BY <password> ACCOUNT UNLOCK; NOTE: if you unlock an account without resetting the password, then the password remains expired, therefore, the IDENTIFIED BY password clause is necessary.  The first time the user logs in to the Oracle Database, he needs to change his password.

PostgreSQL CREATE TABLESPACE

A tablespace is a location on the storage device where PostgreSQL database stores data file containing database objects such as indexes, and tables. PostgreSQL uses a tablespace to map a logical name to a physical location on disk. PostgreSQL comes with two default tablespaces:  - pg_default tablespace --->  stores user data.  - pg_global tablespace   --->  stores global data.   Advantages of using tablespaces: 1. if a partition on which the cluster was initialized is out of         space, you can create a new tablespace on a different partition       and   use it until you reconfigure the system. 2. you can use statistics to optimize database performance. For         example, you can place the frequent access indexes or tables on       devices that perform very fast e.g., solid-state devices, and put     the tables containing archiv...

How to resolve - ERROR: cannot cast type numeric to boolean

There is no direct cast defined between numeric and boolean. You can use integer as middle-ground.  ALTER TABLE <schema>.<table_name> ALTER <column_name> TYPE bool USING (<column_name>::int::bool); Ex: ALTER TABLE SANGA.SANGA_H_TRANSACTION_DETAILS  ALTER is_active TYPE bool USING (is_active::int::bool);

Relocating and Renaming Redo Log Members

Use the following steps for relocating redo logs. 1.Shut down the database. SHUTDOWN 2.Copy the redo log files to the new location. mv /<old_path>/redo.log /<new_path>/redo.log mv /<old_path>/redo_2.log /<new_path>/redo_2.log 3.Startup the database with mount mode. CONNECT / as SYSDBA STARTUP MOUNT; 4.Rename the redo log members. ALTER DATABASE RENAME FILE '/<new_path>/redo.log', '/<old_path>/redo_2.log' TO '/<new_path>/redo.log', '/<new_path>/redo_2.log'; 5.The redo log alterations take effect when the database is opened. ALTER DATABASE OPEN;

Postgres Commands

Image
PostgreSQL, or Postgres, is an object-relational database management system that uses the SQL language. It's free, open-source, reliable, robust, and performant. PostgreSQL is also one of the most popular & used relational databases. following are the some of common commands which are use. To list all tablespaces in the current PostgreSQL database server \db

Using pg_dump to Backup PostgreSQL Databases and Tables

Backing up a PostgreSQL database is a crucial task to ensure data integrity and disaster recovery. The "pg_dump" utility is a powerful tool that allows us to create backups of databases or specific tables in PostgreSQL. This article will guide you through various use cases of pg_dump to create backups of databases and tables with or without data. Dumping Specific Tables with Schema Only: ----------------------------------------- To obtain the Data Definition Language (DDL) for specific tables within a schema, we can use the following commands: pg_dump -h localhost -p port -U username databasename -s -t table1 -t table2 > filename.sql pg_dump -h localhost -p port -U username databasename -s -t table1 -t table2 -f filename.sql The above commands will connect to the specified database (databasename) on the specified host and port, and it will extract the schema-only (-s) dump of the specified tables (-t table1 and table2) to the "filename.sql" file.   Dumping Specif...