Oracle cloud 의 LVM 환경에서 Provisioning 가능한 preview 버전인 Oracle 20c를 설치하고 Parameter 등 기본 정보에 대해 확인해 보았다.




SQL> select * from v$version;


BANNER

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

BANNER_FULL

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

BANNER_LEGACY

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

    CON_ID

----------

Oracle Database 20c EE High Perf Release 20.0.0.0.0 - Production

Oracle Database 20c EE High Perf Release 20.0.0.0.0 - Production

Version 20.2.0.0.0

Oracle Database 20c EE High Perf Release 20.0.0.0.0 - Production


[DBCS2]oracle@dbcs2:/home/oracle# ss


SQL*Plus: Release 20.0.0.0.0 - Production on Mon Apr 6 13:29:53 2020

Version 20.2.0.0.0


Copyright (c) 1982, 2019, Oracle.  All rights reserved.



Connected to:

Oracle Database 20c EE High Perf Release 20.0.0.0.0 - Production

Version 20.2.0.0.0


NAME                                 TYPE        VALUE

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

DBFIPS_140                           boolean     FALSE

_gc_policy_time                      integer     20

_gc_undo_affinity                    boolean     TRUE

active_instance_count                integer

adg_account_info_tracking            string      LOCAL

adg_redirect_dml                     boolean     FALSE

allow_deprecated_rpcs                string      YES

allow_global_dblinks                 boolean     FALSE

allow_group_access_to_sga            boolean     FALSE

allow_rowid_column_type              boolean     FALSE

approx_for_aggregation               boolean     FALSE

approx_for_count_distinct            boolean     FALSE

approx_for_percentile                string      NONE

aq_tm_processes                      integer     1

archive_lag_target                   integer     0

asm_diskstring                       string

asm_preferred_read_failure_groups    string

audit_file_dest                      string      /u01/app/oracle/admin/DBCS2_ic

                                                 n1v6/adump

audit_sys_operations                 boolean     TRUE

audit_syslog_level                   string

audit_trail                          string      DB

autotask_max_active_pdbs             integer     2

awr_pdb_autoflush_enabled            boolean     FALSE

awr_pdb_max_parallel_slaves          integer     10

awr_snapshot_time_offset             integer     0

background_core_dump                 string      partial

background_dump_dest                 string      /u01/app/oracle/homes/OraDB20H

                                                 ome1/rdbms/log

backup_tape_io_slaves                boolean     FALSE

bitmap_merge_area_size               integer     1048576

blank_trimming                       boolean     FALSE

buffer_pool_keep                     string

buffer_pool_recycle                  string

cdb_cluster                          boolean     FALSE

cdb_cluster_name                     string

cell_offload_compaction              string      ADAPTIVE

cell_offload_decryption              boolean     TRUE

cell_offload_parameters              string

cell_offload_plan_display            string      AUTO

cell_offload_processing              boolean     TRUE

cell_offloadgroup_name               string

circuits                             integer

client_result_cache_lag              big integer 3000

client_result_cache_size             big integer 0

client_statistics_level              string      TYPICAL

clonedb                              boolean     TRUE

clonedb_dir                          string

cluster_database                     boolean     FALSE

cluster_interconnects                string

commit_logging                       string

commit_point_strength                integer     1

commit_wait                          string

commit_write                         string

common_user_prefix                   string      C##

compatible                           string      20.0.0

connection_brokers                   string      ((TYPE=DEDICATED)(BROKERS=1)),

                                                  ((TYPE=EMON)(BROKERS=1))

containers_parallel_degree           integer     65535

control_file_record_keep_time        integer     38

control_files                        string      /u02/app/oracle/oradata/DBCS2_

                                                 icn1v6/control01.ctl, /u03/app

                                                 /oracle/fast_recovery_area/DBC

                                                 S2_ICN1V6/control02.ctl

control_management_pack_access       string      DIAGNOSTIC+TUNING

core_dump_dest                       string      /u01/app/oracle/diag/rdbms/dbc

                                                 s2_icn1v6/DBCS2/cdump

cpu_count                            integer     2

cpu_min_count                        string      2

create_bitmap_area_size              integer     8388608

create_stored_outlines               string

cursor_bind_capture_destination      string      memory+disk

cursor_invalidation                  string      IMMEDIATE

cursor_sharing                       string      EXACT

cursor_space_for_time                boolean     FALSE

data_guard_max_io_time               integer     240

data_guard_max_longio_time           integer     240

data_guard_sync_latency              integer     0

data_transfer_cache_size             big integer 0

db_16k_cache_size                    big integer 0

db_2k_cache_size                     big integer 0

db_32k_cache_size                    big integer 0

db_4k_cache_size                     big integer 0

db_8k_cache_size                     big integer 0

db_big_table_cache_percent_target    string      0

db_block_buffers                     integer     0

db_block_checking                    string      MEDIUM

db_block_checksum                    string      TYPICAL

db_block_size                        integer     8192

db_cache_advice                      string      ON

db_cache_size                        big integer 0

db_create_file_dest                  string      /u02/app/oracle/oradata/DBCS2_

                                                 icn1v6/

db_create_online_log_dest_1          string      /u03/app/oracle/redo/

db_create_online_log_dest_2          string

db_create_online_log_dest_3          string

db_create_online_log_dest_4          string

db_create_online_log_dest_5          string

db_domain                            string      sub03110258000.publicvcn.oracl

                                                 evcn.com

db_file_multiblock_read_count        integer     128

db_file_name_convert                 string

db_files                             integer     200

db_flash_cache_file                  string

db_flash_cache_size                  big integer 0

db_flashback_retention_target        integer     1440

db_index_compression_inheritance     string      NONE

db_keep_cache_size                   big integer 0

db_lost_write_protect                string      NONE

db_name                              string      DBCS2

db_performance_profile               string

db_recovery_file_dest                string      /u03/app/oracle/fast_recovery_

                                                 area

db_recovery_file_dest_size           big integer 238G

db_recycle_cache_size                big integer 0

db_securefile                        string      PREFERRED

db_ultra_safe                        string      OFF

db_unique_name                       string      DBCS2_icn1v6

db_unrecoverable_scn_tracking        boolean     TRUE

db_writer_processes                  integer     1

dbnest_enable                        string      NONE

dbnest_pdb_fs_conf                   string

dbwr_io_slaves                       integer     0

ddl_lock_timeout                     integer     0

default_sharing                      string      metadata

deferred_segment_creation            boolean     TRUE

dg_broker_config_file1               string      /u01/app/oracle/homes/OraDB20H

                                                 ome1/dbs/dr1DBCS2_icn1v6.dat

dg_broker_config_file2               string      /u01/app/oracle/homes/OraDB20H

                                                 ome1/dbs/dr2DBCS2_icn1v6.dat

dg_broker_start                      boolean     FALSE

diagnostic_dest                      string      /u01/app/oracle

diagnostics_control                  string      IGNORE

disable_pdb_feature                  big integer 0

disk_asynch_io                       boolean     TRUE

dispatchers                          string      (PROTOCOL=TCP) (SERVICE=DBCS2X

                                                 DB)

distributed_lock_timeout             integer     60

dml_locks                            integer     1416

dnfs_batch_size                      integer     4096

drcp_dedicated_opt                   string      YES

dst_upgrade_insert_conv              boolean     TRUE

enable_automatic_maintenance_pdb     boolean     TRUE

enable_ddl_logging                   boolean     TRUE

enable_dnfs_dispatcher               boolean     FALSE

enable_goldengate_replication        boolean     FALSE

enable_imc_with_mira                 boolean     FALSE

enable_pluggable_database            boolean     TRUE

enabled_PDBs_on_standby              string      *

encrypt_new_tablespaces              string      ALWAYS

event                                string

external_keystore_credential_locatio string

n

fal_client                           string

fal_server                           string

fast_start_io_target                 integer     0

fast_start_mttr_target               integer     0

fast_start_parallel_rollback         string      LOW

file_mapping                         boolean     FALSE

fileio_network_adapters              string

filesystemio_options                 string      none

fixed_date                           string

forward_listener                     string

gcs_server_processes                 integer     0

global_names                         boolean     FALSE

global_txn_processes                 integer     1

hash_area_size                       integer     131072

heat_map                             string      OFF

hi_shared_memory_address             integer     0

hs_autoregister                      boolean     TRUE

http_proxy                           string

ifile                                file

ignore_session_set_param_errors      string

inmemory_adg_enabled                 boolean     TRUE

inmemory_automatic_level             string      OFF

inmemory_clause_default              string

inmemory_deep_vectorization          boolean     TRUE

inmemory_expressions_usage           string      ENABLE

inmemory_force                       string      DEFAULT

inmemory_max_populate_servers        integer     0

inmemory_optimized_arithmetic        string      DISABLE

inmemory_prefer_xmem_memcompress     string

inmemory_prefer_xmem_priority        string

inmemory_query                       string      ENABLE

inmemory_size                        big integer 0

inmemory_trickle_repopulate_servers_ integer     1

percent

inmemory_virtual_columns             string      MANUAL

inmemory_xmem_size                   big integer 0

instance_abort_delay_time            integer     0

instance_groups                      string

instance_mode                        string      READ-WRITE

instance_name                        string      DBCS2

instance_number                      integer     0

instance_type                        string      RDBMS

instant_restore                      boolean     TRUE

java_jit_enabled                     boolean     TRUE

java_max_sessionspace_size           integer     0

java_pool_size                       big integer 0

java_restrict                        string      none

java_soft_sessionspace_limit         integer     0

job_queue_processes                  integer     40

kafka_config_file                    string

large_pool_size                      big integer 0

ldap_directory_access                string      NONE

ldap_directory_sysauth               string      no

license_max_sessions                 integer     0

license_max_users                    integer     0

license_sessions_warning             integer     0

listener_networks                    string

lob_signature_enable                 boolean     FALSE

local_listener                       string      LISTENER_DBCS2

lock_name_space                      string

lock_sga                             boolean     FALSE

log_archive_config                   string

log_archive_dest                     string

log_archive_dest_1                   string

log_archive_dest_10                  string

log_archive_dest_11                  string

log_archive_dest_12                  string

log_archive_dest_13                  string

log_archive_dest_14                  string

log_archive_dest_15                  string

log_archive_dest_16                  string

log_archive_dest_17                  string

log_archive_dest_18                  string

log_archive_dest_19                  string

log_archive_dest_2                   string

log_archive_dest_20                  string

log_archive_dest_21                  string

log_archive_dest_22                  string

log_archive_dest_23                  string

log_archive_dest_24                  string

log_archive_dest_25                  string

log_archive_dest_26                  string

log_archive_dest_27                  string

log_archive_dest_28                  string

log_archive_dest_29                  string

log_archive_dest_3                   string

log_archive_dest_30                  string

log_archive_dest_31                  string

log_archive_dest_4                   string

log_archive_dest_5                   string

log_archive_dest_6                   string

log_archive_dest_7                   string

log_archive_dest_8                   string

log_archive_dest_9                   string

log_archive_dest_state_1             string      enable

log_archive_dest_state_10            string      enable

log_archive_dest_state_11            string      enable

log_archive_dest_state_12            string      enable

log_archive_dest_state_13            string      enable

log_archive_dest_state_14            string      enable

log_archive_dest_state_15            string      enable

log_archive_dest_state_16            string      enable

log_archive_dest_state_17            string      enable

log_archive_dest_state_18            string      enable

log_archive_dest_state_19            string      enable

log_archive_dest_state_2             string      enable

log_archive_dest_state_20            string      enable

log_archive_dest_state_21            string      enable

log_archive_dest_state_22            string      enable

log_archive_dest_state_23            string      enable

log_archive_dest_state_24            string      enable

log_archive_dest_state_25            string      enable

log_archive_dest_state_26            string      enable

log_archive_dest_state_27            string      enable

log_archive_dest_state_28            string      enable

log_archive_dest_state_29            string      enable

log_archive_dest_state_3             string      enable

log_archive_dest_state_30            string      enable

log_archive_dest_state_31            string      enable

log_archive_dest_state_4             string      enable

log_archive_dest_state_5             string      enable

log_archive_dest_state_6             string      enable

log_archive_dest_state_7             string      enable

log_archive_dest_state_8             string      enable

log_archive_dest_state_9             string      enable

log_archive_duplex_dest              string

log_archive_format                   string      %t_%s_%r.dbf

log_archive_max_processes            integer     4

log_archive_min_succeed_dest         integer     1

log_archive_start                    boolean     FALSE

log_archive_trace                    integer     0

log_buffer                           big integer 16M

log_checkpoint_interval              integer     0

log_checkpoint_timeout               integer     1800

log_checkpoints_to_alert             boolean     FALSE

log_file_name_convert                string

long_module_action                   boolean     TRUE

max_auth_servers                     integer     25

max_datapump_jobs_per_pdb            string      100

max_datapump_parallel_per_job        string      50

max_dispatchers                      integer

max_dump_file_size                   string      unlimited

max_idle_blocker_time                integer     0

max_idle_time                        integer     0

max_iops                             integer     0

max_mbps                             integer     0

max_pdbs                             integer     4098

max_shared_servers                   integer

max_string_size                      string      STANDARD

memoptimize_pool_size                big integer 0

memory_max_target                    big integer 0

memory_target                        big integer 0

min_auth_servers                     integer     1

multishard_query_data_consistency    string      strong

multishard_query_partial_results     string      not allowed

nls_calendar                         string

nls_comp                             string      BINARY

nls_currency                         string

nls_date_format                      string

nls_date_language                    string

nls_dual_currency                    string

nls_iso_currency                     string

nls_language                         string      AMERICAN

nls_length_semantics                 string      BYTE

nls_nchar_conv_excp                  string      FALSE

nls_numeric_characters               string

nls_sort                             string

nls_territory                        string      AMERICA

nls_time_format                      string

nls_time_tz_format                   string

nls_timestamp_format                 string

nls_timestamp_tz_format              string

noncdb_compatible                    boolean     FALSE

object_cache_max_size_percent        integer     10

object_cache_optimal_size            integer     10240000

ofs_threads                          integer     4

olap_page_pool_size                  big integer 0

one_step_plugin_for_pdb_with_tde     boolean     FALSE

open_cursors                         integer     300

open_links                           integer     4

open_links_per_instance              integer     4

optimizer_adaptive_plans             boolean     TRUE

optimizer_adaptive_reporting_only    boolean     FALSE

optimizer_adaptive_statistics        boolean     FALSE

optimizer_capture_sql_plan_baselines boolean     FALSE

optimizer_capture_sql_quarantine     boolean     FALSE

optimizer_cross_shard_resiliency     boolean     FALSE

optimizer_dynamic_sampling           integer     2

optimizer_features_enable            string      20.1.0

optimizer_ignore_hints               boolean     FALSE

optimizer_ignore_parallel_hints      boolean     FALSE

optimizer_index_caching              integer     0

optimizer_index_cost_adj             integer     100

optimizer_inmemory_aware             boolean     TRUE

optimizer_mode                       string      ALL_ROWS

optimizer_real_time_statistics       boolean     FALSE

optimizer_secure_view_merging        boolean     TRUE

optimizer_session_type               string      NORMAL

optimizer_use_invisible_indexes      boolean     FALSE

optimizer_use_pending_statistics     boolean     FALSE

optimizer_use_sql_plan_baselines     boolean     TRUE

optimizer_use_sql_quarantine         boolean     TRUE

os_authent_prefix                    string      ops$

os_roles                             boolean     FALSE

outbound_dblink_protocols            string      ALL

parallel_adaptive_multi_user         boolean     FALSE

parallel_degree_limit                string      CPU

parallel_degree_policy               string      MANUAL

parallel_execution_message_size      integer     16384

parallel_force_local                 boolean     FALSE

parallel_instance_group              string

parallel_max_servers                 integer     40

parallel_min_degree                  string      1

parallel_min_percent                 integer     0

parallel_min_servers                 integer     4

parallel_min_time_threshold          string      AUTO

parallel_servers_target              integer     40

parallel_threads_per_cpu             integer     1

pdb_file_name_convert                string

pdb_lockdown                         string

pdb_os_credential                    string

pdb_template                         string

permit_92_wrap_format                boolean     TRUE

pga_aggregate_limit                  big integer 3G

pga_aggregate_target                 big integer 1536M

pkcs11_library_location              string

plscope_settings                     string      IDENTIFIERS:NONE

plsql_ccflags                        string

plsql_code_type                      string      INTERPRETED

plsql_debug                          boolean     FALSE

plsql_optimize_level                 integer     2

plsql_v2_compatibility               boolean     FALSE

plsql_warnings                       string      DISABLE:ALL

pmem_filestore                       string

pre_page_sga                         boolean     TRUE

private_temp_table_prefix            string      ORA$PTT_

processes                            integer     200

processor_group_name                 string

query_rewrite_enabled                string      TRUE

query_rewrite_integrity              string      enforced

rdbms_server_dn                      string

read_only_open_delayed               boolean     FALSE

recovery_parallelism                 integer     0

recyclebin                           string      on

redo_transport_user                  string

remote_dependencies_mode             string      TIMESTAMP

remote_listener                      string

remote_login_passwordfile            string      EXCLUSIVE

remote_os_authent                    boolean     FALSE

remote_os_roles                      boolean     FALSE

remote_recovery_file_dest            string

replication_dependency_tracking      boolean     TRUE

resource_limit                       boolean     TRUE

resource_manage_goldengate           boolean     FALSE

resource_manager_cpu_allocation      integer     2

resource_manager_plan                string

result_cache_max_result              integer     5

result_cache_max_size                big integer 31488K

result_cache_mode                    string      MANUAL

result_cache_remote_expiration       integer     0

resumable_timeout                    integer     0

rollback_segments                    string

scheduler_follow_pdbtz               boolean     FALSE

sec_case_sensitive_logon             boolean     TRUE

sec_max_failed_login_attempts        integer     3

sec_protocol_error_further_action    string      (DROP,3)

sec_protocol_error_trace_action      string      TRACE

sec_return_server_release_banner     boolean     FALSE

serial_reuse                         string      disable

service_names                        string      DBCS2_icn1v6.sub03110258000.pu

                                                 blicvcn.oraclevcn.com

session_cached_cursors               integer     50

session_max_open_files               integer     10

sessions                             integer     322

sga_max_size                         big integer 6G

sga_min_size                         big integer 0

sga_target                           big integer 6G

shadow_core_dump                     string      partial

shard_queries_restricted_by_key      boolean     FALSE

shared_memory_address                integer     0

shared_pool_reserved_size            big integer 53687091

shared_pool_size                     big integer 0

shared_server_sessions               integer

shared_servers                       integer     1

shrd_dupl_table_refresh_rate         integer     60

skip_unusable_indexes                boolean     TRUE

smtp_out_server                      string

sort_area_retained_size              integer     0

sort_area_size                       integer     65536

spatial_vector_acceleration          boolean     TRUE

spfile                               string      /u01/app/oracle/dbs/spfileDBCS

                                                 2.ora

sql92_security                       boolean     TRUE

sql_trace                            boolean     FALSE

sqltune_category                     string      DEFAULT

ssl_wallet                           string

standby_db_preserve_states           string      NONE

standby_file_management              string      MANUAL

standby_pdb_source_file_dblink       string

standby_pdb_source_file_directory    string

star_transformation_enabled          string      FALSE

statistics_level                     string      TYPICAL

streams_pool_size                    big integer 0

tablespace_encryption_default_algori string      AES128

thm

tape_asynch_io                       boolean     TRUE

target_pdbs                          integer     12

tde_configuration                    string      keystore_configuration=file

temp_undo_enabled                    boolean     FALSE

thread                               integer     0

threaded_execution                   boolean     FALSE

timed_os_statistics                  integer     0

timed_statistics                     boolean     TRUE

trace_enabled                        boolean     TRUE

tracefile_identifier                 string

transactions                         integer     354

transactions_per_rollback_segment    integer     5

undo_management                      string      AUTO

undo_retention                       integer     900

undo_tablespace                      string      UNDOTBS1

unified_audit_common_systemlog       string

unified_audit_systemlog              string

uniform_log_timestamp_format         boolean     TRUE

use_dedicated_broker                 boolean     FALSE

use_large_pages                      string      ONLY

user_dump_dest                       string      /u01/app/oracle/homes/OraDB20H

                                                 ome1/rdbms/log

wallet_root                          string

workarea_size_policy                 string      AUTO

xml_db_events                        string      enable



Posted by pat98

2016. 9. 7. 11:21 오라클

oracle option enable


Oracle option enable/disable 방법


라이센스에 관련된 부분이니 민감한 부분임...


원래 DB 내리고 하라고 하는데 Single 이라 그런지 기동상태에서 해도 잘 되네??


But!!! alert log 살펴보면 해당 메세지 지속적으로 발생함.


Wed Sep 07 10:58:44 2016

WARNING: Oracle executable binary mismatch detected.

 Binary of new process does not match binary which started instance

issue alter system set "_disable_image_check" = true to disable these messages


현재 인스상태 상태와 일치하지 않으므로 메세지 발생하게 됨.

내렸다 올리면 없어짐..


[oracle:/home/oracle]#chopt disable partitioning


Writing to /oracle/product/11.2.0.4/install/disable_partitioning.log...

/usr/bin/make -f /oracle/product/11.2.0.4/rdbms/lib/ins_rdbms.mk part_off ORACLE_HOME=/oracle/product/11.2.0.4

/usr/bin/make -f /oracle/product/11.2.0.4/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/oracle/product/11.2.0.4


sys@TEST> set line 120;

sys@TEST> col parameter for A50

sys@TEST> col value for A20

sys@TEST> select parameter,value from v$option where parameter='Partitioning';


PARAMETER                                          VALUE

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

Partitioning                                          FALSE


- 11.2


chopt enable dm  (Oracle Data Mining)

chopt disable dm


chopt enable dv (Database Vault)

chopt disable dv


chopt enable olap (Oracle OLAP)

chopt disable olap


chopt enable lbac (Oracle Label Security)

chopt disable lbac


chopt enable partitioning (Oracle Partitioning)

chopt disable partitioning


chopt enable rat (Real Application Testing)

chopt disable rat


- 12.1


chopt enable dm  (Oracle Data Mining)

chopt disable dm


chopt enable olap (Oracle OLAP)

chopt disable olap


chopt enable partitioning (Oracle Partitioning)

chopt disable partitioning


chopt enable rat (Real Application Testing)

chopt disable rat


- 해당 옵션 적용 여부 확인


set line 120;

col parameter for A50

col value for A20

select parameter,value from v$option where parameter='Partitioning';

select parameter,value from v$option where parameter='Active Data Guard';


- 해당 옵션 사용유무 확인


col name for A60

col version for A15

select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%PARTITION%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%OLAP%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%TEXT%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%XDB%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%VAULT%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%REAL%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%LABEL%';


select name, version, last_usage_date,currently_used from DBA_FEATURE_USAGE_STATISTICS where upper(name) like '%ACTIVE%';



Posted by pat98

2015. 11. 23. 11:09 오라클

oracle export object type


- original export 임, exportdump 아님.

- oracle export mode 에 따른 Object Type

 

 

- Import 되는 순서

 

1. Tablespaces
2. Profiles
3. Users
4. Roles
5. System Privilege Grants
6. Role Grants
7. Default Roles
8. Tablespace Quotas
9. Resource Costs
10. Rollback Segments
11. Database Links
12. Sequences
13. Snapshots
14. Snapshot Logs
15. Job Queues
16. Refresh Groups
17. Cluster Definitions
18. Tables (also grants,comments, indexes, constraints, auditing)
19. Referential Integrity
20. POSTTABLES actions
21. Synonyms
22. Views
23. Stored Procedures
24. Triggers, Defaults and Auditing

Posted by pat98

set linesize 150
col name for A30
col value for A30
select name, type, value,isdefault, isses_modifiable, issys_modifiable from v$parameter where name like '%process%';

 

  - NAME : 파라메터 이름
  - TYPE : 파라메터 설정 타입
  - VALUE : 파라메터 값
  - ISDEFAULT : 파라메터 기본 값 사용 유무
  - ISSES_MODIFIABLE : ALTER SESSION 명령으로 파라메터 설정 값을 변경할 수 있는지 여부
  - ISSYS_MODIFIABLE : ALTER SYSTEM 명령으로 파라메터 설정 값을 변경할 수 있는지 여부
 
 TYPE 컬럼 값         내용           파라메터 예제
     1       TRUE/FALSE 중 하나를 의미  TIMED_STATISTICS
     2       문자 값을 의미          CONTROL_FILES
     3       작은 숫자 값을 의미  SESSION
     4       파일을 의미          IFILE
     5       지정된 값 없음          -
     6       큰 숫자 의미          SHARED_POOL_SIZE

Posted by pat98

2013. 12. 5. 00:05 오라클

opatch auto 의 이해


ORACLE_HOME, GRID_HOME 에 최신 OPatch 파일을 풀어 주고..

 

테스트에 사용된 Patchset LInux x86_64 11.2.0.3.7 GI Patch set 이다.

 

패치과정을 살펴보고 어떤식으로 진행되는지 Review 해보도록 한다.


 여기서 혼동하지 말아야할 것은 1번, 2번 서버가 있다고 하면..


opatch auto 를 실행한 서버만 auto 로 Patch 가 적용된다고 하는것이다. 절대 2번 서버도 같이 패치되지 않는다. 

2번도 별도로 진행해 주어야 한다.


순서

1. 1node down

2. 패치적용

3. 1node up

4. 2node down

5. 패치적용

6. 2node up

 

[root:/oragrid/product/11.2.0/OPatch]#./opatch auto /oragrid -oh /oragrid/product/11.2.0 -ocmrf /oragrid/product/11.2.0/ocm.rsp
Executing /oragrid/product/11.2.0/perl/bin/perl ./crs/patch11203.pl -patchdir / -patchn oragrid -oh /oragrid/product/11.2.0 -ocmrf /oragrid/product/11.2.0/ocm.rsp -paramfile /oragrid/product/11.2.0/crs/install/crsconfig_params
/oragrid/product/11.2.0/crs/install/crsconfig_params
/oragrid/product/11.2.0/crs/install/s_crsconfig_defs

This is the main log file: /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system: /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.report.log

2013-12-04 23:29:49: Starting Clusterware Patch Setup
Using configuration parameter file: /oragrid/product/11.2.0/crs/install/crsconfig_params
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.rac.db' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2677: Stop of 'ora.rac.db' on 'rac1' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2'
CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'
CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2673: Attempting to stop 'ora.crf' on 'rac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully unlock /oragrid/product/11.2.0
patch //oragrid/16619898  apply successful for home  /oragrid/product/11.2.0
patch //oragrid/16619892  apply failed  for home  /oragrid/product/11.2.0
CRS-4123: Oracle High Availability Services has been started.

 

패치 Step을 살펴보자..

cat /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.report.log

***********  Configuration Data  ***********
* It shows only those targets that will be patched in this session *


crs_home=/oragrid/product/11.2.0      owner=oracle      opatch_ver=11.2.0.3.5

*********** Steps to be executed as owner unless specified as root ***********


1: /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619898 -oh /oragrid/product/11.2.0

2: /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619892 -oh /oragrid/product/11.2.0

3: /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619898 -oh /oragrid/product/11.2.0

4: /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619892 -oh /oragrid/product/11.2.0

5: /oragrid/product/11.2.0/bin/emctl stop dbconsole

6: /oragrid/product/11.2.0/crs/install/rootcrs.pl -unlock : run as root

7: /sbin/fuser -k /oragrid/product/11.2.0/bin/crsctl.bin : run as root

8: /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619898 -oh /oragrid/product/11.2.0

9: /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619892 -oh /oragrid/product/11.2.0

10: /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619898 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc

11: /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619892 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc

12: /oragrid/product/11.2.0/bin/emctl start dbconsole

 

자세하게 패치 로그를 살펴보자..

[root:/root]#vi /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.log

2013-12-04 23:29:49: Using Oracle CRS home /oragrid/product/11.2.0
2013-12-04 23:29:49: Checking parameters from paramfile /oragrid/product/11.2.0/crs/install/crsconfig_params to validate installer variables
2013-12-04 23:29:49: The configuration parameter file /oragrid/product/11.2.0/crs/install/crsconfig_params is valid
2013-12-04 23:29:49: ### Printing the configuration values from files:
2013-12-04 23:29:49:    /oragrid/product/11.2.0/crs/install/crsconfig_params
2013-12-04 23:29:49:    /oragrid/product/11.2.0/crs/install/s_crsconfig_defs
2013-12-04 23:29:49: ASM_AU_SIZE=1
2013-12-04 23:29:49: ASM_DISCOVERY_STRING=
2013-12-04 23:29:49: ASM_DISKS=/dev/raw/raw1
2013-12-04 23:29:49: ASM_DISK_GROUP=DATA
2013-12-04 23:29:49: ASM_REDUNDANCY=EXTERNAL
2013-12-04 23:29:49: ASM_SPFILE=
2013-12-04 23:29:49: ASM_UPGRADE=false
2013-12-04 23:29:49: CLSCFG_MISSCOUNT=
2013-12-04 23:29:49: CLUSTER_GUID=
2013-12-04 23:29:49: CLUSTER_NAME=rac-cluster
2013-12-04 23:29:49: CRFHOME="/oragrid/product/11.2.0"
2013-12-04 23:29:49: CRS_LIMIT_CORE=unlimited
2013-12-04 23:29:49: CRS_LIMIT_MEMLOCK=unlimited
2013-12-04 23:29:49: CRS_LIMIT_OPENFILE=65536
2013-12-04 23:29:49: CRS_LIMIT_STACK=2048
2013-12-04 23:29:49: CRS_NODEVIPS='rac1-vip/255.255.255.0/eth0,rac2-vip/255.255.255.0/eth0'
2013-12-04 23:29:49: CRS_STORAGE_OPTION=1
2013-12-04 23:29:49: CSS_LEASEDURATION=400
2013-12-04 23:29:49: DIRPREFIX=
2013-12-04 23:29:49: DISABLE_OPROCD=0
2013-12-04 23:29:49: EXTERNAL_ORACLE=/opt/oracle
2013-12-04 23:29:49: EXTERNAL_ORACLE_BIN=/opt/oracle/bin
2013-12-04 23:29:49: GNS_ADDR_LIST=
2013-12-04 23:29:49: GNS_ALLOW_NET_LIST=
2013-12-04 23:29:49: GNS_CONF=false
2013-12-04 23:29:49: GNS_DENY_ITF_LIST=
2013-12-04 23:29:49: GNS_DENY_NET_LIST=
2013-12-04 23:29:49: GNS_DOMAIN_LIST=
2013-12-04 23:29:49: GPNPCONFIGDIR=/oragrid/product/11.2.0
2013-12-04 23:29:49: GPNPGCONFIGDIR=/oragrid/product/11.2.0
2013-12-04 23:29:49: GPNP_PA=
2013-12-04 23:29:49: HOST_NAME_LIST=rac1,rac2
2013-12-04 23:29:49: ID=/etc/init.d
2013-12-04 23:29:49: INIT=/sbin/init
2013-12-04 23:29:49: INITCTL=/sbin/initctl
2013-12-04 23:29:49: ISROLLING=true
2013-12-04 23:29:49: IT=/etc/inittab
2013-12-04 23:29:49: JLIBDIR=/oragrid/product/11.2.0/jlib
2013-12-04 23:29:49: JREDIR=/oragrid/product/11.2.0/jdk/jre/
2013-12-04 23:29:49: LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
2013-12-04 23:29:49: MSGFILE=/var/adm/messages
2013-12-04 23:29:49: NETWORKS="eth0"/192.168.56.0:public,"eth1"/10.10.10.0:cluster_interconnect
2013-12-04 23:29:49: NEW_HOST_NAME_LIST=
2013-12-04 23:29:49: NEW_NODEVIPS='rac1-vip/255.255.255.0/eth0,rac2-vip/255.255.255.0/eth0'
2013-12-04 23:29:49: NEW_NODE_NAME_LIST=
2013-12-04 23:29:49: NEW_PRIVATE_NAME_LIST=
2013-12-04 23:29:49: NODELIST=rac1,rac2
2013-12-04 23:29:49: NODE_NAME_LIST=rac1,rac2
2013-12-04 23:29:49: OCFS_CONFIG=
2013-12-04 23:29:49: OCRCONFIG=/etc/oracle/ocr.loc
2013-12-04 23:29:49: OCRCONFIGDIR=/etc/oracle
2013-12-04 23:29:49: OCRID=
2013-12-04 23:29:49: OCRLOC=ocr.loc
2013-12-04 23:29:49: OCR_LOCATIONS=NO_VAL
2013-12-04 23:29:49: OLASTGASPDIR=/etc/oracle/lastgasp
2013-12-04 23:29:49: OLD_CRS_HOME=
2013-12-04 23:29:49: OLRCONFIG=/etc/oracle/olr.loc
2013-12-04 23:29:49: OLRCONFIGDIR=/etc/oracle
2013-12-04 23:29:49: OLRLOC=olr.loc
2013-12-04 23:29:49: OPROCDCHECKDIR=/etc/oracle/oprocd/check
2013-12-04 23:29:49: OPROCDDIR=/etc/oracle/oprocd
2013-12-04 23:29:49: OPROCDFATALDIR=/etc/oracle/oprocd/fatal
2013-12-04 23:29:49: OPROCDSTOPDIR=/etc/oracle/oprocd/stop
2013-12-04 23:29:49: ORACLE_BASE=/oracle
2013-12-04 23:29:49: ORACLE_HOME=/oragrid/product/11.2.0
2013-12-04 23:29:49: ORACLE_OWNER=oracle
2013-12-04 23:29:49: ORA_ASM_GROUP=dba
2013-12-04 23:29:49: ORA_DBA_GROUP=dba
2013-12-04 23:29:49: PRIVATE_NAME_LIST=
2013-12-04 23:29:49: RCALLDIR=/etc/rc.d/rc0.d /etc/rc.d/rc1.d /etc/rc.d/rc2.d /etc/rc.d/rc3.d /etc/rc.d/rc4.d /etc/rc.d/rc5.d /etc/rc.d/rc6.d
2013-12-04 23:29:49: RCKDIR=/etc/rc.d/rc0.d /etc/rc.d/rc1.d /etc/rc.d/rc2.d /etc/rc.d/rc3.d /etc/rc.d/rc4.d /etc/rc.d/rc6.d
2013-12-04 23:29:49: RCSDIR=/etc/rc.d/rc3.d /etc/rc.d/rc5.d
2013-12-04 23:29:49: RC_KILL=K15
2013-12-04 23:29:49: RC_KILL_OLD=K96
2013-12-04 23:29:49: RC_KILL_OLD2=K19
2013-12-04 23:29:49: RC_START=S96
2013-12-04 23:29:49: REUSEDG=false
2013-12-04 23:29:49: SCAN_NAME=rac-scan
2013-12-04 23:29:49: SCAN_PORT=1521
2013-12-04 23:29:49: SCRBASE=/etc/oracle/scls_scr
2013-12-04 23:29:49: SILENT=false
2013-12-04 23:29:49: SO_EXT=so
2013-12-04 23:29:49: SRVCFGLOC=srvConfig.loc
2013-12-04 23:29:49: SRVCONFIG=/var/opt/oracle/srvConfig.loc
2013-12-04 23:29:49: SRVCONFIGDIR=/var/opt/oracle
2013-12-04 23:29:49: TZ=Asia/Seoul
2013-12-04 23:29:49: UPSTART_INIT_DIR=/etc/init
2013-12-04 23:29:49: USER_IGNORED_PREREQ=true
2013-12-04 23:29:49: VNDR_CLUSTER=false
2013-12-04 23:29:49: VOTING_DISKS=NO_VAL
2013-12-04 23:29:49: ### Printing other configuration values ###
2013-12-04 23:29:49: CLSCFG_EXTRA_PARMS=
2013-12-04 23:29:49: HAS_GROUP=dba
2013-12-04 23:29:49: HAS_USER=root
2013-12-04 23:29:49: HOST=rac1
2013-12-04 23:29:49: OLR_DIRECTORY=/oragrid/product/11.2.0/cdata
2013-12-04 23:29:49: OLR_LOCATION=/oragrid/product/11.2.0/cdata/rac1.olr
2013-12-04 23:29:49: ORA_CRS_HOME=/oragrid/product/11.2.0
2013-12-04 23:29:49: SUPERUSER=root
2013-12-04 23:29:49: VF_DISCOVERY_STRING=
2013-12-04 23:29:49: crscfg_trace=1
2013-12-04 23:29:49: crscfg_trace_file=/oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.log
2013-12-04 23:29:49: hosts=
2013-12-04 23:29:49: osdfile=/oragrid/product/11.2.0/crs/install/s_crsconfig_defs
2013-12-04 23:29:49: parameters_valid=1
2013-12-04 23:29:49: paramfile=/oragrid/product/11.2.0/crs/install/crsconfig_params
2013-12-04 23:29:49: platform_family=unix
2013-12-04 23:29:49: srvctl_trc_suff=0
2013-12-04 23:29:49: user_is_superuser=1
2013-12-04 23:29:49: ### Printing of configuration values complete ###
2013-12-04 23:29:49: INC is /oragrid/16619898/files/crs/install /oragrid/product/11.2.0/perl/lib/5.10.0/x86_64-linux-thread-multi /oragrid/product/11.2.0/perl/lib/5.10.0 /oragrid/product/11.2.0/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi /oragrid/product/11.2.0/perl/lib/site_perl/5.10.0 /oragrid/product/11.2.0/perl/lib/5.10.0/x86_64-linux-thread-multi /oragrid/product/11.2.0/perl/lib/5.10.0/x86_64-linux-thread-multi /oragrid/product/11.2.0/perl/lib/5.10.0 /oragrid/product/11.2.0/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi /oragrid/product/11.2.0/perl/lib/site_perl/5.10.0 /oragrid/product/11.2.0/perl/lib/site_perl .

2013-12-04 23:29:49: No -patchfile specified, assuming the patch is already uncompressed
2013-12-04 23:29:49: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:49: The patch ids are 16619898 16619892
2013-12-04 23:29:49: The patch ids are 16619898 16619892
2013-12-04 23:29:49: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch query -get_patch_type //oragrid/16619898 -oh /oragrid/product/11.2.0
2013-12-04 23:29:49: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch query -get_patch_type //oragrid/16619898 -oh /oragrid/product/11.2.0 '
2013-12-04 23:29:52: Removing file /tmp/fileV1NRL2
2013-12-04 23:29:52: Successfully removed file: /tmp/fileV1NRL2
2013-12-04 23:29:52: /bin/su successfully executed

2013-12-04 23:29:52: output is  This patch is a "legacy_bundle_top" patch.

2013-12-04 23:29:52: Patch type is "legacy_bundle_top"
2013-12-04 23:29:52: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch query -get_patch_type //oragrid/16619892 -oh /oragrid/product/11.2.0
2013-12-04 23:29:52: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch query -get_patch_type //oragrid/16619892 -oh /oragrid/product/11.2.0 '
2013-12-04 23:29:53: Removing file /tmp/fileKFA5PW
2013-12-04 23:29:53: Successfully removed file: /tmp/fileKFA5PW
2013-12-04 23:29:53: /bin/su exited with rc=75

2013-12-04 23:29:53: output is
2013-12-04 23:29:53: Patch type is
2013-12-04 23:29:53: GI patches are //oragrid/16619898 //oragrid/16619892
2013-12-04 23:29:53: DB patches are //oragrid/16619898/custom/server/16619898 //oragrid/16619892
2013-12-04 23:29:53: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:53: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch util saveconfigurationsnapshot -configFile /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.cfg.log
2013-12-04 23:29:53: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch util saveconfigurationsnapshot -configFile /oragrid/product/11.2.0/cfgtoollogs/opatchauto2013-12-04_23-29-49.cfg.log '
2013-12-04 23:29:53: Removing file /tmp/fileeYSuiU
2013-12-04 23:29:53: Successfully removed file: /tmp/fileeYSuiU
2013-12-04 23:29:53: /bin/su exited with rc=1

2013-12-04 23:29:53: The Oracle Home /product/11.2.0 is not valid directory. Please give proper Oracle Home.
 OPatch returns with error code = 1

2013-12-04 23:29:53: Opening file /etc/oracle/ocr.loc
2013-12-04 23:29:53: Value (FALSE) is set for key=local_only
2013-12-04 23:29:53: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:53: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch version -oh /oragrid/product/11.2.0
2013-12-04 23:29:53: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch version -oh /oragrid/product/11.2.0 '
2013-12-04 23:29:54: Removing file /tmp/file55ZPYR
2013-12-04 23:29:54: Successfully removed file: /tmp/file55ZPYR
2013-12-04 23:29:54: /bin/su successfully executed

2013-12-04 23:29:54: opatch version in oracle home /oragrid/product/11.2.0  is 11.2.0.3.5

2013-12-04 23:29:54: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:54: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:54: silent mode option is -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp
2013-12-04 23:29:54: Running /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:29:54: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:29:54: Processing oracle home /oragrid/product/11.2.0
2013-12-04 23:29:54: Opening file /etc/oracle/ocr.loc
2013-12-04 23:29:54: Value (FALSE) is set for key=local_only
2013-12-04 23:29:54: Home type of /oragrid/product/11.2.0 is CRS
2013-12-04 23:29:54: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:54: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:29:54: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch version -oh /oragrid/product/11.2.0
2013-12-04 23:29:54: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch version -oh /oragrid/product/11.2.0 '
2013-12-04 23:29:54: Removing file /tmp/fileCveUDR
2013-12-04 23:29:54: Successfully removed file: /tmp/fileCveUDR
2013-12-04 23:29:54: /bin/su successfully executed

2013-12-04 23:29:54: opatch version in oracle home /oragrid/product/11.2.0  is 11.2.0.3.5

2013-12-04 23:29:54: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch util checkMinimumOPatchVersion -ph //oragrid/16619898 -version 11.2.0.3.5 -oh /oragrid/product/11.2.0
2013-12-04 23:29:54: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch util checkMinimumOPatchVersion -ph //oragrid/16619898 -version 11.2.0.3.5 -oh /oragrid/product/11.2.0 '
2013-12-04 23:29:57: Removing file /tmp/fileTO5UVS
2013-12-04 23:29:57: Successfully removed file: /tmp/fileTO5UVS
2013-12-04 23:29:57: /bin/su successfully executed

2013-12-04 23:29:57: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch util checkMinimumOPatchVersion -ph //oragrid/16619892 -version 11.2.0.3.5 -oh /oragrid/product/11.2.0
2013-12-04 23:29:57: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch util checkMinimumOPatchVersion -ph //oragrid/16619892 -version 11.2.0.3.5 -oh /oragrid/product/11.2.0 '
2013-12-04 23:30:00: Removing file /tmp/fileGxUG83
2013-12-04 23:30:00: Successfully removed file: /tmp/fileGxUG83
2013-12-04 23:30:00: /bin/su successfully executed

2013-12-04 23:30:00: Status of opatch version check  for /oragrid/product/11.2.0 is 1
2013-12-04 23:30:00: Opatch version check passed for oracle home  /oragrid/product/11.2.0
2013-12-04 23:30:00: Opatch version check passed  for all oracle homes
2013-12-04 23:30:00: Opening file /etc/oracle/ocr.loc
2013-12-04 23:30:00: Value (FALSE) is set for key=local_only
2013-12-04 23:30:00: The cluster nodes are rac1 rac2
2013-12-04 23:30:00: checking if path /oragrid/product/11.2.0/crs/install is shared
2013-12-04 23:30:00: Running as user oracle: /oragrid/product/11.2.0/bin/cluvfy comp ssa -t software -s /oragrid/product/11.2.0/crs/install -n rac1,rac2 -display_status
2013-12-04 23:30:00: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/cluvfy comp ssa -t software -s /oragrid/product/11.2.0/crs/install -n rac1,rac2 -display_status '
2013-12-04 23:30:20: Removing file /tmp/filePBo6vp
2013-12-04 23:30:20: Successfully removed file: /tmp/filePBo6vp
2013-12-04 23:30:20: /bin/su exited with rc=1

2013-12-04 23:30:20: return code for shared check is 256
2013-12-04 23:30:20: output of sharedness check is
 Verifying shared storage accessibility

 Checking shared storage accessibility...

 "/oragrid/product/11.2.0/crs/install" is not shared


 Shared storage check failed on nodes "rac2,rac1"

 Verification of shared storage accessibility was unsuccessful on all the specified nodes.
 NODE_STATUS::rac2:VFAIL
 NODE_STATUS::rac1:VFAIL
 OVERALL_STATUS::VFAIL

2013-12-04 23:30:20: the ishared value is 0
2013-12-04 23:30:20: The oracle home /oragrid/product/11.2.0 is not shared
2013-12-04 23:30:20: Processing oracle home /oragrid/product/11.2.0
2013-12-04 23:30:20: Opening file /etc/oracle/ocr.loc
2013-12-04 23:30:20: Value (FALSE) is set for key=local_only
2013-12-04 23:30:20: Home type of /oragrid/product/11.2.0 is CRS
2013-12-04 23:30:20: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:30:20: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619898 -oh /oragrid/product/11.2.0
2013-12-04 23:30:20: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619898 -oh /oragrid/product/11.2.0 '
2013-12-04 23:30:23: Removing file /tmp/fileU3icUM
2013-12-04 23:30:23: Successfully removed file: /tmp/fileU3icUM
2013-12-04 23:30:23: /bin/su successfully executed

2013-12-04 23:30:23: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619892 -oh /oragrid/product/11.2.0
2013-12-04 23:30:23: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckComponents -ph //oragrid/16619892 -oh /oragrid/product/11.2.0 '
2013-12-04 23:30:27: Removing file /tmp/filelKic0k
2013-12-04 23:30:27: Successfully removed file: /tmp/filelKic0k
2013-12-04 23:30:27: /bin/su successfully executed

2013-12-04 23:30:27: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:30:27: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619898 -oh /oragrid/product/11.2.0
2013-12-04 23:30:27: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619898 -oh /oragrid/product/11.2.0 '
2013-12-04 23:30:31: Removing file /tmp/filegbypr6
2013-12-04 23:30:31: Successfully removed file: /tmp/filegbypr6
2013-12-04 23:30:31: /bin/su successfully executed

2013-12-04 23:30:31: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619892 -oh /oragrid/product/11.2.0
2013-12-04 23:30:31: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckConflictAgainstOH -ph //oragrid/16619892 -oh /oragrid/product/11.2.0 '
2013-12-04 23:30:35: Removing file /tmp/fileSlfK71
2013-12-04 23:30:35: Successfully removed file: /tmp/fileSlfK71
2013-12-04 23:30:35: /bin/su successfully executed

2013-12-04 23:30:35: Status of component/conflict check  for /oragrid/product/11.2.0 is 1
2013-12-04 23:30:35:  Conflict check passes for oracle home  /oragrid/product/11.2.0
2013-12-04 23:30:35: Conflict check passed  for all oracle homes
2013-12-04 23:30:35: Processing oracle home /oragrid/product/11.2.0
2013-12-04 23:30:35: Opening file /etc/oracle/ocr.loc
2013-12-04 23:30:35: Value (FALSE) is set for key=local_only
2013-12-04 23:30:35: Home type of /oragrid/product/11.2.0 is CRS
2013-12-04 23:30:35: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:30:35: Running as user oracle: /oragrid/product/11.2.0/bin/emctl stop dbconsole
2013-12-04 23:30:35: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/emctl stop dbconsole '
2013-12-04 23:30:36: Removing file /tmp/fileyedrRa
2013-12-04 23:30:36: Successfully removed file: /tmp/fileyedrRa
2013-12-04 23:30:36: /bin/su exited with rc=2

2013-12-04 23:30:36: Unlock crshome...
2013-12-04 23:30:36: crshome passed is
2013-12-04 23:30:36: Exclude file used is /oragrid/product/11.2.0/OPatch/crs/installPatch.excl
2013-12-04 23:30:36: Home location in olr.loc is /oragrid/product/11.2.0
2013-12-04 23:30:36: unlock crs home is /oragrid/product/11.2.0
2013-12-04 23:30:36: Executing /oragrid/product/11.2.0/bin/crsctl stop crs -f
2013-12-04 23:30:36: Executing cmd: /oragrid/product/11.2.0/bin/crsctl stop crs -f
2013-12-04 23:32:32: Command output:
>  CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
>  CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
>  CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
>  CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.rac.db' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
>  CRS-2677: Stop of 'ora.rac.db' on 'rac1' succeeded
>  CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'
>  CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded
>  CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2'
>  CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'
>  CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded
>  CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2'
>  CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded
>  CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded
>  CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'
>  CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded
>  CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
>  CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'
>  CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded
>  CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
>  CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.crf' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'
>  CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
>  CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
>  CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded
>  CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded
>  CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
>  CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
>  CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
>  CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
>  CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
>  CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
>  CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
>  CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
>  CRS-4133: Oracle High Availability Services has been stopped.
>End Command output
2013-12-04 23:32:32: /oragrid/product/11.2.0/bin/crsctl stop crs -f
2013-12-04 23:32:32: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:32:34: Command output:
>  CRS-4639: Could not contact Oracle High Availability Services
>  CRS-4000: Command Check failed, or completed with errors.
>End Command output
2013-12-04 23:32:34: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check has
2013-12-04 23:32:35: Command output:
>  CRS-4639: Could not contact Oracle High Availability Services
>End Command output
2013-12-04 23:32:35: The CRS home passed in is /oragrid/product/11.2.0
2013-12-04 23:34:35: Waiting for complete CRS stack to stop
2013-12-04 23:34:35: Invoking removeproc to clean oracle client procs
2013-12-04 23:34:35: Executing cmd: /sbin/fuser -k /oragrid/product/11.2.0/bin/crsctl.bin
2013-12-04 23:34:35: fuser command output for /oragrid/product/11.2.0/bin/crsctl.bin is
2013-12-04 23:34:35: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:34:35: Opening file /etc/oracle/ocr.loc
2013-12-04 23:34:35: Value (FALSE) is set for key=local_only
2013-12-04 23:34:35: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619898 -oh /oragrid/product/11.2.0
2013-12-04 23:34:35: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619898 -oh /oragrid/product/11.2.0 '
2013-12-04 23:34:39: Removing file /tmp/filenBeWwV
2013-12-04 23:34:39: Successfully removed file: /tmp/filenBeWwV
2013-12-04 23:34:39: /bin/su successfully executed

2013-12-04 23:34:39: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619892 -oh /oragrid/product/11.2.0
2013-12-04 23:34:39: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch prereq CheckApplicable -ph //oragrid/16619892 -oh /oragrid/product/11.2.0 '
2013-12-04 23:34:44: Removing file /tmp/file5N7kpS
2013-12-04 23:34:44: Successfully removed file: /tmp/file5N7kpS
2013-12-04 23:34:44: /bin/su successfully executed

2013-12-04 23:34:44: Status of Applicable  check  for /oragrid/product/11.2.0 is 1
2013-12-04 23:34:44: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:34:44: Executing command /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619898 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc as oracle
2013-12-04 23:34:44: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619898 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc
2013-12-04 23:34:44: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619898 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc '
2013-12-04 23:41:02: Removing file /tmp/filesPciS4
2013-12-04 23:41:02: Successfully removed file: /tmp/filesPciS4
2013-12-04 23:41:02: /bin/su successfully executed

2013-12-04 23:41:02: status of apply patch is 0
2013-12-04 23:41:02: The apply patch output is Oracle Interim Patch Installer version 11.2.0.3.5
 Copyright (c) 2013, Oracle Corporation.  All rights reserved.


 Oracle Home       : /oragrid/product/11.2.0
 Central Inventory : /oragrid/oraInventory
    from           : /oragrid/product/11.2.0/oraInst.loc
 OPatch version    : 11.2.0.3.5
 OUI version       : 11.2.0.3.0
 Log file location : /oragrid/product/11.2.0/cfgtoollogs/opatch/opatch2013-12-04_23-34-44PM_1.log

 Verifying environment and performing prerequisite checks...
 OPatch continues with these patches:   16619898

 Do you want to proceed? [y|n]
 Y (auto-answered by -silent)
 User Responded with: Y
 All checks passed.

 Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
 (Oracle Home = '/oragrid/product/11.2.0')


 Is the local system ready for patching? [y|n]
 Y (auto-answered by -silent)
 User Responded with: Y
 Backing up files...
 Applying interim patch '16619898' to OH '/oragrid/product/11.2.0'

 Patching component oracle.crs, 11.2.0.3.0...

 Patching component oracle.usm, 11.2.0.3.0...

 Verifying the update...
 Patch 16619898 successfully applied.
 Log file location: /oragrid/product/11.2.0/cfgtoollogs/opatch/opatch2013-12-04_23-34-44PM_1.log

 OPatch succeeded.

2013-12-04 23:41:02: patch //oragrid/16619898  apply successful for home  /oragrid/product/11.2.0
2013-12-04 23:41:02: Executing command /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619892 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc as oracle
2013-12-04 23:41:02: Running as user oracle: /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619892 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc
2013-12-04 23:41:02: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/OPatch/opatch napply //oragrid/16619892 -local -silent -ocmrf /oragrid/product/11.2.0/ocm.rsp -oh /oragrid/product/11.2.0 -invPtrLoc /oragrid/product/11.2.0/oraInst.loc '
2013-12-04 23:41:13: Removing file /tmp/filek536M4
2013-12-04 23:41:13: Successfully removed file: /tmp/filek536M4
2013-12-04 23:41:13: /bin/su exited with rc=73

2013-12-04 23:41:13: status of apply patch is 18688
2013-12-04 23:41:13: The apply patch output is Oracle Interim Patch Installer version 11.2.0.3.5
 Copyright (c) 2013, Oracle Corporation.  All rights reserved.


 Oracle Home       : /oragrid/product/11.2.0
 Central Inventory : /oragrid/oraInventory
    from           : /oragrid/product/11.2.0/oraInst.loc
 OPatch version    : 11.2.0.3.5
 OUI version       : 11.2.0.3.0
 Log file location : /oragrid/product/11.2.0/cfgtoollogs/opatch/opatch2013-12-04_23-41-03PM_1.log

 Verifying environment and performing prerequisite checks...
 Prerequisite check "CheckActiveFilesAndExecutables" failed.
 The details are:


 Following executables are active :
 /oragrid/product/11.2.0/lib/libclntsh.so.11.1
 UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
 Log file location: /oragrid/product/11.2.0/cfgtoollogs/opatch/opatch2013-12-04_23-41-03PM_1.log

 OPatch failed with error code 73

2013-12-04 23:41:13: patch //oragrid/16619892  apply failed  for home  /oragrid/product/11.2.0
2013-12-04 23:41:13: Performing Post patch actions
2013-12-04 23:41:13: norestart flag is set to
2013-12-04 23:41:13: Opening file /etc/oracle/ocr.loc
2013-12-04 23:41:13: Value (FALSE) is set for key=local_only
2013-12-04 23:41:13: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:41:13: Oracle user for /oragrid/product/11.2.0 is oracle
2013-12-04 23:41:13: Running as user oracle: /oragrid/product/11.2.0/bin/emctl start dbconsole
2013-12-04 23:41:13: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/emctl start dbconsole '
2013-12-04 23:41:14: Removing file /tmp/filedZAZaE
2013-12-04 23:41:14: Successfully removed file: /tmp/filedZAZaE
2013-12-04 23:41:14: /bin/su exited with rc=2

2013-12-04 23:41:14: Performing Post patch actions for Grid Home /oragrid/product/11.2.0
2013-12-04 23:41:14: Executing cmd: /oragrid/product/11.2.0/rdbms/install/rootadd_rdbms.sh
2013-12-04 23:41:14: setrdbmsfileperms succeeded
2013-12-04 23:41:14: Patching Oracle Clusterware
2013-12-04 23:41:14: norestart flag is set to 0
2013-12-04 23:41:15: Executing cmd: /bin/rpm -q sles-release
2013-12-04 23:41:15: Command output:
>  package sles-release is not installed
>End Command output
2013-12-04 23:41:15: init file = /oragrid/product/11.2.0/crs/init/init.ohasd
2013-12-04 23:41:15: Copying file /oragrid/product/11.2.0/crs/init/init.ohasd to /etc/init.d directory
2013-12-04 23:41:15: Setting init.ohasd permission in /etc/init.d directory
2013-12-04 23:41:15: init file = /oragrid/product/11.2.0/crs/init/ohasd
2013-12-04 23:41:15: Copying file /oragrid/product/11.2.0/crs/init/ohasd to /etc/init.d directory
2013-12-04 23:41:15: Setting ohasd permission in /etc/init.d directory
2013-12-04 23:41:15: Executing cmd: /bin/rpm -q sles-release
2013-12-04 23:41:15: Command output:
>  package sles-release is not installed
>End Command output
2013-12-04 23:41:15: Removing "/etc/rc.d/rc3.d/S96ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc3.d/S96ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc3.d/S96ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc3.d/S96ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc5.d/S96ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc5.d/S96ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc5.d/S96ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc5.d/S96ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc0.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc0.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc0.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc0.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc1.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc1.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc1.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc1.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc2.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc2.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc2.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc2.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc3.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc3.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc3.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc3.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc4.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc4.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc4.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc4.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: Removing "/etc/rc.d/rc6.d/K15ohasd"
2013-12-04 23:41:15: Removing file /etc/rc.d/rc6.d/K15ohasd
2013-12-04 23:41:15: Successfully removed file: /etc/rc.d/rc6.d/K15ohasd
2013-12-04 23:41:15: Creating a link "/etc/rc.d/rc6.d/K15ohasd" pointing to /etc/init.d/ohasd
2013-12-04 23:41:15: The file ohasd has been successfully linked to the RC directories
2013-12-04 23:41:15: Executing cmd: /oragrid/product/11.2.0/bin/acfsdriverstate supported
2013-12-04 23:41:16: Command output:
>  ACFS-9200: Supported
>End Command output
2013-12-04 23:41:16: acfs is supported
2013-12-04 23:41:16: Executing '/oragrid/product/11.2.0/bin/acfsroot install'
2013-12-04 23:41:16: Executing cmd: /oragrid/product/11.2.0/bin/acfsroot install
2013-12-04 23:41:27: Command output:
>  ACFS-9300: ADVM/ACFS distribution files found.
>  ACFS-9312: Existing ADVM/ACFS installation detected.
>  ACFS-9314: Removing previous ADVM/ACFS installation.
>  ACFS-9315: Previous ADVM/ACFS components successfully removed.
>  ACFS-9307: Installing requested ADVM/ACFS software.
>  ACFS-9308: Loading installed ADVM/ACFS drivers.
>  ACFS-9321: Creating udev for ADVM/ACFS.
>  ACFS-9323: Creating module dependencies - this may take some time.
>  ACFS-9154: Loading 'oracleoks.ko' driver.
>  ACFS-9154: Loading 'oracleadvm.ko' driver.
>  ACFS-9154: Loading 'oracleacfs.ko' driver.
>  ACFS-9327: Verifying ADVM/ACFS devices.
>  ACFS-9156: Detecting control device '/dev/asm/.asm_ctl_spec'.
>  ACFS-9156: Detecting control device '/dev/ofsctl'.
>  ACFS-9309: ADVM/ACFS installation correctness verified.
>End Command output
2013-12-04 23:41:27: /oragrid/product/11.2.0/bin/acfsroot install ... success
2013-12-04 23:41:27: USM driver install status is 1
2013-12-04 23:41:27: ACFS drivers installation completed
2013-12-04 23:41:27: Starting Oracle Clusterware
2013-12-04 23:41:27: Executing /oragrid/product/11.2.0/bin/crsctl start crs
2013-12-04 23:41:27: Executing cmd: /oragrid/product/11.2.0/bin/crsctl start crs
2013-12-04 23:41:41: Command output:
>  CRS-4123: Oracle High Availability Services has been started.
>End Command output
2013-12-04 23:41:41: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check crs
2013-12-04 23:41:42: Command output:
>  CRS-4638: Oracle High Availability Services is online
>  CRS-4535: Cannot communicate with Cluster Ready Services
>  CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
>  CRS-4534: Cannot communicate with Event Manager
>End Command output
2013-12-04 23:41:42: Running /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:41:42: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:41:42: Checking the status of cluster
2013-12-04 23:41:47: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:41:47: Checking the status of cluster
2013-12-04 23:41:52: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:41:52: Checking the status of cluster
2013-12-04 23:41:57: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:41:57: Checking the status of cluster
2013-12-04 23:42:02: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:02: Checking the status of cluster
2013-12-04 23:42:07: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:07: Checking the status of cluster
2013-12-04 23:42:12: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:12: Checking the status of cluster
2013-12-04 23:42:17: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:17: Checking the status of cluster
2013-12-04 23:42:22: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:22: Checking the status of cluster
2013-12-04 23:42:27: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:27: Checking the status of cluster
2013-12-04 23:42:32: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:32: Checking the status of cluster
2013-12-04 23:42:37: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:38: Checking the status of cluster
2013-12-04 23:42:43: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:43: Checking the status of cluster
2013-12-04 23:42:48: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:48: Checking the status of cluster
2013-12-04 23:42:53: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:53: Checking the status of cluster
2013-12-04 23:42:58: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:42:58: Checking the status of cluster
2013-12-04 23:43:03: Executing cmd: /oragrid/product/11.2.0/bin/crsctl check cluster -n rac1
2013-12-04 23:43:03: Oracle CRS stack installed and running
2013-12-04 23:43:03: Running as user oracle: /oragrid/product/11.2.0/bin/crsctl status resource ora.oc4j
2013-12-04 23:43:03: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/crsctl status resource ora.oc4j '
2013-12-04 23:43:03: Removing file /tmp/fileSPHMTZ
2013-12-04 23:43:03: Successfully removed file: /tmp/fileSPHMTZ
2013-12-04 23:43:03: /bin/su successfully executed

2013-12-04 23:43:03: Running as user oracle: /oragrid/product/11.2.0/bin/srvctl stop oc4j
2013-12-04 23:43:03: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/srvctl stop oc4j '
2013-12-04 23:43:21: Removing file /tmp/fileRPEcmm
2013-12-04 23:43:21: Successfully removed file: /tmp/fileRPEcmm
2013-12-04 23:43:21: /bin/su successfully executed

2013-12-04 23:43:21: Running as user oracle: /oragrid/product/11.2.0/bin/crsctl get jazn /oragrid/product/11.2.0/oc4j/j2ee/home/OC4J_DBWLM_config/system-jazn-data.xml -f
2013-12-04 23:43:21: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/crsctl get jazn /oragrid/product/11.2.0/oc4j/j2ee/home/OC4J_DBWLM_config/system-jazn-data.xml -f '
2013-12-04 23:43:21: Removing file /tmp/filev0qBjC
2013-12-04 23:43:21: Successfully removed file: /tmp/filev0qBjC
2013-12-04 23:43:21: /bin/su successfully executed

2013-12-04 23:43:21: Running as user oracle: /oragrid/product/11.2.0/bin/qosctl -autogenerate
2013-12-04 23:43:21: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/qosctl -autogenerate '
2013-12-04 23:43:24: Removing file /tmp/fileDijqgT
2013-12-04 23:43:24: Successfully removed file: /tmp/fileDijqgT
2013-12-04 23:43:24: /bin/su successfully executed

2013-12-04 23:43:24: Running as user oracle: /oragrid/product/11.2.0/bin/crsctl set jazn /oragrid/product/11.2.0/oc4j/j2ee/home/OC4J_DBWLM_config/system-jazn-data.xml -f
2013-12-04 23:43:24: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/crsctl set jazn /oragrid/product/11.2.0/oc4j/j2ee/home/OC4J_DBWLM_config/system-jazn-data.xml -f '
2013-12-04 23:43:24: Removing file /tmp/fileqkXrxk
2013-12-04 23:43:24: Successfully removed file: /tmp/fileqkXrxk
2013-12-04 23:43:24: /bin/su successfully executed

2013-12-04 23:43:24: Running as user oracle: /oragrid/product/11.2.0/bin/srvctl start oc4j
2013-12-04 23:43:24: s_run_as_user2: Running /bin/su oracle -c ' /oragrid/product/11.2.0/bin/srvctl start oc4j '
2013-12-04 23:43:56: Removing file /tmp/filehsRb5L
2013-12-04 23:43:56: Successfully removed file: /tmp/filehsRb5L
2013-12-04 23:43:56: /bin/su successfully executed

2013-12-04 23:43:56: QoS users were patched correctly.

 

Posted by pat98

장애의 유형과 문제해결

※ SCENARIO 0 : Tablespace의 조작
※ SCENARIO 1 : Online Redo Log의 Mirroring
※ SCENARIO 2 : Full Offline Backup 수행
※ SCENARIO 3 : Recovery - Temporary Tablespace의 유실
※ SCENARIO 4 : Noarchive Log Mode Recovery - Disk의 유실
※ SCENARIO 5 : Read Only Tablespace의 Backup & Recovery
※ SCENARIO 6 : DATABASE의 BACKUP - Control File Mirroring & Archive log mode
※ SCENARIO 7 : Complete Recovery(Archive) - User의 DATA FILE 유실
※ SCENARIO 8 : Complete Recovery(ARchive) - Tablespace Recovery
※ SCENARIO 9 : Complete Recovery(ARchive) - Datafile Recovery
※ SCENARIO 10 : Parallel Recovery(Archive)
※ SCENARIO 11 : Complete Recovery - Shutdown 하지 않고 Data File만 Recovery
※ SCENARIO 12 : Online Backup (Hot Backup)
※ SCENARIO 13 : Online Backup 실패 후 Recovery - Online Backup 도중에 정전
※ SCENARIO 14 : Incomplete Recovery(Noarchive) - 실수로 Drop한 Table의 복구
※ SCENARIO 15 : Inactive Online Redo Log Group의 유실
※ SCENARIO 16 : Current Online Redo Log Group의 유실
※ SCENARIO 17 : 모든 Online Redo Log Group의 유실
※ SCENARIO 18 : 모든 Redo Log & Data File 유실
※ SCENARIO 19 : Control File Recreate
※ SCENARIO 20 : 모든 Control File 유실
※ SCENARIO 21 : Control File과 Data File 동시에 유실
※ SCENARIO 22 : Read Only Tablespace의 상태변경에 따른 Recovery -1
※ SCENARIO 23 : Read Only Tablespace의 상태변경에 따른 Recovery -2
※ SCENARIO 24 : Read Only Tablespace의 상태변경에 따른 Recovery -3
※ SCENARIO 25 : Recovery from Online Backup - Data File, Control File 유실
※ SCENARIO 26 : Recovery from Online Backup - File들 모두가 사라졌다.
                 게다가, Archived Redo Log File의 일부가 없고,
                 Data File Backup도 일부 없다.
※ SCENARIO 27 : Recover with No Backup
※ SCENARIO 28 : Incremental export 와 direct path
※ SCENARIO 29 : standby database 생성
※ SCENARIO 30 : Catalog DB를 이용한 복구 Oracle8

 

 
<SCENARIO 0 : Tablespace의 조작>


① 새로운 Tablespace Create
  [/DBA3/DBA/dba숫자]svrmgrl

  SVRMGR> connect internal
  SVRMGR> startup
  SVRMGR> create tablespace test
       2> datafile '/DBA3/DBA/dba숫자/u01/test_01.dbf'
       3> size 10k;
  SVRMGR> select tablespace_name, bytes, file_name from dba_data_files;

② Table Create

  SVRMGR> create table test(name char(30))
       2> tablespace test
       3> storage(initial 4k);

③ Table에 Row들을 Insert

  SVRMGR> @?/labs/test100
          Statement processed.

  SVRMGR> @?/labs/test100
          ORA-01653: unable to extend table SYS.TEST by 5 in tablespace TEST
          ORA-06512: at line 6

④ Tablespace를 늘인다

  SVRMGR> alter tablespace test
       2> add datafile '/DBA3/DBA/dba숫자/u01/test_02.dbf' size 30k;
          Statement processed.

  SVRMGR> @?/labs/test100
          Statement processed.

  SVRMGR> select tablespace_name, bytes, file_name from dba_data_files;

  SVRMGR> !ls -la $ORACLE_HOME/u01  --> "test_02.dbf" file 크기 확인

          total 22563
          drwxrwxr-x   2 dbamgr     dba          512 Feb 24 13:08 .
          drwxrwxr-x  43 dba숫자    dba         1024 Feb 20 23:21 ..
          -rw-rw----   1 dba숫자    dba       514048 Feb 24 13:05 index_01.dbf
          -rw-rw----   1 dba숫자    dba       155648 Feb 24 13:05 log1a.rdo
          -rw-rw----   1 dba숫자    dba       155648 Feb 24 13:09 log2a.rdo
          -rw-rw----   1 dba숫자    dba       155648 Feb 24 12:55 log3a.rdo
          -rw-rw----   1 dba숫자    dba     10487808 Feb 24 13:09 system.dbf
          -rw-rw----   1 dba숫자    dba        12288 Feb 24 13:09 test_01.dbf
          -rw-rw----   1 dba숫자    dba        32768 Feb 24 13:09 test_02.dbf

⑤ Datafile의 크기를 늘인다

  SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u01/test_02.dbf'  resize 50k;
          Statement processed.

  SVRMGR> select tablespace_name, bytes, file_name from dba_data_files;
  SVRMGR> !ls -la $ORACLE_HOME/u01

⑥ Test가 끝나면 Drop

  SVRMGR> drop tablespace test;
          drop tablespace test
          *
          ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
  SVRMGR> drop tablespace test including contents;
          Statement processed.
  SVRMGR> select tablespace_name, bytes, file_name from dba_data_files;
  SVRMGR> !ls -la $ORACLE_HOME/u01
          total 22611
          drwxrwxr-x   2 dbamgr   dba          512 Feb 24 13:08 .
          drwxrwxr-x  43 dba35    dba         1024 Feb 20 23:21 ..
          -rw-rw----   1 dba35    dba       514048 Feb 24 13:05 index_01.dbf
          -rw-rw----   1 dba35    dba       155648 Feb 24 13:05 log1a.rdo
          -rw-rw----   1 dba35    dba       155648 Feb 24 13:18 log2a.rdo
          -rw-rw----   1 dba35    dba       155648 Feb 24 12:55 log3a.rdo
          -rw-rw----   1 dba35    dba     10487808 Feb 24 13:18 system.dbf
          -rw-rw----   1 dba35    dba        12288 Feb 24 13:18 test_01.dbf
          -rw-rw----   1 dba35    dba        53248 Feb 24 13:18 test_02.dbf

⑦ Datafile도 삭제

  SVRMGR> !rm $ORACLE_HOME/u01/test_0*
  SVRMGR> !ls -la $ORACLE_HOME/u01
  SVRMGR> shutdown immediate
          Database closed.
          Database dismounted.
          ORACLE instance shut down.
  SVRMGR> exit

          Server Manager complete.

 

 
<SCENARIO 1 : Online Redo Log의 Mirroring>


  SVRMGR> select * from v$log;
  SVRMGR> select * from v$logfile;
  SVRMGR> alter database add logfile member
          '/DBA3/DBA/dba숫자/u02//log그룹번호b.rdo’to 그룹번호;
          -> 각 그룹마다 멤버의 수를 갖게 미러링한다.

  SVRMGR> select * from v$logfile;

 

 
<SCENARIO 2 : Full Offline Backup 수행>


① database를 shutdown한 상태에서 init/control/data file을 backup 폴더에 copy

① Database를 Startup
  [/DBA3/DBA/dba숫자]svrmgrl
  SVRMGR> connect internal
  SVRMGR> startup

② Tablespace 정보를 확인(DBA_DATA_FILES, V$DATAFILE)
  SVRMGR> select TABLESPACE_NAME, FILE_NAME
       2> from dba_data_files;  --> memo

③ Log File 정보를 확인(V$LOGFILE)
  SVRMGR> select GROUP#, MEMBER
       2> from v$logfile;       --> memo

④ Control File의 정보를 확인
   (V$CONTROLFILE, V$PARAMETER, init<SID>.ora, SHOW PARAMETER command)

⑤ Control File의 이름은 $ORACLE_HOME/dbs에서 Parameter File로 확인
  SVRMGR> host more $ORACLE_HOME/dbs/initDBA숫자.ora  --> memo

⑥ System이 정상인지 확인 (Row들을 Insert)
  SVRMGR> ! more $ORACLE_HOME/labs/more_emp.sql
  SVRMGR> @?/labs/more_emp

* Full Offline Backup 수행

⑦ Database Shutdown
  SVRMGR> shutdown immediate
  SVRMGR> exit

⑧ File들을 Backup
  [/DBA3/DBA/dba숫자] cp -rp u0* backup
  [/DBA3/DBA/dba숫자] cp dbs/initDBA*.ora backup
  [/DBA3/DBA/dba숫자] cp dbs/cntrlDBA*.ctl backup

⑨ backup에 가서 확인
  [/DBA3/DBA/dba숫자] cd backup
  [/DBA3/DBA/dba숫자] ls -la

 


 
<SCENARIO 3 : Recovery - Temporary Tablespace의 유실>


1) 정상적인 업무를 수행

- Database를 기동

  SVRMGR> connect internal
  SVRMGR> startup
  SVRMGR> select tablespace_name, file_name from dba_data_files;
          --> Temporary Tablespace의 Data File 경로명을 확인
  SVRMGR> !ls -la /DBA3/DBA/dba숫자/u04/temp_01.dbf      --> 크기 확인

2) Failure를 만든다.

   SVRMGR> shutdown abort          --> Failure를 상상
   SVRMGR> exit
   [/DBA3/DBA/dba숫자]cd $ORACLE_HOME/u04
   [/DBA3/DBA/dba숫자/u04]mv temp_01.dbf temp_01.org    --> Temporary Tablespace의 유실

   SVRMGR> connect internal
   SVRMGR> startup mount
   SVRMGR> alter database open;
           alter database open
                    *
           ORA-01157: cannot identify data file 4 - file not found
           ORA-01110: data file 4: '/DBA3/DBA/dba숫자/u04/temp_01.dbf'

3) Recovery 수행

- Temporary Tablespace라면 Drop하고 새로 만들면 될껄?

   SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u04/temp_01.dbf' offline drop;
           Statement processed.         --> Temporary Tablespace를 포기하고 Startup
   SVRMGR> alter database open;
           Stateent processed.
   SVRMGR> select * from dba_tablespaces;
           --> "Temp" Tablespace는 그래도 존재
           --> 왜냐면 Temp Tablespace의 구성 File 중 하나를 Drop한 것 뿐이니까.
               (여기선 우연히 하나였다)
   SVRMGR> drop tablespace temp including contents;     --> 이젠 새로 만들면 끝
   SVRMGR> create tablespace temp
        2> datafile '/DBA3/DBA/dba숫자/u04/temp_01.dbf' size 1M;
   SVRMGR> shutdown immediate               --> Shutdown과 Startup을 해봐서 잘 되는지 확인
   SVRMGR> startup
   SVRMGR> shutdown immediate
   SVRMGR> exit

   [/DBA3/DBA/dba숫자/u04]rm temp_01.org    --> 필요 없는 File을 삭제
   [/DBA3/DBA/dba숫자/u04]cd

 

 
<SCENARIO 4 : Noarchive Log Mode Recovery - Disk의 유실>


1) Failure를 가정하고 Recovery 수행

- 모든 File들을 Restore하려는 데, "users_01.dbf"를 원래 위치에 Restore 할 수가 없다.
  따라서, 할 수 없이 $ORACLE_HOME에 Restore 한다.
  [/DBA3/DBA/dba숫자] cd backup
  [/DBA3/DBA/dba숫자/backup] ls
      cntrlDBA숫자.ctl  u01 &nbsp;         u03
      initDBA숫자.ora   u02 &nbsp;         u04

  [/DBA3/DBA/dba숫자/backup] cp -rp u0* $ORACLE_HOME
  [/DBA3/DBA/dba숫자/backup] cp initDBA숫자.ora $ORACLE_HOME/dbs
  [/DBA3/DBA/dba숫자/backup] cp cntrlDBA숫자.ctl $ORACLE_HOME/dbs
  [/DBA3/DBA/dba숫자/backup] cd $ORACLE_HOME/u03
  [/DBA3/DBA/dba숫자/u03]ls
      query_01.dbf  rbs_01.dbf    users_01.dbf

  [/DBA3/DBA/dba숫자/u03] mv users_01.dbf $ORACLE_HOME
                          --> users_01.dbf 이 다른 곳으로 이사 갔다.

  [/DBA3/DBA/dba숫자/u03] cd
  [/DBA3/DBA/dba숫자] ls -la users*

2) Startup 시도

  SVRMGR> connect internal
  SVRMGR> startup mount
  SVRMGR> alter database open;
          alter database open
              *
          ORA-01157: cannot identify data file 3 - file not found
          ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'
  SVRMGR> select name from v$datafile;

                      NAME
          ----------------------------------------------------------
          /DBA3/DBA/dba숫자/u01/system.dbf
          /DBA3/DBA/dba숫자/u03/rbs_01.dbf
          /DBA3/DBA/dba숫자/u03/users_01.dbf
          /DBA3/DBA/dba숫자/u04/temp_01.dbf
          /DBA3/DBA/dba숫자/u03/query_01.dbf
          /DBA3/DBA/dba숫자/u01/index_01.dbf
          6 rows selected.

          --> Oracle Server는 File이 다른 곳($ORACLE_HOME)에 있다는 것을 모르네.

3) 그럼 내가 가르쳐 주지.

  SVRMGR> alter database rename file '/DBA3/DBA/dba숫자/u03/users_01.dbf'
       2> to '/DBA3/DBA/dba숫자/users_01.dbf';

4) 다시 Open 시도

  SVRMGR> alter database open;   --> 성공!!!
  SVRMGR> shutdown immediate
  SVRMGR> startup                --> 한번 더 확인

5) 원래 상태로 만들자.

  SVRMGR> shutdown immediate
  SVRMGR> exit

  [/DBA3/DBA/dba숫자]rm users_01.dbf
  [/DBA3/DBA/dba숫자]cd backup
  [/DBA3/DBA/dba숫자/backup]cp -rp u0* $ORACLE_HOME
  [/DBA3/DBA/dba숫자/backup]cp initDBA숫자.ora $ORACLE_HOME/dbs
  [/DBA3/DBA/dba숫자/backup]cp cntrlDBA숫자.ctl $ORACLE_HOME/dbs
  [/DBA3/DBA/dba숫자/backup]cd
  [/DBA3/DBA/dba숫자]svrmgrl

  SVRMGR> connect internal
  SVRMGR> startup                --> 괜히 확인
  SVRMGR> shutdown
  SVRMGR> exit

 

 
<SCENARIO 5 : Read Only Tablespace의 Backup & Recovery>


1) 정상적인 업무를 수행

   SVRMGR> connect internal
   SVRMGR> startup
   SVRMGR> @?/labs/more_emp

2) Read Only Tablespace의 Backup
   - Online/Offline 상태, 즉 DB가 사용중이던지 사용중이 아니던지 관계없이 Copy

   SVRMGR> !cp  u03/query_01.dbf  $ORACLE_HOME

3) Failure를 만든다
   - 업무 수행 중에 query_01.dbf  File이 삭제되었다

   SVRMGR> @?/labs/more_emp
   SVRMGR> !rm  u03/query_01.dbf
   SVRMGR> select * from scott.new_dept;
           ORA-01116: error in opening database file 5
           ORA-01110: data file 5: '/DBA3/DBA/dba숫자/u03/query_01.dbf'
           ORA-07368: sfofi: open error, unable to open database file.
           SVR4 Error: 2: No such file or directory

4) Recovery 시작
   - Online/Offline 상태, 즉 DB가 사용중이던지 사용중이 아니던지 관계없이 Copy

   SVRMGR> !cp  $ORACLE_HOME/query_01.dbf  u03
   SVRMGR> select * from scott.new_dept;   --> 이게 Recovery 전부...
   SVRMGR> shutdown
   SVRMGR> exit

 

 
< SCENARIO 6 :DATABASE의 BACKUP - Control File Mirroring & Archive log mode >


1) Control File을 Mirroring하여 Database를 StartUp

  - parameter File을 보고 현재의 "control_files=?????"를 확인
    [/DBA3/DBA/dba숫자] more dbs/initDBA숫자.ora

  - Control File을 복사
    [/DBA3/DBA/dba숫자] cp dbs/cntrlDBA숫자.ctl u01
    [/DBA3/DBA/dba숫자] cp dbs/cntrlDBA숫자.ctl u02

  - 추가된 Control File들을 init<SID>.ora File에 등록
    [/DBA3/DBA/dba숫자] vi dbs/initDBA숫자.ora
    (수정) control_files=($ORACLE_HOME/dbs/cntrlDBA숫자.ctl,
                          $ORACLE_HOME/u01/cntrlDBA숫자.ctl,
                          $ORACLE_HOME/u02/cntrlDBA숫자.ctl)
     :wq

  - Database를 Startup
    SVRMGR> connect internal
    SVRMGR> startup

2) Database를 Archive Log Mode로 운영

  - 현재 Archive Log Mode를 확인
    SVRMGR> select * from v$logfile;       --> On-Line Redo Log File들 확인
    SVRMGR> archive log list               --> No Archive Mode 확인

  - Archive Log Mode로 전환 & Parameter 수정
    SVRMGR>shutdown immediate
    SVRMGR>host
    [/DBA3/DBA/dba숫자]vi dbs/initDBA숫자.ora
    (수정) log_archive_start  = true
           log_archive_dest   = $ORACLE_HOME/arch
           log_archive_format = _%s.arc
     :wq

    [/DBA3/DBA/dba숫자]exit
    SVRMGR>startup mount                    --> 반드시 Mount로 StartUp 해야 함
    SVRMGR>alter database archivelog;       --> Mode 변경
    SVRMGR>archive log list                 --> Archive Mode 확인,
                                            --> Current Log 번호 기억
    SVRMGR>alter database open;             --> 현재 Mount이므로

3) Documentation을 위한 정보 탐색

  - Tablespace 정보
    SVRMGR> select  TABLESPACE_NAME, FILE_NAME, v$datafile.STATUS, ENABLED
         2>   from  dba_data_files, v$datafile
         3>  where  FILE_ID = FILE#;

  - Log File 정보
    SVRMGR> select  v$logfile.MEMBER, v$logfile.GROUP#, v$log.STATUS, BYTES
         2>   from  v$logfile, v$log
         3>  where  v$logfile.GROUP# = v$log.GROUP#;

  - Control File 정보
    SVRMGR> select * from v$controlfile;

  - 각종 Parameter 정보
    SVRMGR> show parameter log
    SVRMGR> show parameter db_block
    SVRMGR> show parameter dump

4) System이 정상인지 확인

  - Row들을 Insert
    SVRMGR> host more $ORACLE_HOME/labs/more_emp.sql
    SVRMGR> @?/labs/more_emp

  - Archived Log File이 만들어 지는 지 확인
    SVRMGR> host ls -la $ORACLE_HOME/*.arc      --> Log File 존재 확인
    SVRMGR> archive log list                    --> Current Log 번호 증가 확인

5) Full Offline Backup 수행

  - Database Shutdown
    SVRMGR> shutdown immediate
    SVRMGR> exit

  - File들을 Backup (만일을 위해서 두 번 Backup)
    [/DBA3/DBA/dba숫자] cp -rp u0* dontouch
    [/DBA3/DBA/dba숫자] cp dbs/init*.ora dontouch
    [/DBA3/DBA/dba숫자] cp dbs/cntrl*.ctl dontouch
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp dbs/init*.ora backup
    [/DBA3/DBA/dba숫자] cp dbs/cntrl*.ctl backup

  - 확인
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 7 : Complete Recovery - User의 DATA FILE 유실>


1) 정상적인 업무를 수행

  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc                --> 현재의 Archived Log File 확인
    SVRMGR> !more labs/more_emp.sql      --> "scott" user의 "s_emp" table에 Row를 Insert/Update 하는 Script
    SVRMGR> @?/labs/more_emp
    SVRMGR> exit
   [/DBA3/DBA/dba숫자] ls -la *.arc      --> Archived Log File 생성 확인

2) Failure를 만든다.

    [/DBA3/DBA/dba숫자] ls u03           --> "USERS" Tablespace를 구성하는 File 확인
    [/DBA3/DBA/dba숫자] rm u03/users_01.dbf   --> FIle 삭제
    [/DBA3/DBA/dba숫자] ls u03

    SVRMGR> connect internal
    SVRMGR> shutdown immediate           --> Error 발생 & 실패
    SVRMGR> shutdown abort
    SVRMGR> exit

3) Recovery 시작

① 예전에 받은 Full Backup으로부터 손상된 Data File을 Restore
    [/DBA3/DBA/dba숫자] cd backup/u03
    [/DBA3/DBA/dba숫자/backup/u03] ls -la
    [/DBA3/DBA/dba숫자/backup/u03] cp users_01.dbf $ORACLE_HOME/u03

  - Recovery를 수행

② SVRMGR> startup
    --> Error와 함께 Mount까지만 수행
    --> Recovery를 위해선 " Startup Mount " 하는게 정상
    Database mounted.
    ORA-01113: file 3 needs media recovery
    ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'

③ SVRMGR> recover database
    ORA-00279: Change 7474 generated at 04/24/97 22:52:31 needed for thread 1
    ORA-00289: Suggestion : /DBA3/DBA/dba27/arch_256.arc
    ORA-00280: Change 7474 for thread 1 is in sequence #256
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}  --> 여러번 "Enter"를 눌러야 함
    Media recovery complete.

④ SVRMGR> alter database open;
    --> 현재가 "Mount" 상태이므로

4) System이 정상적으로 복구 되었는지 확인
   SVRMGR> select count(*) from scott.s_emp; --> 정상적으로 수행 됨
   SVRMGR> shutdown immediate                --> 정상적으로 수행 됨
   SVRMGR> exit

 

 
<SCENARIO 8 : Complete Recovery - Tablespace Recovery>


1) 정상적인 업무를 수행

  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc                    --> 현재의 Archived Log File 확인
    SVRMGL> @?/labs/more_emp
    SVRMGR> exit
    [/DBA3/DBA/dba숫자]ls -la *.arc          --> Archived Log File 생성 확인

2) Failure를 만든다.

    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03                  --> "USERS" Tablespace를 구성하는 File 확인
    [/DBA3/DBA/dba숫자] rm $ORACLE_HOME/u03/users_01.dbf     --> FIle 삭제
    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03

    SVRMGR> connect internal
    SVRMGR> shutdown immediate               --> Error 발생 & 실패
    SVRMGR> shutdown abort
    SVRMGR> exit

3) Recovery 시작

  - 예전에 받은 Full Backup으로부터 손상된 Data File을 Restore
    [/DBA3/DBA/dba숫자] cd backup/u03
    [/DBA3/DBA/dba숫자/backup/u03] ls -la
    [/DBA3/DBA/dba숫자/backup/u03] cp users_01.dbf $ORACLE_HOME/u03

  - Recovery를 수행
    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> alter database open;                       --> Error
          ORA-01113: file 3 needs media recovery
          ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'
    SVRMGR> select FILE#, STATUS, NAME from v$datafile;
    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf' offline;
    SVRMGR> select FILE#, STATUS, NAME from v$datafile;
    SVRMGR> alter database open;
    SVRMGR> select TABLESPACE_NAME, STATUS from dba_tablespaces;
    SVRMGR> alter tablespace user_data offline immediate;
    SVRMGR> select TABLESPACE_NAME, STATUS from dba_tablespaces;
    SVRMGR> recover tablespace user_data
          ORA-00279: Change 7220 generated at 02/24/97 23:51:30 needed for thread 1
          ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_219.arc
          ORA-00280: Change 7220 for thread 1 is in sequence #219
          Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
          auto        -                               --> 입력하자

    SVRMGR> alter tablespace user_data online;
    SVRMGR> select count(*) from scott.s_emp;           --> 정상적으로 수행 됨
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 9 : Complete Recovery - Datafile Recovery>


1) 정상적인 업무를 수행

  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc                --> 현재의 Archived Log File 확인
    SVRMGR> @?/labs/more_emp
    SVRMGR> exit
    [/DBA3/DBA/dba숫자]ls -la *.arc      --> Archived Log File 생성 확인

2) Failure를 만든다.
    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03       --> "USERS" Tablespace를 구성하는 File 확인
    [/DBA3/DBA/dba숫자] rm $ORACLE_HOME/u03/users_01.dbf     --> FIle 삭제
    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03

    SVRMGR> connect  internal
    SVRMGR> shutdown immediate           --> Error 발생 & 실패
    SVRMGR> shutdown abort
    SVRMGR> exit

3) Recovery 시작


① 예전에 받은 Full Backup으로부터 손상된 Data File을 Restore
    [/DBA3/DBA/dba숫자] cd backup/u03
    [/DBA3/DBA/dba숫자/backup/u03] ls -la
    [/DBA3/DBA/dba숫자/backup/u03] cp users_01.dbf $ORACLE_HOME/u03

  - Recovery를 수행
    SVRMGR> connect internal

② startup mount

③ SVRMGR> alter database open;
     ORA-01113: file 3 needs media recovery
     ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'

④ SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf' offline;
⑤ SVRMGR> alter database open;
⑥ SVRMGR> recover datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf'
     ORA-00279: Change 7220 generated at 02/24/97 23:51:30 needed for thread 1
     ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_219.arc
     ORA-00280: Change 7220 for thread 1 is in sequence #219
     Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
     "Return key"를 여러번 누르거나, "auto"를 입력하자

⑦ SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf' online;
    SVRMGR> select count(*) from scott.s_emp;       --> 정상적으로 수행 됨
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 10 : Parallel Recovery>


1) Parallel 환경 setup
  - parameter file을 수정하여 parallel 환경을 만든다.
    Parallel_min_servers = 2
    Parallel_max_servers = 4
    Recovery_parallelism = 4

  - DB를 다시 기동한 후 background process들 (p000, p001) 을 확인한다.
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> host ps -ef | grep <SID>
    SVRMGR> select count(*) from scott.s_emp;
    SVRMGR> shutdown immediate

2) user_data tablespace를 backup받고 DB 기동후, 정상적인 업무를 수행
    [/DBA3/DBA/dba숫자]cp u03/users_01.dbf u03/users_01.bak

    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp  -----> row들을 insert

3) Failure를 만든다.

    SVRMGR> shutdown immediate
    SVRMGR> host rm $ORACLE_HOME/u03/users_01.dbf

4) DB 복구 작업

  - backup 받은 file을 restore 시킨 후, Database를 mount 시킨다.
    SVRMGR> !mv u03/users_01.bak u03/users_01.dbf
    SVRMGR> startup mount
    SVRMGR> alter database open
           ORA-01113: file 3 needs media recovery
           ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'

  - DB parallel recovery 후 DB open
    SVRMGR> set autorecovery on
    SVRMGR> recover database parallel (degree 4)
            ......
            Media recovery complete.
    SVRMGR> alter database open

5) System이 정상인지 확인

    SVRMGR> select count(*) from scott.s_emp;
    SVRMGR> !ps -ef | grep <SID>    ---->  p002, p003 확인 (<- degree 4)

- 5분 이상 경과 후, p002, p003이 존재하는지 확인한다.
    SVRMGR> !ps -ef | grep <SID>
    SVRMGR> shutdown immediate
    SVRMGR> exit
 


 
<SCENARIO 11 : Complete Recovery - Shutdown 하지 않고 Data File만 Recovery>


1) 정상적인 업무를 수행

  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc              --> 현재의 Archived Log File 확인
    SVRMGR> @?/labs/more_emp
    SVRMGR> exit
    [/DBA3/DBA/dba숫자] ls -la *.arc    --> Archived Log File 생성 확인

2) Failure를 만든다.
    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03               --> "USERS" Tablespace를 구성하는 File 확인
    [/DBA3/DBA/dba숫자] rm $ORACLE_HOME/u03/users_01.dbf  --> FIle 삭제
    [/DBA3/DBA/dba숫자] ls $ORACLE_HOME/u03

    SVRMGR> connect internal
    SVRMGR> select * from scott.s_dept;
                 ID               NAME           REGION_ID
            ---------- ------------------------- ----------
            ORA-01116: error in opening database file 3
            ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'
            ORA-07368: sfofi: open error, unable to open database file.
            SVR4 Error: 2: No such file or directory

3) Recovery 시작


① 예전에 받은 Full Backup으로부터 손상된 Data File을 Restore
    [/DBA3/DBA/dba숫자] cd backup/u03
    [/DBA3/DBA/dba숫자/backup/u03] ls -la
    [/DBA3/DBA/dba숫자/backup/u03] cp users_01.dbf $ORACLE_HOME/u03

  - Recovery를 수행
    SVRMGR> connect internal
    SVRMGR> alter database datafile  '/DBA3/DBA/dba숫자/u03/users_01.dbf' offline;

    SVRMGR> recover datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf'
        ORA-00279: Change 7220 generated at 02/24/97 23:51:30 needed for thread 1
        ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_219.arc
        ORA-00280: Change 7220 for thread 1 is in sequence #219
        Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
        "Return key"를 여러번 누르거나, "auto"를 입력하자

    SVRMGR> alter database datafile  '/DBA3/DBA/dba숫자/u03/users_01.dbf' online;

    SVRMGR> select count(*) from scott.s_emp;      --> 정상적으로 수행 됨
    SVRMGR> select * from scott.s_dept;            --> 정상적으로 수행 됨

    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 12 : Online Backup (Hot Backup)>


1) 정상적인 업무를 수행
  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc          --> 현재의 Archived Log File 확인
    SVRMGR> @?/labs/more_emp
    SVRMGR> !ls -la *.arc          --> Archived Log File 생성 확인

2) Online Backup

 ① Data File들의 Online Backup : datafile별로 backup받는다.
    SVRMGR> select tablespace_name, file_name from dba_data_files;
    SVRMGR> select status, enabled, name from v$datafile;
             --> enabled가 "READ ONLY" Tablespace는 Online Backup시에 제외
    SVRMGR> !mkdir $ORACLE_HOME/online_backup

SVRMGR> alter tablespace system begin backup;
SVRMGR> !cp u01/system.dbf online_backup
SVRMGR> alter tablespace system end backup;
    SVRMGR> alter tablespace rbs begin backup;
    SVRMGR> !cp  u03/rbs_01.dbf  online_backup
    SVRMGR> alter tablespace rbs end backup;

    SVRMGR> alter tablespace user_data begin backup;
    SVRMGR> !cp  u03/users_01.dbf  online_backup
    SVRMGR> alter tablespace user_data end backup;

    SVRMGR> alter tablespace temp begin backup;
    SVRMGR> !cp  u04/temp_01.dbf  online_backup
    SVRMGR> alter tablespace temp end backup;

    SVRMGR> alter tablespace user_index begin backup;
    SVRMGR> !cp  u01/index_01.dbf  online_backup
    SVRMGR> alter tablespace user_index end backup;

SVRMGR> alter system switch logfile;
 ② Read-only Tablespace Backup
    Read-only Tablespace는 예전 Backup에 이미 Copy되어 있으므로 다시 수행할 필요가 없다.
    그래도 꼭 하겠다면 "alter tablespace ...begin/end backup" 없이 수행
    에이, 말 나온 김에 한번 해보자......
    SVRMGR> !cp  u03/query_01.dbf  online_backup

 ③ Control File의 Online Backup

SVRMGR> alter database backup controlfile to
 '$ORACLE_HOME/online_backup/backup_control.ctl' reuse;
SVRMGR> alter database backup controlfile to trace;
 ④ Parameter File의 Backup
    SVRMGR> !cp  dbs/initDBA숫자.ora  online_backup
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 13 : Online Backup 실패후 Recovery - Online Backup 도중에 정전>


1) 정상적인 업무를 수행
  - Database를 기동 & 업무 수행
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp

2) Online Backup
  - Data File들의 Online Backup
    SVRMGR> alter tablespace user_data begin backup;
    SVRMGR> !cp  u03/users_01.dbf  online_backup
    SVRMGR> shutdown abort       --> 정전 사태 발생
    SVRMGR> exit

    [/DBA3/DBA/dba숫자] svrmgrl  --> 다시 전원이 들어와서 DB를 살리려고 시도
    SVRMGR> connect internal
    SVRMGR> startup
          ORA-01113: file 3 needs media recovery
          ORA-01110: data file 3: '/DBA3/DBA/dba숫자/u03/users_01.dbf'
                     --> 어?  이상하다....아하!  이것쯤이야..

    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/users_01.dbf' end backup;
    SVRMGR> alter database open;
    SVRMGR> --> Online Backup을 다시 받으면 된다
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 14 : Incomplete Recovery - 실수로 Drop한 Table의 복구>


1) 정상적인 업무를 수행

  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp

2) Failure를 만든다.
    SVRMGR> !date                                       --> 현재의 시간을 기억해야 함
    SVRMGR> drop table scott.s_emp cascade constraints; --> 실수로 Drop 하였다고 가정
    SVRMGR> select * from scott.s_emp;
            select * from scott.s_emp
                   *
          ERROR at line 1:
          ORA-00942: table or view does not exist  --> 이제와서 후회

3) Recovery 수행

  - 예전에 받은 Full Backup으로부터 Data File들을 Restore
    SVRMGR> shutdown immediate
    SVRMGR> exit

    [/DBA3/DBA/dba숫자] cd backup
    [/DBA3/DBA/dba숫자/backup] ls
    [/DBA3/DBA/dba숫자/backup] cp u01/*.dbf $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/backup] cp u03/*.dbf $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/backup] cp u04/*.dbf $ORACLE_HOME/u04

  - Incomplete Recovery 수행
    SVRMGR> connect internal
    SVRMGR> startup mount

① SVRMGR> set autorecovery on
② SVRMGR> recover database until time '1997-01-23:16:44:47'
--> 앞에서 기억한 시간이어야 함
③ SVRMGR> alter database open resetlogs; --> Incomplete Recovery 이니까 "resetlogs"로 Open
④ SVRMGR> archive log list --> Log Sequence 번호가 Reset되었음
    SVRMGR> select * from scott.s_emp;     --> Drop 되었던 "s_emp" Table이 다시 살아났다.
    SVRMGR> shutdown immediate
    SVRMGR> exit

 ⑤ Log Sequence 번호가 Reset 되었으니까 Off-Line Full Backup 수행
    [/DBA3/DBA/dba숫자/backup] cd $ORACLE_HOME
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp dbs/cntrl*.ctl backup
    [/DBA3/DBA/dba숫자] cp dbs/init*.ora backup

  - 더 이상 필요 없는 File들을 삭제
    [/DBA3/DBA/dba숫자] rm *.arc
    [/DBA3/DBA/dba숫자] ls

 

 
<SCENARIO 15 : Inactive Online Redo Log Group의 유실>


1) 정상적인 업무를 수행
  SVRMGR> connect / as sysdba   --> connect internal과 같음
  SVRMGR> startup
  SVRMGR> @?/labs/more_emp

2) Failure를 만든다.

  - Inactive Online Redo Log Group을 유실
    SVRMGR> select v$logfile.member from v$logfile where group# =
            ( select min(v$log.group#) from v$log where status = 'INACTIVE');

                                   MEMBER
           ------------------------------------------------------------
              /DBA3/DBA/dba숫자/u01/log2a.rdo    --> 예를 들어서...라면
              /DBA3/DBA/dba숫자/u02/log2b.rdo
              2 rows selected.

    SVRMGR> !ls u01 u02
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/log2a.rdo
    SVRMGR> !rm /DBA3/DBA/dba숫자/u02/log2b.rdo
    SVRMGR> !ls u01 u02

  - Database가 비정상적으로 수행됨을 확인
    SVRMGR> connect / as sysdba
    SVRMGR> @more_emp            --> Online Redo Log FIle의 유실로 인해 Error 발생
    SVRMGR> shutdown immediate   --> shutdown 실패 (Server Process가 죽었다)
    SVRMGR> exit                 --> exit 했다가 다시 들어가자.

3) Recovery 시작

    SVRMGR> connect / as sysdba
    SVRMGR> shutdown abort
    SVRMGR> startup                                     --> Mount까지만 수행됨
    SVRMGR> select * from v$logfile;                    --> Log FIle의 유실이 반영되지 않았음을 확인
    SVRMGR> alter database backup controlfile to trace; --> 그냥 습관적으로
    SVRMGR> alter database drop logfile group 그룹번호; --> Log FIle의 유실을 반영
    SVRMGR> select * from v$logfile;                    --> Log FIle의 유실이 반영되었음을 확인
    SVRMGR> alter database add logfile group 그룹번호
         2>  '/DBA3/DBA/dba숫자/u01/log그룹번호a.rdo' size 150k;
             --> 유실된 Online Redo Log Group의 첫번째 Member를 생성

    SVRMGR> alter database add logfile member '/DBA3/DBA/dba숫자/u02/log그룹번호b.rdo' to group 그룹번호;
            --> 복구된 Online Redo Log Group의 두번째 Member를 생성
    SVRMGR> select * from v$logfile;                     --> Log File들이 생성되었는지 확인
                                                         --> Invalid는 나중에 없어지니까 놀라지 마세요.
    SVRMGR> alter database open;                         --> Database를 Open

4) System이 정상적으로 복구 되었는지 확인

    SVRMGR> @more_emp
    SVRMGR> select * from v$logfile;   --> 음, Invalid가 없어졌구나.
    SVRMGR> shutdown immediate
    SVRMGR> startup                    --> startup도 제대로 되는구나.
    SVRMGR> shutdown immediate
    SVRMGR> exit
    [/DBA3/DBA/dba26/labs] cd

 

 
<SCENARIO 16 : Current Online Redo Log Group의 유실>


1) 정상적인 업무를 수행
  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp
    SVRMGR> !ls -la *.arc

2) Failure를 만든다.
  - Current Online Redo Log Group을 유실
    SVRMGR> select v$logfile.member from v$logfile where group# =
            ( select min(v$log.group#) from v$log where status = 'CURRENT');
                   MEMBER
           ----------------------------------------------------------------
            /DBA3/DBA/dba숫자/u01/log1a.rdo           --> 예를 들어 ...라면
            /DBA3/DBA/dba숫자/u02/log1b.rdo
              2 rows selected.

    SVRMGR> !ls u01 u02
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/log1a.rdo
    SVRMGR> !rm /DBA3/DBA/dba숫자/u02/log1b.rdo
    SVRMGR> !ls u01 u02

  - Database가 비정상적으로 수행됨을 확인
    SVRMGR> @?/labs/more_emp       --> Online Redo Log FIle의 유실로 인해 Error 발생
                                   --> 무한정 대기하게 된다. Why?
                                   --> "Ctrl-C"를 두번 눌러서 강제 종료
    SVRMGR> shutdown immediate

3) Recovery 시작

  - 유실된 Redo Log Group을 제거하고 재생성함으로써 해결할려고 시도
    SVRMGR> startup     --> Redo Log Group이 유실 되었음을 알리며 Error 발생
                        --> Log Group 번호 확인할 것
                        --> Mount까지만 수행된다

    SVRMGR> alter database drop logfile group 그룹번호;
                        --> 유실된 Redo Log Group을 제거 시도
                        --> Archive되지 않은 Current Log이므로 Error와 함께 실패
                        --> (참고) ORA-00350: log 그룹번호 of thread 1 needs to be archived

  SVRMGR> shutdown immediate
  SVRMGR> exit

  - Alert File, Trace File 확인
    [/DBA3/DBA/dba숫자/labs] cd $ORACLE_HOME/trace
    [/DBA3/DBA/dba숫자/trace] ls
    [/DBA3/DBA/dba숫자/trace] vi alert_DBA숫자.log
                                 --> Archiving을 실패한 기록과 Sequence 번호 확인

    [/DBA3/DBA/dba숫자/trace] more arch_번호.trc
                                 --> 기록되지 않은 Log File의 Sequence 번호 확인
                                 --> (예)ORA-00255: error archiving log 1 of thread 1, sequence # 15
                                 --> Incomplete Recovery 방법으로 복구
                                 --> 예를 들어 sequence # 15번이라면 Incomplete Recovery시
                                     15번 에서 "Cancel" 을 입력할거다.

  - 예전에 받은 Full Backup으로부터 Data File들을 Restore
    [/DBA3/DBA/dba숫자/trace]cd $ORACLE_HOME/backup
    [/DBA3/DBA/dba숫자/backup]cp u01/*.dbf $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/backup]cp u03/*.dbf $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/backup]cp u04/*.dbf $ORACLE_HOME/u04

  - Incomplete Recovery 수행
    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> recover database until cancel
              "cancel" 입력
            --> 계속 "Enter"를 누르다가 15번 에서 "Cancel" 을 입력

    SVRMGR> alter database open resetlogs;
            --> Incomplete Recovery 이니까 "resetlogs"로 Open
            --> 이때 유실된 Log File이 자동으로 만들어 진다

    SVRMGR> archive log list     --> Log Sequence 번호가 Reset되었음
    SVRMGR> shutdown immediate
    SVRMGR> exit

  - Log Sequence 번호가 Reset 되었으니까 Off-Line Full Backup 수행
    [/DBA3/DBA/dba숫자/backup]cd $ORACLE_HOME
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp dbs/cntrl*.ctl backup
    [/DBA3/DBA/dba숫자] cp dbs/init*.ora backup

  - 더 이상 필요 없는 File들을 삭제
    [/DBA3/DBA/dba숫자] cd trace
    [/DBA3/DBA/dba숫자/trace] rm *.trc        --> Trace File들 삭제
    [/DBA3/DBA/dba숫자/trace]rm alert*.log    --> Alert Log File 삭제
    [/DBA3/DBA/dba숫자/trace]cd $ORACLE_HOME
    [/DBA3/DBA/dba숫자]rm *.arc               --> Archived Redo Log File들 삭제
    [/DBA3/DBA/dba숫자]ls -la *.arc           --> File들 삭제 확인

4) System이 정상적으로 복구 되었는지 확인
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp    --> 음, 잘 되는 군
    SVRMGR> !ls -la *.arc       --> 새로운 Archived Redo Log File들이 만들어 지는 지 확인
    SVRMGR> shutdown immediate
    SVRMGR> exit

 


 
<SCENARIO 17 : 모든 Online Redo Log Group의 유실>


1) 정상적인 업무를 수행
  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp
    SVRMGR> !ls -la *.arc

2) Failure를 만든다.

  - 모든 Online Redo Log Group을 유실
    SVRMGR> !ls u01 u02
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/log*.rdo
    SVRMGR> !rm /DBA3/DBA/dba숫자/u02/log*.rdo

  - Database가 비정상적으로 수행됨을 확인
    SVRMGR> @?/labs/more_emp                --> Online Redo Log FIle의 유실로 인해 Error 발생
    SVRMGR> !ps -ef|grep dba숫자|sort|more  --> Background Precess들과 Server Process들이 죽었다

3) Recovery 시작

  - 앞에서 배운 꽁수로 해결해 보자
    SVRMGR> shutdown immediate  --> shutdown 실패 (Process들이 죽었으니까)
    SVRMGR> shutdown abort      --> shutdown 실패 (Process들이 죽었으니까)
    SVRMGR> exit                --> exit 했다가 다시 들어가자.

    SVRMGR> connect internal
    SVRMGR> shutdown immediate
            ORA-01012: not logged on
    SVRMGR> shutdown abort
            ORACLE instance shut down.
    SVRMGR> startup
          ORA-00313: open failed for members of log group 3 of thread 1
          ORA-00312: online log 3 thread 1: '/DBA3/DBA/dba숫자/u02/log3a.rdo'
          ORA-07360: sfifi: stat error, unable to obtain information about file.
          .............
    SVRMGR> recover database until cancel;
          ORA-00279: Change 8064 generated at 01/20/98 13:02:09 needed for thread 1
          ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_9.arc
          ORA-00280: Change 8064 for thread 1 is in sequence #9
          Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
                  "cancel" 입력
          Media recovery cancelled.
    SVRMGR> alter database open resetlogs;
            alter database open resetlogs
                       *
          ORA-01194: file 1 needs more recovery to be consistent
          ORA-01110: data file 1: '/DBA3/DBA/dba숫자/u01/system.dbf'
          --> 앗! 어더레케 된거야? .....꽁수가 안 통하잖아?
              ??? 할 수 없다. 정식으로 한번 해 보자.
    SVRMGR> exit

  - 정상적인 Incomplete Recovery 수행
    [/DBA3/DBA/dba숫자] cd $ORACLE_HOME/backup
    [/DBA3/DBA/dba숫자/backup] cp u01/*.dbf $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/backup] cp u03/*.dbf $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/backup] cp u04/*.dbf $ORACLE_HOME/u04

    SVRMGR> connect internal
    SVRMGR> archive log list
          Database log mode              Archive Mode
          Automatic archival             Enabled
          Archive destination            /DBA3/DBA/dba숫자/arch
          Oldest online log sequence     4
          Next log sequence to archive   5
          Current log sequence           5
          --> 예를 들어 "Next log sequence to archive   5" 번이라면
          Incomplete Recovery 시 5번 에서 "Cancel" 을 입력할거다.

    SVRMGR> recover database until cancel
           "cancel" 입력          --> 계속 "Enter"를 누르다가 5번 에서 "Cancel" 을 입력
    SVRMGR> alter database open resetlogs;
    SVRMGR> archive log list

  - Log Sequence 번호가 Reset 되었으니까 Offline Full Backup 수행
    SVRMGR> shutdown immediate
    SVRMGR> exit
    [/DBA3/DBA/dba숫자/backup] cd $ORACLE_HOME
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp -p dbs/cntrl*.ctl backup
    [/DBA3/DBA/dba숫자] cp -p dbs/init*.ora backup

  - 더 이상 필요 없는 File들을 삭제
    [/DBA3/DBA/dba숫자] rm *.arc   --> Archived Redo Log File들 삭제

4) System이 정상적으로 복구 되었는지 확인

    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp   --> 음, 잘 되는 군
    SVRMGR> !ls -la *.arc      --> 새로운 Archived Redo Log File들이 만들어 지는 지 확인
    SVRMGR> shutdown immediate
    SVRMGR> exit

 

 
<SCENARIO 18 : 모든 Redo Log & Data File 유실>


1) 정상적인 업무를 수행
  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> @?/labs/more_emp
    SVRMGR> !ls -la *.arc

2) Failure를 만든다.
  - 모든 Online Redo Log Group을 유실
    SVRMGR> !ls u01 u02
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/log*.rdo
    SVRMGR> !rm /DBA3/DBA/dba숫자/u02/log*.rdo

  - datafile을 유실
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/system.dbf
    SVRMGR> !rm /DBA3/DBA/dba숫자/u01/index_01.dbf

  - 정전까지 되었다고 가정
    SVRMGR> shutdown abort

3) Recovery 시작
  - Incomplete Recovery 수행
    SVRMGR> exit
    [/DBA3/DBA/dba숫자] cd $ORACLE_HOME/backup
    [/DBA3/DBA/dba숫자/backup] cp u01/*.dbf $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/backup] cp u03/*.dbf $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/backup] cp u04/*.dbf $ORACLE_HOME/u04

    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> archive log list
            Database log mode              Archive Mode
            Automatic archival             Enabled
            Archive destination            /DBA3/DBA/dba숫자/arch
            Oldest online log sequence     3
            Next log sequence to archive   5
            Current log sequence           5
            --> 예를 들어 "Next log sequence to archive   5" 번이라면
            Incomplete Recovery 시 5번 에서 "Cancel" 을 입력할거다.
    SVRMGR> recover database until cancel
             "cancel" 입력          --> 계속 "Enter"를 누르다가 5번 에서 "Cancel" 을 입력
    SVRMGR> alter database open resetlogs;

  - Log Sequence 번호가 Reset 되었으니까 Offline Full Backup 수행
    SVRMGR> shutdown immediate
    SVRMGR> exit
    [/DBA3/DBA/dba숫자/backup] cd $ORACLE_HOME
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp -p dbs/cntrl*.ctl backup
    [/DBA3/DBA/dba숫자] cp -p dbs/init*.ora backup

  - 더 이상 필요 없는 File들을 삭제
    [/DBA3/DBA/dba숫자] rm *.arc   --> Archived Redo Log File들 삭제

4) System이 정상적으로 복구 되었는지 확인
   SVRMGR> connect internal
   SVRMGR> startup
   SVRMGR> @?/labs/more_emp    --> 음, 잘 되는 군
   SVRMGR> !ls -la *.arc       --> 새로운 Archived Redo Log File들이 만들어 지는 지 확인
   SVRMGR> shutdown immediate
   SVRMGR> exit

 

 
<SCENARIO 19 : Control File Recreate>


1) 정상적인 업무 중 Control File Creation Script를 생성
  SVRMGR> connect internal
  SVRMGR> startup
  SVRMGR> !ps -ef|grep dba숫자|sort  --> 현재 Server Process의 번호 확인
  SVRMGR> alter database backup controlfile to trace;
  SVRMGR> !

  $ cd $ORACLE_HOME/trace
  $ ls
  $ cp ora_프로세서번호.trc control.sql

2) Control File들을 모두 삭제
   $ rm $ORACLE_HOME/dbs/cntrlDBA숫자.ctl
   $ rm $ORACLE_HOME/u01/cntrlDBA숫자.ctl
   $ rm $ORACLE_HOME/u02/cntrlDBA숫자.ctl
   $ exit

   SVRMGR> shutdown immediate
   SVRMGR> startup
          ORA-00205: error identifying controlfile '$ORACLE_HOME/dbs/cntrlDBA숫자.ctl'
          ORA-07360: sfifi: stat error, unable to obtain information about file.
   SVR4 Error: 2: No such file or directory
   SVRMGR> shutdown
   SVRMGR> exit

3) Control File을 새로 생성

   [/DBA3/DBA/dba숫자]cd trace
   [/DBA3/DBA/dba숫자/trace]ls
   [/DBA3/DBA/dba숫자/trace]vi control.sql  --> "STARTUP NOMOUNT" 앞까지 모두 삭제
                                            --> "RECOVER DATABASE" 삭제
   SVRMGR> connect internal
   SVRMGR> @control.sql
   SVRMGR> !ls $ORACLE_HOME/dbs
   SVRMGR> !ls $ORACLE_HOME/u01
   SVRMGR> !ls $ORACLE_HOME/u02

4) 정상인지 확인

   SVRMGR> @?/labs/more_emp
   SVRMGR> !ls $ORACLE_HOME
   SVRMGR> shutdown immediate
   SVRMGR> exit
   [/DBA3/DBA/dba숫자/trace] cd
   [/DBA3/DBA/dba숫자]


 
<SCENARIO 20 : 모든 Control File 유실>


* 이번의 시나리오는 Database의 Mode(Archive/Noarchive)에 관계 없이 모두 가능

1) 정상적인 업무를 수행
   SVRMGR> connect internal
   SVRMGR> startup
   SVRMGR> @?/labs/more_emp
   SVRMGR> !ls *.arc

2) Failure를 만든다.

- Control File을 모두 삭제
  SVRMGR> !rm dbs/*.ctl u01/*.ctl u02/*.ctl
  SVRMGR> shutdown abort     --> 꽥! (사망하시는 소리)
  SVRMGR> exit

3) Recovery 시작
  [/DBA3/DBA/dba숫자]cp backup/cntrlDBA숫자.ctl  dbs
  [/DBA3/DBA/dba숫자]cp backup/cntrlDBA숫자.ctl  u01
  [/DBA3/DBA/dba숫자]cp backup/cntrlDBA숫자.ctl  u02

  SVRMGR> connect internal
  SVRMGR> startup mount
  SVRMGR> recover database using backup controlfile
  ORA-00283: Recovery session canceled due to errors
  ORA-01233: file 5 is read only - cannot recover using backup controlfile
  ORA-01110: data file 5: '/DBA3/DBA/dba숫자/u03/query_01.dbf'
  --> read only File이 있으면 반드시 offline시켜야 한다

  SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/query_01.dbf' offline;
  SVRMGR> recover database using backup controlfile
  ORA-00279: Change 8050 generated at 01/20/98 15:22:26 needed for thread 1
  ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_5.arc
  ORA-00280: Change 8050 for thread 1 is in sequence #5
  Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
  Online Redo Log File 명을 Full Path로 입력
  (예) /DBA3/DBA/dba숫자/u01/log1a.rdo  --> 입력
  그런데, 특별히 운이 좋지 않다면, 다음의 에러가 난다
  (에러 메시지)
  ORA-00310: archived log contains sequence 4; sequence 5 required
  ORA-00334: archived log: '/DBA3/DBA/dba숫자/u01/log1a.rdo'
  그렇다면, recover와 File명 입력을 다시 시도
  (예)
  SVRMGR> recover database using backup controlfile   --> 다시 수행
  /DBA3/DBA/dba숫자/u01/log2a.rdo     --> 다른 Redo Log File 명 입력
  다음의 메시지를 볼 때까지 다른 Redo Log File에도 수행
  (보여야 하는 메시지)
  Log applied.
  Media recovery complete.        --> 이 메시지가 보이면 성공한 것임

  SVRMGR> alter database open resetlogs;
  SVRMGR> select count(*) from scott.s_emp;   --> 성공이다
  SVRMGR> select * from scott.new_emp;
  ORA-00376: file 5 cannot be read at this time
  ORA-01110: data file 5: '/DBA3/DBA/dba숫자/u03/query_01.dbf'
                 --> 얼라리오? 이상하다?      아하! query_01.dbf이 Offline이지!

  SVRMGR> select * from v$datafile;
          --> 역시 "/DBA3/DBA/dba숫자/u03/query_01.dbf"이 Offline이다.

  SVRMGR> alter tablespace query_data online;
  SVRMGR> select * from v$datafile;
  SVRMGR> select * from scott.new_emp;
  SVRMGR> shutdown
  SVRMGR> exit

3) 반드시 Full Backup 수행

  [/DBA3/DBA/dba숫자]cp -rp u0* backup
  [/DBA3/DBA/dba숫자]cp -p dbs/cntrlDBA숫자.ctl backup
  [/DBA3/DBA/dba숫자]cp -p dbs/initDBA숫자.ora backup
  [/DBA3/DBA/dba숫자]rm *.arc

 

 
<SCENARIO 21 : Control File과 Data File 동시에 유실>


1) 정상적인 업무를 수행
  SVRMGR> connect internal
  SVRMGR> startup
  SVRMGR> @?/labs/more_emp
  SVRMGR> !ls *.arc --> 마지막 File의 번호를 기억
  SVRMGR> exit

2) Failure를 만든다.

  - Control File을 모두 삭제
    [/DBA3/DBA/dba숫자] rm dbs/*.ctl u01/*.ctl u02/*.ctl

  - Data File을 삭제
    [/DBA3/DBA/dba숫자] rm u03/users_01.dbf
    [/DBA3/DBA/dba숫자] svrmgrl
    SVRMGR> connect internal
    SVRMGR> shutdown immediate
           ORA-00210: cannot open control file '/DBA3/DBA/dba숫자/dbs/cntrlDBA숫자.ctl'
    SVRMGR> shutdown abort
    SVRMGR> exit

3) Recovery 시작
    [/DBA3/DBA/dba숫자] cp backup/cntrlDBA숫자.ctl dbs
    [/DBA3/DBA/dba숫자] cp backup/cntrlDBA숫자.ctl u01
    [/DBA3/DBA/dba숫자] cp backup/cntrlDBA숫자.ctl u02
    [/DBA3/DBA/dba숫자] cp backup/u03/users_01.dbf u03
    [/DBA3/DBA/dba숫자] svrmgrl

    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> recover database using backup controlfile
          ORA-00283: Recovery session canceled due to errors
          ORA-01233: file 5 is read only - cannot recover using backup controlfile
          ORA-01110: data file 5: '/DBA3/DBA/dba숫자/u03/query_01.dbf'
                     --> read only File이 있으면 반드시 offline시켜야 한다.

    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/query_01.dbf' offline;
    SVRMGR> recover database using backup controlfile
          ORA-00279: Change 8050 generated at 01/20/98 15:22:26 needed for thread 1
          ORA-00289: Suggestion : /DBA3/DBA/dba숫자/arch_5.arc
          ORA-00280: Change 8050 for thread 1 is in sequence #5
          Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
          앞에서 기억한 마지막 번호까지 "Return" Key를 누르고,
          Online Redo Log File 명을 Full Path로 입력
          (예) /DBA3/DBA/dba숫자/u01/log1a.rdo --> 입력
              그런데, 특별히 운이 좋지 않다면, 다음의 에러가 난다
          (에러 메세지)
          ORA-00310: archived log contains sequence 4; sequence 5 required
          ORA-00334: archived log: '/DBA3/DBA/dba숫자/u01/log1a.rdo'
          그렇다면, recover와 File명 입력을 다시 시도
          (예)
    SVRMGR> recover database using backup controlfile    --> 다시 수행
            /DBA3/DBA/dba숫자/u01/log2a.rdo     --> 다른 offline File 명 입력
            다음의 메시지를 볼 때까지 다른 offline File에도 수행
            (보여야 하는 메시지)
            Log applied.
            Media recovery complete.   --> 이 메시지가 보이면 성공한 것임

    SVRMGR> alter database open resetlogs;
    SVRMGR> select count(*) from scott.s_emp;
    SVRMGR> select * from v$datafile;  --> /DBA3/DBA/dba숫자/u03/query_01.dbf이 Offline이다.
    SVRMGR> alter tablespace query_data online;
    SVRMGR> select * from v$datafile;
    SVRMGR> shutdown
    SVRMGR> startup
    SVRMGR> shutdown
    SVRMGR> exit

3) 반드시 Full Backup 수행
    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp -p dbs/cntrlDBA숫자.ctl backup
    [/DBA3/DBA/dba숫자] cp -p dbs/initDBA숫자.ora backup
    [/DBA3/DBA/dba숫자] rm *.arc

>


 
<SCENARIO 22 : Read Only Tablespace의 상태 변경에 따른 recovery - 1>


control file은 그대로 있고 R/O 가 R/W로 변경되고 그 때 데이터의 변동은 archiving되었다.

1) 정상적인 업무를 수행
  [/DBA3/DBA/dba숫자] svrmgrl
  SVRMGR> connect internal
  SVRMGR> startup

2) Read Only tablespace query_data를 Read Write로 바꾸고 scott가 data를 입력함.
   SVRMGR> alter tablespace query_data read write;
   SVRMGR> select tablespace_name, status from dba_tablespaces;
   SVRMGR> alter user scott quota 1 m on query_data;
   SVRMGR> connect scott/tiger;
   SVRMGR> create table query (id number) tablespace query_data;
   SVRMGR> insert into query select id from s_emp;
   SVRMGR> commit;
   SVRMGR> connect internal;
   SVRMGR> shutdown immediate

3) Failure를 만든다
  - 업무 수행 중에 query_01.dbf  File이 삭제되었다.
    [/DBA3/DBA/dba숫자] rm /DBA3/DBA/dba숫자/u03/query_01.dbf

    SVRMGR> connect internal
    SVRMGR> startup
    SVRMGR> select * from scott.new_dept;
            select * from scott.query
                   *
            ORA-01116: error in opening database file 6
         ORA-01110: data file 6: '/ DBA3/DBA/dba숫자 /u03/query_01.dbf'
         ORA-07368: sfofi: open error, unable to open database file.
         SVR4 Error: 2: No such file or directory
    SVRMGR> shutdown abort;
    SVRMGR> exit

4) Recovery 시작

    [/DBA3/DBA/dba숫자] cp backup/u03/query_01.dbf u03 --> restore backup file
    [/DBA3/DBA/dba숫자] svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup
          ORA-01113: file 6 needs media recovery
          ORA-01110: data file 6: '/ DBA3/DBA/dba숫자 /u03/query_01.dbf'

    SVRMGR> set autorecovery on
    SVRMGR> recover database;
            --> control file에 query_data tablespace가 read write로 되어 있어서
                예전에 read only였던 사실은 중요하지 않다.

    SVRMGR> alter database open;
    SVRMGR> select tablespace_name, status from dba_tablespaces; --> read only 가 아니고 online
    SVRMGR> select * from scott.query;
    SVRMGR> shutdown
    SVRMGR> exit

 

 
<SCENARIO 23 : Read Only Tablespace의 상태 변경에 따른 recovery - 2>


control file은 그대로 있고 R/O 가 R/W로 변경되고 그 때 데이터의 변동은 archiving되었다.
또한 그 중간에 test라는 tablespace를 추가하였다.
Control file이 깨졌는데 R/W로 변화를 가한 후 backup을 받지 않아서 옛날 R/O시절의 control
file을 restore한다면?

1) 정상적인 업무를 수행
  [/DBA3/DBA/dba숫자] svrmgrl
  SVRMGR> connect internal
  SVRMGR> startup

2) 새로운 tablespace를 생성하고 data를 입력한다.
  SVRMGR> create tablespace test datafile '/tmp/t숫자.dbf' size 3 m; --> test tablespace 생성
  SVRMGR> alter user scott quota 1 m on test;
  SVRMGR> connect scott/tiger;
  SVRMGR> create table test (id number) tablespace test;
  SVRMGR> insert into test select id from s_emp;
  SVRMGR> insert into s_emp select * from s_emp; --> 기존에 있었던 tablespace에 작업을 한다.
  SVRMGR> commit;
  SVRMGR> connect internal;
  SVRMGR> select tablespace_name, status from dba_tablespaces;

3) Read Only tablespace query_data를 Read Write로 바꾸고 scott가 data를 입력함.
  SVRMGR> alter tablespace query_data read write;
  SVRMGR> select tablespace_name, status from dba_tablespaces;
  SVRMGR> alter user scott quota 1 m on query_data;
  SVRMGR> connect scott/tiger;
  SVRMGR> create table query (id number) tablespace query_data;
  SVRMGR> insert into query select id from s_emp;
  SVRMGR> commit;
  SVRMGR> connect internal;
  SVRMGR> shutdown immediate

3) Failure를 만든다
  - 업무 수행 중에 query_01.dbf  File이 삭제되었다.
  [/DBA3/DBA/dba숫자] rm /DBA3/DBA/dba숫자/u03/query_01.dbf

  SVRMGR> connect internal
  SVRMGR> startup
          ORA-00205: error in identifying control file '$ORACLE_HOME/dbs/cntrlNDBA15.ctl'
          ORA-07360: sfifi: stat error, unable to obtain information about file.
          SVR4 Error: 2: No such file or directory
  SVRMGR> shutdown abort;
  SVRMGR> exit

4) Recovery 시작

  [/DBA3/DBA/dba숫자]cp backup/dbs/cntrlNDBA숫자.ctl dbs
  [/DBA3/DBA/dba숫자]cp backup /dbs/cntrlNDBA숫자.ctl u01
  [/DBA3/DBA/dba숫자]cp backup /dbs/cntrlNDBA숫자.ctl u02
  [/DBA3/DBA/dba숫자]cp backup /u03/query_01.dbf u03
  [/DBA3/DBA/dba숫자] svrmgrl

  SVRMGR> startup mount
  SVRMGR> recover database using backup controlfile;
          ORA-00283: Recovery session canceled due to errors
          ORA-01233: file 6 is read only - cannot recover using backup controlfile
          ORA-01110: data file 6: '/DBA3/DBA/dba숫자 /u03/query_01.dbf'

  SVRMGR> alter database datafile ‘/DBA3/DBA/dba숫자 /u03/query_01.dbf' offline;

  SVRMGR> recover database using backup controlfile
          ORA-00279: Change 7479 generated at 06/03/98 16:52:00 needed for thread 1
          ORA-00289: Suggestion : /base6/NDBA/ndba15/arch_252.arc
          ORA-00280: Change 7479 for thread 1 is in sequence #252
          Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
          /base6/NDBA/ndba15/u01/log3a.rdo
          Log applied.  --> 이 message가 보일 때까지 계속 recovery 수행.
          Media recovery complete

  SVRMGR> alter database open resetlogs;
  SVRMGR> select * from v$datafile; --> MISSING000x 라는 file이 있다. (t.dbf) --> 왜 이름을 모를까?
  SVRMGR> alter database rename file 'MISSING0008' to '/tmp/t.dbf';
  SVRMGR> alter tablespace test online;
          alter tablespace test online
                 *
          ORA-01190: control file or data file 8 is from before the last RESETLOGS
          ORA-01110: data file 8: '/tmp/t.dbf'

  SVRMGR> alter tablespace query_data online;  --> 안되는 이유는?
          alter tablespace query_data online
                 *
          ORA-01190: control file or data file 6 is from before the last RESETLOGS
          ORA-01110: data file 6: '/base6/NDBA/ndba15/u03/query_01.dbf'

  SVRMGR> select count(*) from scott.s_emp;
  SVRMGR> shutdown
  SVRMGR> exit

 

 
<SCENARIO 24 : Read Only Tablespace의 상태 변경에 따른 recovery - 3>


control file은 그대로 있고 R/O 가 R/W로 변경되고 그 때 데이터의 변동은 archiving되었다.
또한 그 중간에 test라는 tablespace를 추가하였다. Control file이 깨졌는데 R/W로 변화를
가한 후 backup을 이용하면 복구가 가능하다. 항상 control file을 backup.

1) 정상적인 업무를 수행
  [/DBA3/DBA/dba숫자] svrmgrl
  SVRMGR> connect internal
  SVRMGR> startup

2) 새로운 tablespace를 생성하고 data를 입력한다.
  SVRMGR> create tablespace test datafile '/tmp/t숫자.dbf' size 3 m; --> test tablespace 생성
  SVRMGR> alter user scott quota 1 m on test;
  SVRMGR> connect scott/tiger;
  SVRMGR> create table test (id number) tablespace test;
  SVRMGR> insert into test select id from s_emp;
  SVRMGR> insert into s_emp select * from s_emp; --> 기존에 있었던 tablespace에 작업을 한다.
  SVRMGR> commit;
  SVRMGR> connect internal;
  SVRMGR> select tablespace_name, status from dba_tablespaces;

3) Read Only tablespace query_data를 Read Write로 바꾸고 scott가 data를 입력함.
  SVRMGR> alter tablespace query_data read write;
  SVRMGR> select tablespace_name, status from dba_tablespaces;
  SVRMGR> alter user scott quota 1 m on query_data;
  SVRMGR> connect scott/tiger;
  SVRMGR> create table query (id number) tablespace query_data;
  SVRMGR> insert into query select id from s_emp;
  SVRMGR> commit;
  SVRMGR> connect internal;
  SVRMGR> shutdown immediate

  SVRMGR> !ps -ef | grep NDBA15
          ndba15 25748 25747  0 11:38:49 ?        0:03 oracleNDBA15
                 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
          ndba15 25766 25765  2 11:39:26 pts/40   0:00 grep NDBA15
          ndba15 25102     1  6 11:20:43 ?        5:37 oracleNDBA15
                 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

  SVRMGR> !ls $ORACLE_HOME/trace
       alert_NDBA15.log  ora_25748.trc

  SVRMGR> !mv $ORACLE_HOME/trace/ ora_25748.trc /tmp/c.sql
  SVRMGR> !vi /tmp/c.sql
  SVRMGR

3) Failure를 만든다
  - 업무 수행 중에 control File이 삭제되었다.
    [/DBA3/DBA/dba숫자] rm */cntrl*.ctl
    [/DBA3/DBA/dba숫자] svrmgrl

    SVRMGR> connect internal
    SVRMGR> startup
      ORA-00205: error in identifying control file '$ORACLE_HOME/dbs/cntrlNDBA15.ctl'
      ORA-07360: sfifi: stat error, unable to obtain information about file.
      SVR4 Error: 2: No such file or directory

    SVRMGR> shutdown abort;
    SVRMGR> shutdown abort;

4) Recovery 시작

  SVRMGR> @/tmp/c.sql
  SVRMGR> select count(*) from scott.s_emp;
  SVRMGR> shutdown
  SVRMGR> exit

 

 
<SCENARIO 25 : Recovery from Online Backup - Data File, Control File 유실>


1) 정상적인 업무를 수행
  - Database를 기동
    [/DBA3/DBA/dba숫자] svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> @?/labs/more_emp
    SVRMGR> !ls -la *.arc      --> 마지막 번호 기억

2) Failure를 만든다.
  - Data file, Control file 삭제
    SVRMGR> shutdown abort
    SVRMGR> exit
    [/DBA3/DBA/dba숫자] rm u01/system.dbf  u03/rbs_01.dbf
    [/DBA3/DBA/dba숫자] rm dbs/*.ctl  u01/*.ctl  u02/*.ctl

3) Recovery 시작
  - Data file, Control file Restore
    [/DBA3/DBA/dba숫자] cd online_backup
    [/DBA3/DBA/dba숫자/online_backup] ls
    [/DBA3/DBA/dba숫자/online_backup] cp system.dbf  $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/online_backup] cp rbs_01.dbf  $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/dbs/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/u01/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/u02/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cd

    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/query_01.dbf' offline;
    SVRMGR> recover database using backup controlfile
            Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
            앞에서 기억한 마지막 번호까지 "Return" Key를 누르고,
            Online Redo Log File 명을 Full Path로 입력
            (예)  /DBA3/DBA/dba숫자/u01/log1a.rdo --> 입력
            Error가 나면, recover와 다른 Online Redo Log File명을 다시 입력
            Media recovery complete.    --> 이 메세지가 보이면 성공한 것임

    SVRMGR> alter database open resetlogs;
    SVRMGR> alter tablespace query_data online;
    SVRMGR> select count(*) from scott.s_emp;
    SVRMGR> shutdown
    SVRMGR> exit

4) 반드시 Full Backup 해야 함.

    [/DBA3/DBA/dba숫자] cp -rp u0* backup
    [/DBA3/DBA/dba숫자] cp -p dbs/cntrlDBA숫자.ctl backup
    [/DBA3/DBA/dba숫자] cp -p dbs/initDBA숫자.ora backup
    [/DBA3/DBA/dba숫자] rm *.arc

 

 
<SCENARIO 26 : Recovery from Online Backup - File들 모두가 사라졌다.
게다가, Archived Redo Log File의 일부가 없고, Data File Backup도 일부 없다.>


0) 바로 앞의 실습(SCENARIO 15번)을 하였다면 Redo Log가 Reset 되었으므로
    Online Backup을 다시 받고 나서 아래의 과정으로 실습하여야 한다.
    Online Backup은 <시나리오12>의 실습 참고.

1) 정상적인 업무를 수행
  - Database를 기동
    SVRMGR> connect internal
    SVRMGR> startup

  - 업무 수행 & Archived Log File 확인
    SVRMGR> !ls -la *.arc    --> 현재의 Archived Log File 확인
    SVRMGR> @?/labs/more_emp

2) Failure를 만든다.
  - Database의 모든 Data file들, 모든 Control file들, 모든 Online Redo Log file들,
    Parameter file 즉, 몽조리 사라졌다. 난리 났다.

    SVRMGR> shutdown abort
    SVRMGR> exit
    [/DBA3/DBA/dba숫자] rm  u01/*  u02/*  u03/*  u04/*  dbs/*.ctl

3) Recovery 시작
  - 게다가 Archived Redo Log File 마지막 2개도 사라졌다.
    [/DBA3/DBA/dba숫자] ls *.arc
    [/DBA3/DBA/dba숫자] rm -i *.arc   --> 알아서 마지막 2개 삭제
    [/DBA3/DBA/dba숫자] ls *.arc      --> 존재하는 마지막 File의 번호를 기억

  - File들을 Restore한다. 그런데 index_01.dbf File의 Backup이 사라졌다. 기절하시겠다.
    [/DBA3/DBA/dba숫자] cd online_backup
    [/DBA3/DBA/dba숫자/online_backup] ls
    [/DBA3/DBA/dba숫자/online_backup] cp initDBA숫자.ora  $ORACLE_HOME/dbs
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/dbs/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/u01/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cp backup_control.ctl  $ORACLE_HOME/u02/cntrlDBA숫자.ctl
    [/DBA3/DBA/dba숫자/online_backup] cp system.dbf  $ORACLE_HOME/u01
    [/DBA3/DBA/dba숫자/online_backup] cp query_01.dbf  rbs_01.dbf  users_01.dbf  $ORACLE_HOME/u03
    [/DBA3/DBA/dba숫자/online_backup] cp temp_01.dbf  $ORACLE_HOME/u04
    [/DBA3/DBA/dba숫자/online_backup] cd

  - Online Redo Log file이 없으니까 Incomplete Recovery 수행
    [/DBA3/DBA/dba숫자]svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup mount
    SVRMGR> recover database using backup controlfile until cancel
          ORA-00283: Recovery session canceled due to errors
          ORA-01233: file 5 is read only - cannot recover using backup controlfile
          ORA-01110: data file 5: '/DBA3/DBA/dba숫자/u03/query_01.dbf'

    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u03/query_01.dbf' offline;

    SVRMGR> recover database using backup controlfile until cancel
          ORA-00283: Recovery session canceled due to errors
          ORA-01157: cannot identify data file 6 - file not found
          ORA-01110: data file 6: '/DBA3/DBA/dba숫자/u01/index_01.dbf'

    SVRMGR> alter database datafile '/DBA3/DBA/dba숫자/u01/index_01.dbf' offline;

    SVRMGR> recover database using backup controlfile until cancel
            Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
                cancel       --> 마지막 Log 번호까지 처리하고 나서 "cancel" 입력
            Media recovery cancelled.
    SVRMGR> alter database open resetlogs;
    SVRMGR> select * from v$datafile;
    SVRMGR> alter tablespace query_data online;
    SVRMGR> select * from dba_tablespaces;
    SVRMGR> drop tablespace user_index; --> Backup 자체가 존재하지 않으므로 포기하는 수 밖에 없다.
    SVRMGR> create tablespace user_index
             datafile '/DBA3/DBA/dba숫자/u01/index_01.dbf' size 500k;
    SVRMGR> select count(*) from scott.s_emp;
    SVRMGR> shutdown
    SVRMGR> exit

4) 반드시 Full Backup 해야 함.

    [/DBA3/DBA/dba숫자]cp -rp u0* backup
    [/DBA3/DBA/dba숫자]cp -p dbs/cntrlDBA숫자.ctl backup
    [/DBA3/DBA/dba숫자]cp -p dbs/initDBA숫자.ora backup
    [/DBA3/DBA/dba숫자]rm *.arc

 

 
<SCENARIO 27 : Recover with No Backup>


1) 정상적인 업무
  [/DBA3/DBA/dba숫자]svrmgrl
  SVRMGR> connect internal
  SVRMGR> startup
  SVRMGR> @?/labs/more_emp
  SVRMGR> !ls *.arc
  SVRMGR> create tablespace new_data
                 datafile '$ORACLE_HOME/u04/new_data.dbf' size 500k reuse ;
  SVRMGR> create table scott.new_data tablespace new_data
              as select * from scott.s_emp;
  SVRMGR> @?/labs/more_emp

2) Failure

  SVRMGR> shutdown abort
  SVRMGR> exit
  [/DBA3/DBA/dba숫자] ls -la $ORACLE_HOME/u04
  [/DBA3/DBA/dba숫자] rm $ORACLE_HOME/u04/new_data.dbf
  [/DBA3/DBA/dba숫자] ls -la $ORACLE_HOME/u04

3) Recovery

   [/DBA3/DBA/dba숫자] svrmgrl
   SVRMGR> connect internal
   SVRMGR> startup
          ORA-01157: cannot identify data file 7 - file not found
       ORA-01110: data file 7: '/DBA3/DBA/dbapjw/u04/new_data.dbf'
   SVRMGR> alter  database
           create datafile '/DBA3/DBA/dba숫자/u04/new_data.dbf';
   SVRMGR> !ls -la $ORACLE_HOME/u04
   SVRMGR> recover datafile '/DBA3/DBA/dba숫자/u04/new_data.dbf'
                auto 입력
   SVRMGR> alter database open;

4) 확인

   SVRMGR> select count(*) from scott.new_data;

5) 원상 복구

  SVRMGR> drop tablespace new_data including contents;
  SVRMGR> !rm /DBA3/DBA/dba숫자/u04/new_data.dbf
  SVRMGR> shutdown
  SVRMGR> exit

 

 
<SCENARIO 28 : Incremental export 와 direct path >


  $ sqlplus scott/tiger
  SQL> SELECT COUNT(1) FROM s_emp;
       COUNT(1)
      ----------
          44
  SQL> exit

  $ exp userid=sys/change_on_install full=y file=Comp001.dmp inctype=complete

  $ sqlplus system/manager
  SQL> @?/labs/more_emp
  SQL> exit

  $exp userid=sys/change_on_install full=y file=Inc002.dmp inctype=incremental

  $ sqlplus system/manager
  SQL> @?/labs/more_emp
  $ exp userid=sys/change_on_install full=y file=Inc003.dmp inctype=incremental

  $ sqlplus system/manager
  SQL> @?/labs/more_emp
  $ exp userid=sys/change_on_install full=y file=Cum004.dmp inctype=cumulative

  $ sqlplus system/manager
  SQL> @?/labs/more_emp
  $ exp userid=sys/change_on_install full=y file=Inc005.dmp inctype=incremental

  $ sqlplus scott/tiger
  SQL> select count(1) from s_emp;
  SQL> drop table s_emp;

  $ imp userid=sys/change_on_install full=y file=Comp001.dmp ignore=y
  $ imp userid=sys/change_on_install full=y file=Cum004.dmp ignore=y
  $ imp userid=sys/change_on_install full=y file=Inc005.dmp ignore=y

  $ sqlplus scott/tiger
  SQL> select count(1) from s_emp;
  $
  $

     *********************************************************
     **               Direct mode Export Test               **
     *********************************************************
  $
  $
  $vi direct.sh
  date > Dstart
  exp userid=scott/tiger table=s_emp file=direct.dmp direct=y
  date > Dend
  $vi conv.sh
  date > Cstart
  exp userid=scott/tiger table=s_emp file=conv.dmp direct=n
  date > Cend

 

 
<SCENARIO 29 : standby database 생성>


  PRIMARY DB part
  Script started on Tue Jan 20 19:53:46 1998

  $ pwd
    /disk2/inst/parkjy/oracle

  $ set | grep ORACLE
    ORACLE_HOME=/disk2/inst/parkjy/oracle
    ORACLE_SID=KELLOGG

  $ svrmgrl
    Oracle Server Manager Release 2.3.2.0.0 - Production
    Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
    O racle7 Server Release 7.3.2.1.0 - Production Release
    With the distributed and parallel query options
    PL/SQL Release 2.3.2.0.0 - Production

  SVRMGR> connect internal
    Connected.

  SVRMGR> @/tmp/more_emp;
          Statement processed.
          Statement processed.
           4 rows processed.
          Statement processed.
          Statement processed.
           4 rows processed.
          Statement processed.
          Statement processed.
           4 rows processed.
          Statement processed.
          Statement processed.
          Statement processed.
           44 rows processed.
          Statement processed.
          Statement processed.

          COUNT(*)
          ----------
             44

          1 row selected.

  SVRMGR> shutdown;
          Database closed.
          Database dismounted.
          ORACLE instance shut down.

  SVRMGR> exit
          Server Manager complete.
  $ pwd
    /disk2/inst/parkjy/oracle
  $ tar cvf dbf.tar u0?/*

  seek = 0K       a u01/system.dbf 10242K
  seek = 10243K   a u02/log1a.rdo 152K
  seek = 10395K   a u02/log1c.rdo 152K
  seek = 10548K   a u02/log1d.rdo 152K
  seek = 10700K   a u02/log2a.rdo 152K
  seek = 10853K   a u02/log3a.rdo 152K
  seek = 11005K   a u03/log1b.rdo 152K
  seek = 11158K   a u03/log2b.rdo 152K
  seek = 11310K   a u03/log3b.rdo 152K
  seek = 11463K   a u04/rbs_01.dbf 1026K
  seek = 12489K   a u05/users_01.dbf 5122K
  seek = 17612K   a u06/index_01.dbf 502K
  seek = 18114K   a u07/temp_01.dbf 1026K
  seek = 19141K   a u08/query_01.dbf 502K

  $ ftp krnile3
    Connected to krnile3.kr.oracle.com.
    220 krnile3 FTP server (UNIX(r) System V Release 4.0) ready.
    Name (krnile3:parkjy):
    331 Password required for parkjy.
    Password:
    230 User parkjy logged in.

  ftp> bin
       200 Type set to I.
  ftp> put dbf.tar
       200 PORT command successful.
       150 Binary data connection for dbf.tar (152.69.16.52,1842).
       226 Transfer complete.
       local: dbf.tar remote: dbf.tar
       20116480 bytes sent in 20 seconds (9.6e+02 Kbytes/s)

  ftp> pwd
       257 "/disk2/inst/parkjy" is current directory.
  ftp> quit
       221 Goodbye.

  $ svrmgrl
    Oracle Server Manager Release 2.3.2.0.0 - Production
    Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
    Oracle7 Server Release 7.3.2.1.0 - Production Release
    With the distributed and parallel query options
    PL/SQL Release 2.3.2.0.0 - Production

  SVRMGR> connect internal
          Connected to an idle instance.
  SVRMGR> startup
          ORACLE instance started.
          Total System Global Area       2113588 bytes
          Fixed Size                       40436 bytes
          Variable Size                  1860160 bytes
          Database Buffers                204800 bytes
          Redo Buffers                      8192 bytes
          Database mounted.
          Database opened.

  SVRMGR> alter database create standby controlfile as '/tmp/stnb.ctl';
          Statement processed.

  SVRMGR> alter system archive log current;
          Statement processed.

  SVRMGR> archive log list;
          Database log mode              Archive Mode
          Automatic archival             Enabled
          Archive destination            /disk2/inst/parkjy/oracle/arch/arc
          Oldest online log sequence     35
          Next log sequence to archive   37
          Current log sequence           37

  SVRMGR> shutdown;
          Database closed.
          Database dismounted.
          ORACLE instance shut down.
  SVRMGR> exit
          Server Manager complete.

  $ cd /tmp
  $ ftp krnile3
    Connected to krnile3.kr.oracle.com.
    220 krnile3 FTP server (UNIX(r) System V Release 4.0) ready.
    Name (krnile3:parkjy):
    331 Password required for parkjy.
    Password:
    230 User parkjy logged in.

  ftp> bin
    200 Type set to I.
    ftp> put stnb.ctl
    200 PORT command successful.
    150 Binary data connection for stnb.ctl (152.69.16.52,1851).
    226 Transfer complete.
    local: stnb.ctl remote: stnb.ctl
    145408 bytes sent in 0.1 seconds (1.4e+03 Kbytes/s)
  ftp> pwd
    257 "/disk2/inst/parkjy" is current directory.
  ftp> quit
    221 Goodbye.

  $ cd
  $ cd oracle/arch
  $ ls
    arc_1.arc    arc_16.arc   arc_22.arc   arc_29.arc   arc_35.arc   arc_6.arc
    arc_10.arc   arc_17.arc   arc_23.arc   arc_3.arc    arc_36.arc   arc_7.arc
    arc_11.arc   arc_18.arc   arc_24.arc   arc_30.arc   arc_4.arc    arc_8.arc
    arc_12.arc   arc_19.arc   arc_25.arc   arc_31.arc   arc_5.arc    arc_9.arc
    arc_13.arc   arc_2.arc    arc_26.arc   arc_32.arc   arc_514.arc
    arc_14.arc   arc_20.arc   arc_27.arc   arc_33.arc   arc_515.arc
    arc_15.arc   arc_21.arc   arc_28.arc   arc_34.arc   arc_516.arc

  $ r ftp krnile3
    Connected to krnile3.kr.oracle.com.
    220 krnile3 FTP server (UNIX(r) System V Release 4.0) ready.
    Name (krnile3:parkjy):
    331 Password required for parkjy.
    Password:
    230 User parkjy logged in.

  ftp> bin
    200 Type set to I.

  ftp> put arc_36.arc
    200 PORT command successful.
    150 Binary data connection for arc_36.arc (152.69.16.52,1854).
    226 Transfer complete.
    local: arc_36.arc remote: arc_36.arc
    14336 bytes sent in 0 seconds (14 Kbytes/s)
  ftp> quit
    221 Goodbye.

    STANDBY DB Part
    Script started on Tue Jan 20 18:56:25 1998
  $ pwd
    /disk2/inst/parkjy
  $ set | grep ORACLE
    ORACLE_HOME=/disk2/inst/parkjy/oracle
    ORACLE_SID=KELLOGG

  $ ls
    C++          TEST         arc_36.arc   dbf.tar      oracle       work
    PROC         WEB          arch         dbs_standby  stnb.ctl

  $ mv arc_36.* orace le/arch
  $ mv stnb.ctl oracle/dbs/cntrlKELLOGG.ctl
  $ ls oracle/dbs
    cntrlKELLOG.ctl   create_db.sql     log1KELLOGG.dbf   s2.ctl
    cntrlKELLOGG.bak  dbs1KELLOGG.dbf   log2KELLOGG.dbf   sql.bsq
    cntrlKELLOGG.ctl  destroydb         mkdb              standby.ctl
    create_db.sh      initKELLOGG.ora   s.ctl

  $ mv dbf.tar oracle
  $ cd oracle
  $ tar xvf dbf.. tar
    x u01/system.dbf, 10487808 bytes, 10242K
    x u02/log1a.rdo, 155648 bytes, 152K
    x u02/log1c.rdo, 155648 bytes, 152K
    x u02/log1d.rdo, 155648 bytes, 152K
    x u02/log2a.rdo, 155648 bytes, 152K
    x u02/log3a.rdo, 155648 bytes, 152K
    x u03/log1b.rdo, 155648 bytes, 152K
    x u03/log2b.rdo, 155648 bytes, 152K
    x u03/log3b.rdo, 155648 bytes, 152K
    x u04/rbs_01.dbf, 1050624 bytes, 1026K
    x u05/users_01.dbf, 5244928 bytes, 5122K
    x u06/index_01.dbf, 514048 bytes, 502K
    x u07/temp_01.dbf, 1050624 bytes, 1026K
    x u08/query_01.dbf, 514048 bytes, 502K

  $ svrmgrl
    Oracle Server Manager Release 2.1.4.0.0 - Production
    Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
    Oracle7 Server Release 7.3.2.1.0 - Production Release
    With the distributed and parallel query options
    PL/SQL Release 2.3.2.0.0 - Production

  SVRMGR> connect internal
    Connected to an idle instance.

  SVRMGR> startup nomount
    ORACLE instance started.
    Total System Global Area       2113588 bytes
    Fixed Size                       40436 bytes
    Variable Size                  1860160 bytes
    Database Buffers                204800 bytes
    Redo Buffers                      8192 bytes

  SVRMGR> alter database mount standby database;
    Statement processed.

  SVRMGR> recover standby database;
    ORA-00279: Change 9735 generated at 01/20/98 19:54:43 needed for thread 1
    ORA-00289: Suggestion : /disk2/inst/parkjy/oracle/arch/arc_36.arc
    ORA-00280: Change 9735 for thread 1 is in sequence #36
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    Log applied.

    ORA-00279: Change 9743 generated at 01/20/98 19:57:41 needed for thread 1
    ORA-00289: Suggestion : /disk2/inst/parkjy/oracle/arch/arc_37.arc
    ORA-00280: Change 9743 for thread 1 is in sequence #37
    ORA-00278: Logfile '/disk2/inst/parkjy/oracle/arch/arc_36.arc' no longer needed for this recovery
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

    cancel;
    Media recovery cancelled.

  SVRMGR> alter database activate standby database;
    Statement processed.

  SVRMGR> shutdown;
    sORA-01507: database not mounted
    Database dismounted.
    ORACLE instance shut down.

  SVGMGR> startup
  SVRMGR> ORACLE instance started.
    Total System Global Area       2113588 bytes
    Fixed Size                       40436 bytes
    Variable Size                  1860160 bytes
    Database Buffers                204800 bytes
    Redo Buffers                      8192 bytes
    Database mounted.
    Database opened.

  SVRMGR> select count(*)
       2> from d s_emp.scott           scott.s_emp;

          COUNT(*)
         ----------
            44
         1 row selected.

  SVRMGR> shutdown;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
  SVRMGR> exit
    Server Manager complete

 

 
<SCENARIO 30 : Catalog DB를 이용한 복구 Oracle8 >


Part I.

1. Try starting the rman program.
   What happens and why?

$ rman
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06009: using target database controlfile instead of recovery catalog

RMAN>
Recovery manager connects to your database expecting no recovery
catalog. All information is retrieved from the controlfile.

2. Disconnect from the recovery manager.
   Connect to the recovery catalog using dbaXX/dbaXX@DBA16 as connect string.
   You should connect to your targeted database as internal/admin@DBAXX.
   XX is your account number.
   Do not specify a log file that way all messages will be written to
   your screen.

$ rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\"
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06008: connected to recovery catalog database
RMAN>

3. Register your database with the recovery catalog.
RMAN> register database;
RMAN-08006: database registered in recovery catalog
RMAN-08002: starting full resync of recovery catalog
RMAN-08029: snapshot controlfile name set to default value: ?/dbs/snapcf_@.f
RMAN-08004: full resync complete
RMAN>

4. List the incarnation of the database.
RMAN> list incarnation of database;
RMAN-06240: List of Database Incarnations
RMAN-06241: DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
RMAN-06242: ------- ------- -------- ---------------- --- ---------- -------
RMAN-06243: 1       2       DBA15    4045670789       YES 1          18-FEB-97
RMAN>

5. Try to do a resync of the recovery catalog.
RMAN> resync catalog;
RMAN-08002: starting full resync of recovery catalog
RMAN-08004: full resync complete
RMAN>

6. Exit the recovery manager and reconnect directing your output to a logfile.
rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\" \
> msglog=\"rmanDBA15.log\"

7. Try to do a resync one more time.
RMAN> resync catalog;
RMAN>

8. Exit and investigate your logfile.
RMAN> exit

$ cat rmanDBA15.log
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06008: connected to recovery catalog database

RMAN> resync catalog;
RMAN-08002: starting full resync of recovery catalog
RMAN-08004: full resync complete

RMAN> exit
Recovery Manager complete.


Part II.

1. Investigate the script cre_back.rman
   Change "YOUR_PATH" to contain your HOME directory
   (Can be displayed using pwd from the unix prompt)

$ cat cre_back.rman
create script back_db_full {
allocate channel d1 type disk;
backup full filesperset 4
(database include current controlfile
 format "/YOUR_PATH/BACK/back_DBA15_full.%s.%p");
release channel d1;}

2. Connect to the recovery catalog database and use your database
   as the targeted database.
   Create and run the backup script
   What happens and why ?
   Note that Recovery Manager does not accept the @script as svrmgr or
   sqlplus, so you either have to cut and paste or type it in.

$ rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\"
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06008: connected to recovery catalog database

RMAN> create script back_db_full {

2> allocate channel d1 type disk;
3> backup full filesperset 4
4> (database include current controlfile
5> format "/users/dba15/BACK/back_DBA15_full.%s.%p");
6> release channel d1;}
RMAN-08085: created script back_db_full
RMAN> run { execute script back_db_full;}
RMAN-08030: allocated channel: d1
RMAN-08500: channel d1: sid=9 devtype=DISK
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=17 set_stamp=296089196
RMAN-03007: exception occurred during execution, error is retryable
RMAN-07004: unhandled exception during command execution on channel d1
RMAN-10032: unhandled exception during execution of job step 1: ORA-06512: at line 57
RMAN-10035: exception raised in RPC: ORA-19624: operation failed, retry possible
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 312
RMAN-10031: ORA-19624 occurred during call to X$DBMS_BACKUP_RESTORE.BACKUPDATAFILE

This happens because your database is running in NOARCHIVELOG mode and a backup
from recovery manager can only be performed with the database in mounted state.

3. Shutdown your database and restart it in mount mode.
   Rerun your script.

RMAN> exit;
Recovery Manager complete.

$ svrmgrl
Oracle Server Manager Release 3.0.2.0.0 - Beta
Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
Oracle8 Server Release 8.0.2.0.0 - Beta
With the distributed, heterogeneous, replication, objects,
parallel query and Spatial Data options
PL/SQL Release 3.0.2.0.0 - Beta

SVRMGR> connect internal
Connected.

SVRMGR> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.

SVRMGR> startup mount pfile=initDBA15.ora
ORACLE instance started.
Total System Global Area       4635056 bytes
Fixed Size                       43724 bytes
Variable Size                  4116196 bytes
Database Buffers                409600 bytes
Redo Buffers                     65536 bytes
Database mounted.

SVRMGR> exit
Server Manager complete.

$ rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\"
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06008: connected to recovery catalog database
RMAN> run { execute script back_db_full;}
RMAN-08030: allocated channel: d1
RMAN-08500: channel d1: sid=8 devtype=DISK
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=18 set_stamp=296089658
RMAN-08010: channel d1: including datafile number 1 in backupset
RMAN-08010: channel d1: including datafile number 2 in backupset
RMAN-08010: channel d1: including datafile number 3 in backupset
RMAN-08010: channel d1: including datafile number 4 in backupset
RMAN-08013: channel d1: piece 1 created
RMAN-08503: piece handle=/users/dba15/BACK/back_DBA15_full.18.1 comment=NONE
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=19 set_stamp=296089694
RMAN-08010: channel d1: including datafile number 5 in backupset
RMAN-08010: channel d1: including datafile number 6 in backupset
RMAN-08010: channel d1: including datafile number 7 in backupset
RMAN-08010: channel d1: including datafile number 8 in backupset
RMAN-08013: channel d1: piece 1 created
RMAN-08503: piece handle=/users/dba15/BACK/back_DBA15_full.19.1 comment=NONE
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=20 set_stamp=296089706
RMAN-08010: channel d1: including datafile number 9 in backupset
RMAN-08010: channel d1: including datafile number 10 in backupset
RMAN-08010: channel d1: including datafile number 11 in backupset
RMAN-08010: channel d1: including datafile number 12 in backupset
RMAN-08013: channel d1: piece 1 created
RMAN-08503: piece handle=/users/dba15/BACK/back_DBA15_full.20.1 comment=NONE
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=21 set_stamp=296089717
RMAN-08010: channel d1: including datafile number 13 in backupset
RMAN-08010: channel d1: including datafile number 14 in backupset
RMAN-08010: channel d1: including datafile number 15 in backupset
RMAN-08010: channel d1: including datafile number 16 in backupset
RMAN-08013: channel d1: piece 1 created
RMAN-08503: piece handle=/users/dba15/BACK/back_DBA15_full.21.1 comment=NONE
RMAN-08008: channel d1: started datafile backupset
RMAN-08502: set_count=22 set_stamp=296089723
RMAN-08010: channel d1: including datafile number 17 in backupset
RMAN-08010: channel d1: including datafile number 18 in backupset
RMAN-08010: channel d1: including datafile number 19 in backupset
RMAN-08011: channel d1: including current controlfile in backupset
RMAN-08013: channel d1: piece 1 created
RMAN-08503: piece handle=/users/dba15/BACK/back_DBA15_full.22.1 comment=NONE
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN-08031: released channel: d1
RMAN>

4. Startup the database and force some log switches using
   the alter system switch logfile command.

svrmgrl
Oracle Server Manager Release 3.0.2.0.0 - Beta
Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
Oracle8 Server Release 8.0.2.0.0 - Beta
With the distributed, heterogeneous, replication, objects,
parallel query and Spatial Data options
PL/SQL Release 3.0.2.0.0 - Beta

SVRMGR> connect internal
Connected.

SVRMGR> alter database open;
Statement processed.

SVRMGR> alter system switch logfile;
Statement processed.

SVRMGR> alter system switch logfile;
Statement processed.

SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR>

5. Shutdown your database and remove the datafiles, all the logfiles  and
   all the controlfiles.

SVRMGR> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> exit
Server Manager complete.

$ rm *.dbf *.ctl *.log

6. Investigate the script cre_rec.rman
   Change "YOUR_PATH" to contain your HOME directory
   (Can be displayed using pwd from the unix prompt)

$ cat cre_rec.rman
create script rec_db_full{
allocate channel d1 type disk;
restore controlfile to "/YOUR_PATH/control1.ctl";
restore database;
release channel d1;}

7. Startup your instance.
$ svrmgrl
Oracle Server Manager Release 3.0.2.0.0 - Beta
Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
Oracle8 Server Release 8.0.2.0.0 - Beta
With the distributed, heterogeneous, replication, objects,
parallel query and Spatial Data options
PL/SQL Release 3.0.2.0.0 - Beta

SVRMGR> connect internal
Connected.

SVRMGR> startup nomount pfile=initDBA15.ora
ORACLE instance started.
Total System Global Area       4635056 bytes
Fixed Size                       43724 bytes
Variable Size                  4116196 bytes
Database Buffers                409600 bytes
Redo Buffers                     65536 bytes
SVRMGR> exit
Server Manager complete.

8. Connect to the recovery catalog and your instance.
   Run the content of cre_rec.rman.

$ rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\"
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06006: connected to target database: DBA15 (not mounted)
RMAN-06008: connected to recovery catalog database
RMAN> create script rec_db_full{

2> allocate channel d1 type disk;
3> restore controlfile to "/users/dba15/control1.ctl";
4> restore database;
5> sql "alter database mount";
6> release channel d1;}
RMAN-08085: created script rec_db_full

9. Run the script rec_db_full.
RMAN> run {execute script "rec_db_full";}
MAN-08030: allocated channel: d1
RMAN-08500: channel d1: sid=6 devtype=DISK
RMAN-08016: channel d1: started datafile restore
RMAN-08021: channel d1: restoring controlfile
RMAN-08505: output filename=/users/dba15/control1.ctl
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.22.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08016: channel d1: started datafile restore
RMAN-08019: channel d1: restoring datafile number 1
RMAN-08509: destination for restored datafile number=1 filename=/users/dba15/systemDBA15.dbf
RMAN-08019: channel d1: restoring datafile number 2
RMAN-08509: destination for restored datafile number=2 filename=/users/dba15/rbsDBA15.dbf
RMAN-08019: channel d1: restoring datafile number 3
RMAN-08509: destination for restored datafile number=3 filename=/users/dba15/tempDBA15.dbf
RMAN-08019: channel d1: restoring datafile number 4
RMAN-08509: destination for restored datafile number=4 filename=/users/dba15/data01DBA15_1.dbf
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.18.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08016: channel d1: started datafile restore
RMAN-08019: channel d1: restoring datafile number 5
RMAN-08509: destination for restored datafile number=5 filename=/users/dba15/data01DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 6
RMAN-08509: destination for restored datafile number=6 filename=/users/dba15/data02DBA15_1.dbf
RMAN-08019: channel d1: restoring datafile number 7
RMAN-08509: destination for restored datafile number=7 filename=/users/dba15/data02DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 8
RMAN-08509: destination for restored datafile number=8 filename=/users/dba15/data03DBA15_1.dbf
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.19.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08016: channel d1: started datafile restore
RMAN-08019: channel d1: restoring datafile number 9
RMAN-08509: destination for restored datafile number=9 filename=/users/dba15/data03DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 10
RMAN-08509: destination for restored datafile number=10 filename=/users/dba15/data04DBA15_1.dbf
RMAN-08019: channel d1: restoring datafile number 11
RMAN-08509: destination for restored datafile number=11 filename=/users/dba15/data04DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 12
RMAN-08509: destination for restored datafile number=12 filename=/users/dba15/index01DBA15_1.dbf
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.20.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08016: channel d1: started datafile restore
RMAN-08019: channel d1: restoring datafile number 13
RMAN-08509: destination for restored datafile number=13 filename=/users/dba15/index01DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 14
RMAN-08509: destination for restored datafile number=14 filename=/users/dba15/index02DBA15_1.dbf
RMAN-08019: channel d1: restoring datafile number 15
RMAN-08509: destination for restored datafile number=15 filename=/users/dba15/index02DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 16
RMAN-08509: destination for restored datafile number=16 filename=/users/dba15/index03DBA15_1.dbf
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.21.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08016: channel d1: started datafile restore
RMAN-08019: channel d1: restoring datafile number 17
RMAN-08509: destination for restored datafile number=17 filename=/users/dba15/index03DBA15_2.dbf
RMAN-08019: channel d1: restoring datafile number 18
RMAN-08509: destination for restored datafile number=18 filename=/users/dba15/index04DBA15_1.dbf
RMAN-08019: channel d1: restoring datafile number 19
RMAN-08509: destination for restored datafile number=19 filename=/users/dba15/index04DBA15_2.dbf
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/users/dba15/BACK/back_DBA15_full.22.1 params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08031: released channel: d1
RMAN>

10. Exit recovery manager.
    Enter server manager and do a "fake" recovery using :
    recover database until cancel using backup controlfile;

RMAN> exit
Recovery Manager complete.

$ svrmgrl
Oracle Server Manager Release 3.0.2.0.0 - Beta
Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
Oracle8 Server Release 8.0.2.0.0 - Beta
With the distributed, heterogeneous, replication, objects,
parallel query and Spatial Data options
PL/SQL Release 3.0.2.0.0 - Beta

SVRMGR> connect internal
Connected.

SVRMGR> recover database until cancel using backup controlfile;
ORA-00279: change 134717 generated at 03/17/97 23:05:27 needed for thread 1
ORA-00289: suggestion : /oracle/app/oracle/product/8.0.2/dbs/arch1_623.dbf
ORA-00280: change 134717 for thread 1 is in sequence #623
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SVRMGR>

11. Open the database with the resetlog option.
SVRMGR> alter database open resetlogs;
Statement processed.
SVRMGR>

12. Reset the database from recovery manager.

    (Needs to be done after an incomplete recovery)
$ rman target=\"internal/admin@DBA15\" rcvcat=\"dba15/dba15@DBA16\"
Recovery Manager: Release 8.0.2.0.0 - Beta
RMAN-06005: connected to target database: DBA15
RMAN-06008: connected to recovery catalog database
RMAN> reset database;
RMAN-08006: database registered in recovery catalog
RMAN-08002: starting full resync of recovery catalog
RMAN-08029: snapshot controlfile name set to default value: ?/dbs/snapcf_@.f
RMAN-08004: full resync complete
RMAN>

13. Check how many incarnations of your database you have now.
RMAN> list incarnation of database "DBA15";
RMAN-06240: List of Database Incarnations
RMAN-06241: DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
RMAN-06242: ------- ------- -------- ---------------- --- ---------- -------
RMAN-06243: 1       2       DBA15    4045670789       NO  1          18-FEB-97
RMAN-06243: 1       2172    DBA15    4045670789       YES 134718     18-MAR-97

Posted by pat98

 현재 Close 안된cursor ACCESS하고 있는 오브젝트의 정보를 얻고자 하는 경우

 

 현재 사용되고 있는 오브젝트를 알고자 할 경우

select sid,
owner,
object,
type
from v$access
order by 1, 2, 3, 4;

 데이터 딕셔너리의 상세 현황을 보고자 할 경우

select cache#,
type,
subordinate#,
parameter,
count,
usage,
fixed,
gets,
getmisses "Get Misses",
scans,
scanmisses "Scan Misses",
scancompletes "Scan Completes",
modifications,
flushes
from v$rowcache;

 데이터 딕셔너리의 요약 현황을 보고자 할 경우

select sum(count) Count,
sum(usage) Usage,
sum(fixed) Fixed,
sum(gets) Gets,
sum(getmisses) "Get Misses",
sum(scans) Scans,
sum(scanmisses) "Scan Misses",
sum(scancompletes) "Scan Completes",
sum(modifications) Modifications,
sum(flushes) Flushes,
from v$rowcache;

 

select round(sum(gets)/(sum(gets)+sum(getmisses)) * 100,2)
from v$rowcache;

 DB block buffer에서 읽혀진 횟수를 보고자 할 경우

# Returns a count of gets in the db block buffer.
select sum(value)
from v$sysstat
where name in ('db block gets', 'consistent gets');

 DB block buffer의 활용도를 보고자 하는 경우

select round((1-(pr.value/(bg.value+cg.value)))*100,2)
from v$sysstat pr, v$sysstat bg, v$sysstat cg
where pr.name = 'physical reads'
and bg.name = 'db block gets'
and cg.name = 'consistent gets';

 DB block buffer의 전반적인 레포팅

column phys_read heading "Physical|Reads" format 99999999990
column block_get heading "Block|Gets" format 99999999990
column consi_get heading "Consistent|Gets" format 99999999990
column bchr heading "BCHR" format 999.90

select pr.value phys_read, bg.value block_get, cg.value consi_get,
(1 - ( pr.value/(bg.value+cg.value) ) ) * 100 bchr
from v$sysstat pr, v$sysstat bg, v$sysstat cg
where pr.name = 'physical reads'
and bg.name = 'db block gets'
and cg.name = 'consistent gets';

 DB block 의 사용현황을 요약하고자 할 경우

select decode(state, 0, 'Free', 1, 'Read and Modified', 2, 'Read and Not Modified', 3, 'Currently Being Read', 'Other' ),count(*)
from x$bh
group by decode(state, 0, 'Free', 1, 'Read and Modified', 2, 'Read and Not Modified', 3, 'Currently Being Read', 'Other' );

 디스크로부터 가장 많이 읽혀지는 sql문장을 알고 싶은 경우

select sql_text
from v$sqlarea, v$session
where address = sql_address
and username is not null
and disk_reads/executions =
(select max(disk_reads/executions)
from v$sqlarea, v$session
where address = sql_address
and username is not null
and executions > 0);

 버퍼에서 가장 많이 읽혀지는 sql문장을 알고 싶은 경우

select sql_text
from v$sqlarea, v$session
where address = sql_address
and username is not null
and buffer_gets/executions = (select max(buffer_gets/executions)
from v$sqlarea, v$session
where address = sql_address
and username is not null);

 EXTENT 현황을 알고 싶은 경우

select owner, segment_name, segment_type, count(*) numext,
round(sum(bytes)/1024/1024,1) MB
from sys.dba_extents
where owner not in ('SYS','SYSTEM')
group by segment_name, segment_type
order by segment_type, round(sum(bytes)/1024/1024,1) desc, segment_name;

 Extent 가 가장 많이 일어난 횟수

select max(extent_id) + 1
from sys.dba_extents
where owner not in ('SYS','SYSTEM');

 Extent 가 가장 많이 일어난 세그먼트

select owner, segment_name
from sys.dba_extents
where owner not in ('SYS','SYSTEM')
and extent_id =
(select max(extent_id)
from sys.dba_extents
where owner not in ('SYS','SYSTEM'));

 데이터 파일별 Access 유형별 횟수

select name,
phyrds "Total Reads",

phywrts "Total Writes",
phyblkrd "Blocks Read",
phyblkwrt "Blocks Written"
from v$datafile d, v$filestat s
where d.file# = s.file#
order by d.file#;

 Free list wait 일어난 비율 : 낮을수록 좋음

select round((sum(decode(w.class, 'free list',count, 0))
/ (sum(decode(name,'db block gets', value, 0))
+ sum(decode(name,'consistent gets', value, 0))))
* 100,2)
from v$waitstat w, v$sysstat;

 SYSTEM 테이블스페이스 내 인덱스 생성현황

select count(*)
from sys.dba_indexes i
where i.tablespace_name = 'SYSTEM'
and i.owner not in ('SYS','SYSTEM');

 Network 부하 (bytes)

select sum(value)
from v$sysstat
where name like 'bytes%SQL*Net%';

 데이터 파일로부터 physical I/O 횟수

select sum(phyrds) + sum(phywrts) "Total I/O"
from v$filestat;

 I/O 의 종합 현황

select sum(decode(name,'db block changes', value,0)) "Block Changes",
(sum(decode(name, 'db block gets', value,0))
+ sum(decode(name, 'consistent gets', value,0))) "Buffer Gets",
sum(decode(name,'physical reads', value, 0)) "Physical Reads",
(sum(decode(name, 'db block gets', value,0))
+ sum(decode(name, 'consistent gets', value,0)))
/ sum(decode(name,'physical reads', value, 0)) "Gets / Reads"
from v$sysstat;

 Latch로 인한 경합률 : 0에 가까울수록 좋음

select round(greatest(
(sum(decode(ln.name, 'cache buffers lru chain', misses,0))
/ greatest(sum(decode(ln.name, 'cache buffers lru chain', gets,0)),1)),
(sum(decode(ln.name, 'enqueues', misses,0))
/ greatest(sum(decode(ln.name, 'enqueues', gets,0)),1)),
(sum(decode(ln.name, 'redo allocation', misses,0))
/ greatest(sum(decode(ln.name, 'redo allocation', gets,0)),1)),
(sum(decode(ln.name, 'redo copy', misses,0))
/ greatest(sum(decode(ln.name, 'redo copy', gets,0)),1)))
* 100,2)
from v$latch l, v$latchname ln
where l.latch# = ln.latch#;

 Latch 상세 현황

select ln.name,
lh.pid,
l.immediate_gets,
l.immediate_misses,
l.gets,
l.misses,
l.sleeps
from v$latch l, v$latchholder lh, v$latchname ln
where l.latch# = ln.latch#
and l.addr = lh.laddr(+)
order by l.level#, l.latch#;

 Latch 효율성 평가 : 100에 가까울수록 좋음

select round(((sum(l.immediate_gets) + sum(l.misses) + sum(l.gets))
/ (sum(l.immediate_gets) + sum(l.immediate_misses) + sum(l.gets) + sum(l.misses))) * 100,2)
from v$latch l;

 Latch 종합 현황

select sum(l.immediate_gets),
sum(l.immediate_misses),
sum(l.gets),
sum(l.misses),
sum(l.sleeps)
from v$latch l, v$latchholder lh, v$latchname ln
where l.latch# = ln.latch#
and l.addr=lh.laddr(+);

 Library cache 효율성 : 100에 가까울수록 좋음

select round(sum(pinhits)/sum(pins) * 100,2)
from v$librarycache;

 Library cache 상세 현황

select namespace name,
gets,
gethits,
round(gethitratio*100,2) "GetHit Percentage",
pins,
pinhits,
round(pinhitratio*100,2) "PinHit Percentage",
reloads,
invalidations
from v$librarycache
order by 1;

 메모리 allocate 현황

select sum(value)
from v$statname n, v$sesstat s
where n.statistic# = s.statistic#
and name = 'session uga memory';

select sum(value)
from v$statname n, v$sesstat s
where n.statistic# = s.statistic#
and name = 'session uga memory max';

 Open transaction 횟수

select sum(xacts) from v$rollstat;

 Parse 효율성

select round(sum(decode(name, 'opened cursors cumulative', value, 0))
/ sum(decode(name,'parse count', value,0)) * 100, 2)
from v$sysstat;

 Parse 현황

select ptc.value "Parse Time CPU",
pte.value "Parse Time Elapsed",
pc.value "Parse Count"
from v$sysstat ptc, v$sysstat pte, v$sysstat pc
where ptc.statistic#=96
and pte.statistic#=97
and pc.statistic#=98;

 Physical Read 횟수

select sum(value)
from v$sysstat
where name = 'physical reads';

 Recursive call 횟수

select value from v$sysstat where name = 'recursive calls';

 Redo Log latch 경합

select round(greatest(
(sum(decode(ln.name, 'redo copy', misses,0))
/ greatest(sum(decode(ln.name, 'redo copy', gets,0)),1)),
(sum(decode(ln.name, 'redo allocation', misses,0))
/ greatest(sum(decode(ln.name, 'redo allocation', gets,0)),1)),
(sum(decode(ln.name, 'redo copy', immediate_misses,0))
/ greatest(sum(decode(ln.name, 'redo copy', immediate_gets,0))
+ sum(decode(ln.name, 'redo copy', immediate_misses,0)),1)),
(sum(decode(ln.name, 'redo allocation', immediate_misses,0))
/ greatest(sum(decode(ln.name, 'redo allocation', immediate_gets,0))
+ sum(decode(ln.name, 'redo allocation', immediate_misses,0)),1)))
* 100,2)
from v$latch l, v$latchname ln
where l.latch# = ln.latch#;

 

 리두로그 정보

select value from v$sysstat where name = 'redo log space waittime';

select sum(decode(name,'redo blocks written', value,0)) "Block Writes",
sum(decode(name,'redo entries', value, 0)) "Entries",
sum(decode(name,'redo size', value, 0)) "Size",
sum(decode(name,'redo log space requests', value, 0)) "Space Requests",
sum(decode(name,'redo synch writes', value,0)) "Synch Writes",
sum(decode(name,'redo writes', value,0)) "Writes"
from v$sysstat;

 Library Cache  활용도

 

select round((1 - (sum(reloads) / sum(pins))) * 100, 2)
from v$librarycache;

 롤백세그먼트 경합률

select round(sum(waits)/sum(gets),2) from v$rollstat;

 롤백세그먼트 현황

select n.usn,
n.name,
s.username Name,
s.osuser,
rs.extents,
rs.wraps,
rs.rssize "Size (Bytes)"
from v$rollname n, v$rollstat rs, v$session s, v$transaction t
where t.addr = s.taddr(+)
and rs.usn(+) = n.usn
and t.xidusn(+) = n.usn
and rs.status = 'ONLINE'
order by n.usn;

 SGA Free Space 현황

select sum(decode(name, 'free memory', bytes, 0))
from v$sgastat;

select round((sum(decode(name, 'free memory', bytes, 0))
/ sum(bytes)) * 100,0)
from v$sgastat;

 SGA Size

select sum(value) from v$sga;

 Shared Pool reload 횟수 및 비율

select sum(reloads)
from v$librarycache
where namespace in ('SQL AREA','TABLE/PROCEDURE', 'BODY','TRIGGER');
 
 select round(sum(reloads)
/ sum(pins) * 100,2)
from v$librarycache
where namespace in ('SQL AREA','TABLE/PROCEDURE','BODY','TRIGGER');

 Sort_Area 효율성

select round((sum(decode(name, 'sorts (memory)', value, 0))
/ (sum(decode(name, 'sorts (memory)', value, 0))
+ sum(decode(name, 'sorts (disk)', value, 0))))
* 100,2)
from v$sysstat;

 소트 현황

select username Name,
osuser,
sd.value "Disk Sorts",
sm.value "Memory Sorts",
sr.value "Rows Sorted"
from v$session s, v$sesstat sd, v$sesstat sm, v$sesstat sr
where s.sid = sd.sid
and s.sid = sm.sid
and s.sid = sr.sid
and sd.statistic# = 101
and sm.statistic# =100
and sr.statistic# =102
and s.type != 'BACKGROUND';

 소트 건수

select sum(value) from v$sysstat where statistic#=102);

 SQL AREA 활용현황

select username,
sql_text,
sorts,
disk_reads Reads,
buffer_gets Gets
from v$sqlarea s,
sys.dba_users u
where s.parsing_user_id = u.user_id
and users_executing > 0
order by 1;

 V$SYSSTAT를 이용한 테이블 스캔현황

select value
from v$sysstat
where name = 'table scans (long tables)';
 
 select value
from v$sysstat
where name = 'table scans (short tables)';
 
select s.value + l.value
from v$sysstat s, v$sysstat l
where s.name = 'table scans (short tables)'
and l.name = 'table scans (long tables)';
 

 

 SYSTEM 테이블스페이스에 생성된 테이블 수

select count(*)
from sys.dba_tables t
where t.tablespace_name = 'SYSTEM'
and t.owner not in ('SYS','SYSTEM');

 Next Extent Free 영역보다 큰 경우

select s.segment_name "Segment Name",
s.tablespace_name "Tablespace Name",
s.next_extent "Next Extent",
f.free_bytes "Free Bytes"
from dba_segments s,
(select tablespace_name,
sum(bytes) free_bytes
from dba_free_space
group by tablespace_name) f
where f.tablespace_name = s.tablespace_name
and s.next_extent > f.free_bytes;

 테이블 스페이스 FREE SPACE 현황

select tablespace_name Name,
sum(bytes) Bytes,
sum(blocks) Blocks,
count(*)
Number of Files
from sys.dba_free_space
group by tablespace_name;

 테이블스페이스 조각

(Fragmentation) 현황

 

select f.tablespace_name "Tablespace Name",
file_name "File Name",
block_id, "Block Id"
f.blocks "Number of Blocks",
f.bytes "Number of Bytes"
from dba_free_space f, dba_data_files d
where f.file_id = d.file_id
order by f.tablespace_name ASC, file_name ASC, f.blocks DESC;

[출처] [펌] [오라클]디비 모니터링 쿼리|작성자 slash

Posted by pat98
이전버튼 1 이전버튼

04-27 15:27
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

최근에 달린 댓글