Linux 12C DG Installation Documentation

Source: Internet
Author: User

1. View host and database information

$ sqlplus/as SYSDBA

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production

With the partitioning, Real application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real application testing options

Sql>

Sql> select * from V$version;

BANNER con_id

-------------------------------------------------------------------------------- ----------

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production 0

PL/SQL Release 12.1.0.2.0-production 0

CORE 12.1.0.2.0 Production 0

TNS for linux:version 12.1.0.2.0-production 0

Nlsrtl Version 12.1.0.2.0-production 0

Sql> Set Linesize 140

Set pagesize 999

Col name for A25

Col value for A60

Select Name,value from v$parameter where name like '%dump% ';

NAME VALUE

------------------------- ------------------------------------------------------------

Shadow_core_dump Partial

Background_core_dump Partial

Background_dump_dest/oracle/app/oracle/product/12.1.0/dbhome_1/rdbms/log

User_dump_dest/oracle/app/oracle/product/12.1.0/dbhome_1/rdbms/log

Core_dump_dest/oracle/app/oracle/diag/rdbms/g_xshis/gxshis1/cdump

Max_dump_file_size Unlimited

6 rows selected.

Sql> col value for A60

Select Name,value from v$parameter where name like '%pfile% ';

NAME VALUE

------------------------- ------------------------------------------------------------

SPFile +data/g_xshis/parameterfile/spfilegxshis.ora

Sql> col name for A50

Select name from V$controlfile;

NAME

--------------------------------------------------

+data/g_xshis/controlfile/current.261.922142579

+flash/g_xshis/controlfile/current.256.922142579

Sql> Col member for A50

Select member from V$logfile;

MEMBER

--------------------------------------------------

+data/g_xshis/onlinelog/group_2.347.927043957

+flash/g_xshis/onlinelog/group_2.4021.927043957

+data/g_xshis/onlinelog/group_1.346.927043955

+flash/g_xshis/onlinelog/group_1.259.927043955

+data/g_xshis/onlinelog/group_3.348.927043957

+flash/g_xshis/onlinelog/group_3.258.927043957

+data/g_xshis/onlinelog/group_4.267.927043957

+flash/g_xshis/onlinelog/group_4.260.927043957

+data/g_xshis/onlinelog/group_5.349.927576115

+data/g_xshis/onlinelog/group_6.350.927576115

+data/g_xshis/onlinelog/group_7.351.927576115

+data/g_xshis/onlinelog/group_8.352.927576123

+data/g_xshis/onlinelog/group_9.353.927576123

+data/g_xshis/onlinelog/group_10.354.927576123

Sql> select name from V$datafile;

+data/g_xshis/datafile/system.258.922142465

+data/g_xshis/tablespaces/tsp_acct.dbf

+data/g_xshis/datafile/sysaux.257.922142419

+data/g_xshis/datafile/undotbs1.260.922142521

+data/g_xshis/datafile/undotbs2.265.922142785

+data/g_xshis/datafile/users.259.922142519

+data/g_xshis/tablespaces/tsp_bldbank.dbf

+data/g_xshis/tablespaces/tsp_clinpath.dbf

+data/g_xshis/tablespaces/tsp_comm.dbf

+data/g_xshis/tablespaces/tsp_cpr.dbf

+data/g_xshis/tablespaces/tsp_healthcare.dbf

+data/g_xshis/tablespaces/tsp_hisuser.dbf

+data/g_xshis/tablespaces/tsp_infect.dbf

+data/g_xshis/tablespaces/tsp_inpadm.dbf

+data/g_xshis/tablespaces/tsp_inpbill.dbf

+data/g_xshis/tablespaces/tsp_inquire.dbf

+data/g_xshis/tablespaces/tsp_insurance.dbf

+data/g_xshis/tablespaces/tsp_interface.dbf

+data/g_xshis/tablespaces/tsp_lab.dbf

+data/g_xshis/tablespaces/tsp_medadm.dbf

+data/g_xshis/tablespaces/tsp_medrec.dbf

+data/g_xshis/tablespaces/tsp_mobile.dbf

+data/g_xshis/tablespaces/tsp_nursing.dbf

+data/g_xshis/tablespaces/tsp_ordadm.dbf

+data/g_xshis/tablespaces/tsp_outpadm.dbf

+data/g_xshis/tablespaces/tsp_outpbill.dbf

+data/g_xshis/tablespaces/tsp_outpdoct.dbf

+data/g_xshis/tablespaces/tsp_pharmacy.dbf

+data/g_xshis/tablespaces/tsp_phyexam.dbf

+data/g_xshis/tablespaces/tsp_report.dbf

+data/g_xshis/tablespaces/tsp_surgery.dbf

+data/g_xshis/tablespaces/tsp_tj.dbf

+data/g_xshis/tablespaces/tsp_tjhisrpt.dbf

+data/g_xshis/tablespaces/tsp_wsyy.dbf

+data/g_xshis/tablespaces/tsp_exam.dbf

+data/g_xshis/tablespaces/tsp_equipment.dbf

+data/g_xshis/tablespaces/tsp_econstat.dbf

+data/g_xshis/tablespaces/tsp_others.dbf

+data/g_xshis/tablespaces/tsp_emr.dbf

+data/g_xshis/tablespaces/tsp_nsm.dbf

+data/g_xshis/datafile/tsp_clinicpath.331.925047179

Selected rows.

Sql> select name from V$tempfile;

NAME

----------------------------------------------------------------------------------------------------

+data/g_xshis/tempfile/temp.264.922142585

+data/g_xshis/tablespaces/tsp_tmp.dbf

Sql> SELECT * from nls_database_parameters where parameter= ' nls_characterset ';

PARAMETER VALUE

------------------   ------------------------------------------

Nls_characterset ZHS16GBK

$ echo $ORACLE _base

/oracle/app/oracle

$ echo $ORACLE _home

/oracle/app/oracle/product/12.1.0/dbhome_1

2. Preparatory work

Before the implementation of the need to prepare things: disaster preparedness to install the database software, in order to avoid unnecessary trouble, the software catalog and data file directory structure and the main library consistent. If the data file structure on both ends is inconsistent, you will need to restart the database.

Modify the Master repository/etc/hosts file.

3. Make sure the main library is in archive mode

sql> archive log list;

Database Log Mode Archive mode

Automatic Archival Enabled

Archive Destination +data

Oldest online log sequence 2314

Next log sequence to archive 2315

Current log Sequence 2315

If you are in non-archive mode, you need to modify it to archive mode.

4. Modify the main library to strong log mode

Sql> select force_logging from V$database;

For

---

NO

The check is not strong log mode, first modified to strong log mode, the command is as follows:

sql> ALTER DATABASE force logging;

5. Prepare libraries to create the same directory structure

Step omitted, refer to the previous output content creation

6. main Backup library Modify parameters

Main Library Modify Parameters

Sql>

Alter system set Standby_file_management=auto scope=both sid= ' * ';

Alter system set Fal_server=g_xshis scope=both sid= ' * ';

Alter system set log_archive_config= ' dg_config= (g_xshis,standby) ' Scope=both sid= ' * ';

Alter system set log_archive_dest_1= ' Location=+data valid_for= (all_logfiles,all_roles) db_unique_name=g_xshis ' sid= ' *‘;

Alter system set log_archive_dest_2= ' Service=standby lgwr async compression=enable valid_for= (online_logfiles,primary _role) Db_unique_name=standby ' Scope=both;

Alter system set log_file_name_convert= ' +data/standby ', ' +data/g_xshis ' scope=spfile sid= ' * ';

Note: The above settings of the default primary and standby both sides of the data files and log files are consistent, if inconsistent, you need to modify the parameters Db_file_name_convert, Log_file_name_convert, convert the directories on both sides, and modifying these two parameters requires restarting the database.

7. Configure Tnsnames.ora

ORCL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.28.42) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.28.43) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = g_xshis)

)

)

STANDBY =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.28.52) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.28.53) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = standby)

)

)

8. Transfer the parameter file and password file to the standby library

9. Main Library using RMAN backup

Rman> run{

Allocate channel CH1 type disk;

Allocate channel CH2 type disk;

Backup database format '/data/backup/dbf_%d_%t_%s_%p ';

SQL ' alter system archive log current ';

Backup Archivelog all format '/data/backup/arc_%d_%t_%s_%p ' delete input;

Backup current controlfile for standby format '/data/backup/control01.ctl ';

}

Transfer the backup file to the standby repository.

start standby to nomount State

sql> startup Nomount;

Modify Db_unique_name

sql> ALTER SYSTEM SET db_unique_name= standby scope=spfile;

Note: The db_name must be consistent on both sides of the main repository and db_unique_name must be inconsistent.

Reboot for the parameters to take effect:

sql> shutdown immediate;

sql> startup Nomount;

One . Recovery control files

rman> restore standby controlfile from '/data/backup/control01.ctl ';

Start the standby to Mount State

Rman> ALTER DATABASE Mount;

Recovery of the standby library

rman> Restore Database;

rman> restore Archivelog all;

rman> Recover database;

Add standby logfiles

Check the current environment logfile

Sql> Set Lines pages 300

Col Member for A60

Select a.thread#,a.group#,b.member,b.type,a.bytes/1024/1024 MB from V$log a,v$logfile b where a.group#=b.group#

UNION ALL

Select a.thread#,a.group#,b.member,b.type,a.bytes/1024/1024 MB from V$standby_log a,v$logfile b where a.group#=b.group #;

thread#group# MEMBER TYPE MB

------------------------------------------------------------ -------

1 3/data/orcl/redo03.log ONLINE 50

1 2/data/orcl/redo02.log ONLINE 50

1 1/data/orcl/redo01.log ONLINE 50

sql> ALTER DATABASE Add standby logfile

Group 4 ' +data ' size 50M,

Group 5 ' +data ' size 50M,

Group 6 ' +data ' size 50M,

Group 7 ' +data ' size 50M;

restore open in Main library

Sql> alter system set log_archive_dest_2= ' Service=standby lgwr async compression=enable valid_for= (Online_logfiles, Primary_role) Db_unique_name=standby ' Scope=both;

Note: Check that the log_archive_dest_state_1 and log_archive_dest_state_2 parameters are set to enable, and if not set to enable, there may be a problem when switching.

Open in the standby library

Prepare Library Modification Parameters

Alter system set log_archive_dest_1= ' Location=+data valid_for= (all_logfiles,all_roles) db_unique_name=standby ' sid= ' *‘;

Sql> ALTER DATABASE open read only;

Recover managed Standby database using current logfile disconnect;

cut the archive on the main library

Sql> alter system archive log current;

Sql> alter system archive log current;

sql> archive log list;

Database Log Mode Archive mode

Automatic Archival Enabled

Archive Destination/data/arch

Oldest online log sequence 32

Next log sequence to archive 34

Current log Sequence 34

Check the standby alert Log

$ tail-n 9/u01/app/oracle/admin/laugh/bdump/alert_laugh.log

Tue Sep 15 19:04:50 2015

RFS[1]: No standby redo LogFiles created

RFS[1]: Archived Log: '/oradata/arch/1_32_885635743.dbf '

RFS[1]: No standby redo LogFiles created

RFS[1]: Archived Log: '/oradata/arch/1_33_885635743.dbf '

Tue Sep 15 19:04:53 2015

Media Recovery log/oradata/arch/1_32_885635743.dbf

Media Recovery log/oradata/arch/1_33_885635743.dbf

Media Recovery waiting for thread 1 sequence 34

The description has been built successfully.

Linux 12C DG Installation Documentation

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.