create dump of user by using cmd mode
create dump of user by using cmd mode
joisto 7
thrusday
***********************************************************************************
********************************
Rename User
***********************************************************************************
********************************
User ID : BOZLU
Pass: sonali1234
jdbc:oracle:thin:@localhost:1521:orcl
select to_char(to_date('&date', 'DD-MM-YYYY'), 'Day') day from dual; --- this query
will be find your weekday from given date
select * from dba_object_size where name = 'procedure_name'
***********************************************************************************
********************************
user_constraints error Check
***********************************************************************************
********************************
***********************************************************************************
********************************
Create User With max Grants
***********************************************************************************
********************************
-------------------------------------------------------------------
--Create User--
-------------------------------------------------------------------
CREATE USER SBBDPROD_06SEP IDENTIFIED BY SBBDPROD_06SEP
DEFAULT TABLESPACE TBFES;
GRANT DBA TO SBBDPROD_06SEP;
GRANT CREATE SESSION,CREATE TABLE,CREATE SEQUENCE,
CREATE VIEW TO SBBDPROD_06SEP;
GRANT EXECUTE ON DBMS_SQLHASH TO SBBDPROD_06SEP;
GRANT EXECUTE ON DBMS_LOCK TO SBBDPROD_06SEP;
GRANT DEBUG CONNECT SESSION TO SBBDPROD_06SEP;
GRANT DEBUG ANY PROCEDURE TO SBBDPROD_06SEP;
GRANT READ,WRITE ON DIRECTORY DATA_PUMP_DIR TO SBBDPROD_06SEP;
-------------------------------------------------------------------
--Import Dump--
-------------------------------------------------------------------
-------------------------------------------------------------------
remote DB ACCESS
-------------------------------------------------------------------
sqlplus username/password@hostA:1521 /XE
***********************************************************************************
********************************
Import Schema
***********************************************************************************
********************************
--after imported dump we should be check the total amount of invalid objects. if
it's greater then 24 then this is a bad dump
***********************************************************************************
********************************
Change Password
***********************************************************************************
********************************
alter user user_name identified by new_password;
***********************************************************************************
********************************
Export Schema
***********************************************************************************
********************************
/u02/export/dump
-- export tables only
EXP USERID=SBBD_MIG_16MAY/SBBD_MIG_16MAY@ORCL
FILE="D:/Migration/OutputFiles/SBBD_MIG_30MAY.DMP"
LOG="D:/Migration/OutputFiles/EXP_BCBLSEED_MIG_Backup.LOG"
TABLES="ACASLL,ACASLLDTL,ACNTBAL,ACNTBBAL,ACNTCBAL,ACNTCBBAL,ACNTCONTRACT,ACNTCVDBB
AL,ACNTFRZ,ACNTLINK,ACNTMAIL,temp_sec,ACNTOTN,ACNTS,ACNTLIEN,ACNTSTATUS,ACNTVDBBAL,
ADVBAL,ADVBBAL,ADVVDBBAL,ASSETCLS,ASSETCLSHIST,BATCHCOUNTER,CBISS,CLIENTNUM,CLIENTO
TN,CLIENTOTNDTL,CLIENTS,CLIENTSBKDTL,CONNPINFO,CORPCLIENTS,DDPOISS,DDPOISSDTL,DDPOI
SSDTLANX,DDPOPAYDB,DENOMBAL,DENOMDBAL,DEPACCLIEN,depcls,DEPINTPAYMENT,DEPINTPAYMENT
DTL,GLBBAL,GLSUM2010,GLSUM2011,GLSUM2012,IACLINK,INDCLIENTS,JOINTCLIENTS,JOINTCLIEN
TSDTL,LADACNTDTL,lngsacnts,lngsacntdtl,LADACNTS,LIMITLINE,limitlinehist,LIMITSERIAL
,LLACNTOS,LLPROD,LNACAODHIST,LNACDISB,LNACDSDTL,LNACDSDTLHIST,LNACGUAR,LNACIR,LNACI
RHIST,LNACIRS,LNACIRSHIST,LNACMIS,LNACMISHIST,LNACRS,LNACRSDTL,LNACRSHDTL,LNACRSHIS
T,LNSUSPBAL,LNSUSPLED,LOANACNTOTN,LOANACNTS,MARGINREC,NOMENTRY,NOMREG,PBCOUNT,PBDCO
NTDSA,PBDCONTDSAHIST,PBDCONTRACT,PIDDOCS,PROVLED,RDINS,STOPCHQ,STOPLEAF,TDSPI,TDSPI
DTL,TRAN2010,TRANADV2010,TRANBAT2010,tranadvaddn2010,TRAN2011,TRANADV2011,TRANBAT20
11,tranadvaddn2011,TRAN2012,TRANADV2012,TRANBAT2012,tranadvaddn2012,VAULTBAL,VAULTD
BAL,TBILLSERIAL,INVSPDOCIMG,CLAMIMAGE,spdocimage,SECRCPT,SECASSIGNMENTS,SECASSIGNMT
DTL,SECASSIGNMTBAL,SECASSIGNMTDBAL,SECMORTGAGE,SECMORTEC,SECINVEST,SECVEHICLE,SECCL
IENT,SECSHARES,SECSHARESDTL,SECINSUR,SECSTKBKDB,SECSTKBKDBDTL,SECSTKBKDT,SECSTKBKDT
DTL,LNDP,LNDPHIST,LIMFACCURR,LIMITLINEAUX,LOANACHIST,LOANACHISTDTL,LOANACDTL,LIMITL
INECTREQ,LNSUBVENRECV,LNACSUBSIDY,LNACIRDTL,LNACIRHDTL,addrdtls,PBDCONTTRFOD,TDSREM
ITGOV,HOVERING,HOVERRECBRK,amlacturnover,hoverseq,ecsacmap,LADDEPLINK,LADDEPLINKHIS
T,LADDEPLINKHISTDTL,LNGOVTSEC,SECVAL,LOCKERAVL,LOCKERAVLHIST,LOCKERAM,LOCKERCHGSHIS
T,LOCKERACCHIST,LOCKERACC,LOCKERKEYHIST,LOCKERKEY,LOCKERDTLS,LOCKERRENT,LOCKERSTAT,
LOCKERSTATHIST,ACSEQGEN,DEPRCPTPRNT,LEGALNOTICE,LEGALSTAT,LEGALACTION,LNACINTCTL,LN
ACINTCTLHIST,ITFORMS,CLIENTMEM,MEMNUM,DEPCLIENTNOMMEM,NOMINALMEMNUM,LNNOMINALMEM,LN
NOMINALMEMDTL,ACNTOTN,ACNTOTNNEW,LNACCHGS,LNACCHGSQBAL,LNACCHGSQLED,VAULTDBAL,DENOM
DBAL,LNACINTARHIST,LNACINTARDTL,LNACINTARHDTL,LNACINTAR,LNTOTINTDBMIG,SMSBREG,SMSBR
EGDTL,SMSBREGSVC,ivracnts,,IBS_AC_BAL,MIG_LDR,MIG_TDS,MIG_FWD,MIG_RD,IBS_GL_BAL,IBS
_NOMENTRY,MIG_DP,MIG_PDISB,MIG_FWDCFINT,MIG_SBACCR,MIG_CLIENT_ACCESS,MIG_ACNTS_ACCE
SS,MIG_DEP_ACCESS,MIG_CLIENTSBKDTL_ACCESS,MIG_CLNT_KYCACC,MIG_JOINTCLIENTSDTL_ACCES
S,MIG_JOINTCLIENTS_ACCESS,MIG_OVERDUE_DETAILS,MIG_CP,MIG_OBC,MIG_IBC,MIG_SCH_MAST,M
IG_TL_MAST,MIG_INT_MAST,MIG_CHEQ_BK,MIG_CHEQSTOP,MIG_CUMUSUB,MIG_NPARPT,MIG_BANK,MI
G_BR_PARA,MIG_AC_MAST_NEW,MIG_D_MAST_NEW,MIG_LNRPST,TEMP_CLIENT,DEPIA,LOANIA,SBCAIA
,LOANIADTL,SBCAIABRK,ACBALASONHIST,GLSUM2013,TRAN2013,TRANADV2013,TRANBAT2013,trana
dvaddn2013,ACBALASONHIST_MAX,ACBALASONHIST_AVGBAL,NOMREGDTL,ACBALASONHIST_MAX";
***********************************************************************************
*********************************
Export Schema by cmd mode
***********************************************************************************
*********************************
C:\Users\rajesh.poddar>exp
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Username: scott
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Enter array fetch buffer size: 4096 > 4096
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table DEPT 4 rows exported
. . exporting table EMP 14 rows exported
. . exporting table SALGRADE 5 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
C:\Users\rajesh.poddar>
*******************************************************************
show all table list
*******************************************************************
select * from tab;
select count(*) from tab; \\ count tables with views
select count(TABLE_NAME) from user_tables; \\ count only tables
or
select * from tab where tabtype='TABLE';
***********************************************************************************
*****************
show all table with size ( biggest first )
***********************************************************************************
*****************
---ROUND(sum(bytes)/1024/1024/1024, 2) GB (Calculation for GB)
***********************************************************************************
*****************
Count all tables rows according to Users
***********************************************************************************
*****************
select owner, table_name, num_rows
from all_tables
where owner like 'STLBAS' -- Exclude system tables.
and num_rows > 0 -- Ignore empty Tables.
order by num_rows desc -- Biggest first.
;
******************************************
drop/delete table
******************************************
drop table table_name;
******************************************
table backup
******************************************
create table table_name as select * from mig_clients;
******************************************
show user DBA ROLES
******************************************
******************************************
drop user
******************************************
******************************************
show all users
******************************************
******************************************
unlock users
******************************************
*********************************************************************
Create directories
*********************************************************************
*********************************************************************
show all directories
*********************************************************************
*********************************************************************
show all tablespace name
*********************************************************************
*********************************************************************
show hidden file from cmd mode
*********************************************************************
*********************************************************************
how to change hosts file
*********************************************************************
*********************************************************************
loginctl.class file location in Panacea.ear
*********************************************************************
SBBD\Panacea.ear\Panaceaweb.war\WEB-INF\classes\panaceaFLweb\FLCtlbean\
loginctl.class