Total System Global Area 2516582400 bytes Fixed Size 8795904 bytes Variable Size 671090944 bytes Database Buffers 1828716544 bytes Redo Buffers 7979008 bytes Database mounted. SQL> alter database archivelog;
Database altered.
SQL>oh /orcl/app/oracle/oradata/orcl/archivelog
SQL> alter system set log_archive_dest_1='location=/orcl/app/oracle/oradata/orcl/archivelog';
SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination /orcl/app/oracle/oradata/orcl/archivelog Oldest online log sequence 1 Next log sequence to archive 3 Current log sequence 3
SQL> show parameter recovery;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /orcl/app/oracle/fast_recovery _area/orcl db_recovery_file_dest_size big integer 12780M recovery_parallelism integer 0 remote_recovery_file_dest string SQL> alter system set db_recovery_file_dest_size=1G;
System altered.
SQL> show parameter recovery;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /orcl/app/oracle/fast_recovery _area/orcl db_recovery_file_dest_size big integer 1G recovery_parallelism integer 0 remote_recovery_file_dest string SQL> select name,open_mode from v$pdbs;
NAME -------------------------------------------------------------------------------- OPEN_MODE ---------- PDB$SEED MOUNTED
ORCLPDB MOUNTED
SQL> alter database open;
Database altered.
SQL> select name,open_mode from v$pdbs;
NAME -------------------------------------------------------------------------------- OPEN_MODE ---------- PDB$SEED READ ONLY
ORCLPDB MOUNTED
SQL> alter pluggable database all open;
Pluggable database altered.
SQL> select name ,open_mode from v$pdbs;
NAME -------------------------------------------------------------------------------- OPEN_MODE ---------- PDB$SEED READ ONLY
MEMBER -------------------------------------------------------------------------------- /orcl/app/oracle/oradata/orcl/redo03.log /orcl/app/oracle/oradata/orcl/redo02.log /orcl/app/oracle/oradata/orcl/redo01.log
SQL> alter database add standby logfile '/orcl/app/oracle/oradata/orcl/stdredo01.log' size 50M;
Database altered.
SQL> alter database add standby logfile '/orcl/app/oracle/oradata/orcl/stdredo02.log' size 50M;
Database altered.
SQL> alter database add standby logfile '/orcl/app/oracle/oradata/orcl/stdredo03.log' size 50M;
Database altered.
SQL> alter database add standby logfile '/orcl/app/oracle/oradata/orcl/stdredo04.log' size 50M;
Database altered.
SQL> select member from v$logfile;
MEMBER -------------------------------------------------------------------------------- /orcl/app/oracle/oradata/orcl/redo03.log /orcl/app/oracle/oradata/orcl/redo02.log /orcl/app/oracle/oradata/orcl/redo01.log /orcl/app/oracle/oradata/orcl/stdredo01.log /orcl/app/oracle/oradata/orcl/stdredo02.log /orcl/app/oracle/oradata/orcl/stdredo03.log /orcl/app/oracle/oradata/orcl/stdredo04.log
7 rows selected.
05,备份主库
创建备份目录
SQL> ho mkdir /home/oracle/dgback/
备份
RMAN> configure channel device type disk format '/home/oracle/dgback/%d_%I_%s_%p.bkp';
RMAN> backup as compressed backupset database include current controlfile for standby plus archivelog;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string NODE12C01
这些配置的话需要一 一对应 配置操作命令有下:
alter system set service_names='NODE12C02'; ---更改服务名 alter system set db_unique_name='NODE12C02' scope=spfile; create spfile from pfile='/orcl/app/oracle/product/12.1.0/db_1/dbs/initorcl.ora'; --创建spfile startup nomount pfile='/orcl/app/oracle/product/12.1.0/db_1/dbs/initorcl.ora'; --指定启动 要相互能连接上
[oracle@node12c02 admin]$ sqlplus sys/123456@NODE12C01 as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Apr 2 22:42:25 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@node12c01 admin]$ sqlplus sys/123456@NODE12C02 as sysdba