Table Partition

Table Partition: SQL>select * from user_part_tables; SQL>select * from user_tab_partitions; SQL> select table_name,table_owner,partition_name,subpartition_count from dba_tab_partitions where table_name='<table_name>’; Oracle you can partition a table by CREATING PARTITION TABLES 1)Range Partitioning:  This type of partitioning is useful when dealing with data that has logical ranges into which it can be distributed;for example, value of year. Performance is […]

Read More

PostgreSQL Introduction

PostgreSQL is an free open-source database system that supports both relational (SQL) and non-relational (JSON) queries. PostgreSQL is a back-end database for dynamic websites and web applications. PostgreSQL supports the most important programming languages: Python.

Read More

Oracle Cloud Introduction

Oracle Cloud Infrastructure launched in October 2016 with a single region and core services across compute, storage,and networking. Since then, Oracle Cloud has expanded to more than 70 services available in 29 cloud regionsworldwide with plans to reach 38 total regions by the end of 2021. OCI offers relational, OLAP, JSON, and NoSQLdatabases, containers, Kubernetes, […]

Read More

                          Tablespace Level(exp/imp)

Step1:Create tablespace and Expdp: SQL> select table_name,tablespace_name from dba_tables where table_name=’BK’; TABLE_NAME ——————————————————————————– TABLESPACE_NAME —————————— BK INBA SQL> select name from v$datafile; NAME ——————————————————————————– /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_h1lpjm44_.dbf /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_h1lpl0nb_.dbf /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_h1lplsxv_.dbf /u01/app/oracle/oradata/ORCL/datafile/inba01.dbf /u01/app/oracle/oradata/ORCL/datafile/o1_mf_users_h1lplv5f_.dbf SQL> alter user remo default tablespace inba; User altered. SQL> conn remo/remo Connected. SQL> select * from bb;                ID ———-                22                23                […]

Read More

Oracle Architecture

Explain Oracle Architecture?Oracle Instance:a means to access an Oracle database,always opens one and only one database and consists of memory structures and background process.Oracle server:a DBMS that provides an open, comprehensive, integrated approach to information management,Consists of an Instance and a database.Oracle database:a collection of data that is treated as a unit,Consists of Datafiles, Control […]

Read More

             User Level Expdp/Impdp in Oracle DB

Step1:To create user and table: SQL> conn remo/remo Connected. SQL> select count(*) from emp;   COUNT(*) ———-                 4 SQL> host Step2:Create Directory and grant permission: SQL>create directory dir as ‘/u01/exportfile’; SQL>grant exp_full_database,imp_full_database to sys,system,remo; SQL> grant read,write on directory dir to sys,system,remo; Grant succeeded. Step3:Export the Dumpfile: [oracle@trichy u01]$ expdp directory=dir dumpfile=bkp_remo.dmp log=bkp_remo.log owner=’REMO’ […]

Read More

Oracle Data Guard Physical Standby Configuration Part2

Stage-4 Performing a Oracle Data Guard Switchover Using DGMGRL Step1:-Check the Primary Database Check both side select name,open_mode,database_role,protection_level from v$database; Standby side SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”, APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference”FROM(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# […]

Read More

Oracle Data Guard Physical Standby Configuration Part1

Stage-1 How to Create a Physical Standby Database using Backup PiecesHigh Level Steps Goal : How to Create Physical Standby Database using RMAN Backup With Duplicate Command SQL> startupORACLE instance started.Total System Global Area 2432696320 bytesFixed Size 8623592 bytesVariable Size 654314008 bytesDatabase Buffers 1761607680 bytesRedo Buffers 8151040 bytesDatabase mounted.Database opened. SQL> alter database force logging; […]

Read More

Oracle Data Guard Physical Standby Configuration

Stage-3 How To Create An Oracle 12c Data Guard Active Standby Database Primary Database Name indiaStandby Database name China Step:1 Enable Archive log mode and Flashback on Flashback database is highly recommended because in case of failover, you need not re-create primary database from scratch shut immediatestartup mountalter database archive log;alter database flashback on; Step:2 […]

Read More

Rman Commands

RMAN BACKUP STATUS set linesize 500 pagesize 2000 col Hours format 9999.99 col input_type for a20 col STATUS format a10 col RMAN_Bkup_start_time for a20 col RMAN_Bkup_end_time for a20 select SESSION_KEY, INPUT_TYPE, STATUS, to_char(START_TIME,’mm-dd-yyyy hh24:mi:ss’) as RMAN_Bkup_start_time, to_char(END_TIME,’mm-dd-yyyy hh24:mi:ss’) as RMAN_Bkup_end_time, elapsed_seconds/3600 Hours from V$RMAN_BACKUP_JOB_DETAILS order by session_key;  Database backups  RMAN> BACKUP DATABASE;  RMAN> BACKUP DATABASE […]

Read More