To provide database restoring, besides data files, you need recovery aid files: a trace file of the control file and a copy of the init.ora file. The trace file of the control file contains the names and locations of all of the data files and additional data files that have been added to the database. It also contains the redo logs and the commands that can be used to recreate the database structure. The init.ora file contains Oracle initializing parameters, including the names and locations of the database control files. To create trace file of the control file, spfile file and to backup them: - Log on to the computer that hosts the Oracle database as the oracle user.
Open Oracle SQL*Plus and log as sysdba user:
OS> sqlplus / as sysdba If the system was installed using kickstartthe installer, you can use wsqlplus command. | Информация |
|---|
| wsqlplus command is an alias of sqlplus:
alias wsqlplus='rlwrap -b "" -f ~/sql.dict sqlplus'
|
Wait for Connected message. - Copy (or enter) the following SQL queue to the command prompt:
SQL> alter database backup controlfile to trace; - To find the directory in which the trace file was created, enter:
SQL> show parameter user_dump; At that folder you can find trc file and alert_iwtm.log file (alert_INSTANCE_NAME). At log file you can find the name of the trace file which was created. Exit Oracle SQL*Plus:
SQL> exit - If the system was installed using kickstart installer and default parameters were left, you can check last alert_iwtm.log records by the following command:
OS> tail -f /u01/app/oracle/diag/rdbms/iwtm/iwtm/trace/alert_iwtm.log Press CTRL+C to exit view. - Create a copy of spfile (pfile):
OS> sqlplus / as sysdba
SQL> CREATE PFILE from SPFILE; - To find the directory in which the pfile file was created, enter:
SQL> show parameter PFILE It returns a path to the directory where pfile was created (/u01/app/oracle/product/db_1/dbs/ by default). In this folder the initiwtm.ora file is located too. Please create a backup for initiwtm.ora file. Exit Oracle SQL*Plus:
SQL> exit - Copy trace and spfile files to the backup storage, to previously created
/opt/IWTM_Backup_Files/Recovery_Aid subdirectory. - Be sure to copy the file with the most recent date and timestamp. To check the date and the timestamps of the files in the directory, enter:
OS> ll - Rename the file so that it can be easily identified, for example:
controlfilebackupMMDDYY.trc
|