Sunday, 17 May 2020

Oracle FULL Database Compressed backup on Disk using RMAN

connect target /
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE disk;
ALLOCATE CHANNEL c2 DEVICE TYPE disk;
ALLOCATE CHANNEL c3 DEVICE TYPE disk;
ALLOCATE CHANNEL c4 DEVICE TYPE disk;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
sql 'ALTER SYSTEM SWITCH LOGFILE';
sql 'ALTER SYSTEM SWITCH LOGFILE';
sql 'ALTER SYSTEM SWITCH LOGFILE';
CROSSCHECK ARCHIVELOG ALL;
backup AS COMPRESSED BACKUPSET full database tag PRD_FULL format '/location/%d_%T_%s_%p_FULL';
backup as compressed backupset archivelog all format 'location/%d_%s_%p_%c_%t.arc.rman';
backup current controlfile format '/location/%d_%T_%s_%p_CONTROL.ctl';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}

Wednesday, 17 May 2017

Drop Oracle Database

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup restrict;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 3557658624 bytes
Fixed Size                  2251448 bytes
Variable Size            1795163464 bytes
Database Buffers         1744830464 bytes
Redo Buffers               15413248 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> select name, open_mode, database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
QAS       READ WRITE           PRIMARY

SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation


SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> start mount restrict
SP2-0310: unable to open file "mount.sql"
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
eccqas:oraqas 111>
eccqas:oraqas 111>
eccqas:oraqas 111>
eccqas:oraqas 111> sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed May 17 15:02:03 2017

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

Connected to an idle instance.

SQL> startup mount restrict
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 3557658624 bytes
Fixed Size                  2251448 bytes
Variable Size            1795163464 bytes
Database Buffers         1744830464 bytes
Redo Buffers               15413248 bytes
Database mounted.
SQL>  select name, open_mode, database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
QAS       MOUNTED              PRIMARY

SQL> drop database;

Database dropped.