实例未启动,应当使用startup命令将备用库启动后重试。
[oracle@udbs01 dbs]$ vi phys_sby1.txt
[oracle@udbs01 dbs]$ rman
RMAN> @phys_sby1.txt
RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate channel prmy2 type disk;
4> allocate channel prmy3 type disk;
5> allocate channel prmy4 type disk;
6> allocate auxiliary channel stby type disk;
7> duplicate target database for standby from active database
8> spfile
9> parameter_value_convert 'u01prmy','u01sby1'
10> set db_unique_name='u01sby1'
11> set db_recovery_file_dest='+FRA'
12> set db_recovery_file_dest_size='5G'
13> set control_files='+DATA'
14> set log_archive_max_processes='5'
15> set fal_client='u01sby1'
16> set fal_server='u01prmy'
17> set log_archive_config='dg_config=(u01prmy,u01sby1)'
18> set log_archive_dest_2='service=u01prmy ASYNC
19> valid_for=(online_logfile,primary_role) db_unique_name=u01prmy';
20> }
using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: SID=53 device type=DISK
allocated channel: prmy2
channel prmy2: SID=56 device type=DISK
allocated channel: prmy3
channel prmy3: SID=36 device type=DISK
allocated channel: prmy4
channel prmy4: SID=23 device type=DISK
released channel: prmy1
released channel: prmy2
released channel: prmy3
released channel: prmy4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of allocate command at 09/26/2022 20:03:48
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
注意:因为第一次将phys_sby1.txt建在了dbs目录下,而打开rma时是在home下打开,所以报错,打不开此脚本文件
上面的问题是因为备用库未启动,因此报错