Data Guard Scripts ( On the Standby )

on 6:53 AM


On the Standby : 

select name,value from gv$parameter where name in ('db_name','db_unique_name','db_domain','db_file_name_convert','log_file_name_convert','fal_server','fal_client','remote_login_passwordfile','standby_file_management','dg_broker_start','dg_broker_config_file1','dg_broker_config_file2');

select status,instance_name,database_role,open_mode,protection_mode,switchover_status from gv$instance,gv$database;

select name,(space_limit/1024/1024/1024) "Limit in GB",(space_used/1024/1024/1024) "Used in GB" from v$recovery_file_dest;

select thread#,max(sequence#) from gv$archived_log group by thread#;

select thread#,max(sequence#) from gv$archived_log where applied='YES' group by thread#;

select dest_id, dest_name, status, target, archiver , destination from GV$ARCHIVE_DEST where destination IS NOT NULL;

select inst_id,process,status,sequence#,thread#,client_process from gv$managed_standby;

Data Guard Scripts ( On the Primary )

on 6:40 AM

On the Primary :

select name,value from gv$parameter where name in ('db_name','db_unique_name','db_domain','db_file_name_convert','log_file_name_convert','fal_server','fal_client','remote_login_passwordfile','standby_file_management','dg_broker_start','dg_broker_config_file1','dg_broker_config_file2');

select status,instance_name,database_role,open_mode,protection_mode,switchover_status from gv$instance,gv$database;

select name,(space_limit/1024/1024/1024) "Limit in GB",(space_used/1024/1024/1024) "Used in GB" from v$recovery_file_dest;

select thread#,max(sequence#) from gv$archived_log group by thread#;

select inst_id,dest_id, dest_name, status, target, archiver , destination from GV$ARCHIVE_DEST where destination IS NOT NULL;

select * from (select severity,error_code,message,to_char(timestamp,'DD-MON-YYYY HH24:MI:SS') from v$dataguard_status where dest_id=2 order by rownum DESC) where rownum <= 7;

SCP Syntax

on 8:06 AM

Basic syntax :

scp source_file_name username@destination_host:destination_folder

Specify specific port(3301) to use with scp :

scp -P 3301 fullimp15may2017.dmp username@destination_host
password : *********

Note : " P " is capital letter

Data Pump Encryption in Oracle

on 7:49 AM

[oracle@india ~]$ expdp directory=DATA_PUMP_DIR  dumpfile=hameed.dmp logfile=hameed.log  schemas=hameed encryption=all  encryption_password=oracle encryption_algorithm=AES256 ENCRYPTION_MODE=password

Export: Release 11.2.0.4.0 - Production on Sun May 14 13:25:54 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA directory=DATA_PUMP_DIR dumpfile=hameed.dmp logfile=hameed.log schemas=hameed encryption=all encryption_password=******** encryption_algorithm=AES256 ENCRYPTION_MODE=password
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
. . exported "HAMEED"."INFO"                             5.835 KB       1 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  /u01/app/oracle/admin/Stage/dpdump/hameed.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Sun May 14 13:27:32 2017 elapsed 0 00:01:13

[oracle@india ~]$ impdp directory=DATA_PUMP_DIR dumpfile= hameed.dmp logfile=hameedimp.log remap_schema=hameed:abdul

Import: Release 11.2.0.4.0 - Production on Sun May 14 13:33:31 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39174: Encryption password must be supplied.


[oracle@india ~]$ impdp directory=DATA_PUMP_DIR dumpfile= hameed.dmp logfile=hameedimp.log remap_schema=hameed:abdul  encryption_password=oracl

Import: Release 11.2.0.4.0 - Production on Sun May 14 13:36:17 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39176: Encryption password is incorrect.

[oracle@india ~]$ impdp directory=DATA_PUMP_DIR dumpfile= hameed.dmp logfile=hameedimp.log remap_schema=hameed:abdul  encryption_password=oracle

Import: Release 11.2.0.4.0 - Production on Sun May 14 13:35:42 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_FULL_01":  /******** AS SYSDBA directory=DATA_PUMP_DIR dumpfile= logfile=hameedimp.log remap_schema=hameed:abdul encryption_password=********
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"ABDUL" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "ABDUL"."INFO"                              5.835 KB       1 rows
Job "SYS"."SYS_IMPORT_FULL_01" completed with 1 error(s) at Sun May 14 13:35:53 2017 elapsed 0 00:00:07