Monday, January 29, 2018

How To Extend/Decrease the Size of a tablespace


Option 1

 You can extend the size of a tablespace by increasing the size of an existing datafile by typing the following command.

SQL> alter  database jsm datafile ‘/u01/oracle/data/jsmtbs01.dbf’ resize 100M;

This will increase the size from 50M to 100M

Option 2

You can also extend the size of a tablespace by adding a new datafile to a tablespace. This is useful if the size of existing datafile is reached o/s file size limit or the drive where the file is existing does not have free space. To add a new datafile to an existing tablespace give the following command.

SQL> alter tablespace add datafile‘/u02/oracle/jsm/jsmtbs02.dbf’size 50M;

Option 3

You can also use auto extend feature of datafile. In this, Oracle will automatically increase the size of a datafile whenever space is required. You can specify by how much size the file should increase and Maximum size to which it should extend.
To make a existing datafile auto extendable give the following command.

SQL> alter database datafile ‘/u01/oracle/jsm/jsmtbs01.dbf’ auto extend ON next 5M maxsize 500M;

You can also make a datafile auto extendable while creating a new tablespace itself by giving the following command.

SQL> create tablespace jsm datafile ‘/u01/oracle/jsm/jsmtbs01.dbf’ size 50M auto extend ON next 5M maxsize 500M;


You can decrease the size of tablespace by decreasing the datafile associated with it. You decrease a datafile only up to size of empty space in it. To decrease the size of a datafile give the following command

SQL> alter database datafile ‘/u01/oracle/jsm/jsmtbs01.dbf’      resize 30M;


A free extent in a dictionary-managed tablespace is made up of a collection of contiguous free blocks. When allocating new extents to a tablespace segment, the database uses the free extent closest in size to the required extent. In some cases, when segments are dropped, their extents are deallocated and marked as free, but adjacent free extents are not immediately recombined into larger free extents. The result is fragmentation that makes allocation of larger extents more difficult.
You should often use the ALTER TABLESPACE ... COALESCE statement to manually coalesce any adjacent free extents. To Coalesce a tablespace give the following command.

SQL> alter tablespace jsm coalesce;








Rman List Failure, Advise Failure and Repair Failure

List Failure, Advise Failure and Repair Failure with Oracle RMAN


 Rman is very easy tool for recovery. Suppose you lost your datafile or a block is corrupted or you lost a tablespace, Dont worry about it . Talk to RMAN that takes care of the rest.  

The Data Recovery Advisor,one of the RMAN beauties come with 11g (DRA).

Below is the easiest step to recover it.
Firstly I removed one of my datafile.
rm –r  /u01/app/oracle/oradata/TEST/datafile/myts01.dbf 
Now I  try to open the database . I will get an error.

SQL> startup;
ORACLE instance started.
Total System Global Area 2042241024 bytes
Fixed Size 1337548 bytes
Variable Size 1224738612 bytes
Database Buffers 805306368 bytes
Redo Buffers 10858496 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 – see DBWR trace file
ORA-01110: data file 7: ‘/u01/app/oracle/oradata/TEST/datafile/myts01.dbf’

Now I open the database in mount stage;

SQL> select status from v$instance;
STATUS
————
MOUNTED
Rman target/
RMAN> list failure;

Database Role: PRIMARY
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
282        CRITICAL OPEN      29-JAN-18     myts01.dbf’ datafile 7:
/u01/app/oracle/oradata/TEST/datafile/myts01.dbf’
RMAN> advise failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
———- ——– ——— ————- ——-
78802 HIGH OPEN 29-JAN-18   One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file ‘/u01/app/oracle/oradata/TEST/datafile/myts01.dbf’ was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
—— ——————
1 Restore and recover datafile 7
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/talip/TALIP/hm/reco_3655040472.hm
RMAN suggested to us a script to solve the problem. Let’s see what the contents of this script;
RMAN> repair failure preview;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/talip/TALIP/hm/reco_3655040472.hm
contents of repair script:
# restore and recover datafile
restore datafile 7;
recover datafile 7;
Yes, we are looking for exactly that suggested the recovery script. I agree with RMAN and let’s recover our datafile.
RMAN> repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/talip/TALIP/hm/reco_3655040472.hm
contents of repair script:
# restore and recover datafile
restore datafile 7;
recover datafile 7;
Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script
Starting restore at 29-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: restoring datafile 00007
input datafile copy RECID=7 STAMP=756487675 file name=/oracle/yedek/TALIP/data_D-TALIP_I-1561456315_TS-MYTS_FNO-7_09mhe5f3
destination for restore of datafile 00007: ‘/u01/app/oracle/oradata/TEST/datafile/myts01.dbf’

channel ORA_DISK_1: copied datafile copy of datafile 00007
output file name=/u01/app/oracle/oradata/TEST/datafile/myts01.dbf’ RECID=0 STAMP=0
Finished restore at 29-JAN-18
Starting recover at 29-JAN-18
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 29-JAN-18
repair failure complete
Do you want to open the database (enter YES or NO)? yes
database opened
RMAN>exit;
Everything is fine. RMAN took care of everything. Our database is in good hands 
SQL> select status from v$instance;
STATUS
————
OPEN


Monday, January 22, 2018

Buffer Cache Hit Ratio

Buffer Hit Ratio

BUFFER HIT RATIO NOTES:

•  Consistent Gets - The number of accesses made to the block buffer to retrieve data in a consistent mode.
•  DB Blk Gets - The number of blocks accessed via single block gets (i.e. not through the consistent get mechanism).
•  Physical Reads - The cumulative number of blocks read from disk.
•  Logical reads are the sum of consistent gets and db block gets.
•  The db block gets statistic value is incremented when a block is read for update and when segment header blocks are accessed.

•  Hit Ratio should be > 80%, else increase DB_BLOCK_BUFFERS in init.ora

 To Check with Query
select   sum(decode(NAME, 'consistent gets',VALUE, 0)) "Consistent Gets",
            sum(decode(NAME, 'db block gets',VALUE, 0)) "DB Block Gets",
            sum(decode(NAME, 'physical reads',VALUE, 0)) "Physical Reads",
            round((sum(decode(name, 'consistent gets',value, 0)) +
                   sum(decode(name, 'db block gets',value, 0)) -
                   sum(decode(name, 'physical reads',value, 0))) /
                  (sum(decode(name, 'consistent gets',value, 0)) +
                   sum(decode(name, 'db block gets',value, 0))) * 100,2) "Hit Ratio"
from   v$sysstat;

Data Dict Hit Ratio

DATA DICTIONARY HIT RATIO NOTES:

•  Gets - Total number of requests for information on the data object.
•  Cache Misses - Number of data requests resulting in cache misses
•  Hit Ratio should be > 90%, else increase SHARED_POOL_SIZE in init.ora
To Check with Query

select   sum(GETS),
            sum(GETMISSES),
            round((1 - (sum(GETMISSES) / sum(GETS))) * 100,2)
from    v$rowcache;

SQL Cache Hit Ratio

SQL CACHE HIT RATIO NOTES:

•  Pins - The number of times a pin was requested for objects of this namespace.
•  Reloads - Any pin of an object that is not the first pin performed since the object handle was created, and which requires loading the object from disk.

•  Hit Ratio should be > 85%

To Check with Query

select   sum(PINS) Pins,
            sum(RELOADS) Reloads,
            round((sum(PINS) - sum(RELOADS)) / sum(PINS) * 100,2) Hit_Ratio
from    v$librarycache;

Library Cache Miss Ratio

LIBRARY CACHE MISS RATIO NOTES:
•  Executions - The number of times a pin was requested for objects of this namespace.
•  Cache Misses - Any pin of an object that is not the first pin performed since the object handle was created, and which requires loading the object from disk.

•  Hit Ratio should be < 1%, else increase SHARED_POOL_SIZE in init.ora

To Check with Query

select   sum(PINS) Executions,
            sum(RELOADS) cache_misses,
            sum(RELOADS) / sum(PINS) miss_ratio
from    v$librarycache;


Wednesday, January 10, 2018

Recovery of a dropped tablespace

Recovery of a dropped tablespace

To recover from a case of a dropped tablespace, the Tablespace Point In Time Recovery (TSPITR) method cannot be used.

When you drop a tablespace, the controlfile will then no longer have any records of the tablespace which has been dropped. Attempts to use the RMAN RECOVER TABLESPACE command will return the RMAN error RMAN-06019 – “could not translate tablespace name” as shown below.


SQL> drop tablespace rman10 including contents and datafiles;

Tablespace dropped.

testdb:/u01/oracle/diag/rdbms/apex/apex/trace> rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jan 10 11:53:58 2009

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

connected to target database: TESTDB (DBID=2469552796)

RMAN> restore tablespace rman10;

Starting restore at 10-JAN-18
using target database control file instead of recovery catalog
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=141 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/01/2018 11:54:11
RMAN-20202: tablespace not found in the recovery catalog

So to recover from a dropped tablespace, we have two options:

1)  Do a point in time recovery of the whole database until the time the tablespace was dropped.
2)  Create a clone of the database from a valid backup, export the required tables from the tablespace which has been dropped, recreate the tablespace and then import the tables from the clone.

The first option will require an outage of the entire database and the entire database will be rolled back in tine in order to recover the tablespace.

Let us examine the first option using the example shown below:

In this example, CONTROLFILE AUTOBACKUP has been turned on and Flashback has been enabled for the database.
With Flashback enabled, the db_recovery_file_dest will have a sub-directory ‘autobackup’ as shown below for each day

We will Take full Backup.

backup database plus archivelog;

Starting backup at 10-JAN-18
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=24 STAMP=965056892
channel ORA_DISK_1: starting piece 1 at 10-JAN-18
channel ORA_DISK_1: finished piece 1 at 10-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_01_10/o1_mf_annnn_TAG20180110T152133_f5crk5bz_.bkp tag=TAG20180110T152133 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=13 RECID=15 STAMP=965046171
input archived log thread=1 sequence=14 RECID=22 STAMP=965047189
input archived log thread=1 sequence=15 RECID=23 STAMP=965047189
input archived log thread=1 sequence=16 RECID=21 STAMP=965047189
channel ORA_DISK_1: starting piece 1 at 10-JAN-18
channel ORA_DISK_1: finished piece 1 at 10-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_01_10/o1_mf_annnn_TAG20180110T152133_f5crk6g0_.bkp tag=TAG20180110T152133 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-JAN-18

Starting backup at 10-JAN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/drtbs1.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/drtbs2.
dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/arul1.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-JAN-18
channel ORA_DISK_1: finished piece 1 at 10-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_01_10/o1_mf_nnndf_TAG20180110T152135_f5crk7pb_.bkp tag=TAG20180110T152135 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 10-JAN-18

Starting backup at 10-JAN-18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=25 STAMP=965056950
channel ORA_DISK_1: starting piece 1 at 10-JAN-18
channel ORA_DISK_1: finished piece 1 at 10-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_01_10/o1_mf_annnn_TAG20180110T152230_f5crlyvl_.bkp tag=TAG20180110T152230 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-JAN-18

Starting Control File and SPFILE Autobackup at 10-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2018_01_10/o1_mf_s_965056952_f5crm0dh_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 10-JAN-18


ttestdb:/u02/oradata/testdb/TESTDB/autobackup/2018_01_10> ls -lrt
total 63040
-rw-r-----    1 oracle   dba         6455296 Jan  10  10:22 o1_mf_s_693915680_57dlgcqh_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  11:49 o1_mf_s_693920955_57dqkw0j_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  13:28 o1_mf_s_693926889_57dxcbdx_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  14:18 o1_mf_s_693928526_57f094n9_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan    10  14:20 o1_mf_s_693930026_57f0fbo2_.bkp

When we drop the tablespace we are changing the structure of the database and since controlfile autobackup has been turned on, we see another backup file has been created in the autobackup location in the flash recovery area on disk.

Now we create tablespace..

SQL> create tablespace arul datafile '/u01/app/oracle/oradata/orcl/arul1.dbf'  
size 100M  extent management local;

SQL> drop tablespace arul including contents and datafiles;

Tablespace dropped.

Now We check valid backup

testdb:/u02/oradata/testdb/TESTDB/autobackup/2009_08_03> ls -lrt
total 75648
-rw-r-----    1 oracle   dba         6455296 Jan  10  10:22 o1_mf_s_693915680_57dlgcqh_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  11:49 o1_mf_s_693920955_57dqkw0j_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  3 13:28 o1_mf_s_693926889_57dxcbdx_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  14:18 o1_mf_s_693928526_57f094n9_.bkp
-rw-r-----    1 oracle   dba         6455296 Jan   10  14:20 o1_mf_s_693930026_57f0fbo2_.bkp
-rw-r-----    1 oracle   dba         6455296 Aug  3 14:38 o1_mf_s_693931114_57f1hbmo_.bkp

We then shutdown the database, startup in nomount mode and attempt to restore the controlfile from autobackup.

The most recent controlfile autobackup has been restored, but since this has been taken after the tablespace was dropped, the tablespace which has been dropped (ARUL) is not referenced in the control file that we just restored. If we try to restore and recover the database, the dropped tablespace will not be restored.

 SQL> shutdown immediate;

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  264241152 bytes
Fixed Size                  2083304 bytes
Variable Size             142607896 bytes
Database Buffers          113246208 bytes
Redo Buffers                6303744 bytes

RMAN> restore controlfile from autobackup;

Starting restore at 10-JAN-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

recovery area destination: /u02/oradata/testdb/
database name (or database unique name) used for search: TESTDB
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u02/oradata/testdb/TESTDB/autobackup/2009_08_03/o1_mf_s_693931114_57f1hbmo_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u02/oradata/testdb/control01.ctl
output filename=/u02/oradata/testdb/control02.ctl
output filename=/u02/oradata/testdb/control03.ctl
Finished restore at 10-JAN-18

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> report schema;
...

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1230     SYSTEM               ***     /u02/oradata/testdb/system01.dbf
2    1700     UNDOTBS1             ***     /u02/oradata/testdb/undotbs01.dbf
3    370      SYSAUX               ***     /u02/oradata/testdb/sysaux01.dbf
4    280      USERS                ***     /u02/oradata/backup/bkp.04klgv2b
5    131      EXAMPLE              ***     /u02/oradata/testdb/example01.dbf
6    150      USERS                ***     /u02/oradata/backup/bkp.06klgv3k
9    100      USERS                ***     /u02/oradata/backup/bkp.08klgv4i


We will need to restore a backup of the controlfile which contains records for the tablespace ARUL. We use the RESTORE CONTROLFILE FROM command to restore a specific controlfile autobackup.

RMAN>  restore controlfile from '/u02/oradata/testdb/TESTDB/autobackup/2018_01_10/o1_mf_s_693930026_57f0fbo2_.bkp';

Starting restore at 10-JAN-18
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u02/oradata/testdb/control01.ctl
output filename=/u02/oradata/testdb/control02.ctl
output filename=/u02/oradata/testdb/control03.ctl
Finished restore at 10-JAN-18

RMAN> report schema;
.....

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    1230     SYSTEM               ***     /u02/oradata/testdb/system01.dbf
2    1700     UNDOTBS1             ***     /u02/oradata/testdb/undotbs01.dbf
3    370      SYSAUX               ***     /u02/oradata/testdb/sysaux01.dbf
4    280      USERS                ***     /u02/oradata/backup/bkp.04klgv2b
5    131      EXAMPLE              ***     /u02/oradata/testdb/example01.dbf
6    150      USERS                ***     /u02/oradata/backup/bkp.06klgv3k
7    0        ARUL                 ***     /u02/oradata/testdb/arul01.dbf
9    100      USERS                ***     /u02/oradata/backup/bkp.08klgv4i


The alert log will also show the time when the tablespace was dropped. We can also see that a controlfile autobackup has taken place after the tablespace was dropped.

drop tablespace arul including contents and datafiles
Mon Jan  10 14:38:34 2018
Deleted file /u02/oradata/testdb/arul01.dbf
Starting control autobackup
Control autobackup written to DISK device
        handle '/u02/oradata/testdb/TESTDB/autobackup/2018_01_10/o1_mf_s_693931114_57f1hbmo_.bkp'
Completed: drop tablespace arul including contents and datafiles


Now that we know the time the tablespace was dropped, we can do a point in time recovery of the DATABASE in order to recover the tablespace which has been dropped.

RMAN> run {
2> set until time "to_date('10-JAN-2018 14:38:00','DD-MON-YYYY HH24:Mi:SS')";
3> restore database;
4> recover database;
5> }

executing command: SET until clause
using target database control file instead of recovery catalog

Starting restore at 10-JAN-18
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=159 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: restoring datafile 00004
input datafile copy recid=14 stamp=693929215 filename=/u02/oradata/testdb/users01.dbf
destination for restore of datafile 00004: /u02/oradata/backup/bkp.04klgv2b
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u02/oradata/testdb/system01.dbf
restoring datafile 00002 to /u02/oradata/testdb/undotbs01.dbf
restoring datafile 00003 to /u02/oradata/testdb/sysaux01.dbf
restoring datafile 00005 to /u02/oradata/testdb/example01.dbf
restoring datafile 00007 to /u02/oradata/testdb/arul01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece 0gkloo6p_1_1
channel ORA_DISK_1: copied datafile copy of datafile 00004
output filename=/u02/oradata/backup/bkp.04klgv2b recid=21 stamp=693932732
channel ORA_DISK_1: restoring datafile 00006
input datafile copy recid=13 stamp=693929146 filename=/u02/oradata/testdb/users02.dbf
destination for restore of datafile 00006: /u02/oradata/backup/bkp.06klgv3k
channel ORA_DISK_1: copied datafile copy of datafile 00006
output filename=/u02/oradata/backup/bkp.06klgv3k recid=23 stamp=693932755
channel ORA_DISK_1: restoring datafile 00009
input datafile copy recid=10 stamp=693929108 filename=/u02/oradata/testdb/users03.dbf
destination for restore of datafile 00009: /u02/oradata/backup/bkp.08klgv4i
channel ORA_DISK_1: copied datafile copy of datafile 00009
output filename=/u02/oradata/backup/bkp.08klgv4i recid=26 stamp=693932809
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=0gkloo6p_1_1 tag=TAG20090803T113241
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:02:40
Finished restore at 10-JAN-18

Starting recover at 10-JAN-18
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 8 is already on disk as file /u02/oradata/testdb/arch/arch.8.1.693662800.log
archive log thread 1 sequence 9 is already on disk as file /u02/oradata/testdb/arch/arch.9.1.693662800.log
archive log thread 1 sequence 10 is already on disk as file /u02/oradata/testdb/arch/arch.10.1.693662800.log
archive log thread 1 sequence 1 is already on disk as file /u02/oradata/testdb/redo01.log
archive log thread 1 sequence 2 is already on disk as file /u02/oradata/testdb/redo02.log
archive log filename=/u02/oradata/testdb/arch/arch.8.1.693662800.log thread=1 sequence=8
archive log filename=/u02/oradata/testdb/arch/arch.9.1.693662800.log thread=1 sequence=9
archive log filename=/u02/oradata/testdb/arch/arch.10.1.693662800.log thread=1 sequence=10
archive log filename=/u02/oradata/testdb/redo01.log thread=1 sequence=1
archive log filename=/u02/oradata/testdb/redo02.log thread=1 sequence=2
media recovery complete, elapsed time: 00:00:06
Finished recover at 10-JAN-18

RMAN>

RMAN> alter database open resetlogs;

database opened

We can now see that the tablespace which has been dropped has been recovered

SQL> select file_name,bytes from dba_data_files where
  2  tablespace_name='ARUL';

FILE_NAME
--------------------------------------------------------------------------------
     BYTES
----------
/u02/oradata/testdb/arul01.dbf
  37748736


How to create user in MY SQL

Create  a new MySQL user Account mysql > CREATE USER ' newuser '@'localhost' IDENTIFIED BY ' password '...