Saturday, May 7, 2016

MIGRATION DOCUMENT


SQL> set lines 300
SQL> set timing on
SQL> column paramater format a30

SQL> select parameter,value from nls_database_parameter where parameter=
  2  'NLS_CHARACTERSET' or parameter='NLS_NCHAR_CHARACTERSET';


PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_CHARACTERSET               WE8MSWIN1252
NLS_NCHAR_CHARACTERSET         AL16UTF16

Elapsed: 00:00:00.12
SQL>


SQL> set lines 300
SQL> set timing on
column comp_name format a35
column version format a15
column status format a29
select comp_name,version,status from dba_registry;



COMP_NAME                           VERSION         STATUS
----------------------------------- --------------- -----------------------------
OWB                                 11.2.0.1.0      VALID
Oracle Application Express          3.2.1.00.10     VALID
Oracle Enterprise Manager           11.2.0.1.0      VALID
OLAP Catalog                        11.2.0.1.0      VALID
Spatial                             11.2.0.1.0      VALID
Oracle Multimedia                   11.2.0.1.0      VALID
Oracle XML Database                 11.2.0.1.0      VALID
Oracle Text                         11.2.0.1.0      VALID
Oracle Expression Filter            11.2.0.1.0      VALID
Oracle Rules Manager                11.2.0.1.0      VALID
Oracle Workspace Manager            11.2.0.1.0      VALID

COMP_NAME                           VERSION         STATUS
----------------------------------- --------------- -----------------------------
Oracle Database Catalog Views       11.2.0.1.0      VALID
Oracle Database Packages and Types  11.2.0.1.0      VALID
JServer JAVA Virtual Machine        11.2.0.1.0      VALID
Oracle XDK                          11.2.0.1.0      VALID
Oracle Database Java Packages       11.2.0.1.0      VALID
OLAP Analytic Workspace             11.2.0.1.0      VALID
Oracle OLAP API                     11.2.0.1.0      VALID

18 rows selected.

[oracle@PrimeDG admin]$ {ORACLE_HOME}/OPatch/opatch lsinventory -patch -detail -invPtrLoc /var/opt/oracle/oraInst_${ORACLE_SID}_11201.loc
-bash: {ORACLE_HOME}/OPatch/opatch: No such file or directory
[oracle@PrimeDG admin]$



SQL> set linesize 200
SQL> set pagesize 100
SQL> select substr(action_time,1,30) action_time,substr(id,1,8) id, substr(action,1,10)action, substr(version,1,8) version, substr(comments,1,20)comments from registry$history;

no rows selected

SQL> set linesize 200
SQL> set pagesize 100
SQL> select substr(action_time,1,30) action_time,substr(id,1,8) id, substr(action,1,10)action, substr(version,1,8) version, substr(comments,1,20)comments from registry$history;

no rows selected

SQL> show parameter cache_size;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
client_result_cache_size             big integer 0
db_16k_cache_size                    big integer 16M
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_cache_size                        big integer 0
db_flash_cache_size                  big integer 0
db_keep_cache_size                   big integer 0
db_recycle_cache_size                big integer 0
SQL> select tablespace_name,block_size from dba_tablespaces;

TABLESPACE_NAME                BLOCK_SIZE
------------------------------ ----------
SYSTEM                               8192
SYSAUX                               8192
UNDOTBS1                             8192
TEMP                                 8192
USERS                                8192
EXAMPLE                              8192
MoidTBS                              8192
TESTTBS                              8192
TS_16K                              16384
GGS_DATA                             8192

10 rows selected.

SQL>



init ora




# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)

db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'





[oracle@PrimeDG dbs]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat May 7 20:49:26 2016

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

connected to target database: PRIMEDG (DBID=2797264308)

RMAN> configure device type disk parallelism 4 backup type to backupset;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

RMAN> backup validate check logical database;

Starting backup at 07-MAY-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=74 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=133 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=9 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=72 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/PrimeDG/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/PrimeDG/undotbs01.dbf
input datafile file number=00008 name=/u14/oradata/PrimeDG/testtbs02.dbf
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/PrimeDG/sysaux01.dbf
input datafile file number=00007 name=/u14/oradata/PrimeDG/testtbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/PrimeDG/users01.dbf
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/PrimeDG/ggs_data01.dbf
input datafile file number=00005 name=/u01/app/oracle/PrimeDG/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/PrimeDG/MoidTBS01.dbf
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:01
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
Control File OK     0              596
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/PrimeDG/TS_16K.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:12
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1    OK     0              160          673             2525969
  File Name: /u01/app/oracle/PrimeDG/system01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              100
  Index      0              177
  Other      0              236

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3    OK     0              0            639             2528079
  File Name: /u01/app/oracle/PrimeDG/undotbs01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              639

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
8    OK     0              512          639             1083162
  File Name: /u14/oradata/PrimeDG/testtbs02.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              127

channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:12
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    OK     0              347          895             2527878
  File Name: /u01/app/oracle/PrimeDG/sysaux01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              30
  Index      0              103
  Other      0              415

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4    OK     0              170          774             2494117
  File Name: /u01/app/oracle/PrimeDG/users01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              227
  Index      0              62
  Other      0              315

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
7    OK     0              768          895             1082640
  File Name: /u14/oradata/PrimeDG/testtbs01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              127

channel ORA_DISK_3: backup set complete, elapsed time: 00:00:13
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
5    OK     0              129          639             2418899
  File Name: /u01/app/oracle/PrimeDG/example01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              228
  Index      0              27
  Other      0              255

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6    OK     0              512          639             1068108
  File Name: /u01/app/oracle/PrimeDG/MoidTBS01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              0
  Index      0              0
  Other      0              127

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
10   OK     0              4            646             2525643
  File Name: /u01/app/oracle/PrimeDG/ggs_data01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              385
  Index      0              75
  Other      0              182

channel ORA_DISK_4: backup set complete, elapsed time: 00:00:09
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
9    OK     0              473          640             1390551
  File Name: /u01/app/oracle/PrimeDG/TS_16K.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              100
  Index      0              0
  Other      0              67

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE       OK     0              2
Finished backup at 07-MAY-16

RMAN>


SQL> select * from v$database_block_corruption;

no rows selected

SQL> column acl format a30
SQL> column host format a20
SQL> column principal format a20
SQL> column privilege format a10
SQL> column is_grant format a8
SQL> set lines 1000
SQL> select acl, host, lower_port, upper_port from DBA_NETWORK_ACLS;

no rows selected

SQL> select acl, principal, privilege, is_grant from DBA_NETWORK_ACL_PRIVILEGES;

no rows selected

SQL> SQL> select OPEN_MODE, LOG_MODE FROM SYS.V$DATABASE;

OPEN_MODE            LOG_MODE
-------------------- ------------
READ WRITE           ARCHIVELOG

SQL> SHOW PARAMETER SPFILE;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /db_1/dbs/spfilePrimeDG.ora
SQL>
SQL> SHOW PARAMETER LOG_ARCHIVE_DEST

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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
SQL>

[oracle@PrimeDG dbs]$ cp -p $ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora $ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora_'date+"%Y%m%d"'
[oracle@PrimeDG dbs]$ ls -ltr
total 9600
-rw-r--r-- 1 oracle oinstall    2851 May 15  2009 init.ora
-rw-rw---- 1 oracle oinstall    1544 Mar 28 15:36 hc_DBUA0.dat
-rw-rw---- 1 oracle oinstall    1544 Mar 28 15:45 hc_PrimeDG.dat
-rw-r----- 1 oracle oinstall      24 Mar 28 15:46 lkPRIMEDG
-rw-r----- 1 oracle oinstall    1536 Apr  3 21:04 orapwPrimeDG
-rw-r--r-- 1 oracle oinstall    1009 Apr  6 08:49 initPrimeDG.ora
-rw-r----- 1 oracle oinstall    3584 May  4 22:21 spfilePrimeDG.ora_date+"%Y%m%d"
-rw-r----- 1 oracle oinstall    3584 May  4 22:21 spfilePrimeDG.ora
-rw-r----- 1 oracle oinstall 9781248 May  7 21:00 snapcf_PrimeDG.f
[oracle@PrimeDG dbs]$



cp -p $ORACLE_HOME/dbs/spfile$PrimeDG.ora $ORACLE_HOME/dbs/spfile$PrimeDG.ora_'date+"%Y%m%d"'

PrimeDG


[root@PrimeDG /]# mkdir -p /data/oracle/staging/$ORACLE_SID
[root@PrimeDG /]# chmod 755 /data/oracle/staging/$ORACLE_SID
[root@PrimeDG staging]# chown -R oracle:dba /data/oracle/staging/$ORACLE_SID
[

[root@PrimeDG staging]# su - oracle
oracle@PrimeDG ~]$ cd /data/oracle/staging/$ORACLE_SID
[oracle@PrimeDG staging]$ ls
[oracle@PrimeDG staging]$ ls -altr
total 8
drwxr-xr-x 3 root   root 4096 May  7 21:17 ..
drwxr-xr-x 2 oracle dba  4096 May  7 21:17 [oracle@PrimeDG oracle]$ . oraenv
ORACLE_SID = [oracle] ? PrimeDG
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle
[oracle@PrimeDG oracle]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat May 7 21:20:18 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create directory migrate as  '/data/oracle/staging/$ORACLE_SID';

Directory created.

SQL> grant read,write on directory migrate to system;

Grant succeeded.

SQL>


SQL> select tablespace_name from dba_tablespaces order by 1;

TABLESPACE_NAME
------------------------------
EXAMPLE
GGS_DATA
MoidTBS
SYSAUX
SYSTEM
TEMP
TESTTBS
TS_16K
UNDOTBS1
USERS

10 rows selected.


SQL> select file_id,file_name, tablespace_name from dba_data_files;


[oracle@PrimeDG oracle]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat May 7 21:34:16 2016

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

connected to target database: PRIMEDG (DBID=2797264308)



RMAN> backup incremental level 0 database plus archivelog
2> ;


No comments:

Post a Comment