Oracle Tutorial: User-managed backup and recovery-Backup other files

Source: Internet
Author: User

Back up archived logs

-- View the archive logs generated by the first archive location in the past day. dest_id indicates the location where archive logs are stored, corresponding to 1 ~ in v $ archive_dest ~ The value of the destination field of 10. 0 indicates that it is unavailable.

SQL> select name from v $ archived_log where dest_id = 1 and first_time> = sysdate-1;

NAME
Bytes ------------------------------------------------------------------------------------------------------------------------
/Oracle/10g/oracle/log/archive_log/archive_1_23_757801926.arclog
/Oracle/10g/oracle/log/archive_log/archive_1_24_757801926.arclog

SQL> select name from v $ archived_log where dest_id = 10 and first_time >=sysdate-1;

NAME
Bytes ------------------------------------------------------------------------------------------------------------------------
/Oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/201%08_01/o%mf_%23_73fljh3f _. arc
/Oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/20151108_02/o%mf_%24_73hwlry6 _. arc

SQL> select destination from v $ archive_dest;

DESTINATION
Bytes ------------------------------------------------------------------------------------------------------------------------
/Oracle/10g/oracle/log/archive_log
/Oracle/10g/oracle/log/archive_log2

USE_DB_RECOVERY_FILE_DEST

10 rows selected.
-- Copy archived logs to the specified Backup Directory
Cp

Backup parameter file
1) if you use a text parameter file (pfile), run the OS command to copy the file to the backup directory.
2) If spfile is used, create pfile is used for backup.
3) If pfile is used, create spfile is used for backup.
SQL> show parameter spfile

NAME TYPE VALUE
-----------------------------------------------------------------------------
Spfile string/oracle/10g/oracle/product/10.
2.0/db_1/dbs/spfileoralife. ora
-- Create pfile, which is equivalent to backing up spfile as pfile
SQL> create pfile = '/oracle/10g/oracle/bakup/database/pfileoralife. ora'
2 from spfile;

File created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
-- Use pfile to start the database to the nomount status. You can also directly start up pfile = 'pfile full path'
SQL> startup nomount pfile = '/oracle/10g/oracle/bakup/database/pfileoralife. ora ';
ORACLE instance started.

Total System Global Area 528482304 bytes
Fixed Size 1220360 bytes
Variable Size 146800888 bytes
Database Buffers 373293056 bytes
Redo Buffers 7168000 bytes
SQL> show parameter pfile; -- The spfile parameter is blank when pfile is used to start the database.

NAME TYPE VALUE
----------------------------------------------------------------------------------------
Spfile string
SQL> show parameter spfile;

NAME TYPE VALUE
----------------------------------------------------------------------------------------
Spfile string

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.