PLSQL Reference for DBA

PLSQL Reference for DBA PL/SQL stands for Procedural Language/SQL.PL/SQL extends SQL by adding control Structures found in other procedural language.PL/SQL combines the flexibility of SQL with Powerful feature of 3rd generation Language. The procedural construct and database access Are present in PL/SQL.PL/SQL can be used in both in database in Oracle Server and in ClientContinue reading PLSQL Reference for DBA

Redo log in general

Managing the Online Redo Log   Creating Online Redo Log Groups and Members Creating Online Redo Log Groups The following statement adds a new group of redo logs to the database: SQL>ALTER DATABASE ADD LOGFILE (‘/oracle/dbs/log1c.rdo’, ‘/oracle/dbs/log2c.rdo’) SIZE 500M; You can also specify the number that identifies the group using the GROUP option: SQL>ALTER DATABASEContinue reading Redo log in general

Materialized View Example

    ORASOA side:   create table tab1(c1 char(10),c2 char(10),c3 char(10));   begin for i in 1..10000 loop insert into tab1 values(i,’A’,’B’); end loop; end;   alter table tab1 add constraint pk_tab1 primary key(c1);   create materialized view log on tab1;—– Default is Primary Key   SQL> select * from mlog$_tab1 where rownum<5;   C1        Continue reading Materialized View Example

All about table and constraints in Oracle

CREATING ORACLE DATABASE OBJECTS CREATING TEMPORARY TABLES   SQL>CREATE GLOBAL TEMPORARY TABLE TEMP_EMP (EMPNO NUMBER,ENAME VARCHAR2(10))   CREATING ONE TABLE WITH DATA FROM ANOTHER   SQL> create table emp_copy(empno,sal) as select empno,sal from emp;   SQL> CREATE TABLE employee_new   2 AS SELECT * FROM employees   3 PARALLEL DEGREE 4   4*NOLOGGING; Table created.SQL>     TEXT DATATYPEContinue reading All about table and constraints in Oracle

DBMS_CRYPTO example

SQL> CONN SYS/SYS AS SYSDBA Connected. SQL> set serveroutput on SQL> SQL> set linesize 121 SQL> SQL> DECLARE l_credit_card_no VARCHAR2(19) := ‘1234-5678-9012-3456’; l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_credit_card_no); l_key RAW(128) := utl_raw.cast_to_raw(‘abcdefgh’); l_encrypted_raw RAW(2048); l_decrypted_raw RAW(2048); BEGIN dbms_output.put_line(‘Original : ‘ || l_credit_card_no); l_encrypted_raw := dbms_crypto.encrypt(l_ccn_raw, dbms_crypto.des_cbc_pkcs5, l_key); dbms_output.put_line(‘Encrypted : ‘ || RAWTOHEX(utl_raw.cast_to_raw(l_encrypted_raw))); l_decrypted_raw := dbms_crypto.decrypt(src => l_encrypted_raw,Continue reading DBMS_CRYPTO example

FAST START FAILOVER (FSFO) CONFIGURATION USING FAR SYNC NODE AS OBSERVER IN DATAGUARD USING DGMGRL

FAST START FAILOVER (FSFO) CONFIGURATION USING  FAR SYNC NODE AS OBSERVER IN DATAGUARD USING DGMGRL   1.For data guard DGMGRL configuration and Far Sync setup please follow below link:- http://clouddba.co/step-step-oracle-active-data-guard-far-sync-rac/   2.Please check current database status DGMGRL> show database  ebilpd1;   Database – ebilpd1   Role:               PRIMARY Intended State:     TRANSPORT-ON Instance(s): EBILPD11 EBILPD12   DatabaseContinue reading FAST START FAILOVER (FSFO) CONFIGURATION USING FAR SYNC NODE AS OBSERVER IN DATAGUARD USING DGMGRL

Step by Step Oracle Active Data Guard Far Sync RAC

     Step by Step Oracle Active Data Guard Far Sync RAC Active Data Guard Far Sync, a new capability with Oracle Database 12c, eliminates compromise by extending zero data loss protection to a replica database located at any distance from the primary database. Active Data Guard Far Sync accomplishes this with minimal expense or complexityContinue reading Step by Step Oracle Active Data Guard Far Sync RAC

Clean *.trc ,*.trm and *.aud older than 1 day clean oracle home

#!/bin/bash . /home/oracle/.bash_profile export log=/u01/app/oracle/shells/clean_rdbms_audit.log echo $ORACLE_HOME | tee $log echo “DELETING AUDIT LOGS FROM RDBMS” | tee -a $log date | tee -a $log df -m $ORACLE_HOME | tee -a $log /bin/find /u01/app/oracle/ -type f -name “*.trc” -mtime +1 -exec rm {} \; find $ORACLE_BASE/admin -type f -name “*.aud” -mtime +5 -exec rm {}Continue reading Clean *.trc ,*.trm and *.aud older than 1 day clean oracle home

Tablespace usage considering autoextend on

This script will show  tablespaces from all databases in server which are full by 85 percent.This script will take care autoextend on clause.This means it will show tablespace usage if growth is exceeding autoextended space. 1.The shell script:- for j in ORCL1 ORCL2 do export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1 export ORACLE_SID=$i #$ORACLE_HOME/bin/sqlplus -S monitor/m0n1t0r@”$j” << EOFContinue reading Tablespace usage considering autoextend on