Linux under oracle11g DG Build (II): Building operations around the main library
Environment
Name |
Main Library |
Standby Library |
Host Name |
Bjsrv |
Shsrv |
Software version |
RedHat Enterprise5.5, Oracle 11g 11.2.0.1 |
RedHat Enterprise5.5, Oracle 11g 11.2.0.1 |
Second, around the main library operations: 1, the main library-Modify the initialization parameters
Sql> show parameter spfile;
NAME TYPE VALUE
------------------------------------ -----------------------------------------
SPFile string/u01/app/oracle/product/11.2.0
/dbhome_1/dbs/spfiletestdb12.ora
Sql>Create Pfile from SPFile;
$CD $ORACLE _home/dbs/
$VI inittestdb12.ora // edit Pfile
Find the online documentation to find the DG pfile file format:
To add a modification description:
Settings in the original parameter file:
*.audit_file_dest= '/u01/app/oracle/admin/testdb12/adump '
*.audit_trail= ' DB '
*.compatible= ' 11.2.0.0.0 '
*.control_files= '/u01/app/oracle/oradata/testdb12/control01.ctl ', '/u01/app/oracle/fast_recovery_area/testdb12/ Control02.ctl '
*.db_block_size=8192
*.db_domain= ' cuug.net ' //delete
*.db_name= ' TestDB12 '
*.db_recovery_file_dest= '/u01/app/oracle/fast_recovery_area '
*.db_recovery_file_dest_size=4322230272
*.diagnostic_dest= '/u01/app/oracle '
*.dispatchers= ' (protocol=tcp) (SERVICE=TESTDB12XDB) '
*.log_archive_dest_1= ' LOCATION=/DSK4/ARCH_BJ ' //delete
*.log_archive_format= ' Arch_%t_%s_%r.log '
*.memory_target=642006528
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile= ' EXCLUSIVE ' //Add
*.undo_tablespace= ' UNDOTBS1 ' //Add
Parameter settings added through the document:
Db_name=chicago //delete
db_unique_name=bjdb //aliases
log_archive_config= ' dg_config= (bjdb,shdb) '
Alias of the database host participating in the DG
control_files= '/arch1/chicago/control1.ctl ', '/arch2/chicago/control2.ctl '//delete
log_archive_dest_1=
' Location=/dsk4/arch_bj
Valid_for= (All_logfiles,all_roles)
Db_unique_name=bjdb'//fill in the main library alias
Log_archive_dest_2=
' Service=shdb Async//via the network to remote standby, maximum performance, asynchronous transmission
Valid_for= (Online_logfiles,primary_role)
Only valid for the main library, only the main library will pass the log to the repository
Db_unique_name=shdb
‘
Log_archive_dest_state_1=enable//Set archive location is available
Log_archive_dest_state_2=enable
remote_login_passwordfile=exclusive //delete
Log_archive_format=%t_%s_%r.arc //delete
log_archive_max_processes=3 //Add, no line in the document?
fal_server=shdb //write each other service name
Db_file_name_convert= '/u01/app/oracle/oradata/sh', '/u01/app/oracle/oradata/testdb12'
File conversion, let the repository know that the data of the main library has changed, write each other first, then write their own
log_file_name_convert=
'/dsk1/oradata/sh ', '/dsk1/oradata/bj ', '/dsk2/oradata/sh ', '/DSK2/ORADATA/BJ '
If the redo log file changes, but also to notify the repository, write each other first, and then write their own, if there are multiple paths to the main library to correspond
standby_file_management= Auto//indicates automatic conversion
Modify the parameters (example):
*.audit_file_dest= '/u01/app/oracle/admin/testdb12/adump '
*.audit_trail= ' DB '
*.compatible= ' 11.2.0.0.0 '
*.control_files= '/u01/app/oracle/oradata/testdb12/control01.ctl ', '/u01/app/oracle/fast_recovery_area/testdb12/ Control02.ctl '
*.db_block_size=8192
*.db_name= ' TestDB12 '
*.db_recovery_file_dest= '/u01/app/oracle/fast_recovery_area '
*.db_recovery_file_dest_size=4322230272
*.diagnostic_dest= '/u01/app/oracle '
*.dispatchers= ' (protocol=tcp) (SERVICE=TESTDB12XDB) '
*.log_archive_format= ' Arch_%t_%s_%r.log '
*.memory_target=642006528
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile= ' EXCLUSIVE '
*.undo_tablespace= ' UNDOTBS1 '
Db_unique_name=bjdb
Log_archive_config= ' dg_config= (bjdb,shdb) '
log_archive_dest_1=
' LOCATION=/DSK4/ARCH_BJ
Valid_for= (All_logfiles,all_roles)
Db_unique_name=bjdb '
Log_archive_dest_2=
' Service=shdb ASYNC
Valid_for= (Online_logfiles,primary_role)
Db_unique_name=shdb '
Log_archive_dest_state_1=enable
Log_archive_dest_state_2=enable
Log_archive_max_processes=3
Fal_server=shdb
Db_file_name_convert= '/u01/app/oracle/oradata/sh ', '/u01/app/oracle/oradata/testdb12 '
log_file_name_convert=
'/dsk1/oradata/sh ', '/dsk1/oradata/bj ', '/dsk2/oradata/sh ', '/DSK2/ORADATA/BJ '
Standby_file_management=auto
Starting a database with Pfile
sql>startupforce nomountpfile= '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/inittestdb12.ora ';
Add:
Sql>startup Force nomountpfile= ' $ORACLE _home/dbs/inittestdb12.ora ';
Error ORA-01078:
View found that the parameter name writing error resulted in the change from Inittestdb12.ora to inittestdb12.ora.
sql>showparameter archive
SQL >Create SPFile frompfile; Generated by SPFile Pfile
SQL >startup forcemount; //Boot to mount
2. Prepare library-Create file directory
Create a directory (for storing data files, log files) in the standby library (SH):
$ mkdir-p/u01/app/oracle/oradata/sh
$ mkdir-p/u01/app/oracle/admin/sh/adump //Storage directory for Audit
3. Main Library-copy data file Preparation Library
Note: Make sure the main library is in the Mount state at this point.
Way:
1, manual copy;
2, Rman backup;
3, Rman cloning.
$scp/u01/app/oracle/oradata/testdb12/*.dbfshsrv:/u01/app/oracle/oradata/sh
The authenticity of host ' shsrv (192.168.4.72) ' can ' t be established.
RSA key fingerprint is 0f:d8:72:64:60:b4:0e:b6:72:69:68:7d:aa:7e:b8:bb.
Is you sure want to continue connecting (yes/no)? Yes
warning:permanently added ' shsrv,192.168.4.72 ' (RSA) to the list of knownhosts.
[email protected] ' s password:Oracle
4. Main library-Generate control file and copy for standby library
Sql>selectstatus from V$instance;
The main library is in the Mount state, at which point you can control the file for the standby
sql>alterdatabase create standby controlfile as '/home/oracle/sh_control01.ctlcle/sh_control01.ctl ';
Place the production control file in the specified directory
$scp/home/oracle/sh_control01.ctl shsrv:/u01/app/oracle/oradata/sh
Copy the generated repository control files to the standby (SH) via the main library
5. Main library-Copy the parameter file to the standby library
$CD $ORACLE _home/dbs
$scpinittestdb12.ora shsrv: $ORACLE _home/dbs/initshdb.ora
6. Master Library-Copy the password file to the standby repository
$scp$oracle_home/dbs/orapwtestdb12 shsrv: $ORACLE _home/dbs/orapwshdb
7. Main Library-Browse alarm log files
$Tail-f/u01/app/oracle/diag/rdbms/bjdb/testdb12/trace/alert_testdb12.log
crtl+z exit//determined by CRT settings
To be continued **************************
Statement:
Original works, from the "Blue Blog" blog, allow the reprint, please be sure to indicate the source (Http://blog.csdn.net/huangyanlong) when reproduced.
The author is entitled to be held liable for copyright related matters.