Monday, April 25, 2016

RMAN Backup in Disk

RMAN Backup in Disk

dt=`date '+%d%m%Y%H%M'`
rman target rman_bkp_user/password <<eof
sql 'alter system archive log current';
run{
allocate channel c1  type disk;
allocate channel c2  type disk;
allocate channel c3  type disk;
allocate channel c4  type disk;
allocate channel c5  type disk;
allocate channel c6  type disk;
allocate channel c7  type disk;
backup AS COMPRESSED BACKUPSET full database tag T24_DB_$dt format '/db_rmanbackup/t24_db_%p_%s_$dt.bkp';
sql 'alter system archive log current';
backup current controlfile tag T24_CTL_$dt format '/db_rmanbackup/t24_ctl_%p_%s_$dt.bkp';
backup spfile tag T24_SPF_$dt format '/db_rmanbackup/t24_spf_%p_%s_$dt.bkp'  ;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
}
eof

Note: rman_bkp_user must have SYSDBA privilege to run RMAN backup.

Database DROP (Without DBCA)

Database DROP (Without DBCA)

TRY 1:
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

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


TRY 2:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount exclusive
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 8551575552 bytes
Fixed Size                  2222664 bytes
Variable Size            4194305464 bytes
Database Buffers         4345298944 bytes
Redo Buffers                9748480 bytes
Database mounted.
SQL> drop database
  2  ;
drop database
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode


TRY 3:
SQL> startup nomount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 8551575552 bytes
Fixed Size                  2222664 bytes
Variable Size            4194305464 bytes
Database Buffers         4345298944 bytes
Redo Buffers                9748480 bytes
SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01507: database not mounted


SQL> alter database mount;

Database altered.

SQL> drop database;
drop database
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode


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

Total System Global Area 8551575552 bytes
Fixed Size                  2222664 bytes
Variable Size            4194305464 bytes
Database Buffers         4345298944 bytes
Redo Buffers                9748480 bytes
Database mounted.
SQL> drop database;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>