DB_RECOVERY_FILE_DEST - Alter parameters ORACLE

on 11:19 PM

DB_RECOVERY_FILE_DEST specifies the default location for the flash recovery area backups. The flash recovery area contains multiplexed copies of current control files and online redo logs, as well as archived redo logs, flashback logs, and RMAN backups.

Specifying this parameter without also specifying the DB_RECOVERY_FILE_DEST_SIZE initialization parameter is not allowed
Below are the steps to Change  DB_RECOVERY_FILE_DEST & DB_RECOVERY_FILE_DEST_SIZE Parameter:

[oracle@]$ sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Sun Aug 16 09:30:39 2015
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter db_recovery

NAME                                 TYPE        VALUE
-------------------------------- ----------- ------------------------------
db_recovery_file_dest                string      /opt/oracle/test01/flash_recovery_area
db_recovery_file_dest_size           big integer 10G

Command for changing db_recovery_file_dest

SQL> alter system set db_recovery_file_dest='/opt/oracle/test01/dbs/arch' scope=both;
System altered.

SQL> show parameter db_recovery
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /opt/oracle/test01/dbs/arch
db_recovery_file_dest_size           big integer 10G

Command for changing db_recovery_file_dest_size

SQL>  alter system set db_recovery_file_dest_size=20G scope=both;
System altered.

SQL> show parameter db_recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /opt/oracle/test01/dbs/arch
db_recovery_file_dest_size           big integer 20G




Flash/Fast Recovery Area (FRA) in Oracle

on 10:08 PM

Flash Recovery Area can be defined as a single, centralized, unified storage area that keep all the database backup & recovery related files and performs those activities in Oracle databases.


Related views
V$RECOVERY_FILE_DEST
V$FLASH_RECOVERY_AREA_USAGE
V$DBA_OUTSTANDING_ALERTS
V$FLASHBACK_DATABASE_LOGFILE


# Instance Name
select instance_name from v$instance;

# Used GB in FRA
select name
, floor(space_limit / 1024 / 1024/1024) "Size GB"
, ceil(space_used  / 1024 / 1024/1024) "Used GB"
from v$recovery_file_dest
order by name;

# FRA Occupants
SELECT * FROM V$FLASH_RECOVERY_AREA_USAGE;

SELECT NAME,
TO_CHAR(SPACE_LIMIT, '999,999,999,999') AS SPACE_LIMIT,
TO_CHAR(SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE, '999,999,999,999') AS SPACE_AVAILABLE,
ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1) AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;


select * from v$Recovery_file_dest;

SELECT
ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1)
AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;

# Location and size of the FRA
show parameter db_recovery_file_dest;

# Size, used, Reclaimable
SELECT
  ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB,
  ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB,
  ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB,
  SUM(B.PERCENT_SPACE_USED)  AS PERCENT_OF_SPACE_USED
FROM
  V$RECOVERY_FILE_DEST A,
  V$FLASH_RECOVERY_AREA_USAGE B
GROUP BY
  SPACE_LIMIT,
  SPACE_USED ,
  SPACE_RECLAIMABLE ;



How to schedule tasks on Linux using the 'at' command

on 12:44 AM



Scheduling jobs is an essential part of administering Linux servers. We took a look at how to schedule jobs on Linux machine using the cron command earlier. Here’s an alternative to cron –at. The primary difference between the two is that when you schedule a task using cron it execute repeatedly without the need for rescheduling. With at, on the other hand, the scheduling of a task is only for a single execution. Both of these commands have their use, and I would suggest that you get a good understanding of them both.

Let’s look at how to schedule a task to execute only once using the at command. First make sure that the at daemon is running using a command like this:

# ps -ef | grep atd

The at command is pretty clever in that it can take some orders in English if you like. For example, you can schedule jobs using the following syntax as well:

root 8231 1 0 18:10 ? 00:00:00 /usr/sbin/atd


If you don’t see atd running start it with this command:


# /etc/init.d/atd start


Once the daemon has been started successfully you can schedule an at task using the two options -f, for the file to be executed, and -v, for the time at which it should be executed. So if you want to execute the shell script shellscript.sh at 6:30 PM you would run the following command:


# at -f shellscript.sh -v 18:30


Remember that with the at command the script shellscript.sh will execute at 6:30 PM and then the scheduling will disappear. So if this is not what you desire, you are better off using cron.


# at -f shellscript.sh 10pm tomorrow

# at -f shellscript.sh 2:50 tuesday

# at -f shellscript.sh 6:00 july 11

# at -f shellscript.sh 2:00 next week

on 11:50 PM

# FTP SCRIPT TO TRANSFER MULTIPLE FILES #


HOST='XXXXXX'
USER='XXXX'
PASSWD='XXX'
FILE='*.txt'


ftp -v -n -i $HOST <
quote USER $USER
quote PASS $PASSWD
mput FILE $FILE
quit
END_SCRIPT
exit 0

on 11:46 PM

# FTP SCRIPT TO TRANSFER ONE FILE #


HOST='xxxxx'

USER='xxx'
PASSWD='xxxx'
FILE='inst.txt'

ftp -n -v $HOST << END_SCRIPT

quote USER $USER
quote PASS $PASSWD
put inst1.txt
quit
END_SCRIPT
exit 0

Basic LINUX - 5

on 8:54 AM

To copy files

[root@database ~]# cp anaconda-ks.cfg file1

To copy folders

[root@database ~]# cp -r dir2 Desktop

To rename  directories and files

[root@database ~]# mv dir3 d4

To move directories and files 


[root@database ~]# mv dir2 /opt

To move directories and files 

[root@database ~]# mv dir2 /opt

To see the type of file

[root@database ~]# file *

Basic LINUX - 4

on 8:47 AM

11. To create nested directories

[root@database ~]# mkdir -p d1/d2/d3/d4

To see the tree structure

[root@database ~]# ls -R d1
d1:
d2

d1/d2:
d3

d1/d2/d3:
d4

d1/d2/d3/d4:


12. To change a directory

[root@database ~]# cd dir1

[root@database ~]# cd ..

[root@database ~]# cd ../..

[root@database ~]# cd -
/root

[root@database ~]# pwd
/root

[root@database ~]# cd

[root@database ~]# pwd
/root

[root@database ~]#

13. To remove files

[root@database ~]# rm file1

rm: remove regular file `file1'? y

14. To remove an empty directory

[root@database ~]# rmdir dir1

[root@database ~]# ls

anaconda-ks.cfg  Desktop  dir2  dir4  f2  f4     file3        install.log.syslog
d1               dir      dir3  f1    f3  file2  install.log  labmanual

15. To remove a directory

[root@database ~]# rm -rf dir

[root@database ~]# ls
anaconda-ks.cfg  Desktop  dir3  f1  f3  file2  install.log         labmanual
d1               dir2     dir4  f2  f4  file3  install.log.syslog

Basic LINUX - 3

on 8:37 AM

5. To create a file

[root@database ~]# cat > file1
hi how are you

6. To see file content

[root@database ~]# cat file1
hi how are you


7. To append a file

[root@database ~]  cat >> file1
iam fine, it is very nice

[root@database ~] cat file1 file2 >> file3 #redirecting output to file3

[root@database ~] cat file3

8. To create a file using touch command

@ Touch - The touch command is the easiest way to create new, empty files.

[root@database ~]# touch f1 f2 f3 f4

[root@database ~]# ls

9. Creating a single directory

[root@database ~]# mkdir dir

10. Creating multiple directories

[root@database ~]# mkdir dir1 dir2 dir3 dir4

[root@database ~]# ls

anaconda-ks.cfg  dir   dir2  dir4  f2  f4     file2  install.log       
labmanual

Basic LINUX - 2

on 8:20 AM

To see a file starting from f

[root@database ~]# ls f*

To see a file have a middle string as disk

[root@database ~]# ls /bin/*disk*

To see a file whose length is 3 characters

[root@database ~]# ls ???

To see a file which starts with single char & ends up with any number of character

[root@database ~]# ls ?edh*

Basic LINUX

on 8:16 AM

Basic Linux Command

1. To check the present working directory


 [root@database ~]# pwd

/root

2. To show the contents of a directory (folder)


[root@database ~]# ls


3145.zip  args1    database_notes  Documents   ifcfg-eth1_March25  linux_image.iso  names         phonenubers  uln_migrate             uln_register.tar
args      BegPerl  Desktop         hello2.plx  index.html.1        mbox             oradiag_root  scripts     

3. To see more details including the permission regarding the contents of a
directory (folder)

[[root@database ~]# ls -l
total 3511620
-rw-r--r--  1 root   root       422670 Dec 30 10:29 3145.zip
-rwxr--r--  1 root   root          105 Apr  8 21:45 args
-rwxr--r--  1 root   root           32 Apr  8 21:51 args1
drwxr-xr-x 17 root   root         4096 Dec 30 10:31 BegPerl
-rw-r--r--  1 root   root         5022 Jan  5 09:55 database_notes
drwxr-xr-x  3 root   root         4096 Mar 25 04:45 Desktop
drwx------  3 root   root         4096 Mar 30 21:33 Documents

4. To see all contents including hidden files of a directory (folder)

[root@database ~]# ls -a             
 .bashrc         .eggcups         .gstreamer-0.10     mbox                 scripts                 uln_register.tar             .xauthgXJKsS - 

5 . To see tree structure of nested directories

[root@database ~]# ls -R /opt
/opt:
ORCLfmap
sqldeveloper
sun
VBoxGuestAdditions-4.2.6

/opt/ORCLfmap:
prot1_32