Command Script
Command Script
Command Script
https://ithelpdesk.jolcorp.info/Summitprod/MDLSMSMGMT/Summit_SMS_ManageAccount.aspx
````````````````````````````````````
Check databases view.
````````````````````````````````````
set lines 200 pages 3000 colsep '|'
col name for a15;
col log_mode for a15;
col open_mode for a15;
col force_logging for a5;
col flashback_on for a5;
col database_role for a15;
select NAME,LOG_MODE,OPEN_MODE,FORCE_LOGGING,FLASHBACK_ON,DATABASE_ROLE,CDB from
v$database;
###################################################################################
###################################################################################
######################################################################
````````````````````````````````````
check datafiles view.
````````````````````````````````````
set lines 200 pages 3000;
col name for a70;
col status for a10;
col AUX_NAME for a10;
col last_time for a10;
select FILE#,NAME,STATUS,BYTES/1024/1024/1024,AUX_NAME,BLOCKS,LAST_TIME from
v$datafile;
###################################################################################
###################################################################################
######################################################################
````````````````````````````````````
check user management view.
````````````````````````````````````
set lines 300 pages 3000 colsep |;
col USERNAME for a25;
col ACCOUNT_STATUS for a20;
col PROFILE for a15;
col DEFAULT_TABLESPACE for a25;
col TEMPORARY_TABLESPACE for a25;
select
username,ACCOUNT_STATUS,CREATED,EXPIRY_DATE,PROFILE,DEFAULT_TABLESPACE,TEMPORARY_TA
BLESPACE from dba_users where username in
('JARVIS','JARVO','OBE','ACC_EMP','TEST');
```````````````````````````````````````````````````
how to check table owner.
````````````````````````````````````````````````````
desc dba_tables for check owner
desc user_sys_privs.
desc ALL_TAB_PRIVS
###################################################################################
###################################################################################
######################################################################
````````````````````````````````````
check db_link view.
````````````````````````````````````
How to create database link.
````````````````````````````````````
check tablespace management view.
````````````````````````````````````
set lines 200 pages 3000 colsep '|';
col file_name for a65;
col TABLESPACE_NAME for a25;
set lines 300 pages 3000;
col File_Size for 999999999
col Max_Size for 999999999
select TABLESPACE_NAME,FILE_NAME,AUTOEXTENSIBLE,BYTES/(1024*1024*1024)
File_Size_GB,MAXBYTES/(1024*1024*1024) Max_Size_GB from dba_data_files; where
tablespace_name='SYSAUX';
CREATE TABLESPACE.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
create tablespace tablespace_name datafile 'PATH' size 10mb autoextend on maxsize
(unlimited); ------->when you create.all time ask your client.
ADD TABLESPACE.
~~~~~~~~~~~~~~~~~~~~~~~~~~
alter tablespace sysaux add datafile 'H:\BJLS\SYSAUX.417.1027175423.DBF' size 16g;
RESIZE TABLESPACE.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alter database datafile 'PATH' resize 10g;
SUM(BYTES)/1024/1024/1024
-------------------------
54.6565552
set ORACLE_HOME=E:\app\srv_rman\product\12.1.0\dbhome_1
set PATH=E:\DB_Backup\Oracle\Logical_Bkps
set ORACLE_SID=BIOSPROD
export tables.
~~~~~~~~~~~~~~~~~~~
how to create directories.
create directory <directory_name> as <path> <--------you want to give any path.
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Password:
Warning: Oracle Data Pump operations are not typically needed when connected to the
root or seed of a container database.
expdp attach="SYS"."SYS_EXPORT_FULL_01"
````````````````````````````````````
check rman code.
````````````````````````````````````
Q- HOW TO TAKE RMAN FULL BACKUP COMMAND GIVEN BELOW.
run
{
allocate channel s1 device type disk;
allocate channel s2 device type disk;
allocate channel s3 device type disk;
backup as compressed backupset database format '/u01/app/oracle/rman_backup/full_
%d_%t_%U.bkp';
backup current controlfile format '/u01/app/oracle/rman_backup/ctl_%d_%t_%U.bkp';
backup archivelog all format '/u01/app/oracle/rman_backup/arch_%d_%t_%U.bkp';
backup spfile format '/u01/app/oracle/rman_backup/spfile_%d_%t_%U.bkp';
release channel s1;
release channel s2;
release channel s3;
}
````````````````````````````````````
check rman_backup_job_detail code. <---- how to check rman job detail?
````````````````````````````````````
Q> how to check rman job status when our backup is running on database?
````````````````````````````````````
check controlfile.
````````````````````````````````````
````````````````````````````````````
cdb and pdb
````````````````````````````````````
````````````````````````````````````````````````````
HOW TO SCHEDULE SUDIT LOG JOBS;
```````````````````````````````````````````````````
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'PURGE_UNIFIED_AUDIT_JOB',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN',
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
SYSTIMESTAMP-10);
DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
use_last_arch_timestamp => TRUE);
END;
````````````````````````````````````````````````````
HOW TO SCHEDULE SUDIT LOG JOBS;
```````````````````````````````````````````````````
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'test_full_job_definition',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN my_job_procedure; END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'freq=hourly; byminute=0; bysecond=0;',
enabled => TRUE);
END;
/
``````````````````````````````````````````````````````````````
Indexes
``````````````````````````````````````````````````````````````
desc all_indexes;
desc dba_indexes;
```````````````````````````````````````````````````
how to check table owner.
````````````````````````````````````````````````````
desc dba_tables for check owner
desc user_sys_privs.
desc ALL_TAB_PRIVS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~
primary and DR checking status.
```````````````````````````````````
FOR DC :