dbca -silent建立rac資料庫
剛好有一個網友問我,dbca -silent是否能建立rac資料庫,是否能啟用歸檔,下面是測試過程
一.先刪除已經存在的rac資料庫jyrac
ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 5120 4892 0 4892 0 N BACKUPDG/ MOUNTED EXTERN N 512 4096 1048576 5120 4724 0 4724 0 Y CRSDG/ MOUNTED EXTERN N 512 4096 1048576 10240 2 0 2 0 N DATADG/
ASMCMD> ls -lt Type Redund Striped Time Sys Name Y TEMPFILE/ Y PARAMETERFILE/ Y ONLINELOG/ Y DATAFILE/ Y CONTROLFILE/ N spfilejyrac.ora => +DATADG/JYRAC/PARAMETERFILE/spfile.268.864825131
[oracle@jyrac1 ~]$ dbca -silent -deleteDatabase -sourceDB jyrac -sysDBAUserName sys -sysDBAPassword system Connecting to database 9% complete 14% complete 19% complete 23% complete 28% complete 33% complete 38% complete 47% complete Updating network configuration files 48% complete 52% complete Deleting instances and datafiles 66% complete 80% complete 95% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/jyrac.log" for further details.
ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 5120 4892 0 4892 0 N BACKUPDG/ MOUNTED EXTERN N 512 4096 1048576 5120 4724 0 4724 0 Y CRSDG/ MOUNTED EXTERN N 512 4096 1048576 10240 10138 0 10138 0 N DATADG/
[root@jyrac1 jyrac]# ps -ef | grep pmon grid 4185 1 0 Jan26 ? 00:01:59 asm_pmon_+ASM1 root 32023 26194 0 16:57 pts/3 00:00:00 grep pmon [grid@jyrac2 ~]$ ps -ef | grep pmon grid 4144 1 0 Jan26 ? 00:02:03 asm_pmon_+ASM2 grid 30617 22435 0 16:57 pts/1 00:00:00 grep pmon
說明rac資料庫jyrac確實已經刪除了,下面以dbca -silent模式來建立rac資料庫jyrac
二.使用dbca -silent來建立rac資料庫jyrac,並使用-initParams引數設定歸檔目錄,使用-nodeinfo來指定rac節點,但-nodeinfo引數在dbca的幫助資訊中並沒有顯示。
[oracle11@oracle11g ~]$ dbca -help dbca [-silent | -progressOnly | -customCreate] { } | { [ [options] ] -responseFile } [-continueOnNonFatalErrors ] Please refer to the manual for details. You can enter one of the following command: Create a database by specifying the following parameters: -createDatabase -templateName [-cloneTemplate] -gdbName [-sid ] [-sysPassword ] [-systemPassword ] [-emConfiguration -dbsnmpPassword -sysmanPassword [-hostUserName -hostUserPassword -backupSchedule ] [-centralAgent ]] [-disableSecurityConfiguration [-datafileDestination | -datafileNames ] [-redoLogFileSize ] [-recoveryAreaDestination ] [-datafileJarLocation ] [-storageType < FS | ASM > [-asmsnmpPassword ] -diskGroupName -recoveryGroupName [-characterSet ] [-nationalCharacterSet ] [-registerWithDirService -dirServiceUserName -dirServicePassword -walletPassword ] [-listeners ] [-variablesFile ]] [-variables ] [-initParams ] [-sampleSchema ] [-memoryPercentage ] [-automaticMemoryManagement ] [-totalMemory ] [-databaseType ]] Configure a database by specifying the following parameters: -configureDatabase -sourceDB [-sysDBAUserName -sysDBAPassword ] [-registerWithDirService|-unregisterWithDirService|-regenerateDBPassword -dirServiceUserName -dirServicePassword -walletPassword ] [-disableSecurityConfiguration [-enableSecurityConfiguration [-emConfiguration -dbsnmpPassword -sysmanPassword [-hostUserName -hostUserPassword -backupSchedule ] [-centralAgent ]] Create a template from an existing database by specifying the following parameters: -createTemplateFromDB -sourceDB ::> -templateName -sysDBAUserName -sysDBAPassword [-maintainFileLocations ] Create a clone template from an existing database by specifying the following parameters: -createCloneTemplate -sourceSID -templateName [-sysDBAUserName -sysDBAPassword ] [-maintainFileLocations ] [-datafileJarLocation ] Generate scripts to create database by specifying the following parameters: -generateScripts -templateName -gdbName [-scriptDest ] Delete a database by specifying the following parameters: -deleteDatabase -sourceDB [-sysDBAUserName -sysDBAPassword ] Query for help by specifying the following options: -h | -help
下面建立rac資料庫jyrac,使用-initParams引數設定了歸檔目錄為+backupdg/,節點為jyrac1,jyrac2
[oracle@jyrac1 ~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname jyrac -sid jyrac -datafileDestination 'datadg/' -redoLogFileSize 50 -recoveryAreaDestination 'datadg/' -storageType ASM -asmsnmpPassword system -diskGroupName 'datadg' -responseFile NO_VALUE -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema true -automaticMemoryManagement true -totalMemory 500 -initParams log_archive_dest_1='location=+backupdg/' -nodeinfo jyrac1,jyrac2 Enter SYS user password: Enter SYSTEM user password: Copying database files 1% complete 3% complete 9% complete 15% complete 21% complete 27% complete 30% complete Creating and starting Oracle instance 32% complete 36% complete 40% complete 44% complete 45% complete 48% complete 50% complete Creating cluster database views 52% complete 70% complete Completing Database Creation 73% complete 76% complete 85% complete 94% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/jyrac/jyrac.log" for further details.
三.檢查資料庫狀態
[root@jyrac1 ~]# ps -ef | grep pmon grid 4185 1 0 Jan26 ? 00:01:59 asm_pmon_+ASM1 oracle 6545 1 0 17:33 ? 00:00:00 ora_pmon_jyrac1 root 7059 6061 0 17:36 pts/4 00:00:00 grep pmon [grid@jyrac2 ~]$ ps -ef | grep pmon grid 4144 1 0 Jan26 ? 00:02:03 asm_pmon_+ASM2 oracle 6320 1 0 17:34 ? 00:00:00 ora_pmon_jyrac2 grid 6756 22435 0 17:36 pts/1 00:00:00 grep pmon
[grid@jyrac2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.BACKUPDG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.CRSDG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.DATADG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.LISTENER.lsnr ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.asm ONLINE ONLINE jyrac1 Started ONLINE ONLINE jyrac2 Started ora.gsd OFFLINE OFFLINE jyrac1 OFFLINE OFFLINE jyrac2 ora.net1.network ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.ons ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.registry.acfs ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE jyrac2 ora.cvu 1 ONLINE ONLINE jyrac2 ora.jyrac.db 1 ONLINE ONLINE jyrac1 Open 2 ONLINE ONLINE jyrac2 Open ora.jyrac1.vip 1 ONLINE ONLINE jyrac1 ora.jyrac2.vip 1 ONLINE ONLINE jyrac2 ora.oc4j 1 ONLINE ONLINE jyrac2 ora.scan1.vip 1 ONLINE ONLINE jyrac2
[grid@jyrac2 ~]$ srvctl status database -d jyrac Instance jyrac1 is running on node jyrac1 Instance jyrac2 is running on node jyrac2
[grid@jyrac2 ~]$ srvctl config database -d jyrac Database unique name: jyrac Database name: jyrac Oracle home: /u01/app/oracle/product/11.2.0/db Oracle user: oracle Spfile: +DATADG/jyrac/spfilejyrac.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: jyrac Database instances: jyrac1,jyrac2 Disk Groups: DATADG Mount point paths: Services: Type: RAC Database is administrator managed
[grid@jyrac2 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-APR-2015 17:39:01 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:15 Uptime 81 days 6 hr. 50 min. 46 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/jyrac2/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.154)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "jyrac" has 1 instance(s). Instance "jyrac2", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 1 instance(s). Instance "jyrac2", status READY, has 1 handler(s) for this service... The command completed successfully
[grid@jyrac2 ~]$ lsnrctl status listener_scan1 LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-APR-2015 17:39:33 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))) STATUS of the LISTENER ------------------------ Alias LISTENER_SCAN1 Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:10 Uptime 81 days 6 hr. 51 min. 23 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/product/11.2.0/crs/log/diag/tnslsnr/jyrac2/listener_scan1/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.159)(PORT=1521))) Services Summary... Service "jyrac" has 2 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Instance "jyrac2", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 2 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Instance "jyrac2", status READY, has 1 handler(s) for this service... The command completed successfully
[grid@jyrac1 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-APR-2015 17:39:08 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:32 Uptime 81 days 6 hr. 50 min. 36 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/jyrac1/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.153)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service... Service "DBUA4235414" has 1 instance(s). Instance "DBUA4235414", status BLOCKED, has 1 handler(s) for this service... Service "jyrac" has 1 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 1 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... The command completed successfully
[oracle@jyrac1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 17 17:40:53 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- jyrac1 SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination +BACKUPDG Oldest online log sequence 4 Current log sequence 5
[oracle@jyrac2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 17 17:40:35 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- jyrac2 SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination +BACKUPDG Oldest online log sequence 1 Current log sequence 1
資料庫雖然指定了歸檔目錄,但是沒有啟動歸檔。
四.使用dbca -silent方式建立rac資料庫的使用示例,更詳細資訊請閱讀Real Application Clusters Installation Guide
Using DBCA Noninteractive (Silent) Configuration for Oracle RAC
You can perform a noninteractive, or "silent" configuration of Oracle RAC using DBCA. To perform a silent configuration, you must have completed an Oracle Clusterware installation, run the root.sh script from the Oracle Database or Oracle ASM homes, and defined the Oracle home and ASM home directory environment variables.
The following command syntax creates an ASM instance and one disk group:
# su oracle -c "$ORA_ASM_HOME/bin/dbca -silent -configureASM -gdbName NO -sid NO -emConfiguration NONE -diskList ASM_Disks -diskGroupName ASM_Group_Name -datafileJarLocation $ORACLE_HOME/assistants/dbca/templates -nodeinfo $NODE1,$NODE2 -obfuscatedPasswords false -asmSysPassword My_ASM_password -redundancy ASM_redundancy"
In the preceding syntax example:
ASM_Disks represent disk addresses, such as /dev/sda1,/dev/sdb1
ASM_Group_Name represents the name of an ASM disk group
ASM_ Redundancy represents an ASM disk redundancy setting, such as 'NORMAL'.
My_ASM_password represents the ASM SYS user password.
The following command syntax creates an Oracle RAC database on an existing ASM disk group, where the cluster nodes are node1 and node2, and where the disk group name is ASMgrp1, the passwords are my_password, and the ASM SYS password is My_ASM_Password:
# su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName $DBNAME -sid $SID -sysPassword my_password -systemPassword my_password -sysmanPassword my_password -dbsnmpPassword my_password -emConfiguration LOCAL -storageType ASM -diskGroupName ASMgrp1 -datafileJarLocation $ORACLE_HOME/assistants/dbca/templates -nodeinfo node1,node2 -characterset WE8ISO8859P1 -obfuscatedPasswords false -sampleSchema false -asmSysPassword My_ASM_password"
dbca -silent方式可以建立rac資料庫,並指定歸檔目錄,但沒有選項設定歸檔,還是需要執行alter database archivelog來啟動歸檔。網友lhrbest後面透過修改建立資料庫的模板檔案(建立資料庫的模板檔案儲存在$ORACLE_HOME/assistants/dbca/templates目錄中)中的引數
[oracle@jyrac1 templates]$ cat General_Purpose.dbc
...省略...
下面對General_Purpose.dbc檔案建立一份副本並啟用歸檔
[oracle@jyrac1 templates]$ cp General_Purpose.dbc General_Purpose_archivelog.dbc
[oracle@jyrac1 templates]$ vi General_Purpose_archivelog.dbc
...省略...
再次刪除rac資料庫jyrac
[oracle@jyrac2 ~]$ dbca -silent -deleteDatabase -sourceDB jyrac -sysDBAUserName sys -sysDBAPassword system Connecting to database 9% complete 14% complete 19% complete 23% complete 28% complete 33% complete 38% complete 47% complete Updating network configuration files 48% complete 52% complete Deleting instances and datafiles 66% complete 80% complete 95% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/jyrac.log" for further details.
ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 5120 4892 0 4892 0 N BACKUPDG/ MOUNTED EXTERN N 512 4096 1048576 5120 4724 0 4724 0 Y CRSDG/ MOUNTED EXTERN N 512 4096 1048576 10240 10138 0 10138 0 N DATADG/
[root@jyrac1 jyrac]# ps -ef | grep pmon grid 4185 1 0 Jan26 ? 00:01:59 asm_pmon_+ASM1 root 32023 26194 0 16:57 pts/3 00:00:00 grep pmon [grid@jyrac2 ~]$ ps -ef | grep pmon grid 4144 1 0 Jan26 ? 00:02:03 asm_pmon_+ASM2 grid 30617 22435 0 16:57 pts/1 00:00:00 grep pmon
使用新建立的模板檔案來建立資料庫:
[oracle@jyrac1 templates]$ dbca -silent -createDatabase -templateName General_Purpose_archivelog.dbc -gdbname jyrac -sid jyrac -datafileDestination 'datadg/' -redoLogFileSize 50 -recoveryAreaDestination 'datadg/' -storageType ASM -asmsnmpPassword system -diskGroupName 'datadg' -responseFile NO_VALUE -characterset ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema true -automaticMemoryManagement true -totalMemory 500 -initParams log_archive_dest_1='location=+backupdg/' -nodeinfo jyrac1,jyrac2 Enter SYS user password: Enter SYSTEM user password: Copying database files 1% complete 3% complete 9% complete 15% complete 21% complete 27% complete 30% complete Creating and starting Oracle instance 32% complete 36% complete 40% complete 44% complete 45% complete 48% complete 50% complete Creating cluster database views 52% complete 70% complete Completing Database Creation 73% complete 76% complete 85% complete 94% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/jyrac/jyrac0.log" for further details.
檢查資料庫狀態:
[grid@jyrac1 ~]$ ps -ef | grep pmon grid 4185 1 0 Jan26 ? 00:02:02 asm_pmon_+ASM1 oracle 18015 1 0 18:06 ? 00:00:00 ora_pmon_jyrac1 grid 18377 18077 0 18:08 pts/4 00:00:00 grep pmon [grid@jyrac2 ~]$ ps -ef | grep pmon grid 4144 1 0 Jan26 ? 00:02:06 asm_pmon_+ASM2 oracle 8184 1 0 18:07 ? 00:00:00 ora_pmon_jyrac2 grid 8398 7717 0 18:08 pts/2 00:00:00 grep pmon
[grid@jyrac2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.BACKUPDG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.CRSDG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.DATADG.dg ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.LISTENER.lsnr ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.asm ONLINE ONLINE jyrac1 Started ONLINE ONLINE jyrac2 Started ora.gsd OFFLINE OFFLINE jyrac1 OFFLINE OFFLINE jyrac2 ora.net1.network ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.ons ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 ora.registry.acfs ONLINE ONLINE jyrac1 ONLINE ONLINE jyrac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE jyrac2 ora.cvu 1 ONLINE ONLINE jyrac2 ora.jyrac.db 1 ONLINE ONLINE jyrac1 Open 2 ONLINE ONLINE jyrac2 Open ora.jyrac1.vip 1 ONLINE ONLINE jyrac1 ora.jyrac2.vip 1 ONLINE ONLINE jyrac2 ora.oc4j 1 ONLINE ONLINE jyrac2 ora.scan1.vip 1 ONLINE ONLINE jyrac2
[grid@jyrac2 ~]$ srvctl status database -d jyrac Instance jyrac1 is running on node jyrac1 Instance jyrac2 is running on node jyrac2
[grid@jyrac2 ~]$ srvctl config database -d jyrac Database unique name: jyrac Database name: jyrac Oracle home: /u01/app/oracle/product/11.2.0/db Oracle user: oracle Spfile: +DATADG/jyrac/spfilejyrac.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: jyrac Database instances: jyrac1,jyrac2 Disk Groups: DATADG Mount point paths: Services: Type: RAC Database is administrator managed
[grid@jyrac1 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-APR-2015 18:09:58 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:32 Uptime 83 days 7 hr. 21 min. 25 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/jyrac1/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.153)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service... Service "DBUA4235414" has 1 instance(s). Instance "DBUA4235414", status BLOCKED, has 1 handler(s) for this service... Service "jyrac" has 1 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 1 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... The command completed successfully Database is administrator managed
[grid@jyrac2 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-APR-2015 18:09:54 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:15 Uptime 83 days 7 hr. 21 min. 40 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/jyrac2/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.154)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service... Service "jyrac" has 1 instance(s). Instance "jyrac2", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 1 instance(s). Instance "jyrac2", status READY, has 1 handler(s) for this service... The command completed successfully
[grid@jyrac2 ~]$ lsnrctl status listener_scan1 LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-APR-2015 18:10:43 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))) STATUS of the LISTENER ------------------------ Alias LISTENER_SCAN1 Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-JAN-2015 10:48:10 Uptime 83 days 7 hr. 22 min. 33 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/11.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/product/11.2.0/crs/log/diag/tnslsnr/jyrac2/listener_scan1/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.159)(PORT=1521))) Services Summary... Service "jyrac" has 2 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Instance "jyrac2", status READY, has 1 handler(s) for this service... Service "jyracXDB" has 2 instance(s). Instance "jyrac1", status READY, has 1 handler(s) for this service... Instance "jyrac2", status READY, has 1 handler(s) for this service... The command completed successfully
檢查歸檔設定:
[oracle@jyrac1 templates]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 19 18:11:17 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination +BACKUPDG Oldest online log sequence 4 Next log sequence to archive 5 Current log sequence 5 SQL> alter system switch logfile; System altered.
[oracle@jyrac2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 19 18:11:51 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination +BACKUPDG Oldest online log sequence 1 Next log sequence to archive 2 Current log sequence 2 SQL> alter system switch logfile; System altered.
ASMCMD> pwd +backupdg/jyrac/archivelog/2015_04_19 ASMCMD> ls -lt Type Redund Striped Time Sys Name ARCHIVELOG UNPROT COARSE APR 19 18:00:00 Y thread_2_seq_2.306.877457527 ARCHIVELOG UNPROT COARSE APR 19 18:00:00 Y thread_2_seq_1.307.877457191 ARCHIVELOG UNPROT COARSE APR 19 18:00:00 Y thread_1_seq_5.312.877457503
可以看到確實啟用了歸檔,在執行alter system switch logfile命令後兩個例項都生成了歸檔重做日誌,使用模板來建立資料庫,還是需要仔細閱讀模板檔案中的引數,這裡謝謝網友lhrbest,dbca- silent是可以建立rac資料庫,可以透過-initParams引數設定歸檔目錄,透過修改建立資料庫的模板檔案中archivelogmode引數啟用歸檔。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-1583785/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- dbca silent靜默建立資料庫資料庫
- 【DBCA -SILENT】靜默安裝之rac資料庫安裝資料庫
- dbca靜默silent建立資料庫_空間不足出錯資料庫
- 2 Day DBA-使用DBCA建立和管理資料庫—使用DBCA建立資料庫資料庫
- 【RAC】 RAC For W2K8R2 安裝--dbca建立資料庫(七)資料庫
- 2.3 通過DBCA建立資料庫資料庫
- 2.3.1 有關使用DBCA建立資料庫資料庫
- AIX下使用dbca建立oracle資料庫AIOracle資料庫
- 在rhel5上oracle 10.2.0.4 上dbca silent刪除資料庫Oracle資料庫
- 2 Day DBA-使用DBCA建立資料庫資料庫
- Oralce 10g 使用DBCA建立資料庫資料庫
- 【DBCA -SILENT】靜默方式安裝11gR2 oracle資料庫軟體Oracle資料庫
- 2 Day DBA-使用DBCA建立和管理資料庫—啟動DBCA資料庫
- rac 建立兩個資料庫資料庫
- RAC資料庫建立STANDBY(六)資料庫
- RAC資料庫建立STANDBY(五)資料庫
- RAC資料庫建立STANDBY(四)資料庫
- RAC資料庫建立STANDBY(三)資料庫
- RAC資料庫建立STANDBY(二)資料庫
- RAC資料庫建立STANDBY(一)資料庫
- 2.3.2 關於使用互動式DBCA建立資料庫資料庫
- 2 Day DBA-使用DBCA建立和管理資料庫資料庫
- OCP課程25:管理Ⅰ之使用DBCA建立資料庫資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- 【故障處理】DBCA建庫詭異問題處理--rac環境不能建立rac庫
- Oracle 12CR2 dbca -silent -createDatabaseOracleDatabase
- 2.3.3 關於使用非互動式/靜默DBCA建立資料庫資料庫
- Oracle使用DBCA建立資料庫指令碼追蹤學習案例(二)Oracle資料庫指令碼
- Oracle使用DBCA建立資料庫指令碼追蹤學習案例(一)Oracle資料庫指令碼
- dbca無法刪除資料庫資料庫
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- RAC資料庫將資料檔案建立在本地磁碟資料庫
- RAC建立DBlink並使用impdp抽取源庫資料
- 使用RMAN duplicate 建立standby資料庫(RAC或單機)資料庫
- oracle 11g使用DBCA以非互動(靜默)方式建立資料庫Oracle資料庫
- dbca建立oracle 11g rac發現不了asm磁碟OracleASM
- 【DBCA】windows2016標準版 dbca建立資料庫報錯,DIM-00019 OS 1053Windows資料庫
- 在RAC建立資料庫報無法建立“/etc/oratab"解決辦法資料庫