0% found this document useful (0 votes)
3 views

dba_activities

Uploaded by

cloudmasterram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

dba_activities

Uploaded by

cloudmasterram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Use management and Role management

Use management and Role management:

security:

Account Locking
tablespace quotas
default tablece
resource

Profile:

default
dba created profile

Roles:

default (connect,resource)
dba defined

Privilages:

System: (Assinged DB)

create tablespace
alter tablespace
drop tablespace

Object:
insert
delete
update
select

SQL:
Create
alter
drop

Authentication:
OS Authentication
DB Authentication
N/w Authentication

Views:
Session_privs
User_sys_privs
Role_role_privs
Role_tab_privs
Role_sys_privs

Whenever user created : identify the tablespace which user nee the store the object
Plan for Quotas for each each tablespace

Assign a default tablespace and temporary tablespace to the user

alter creating the user by following above 4 steps, grant required privilages
or roles (set of privilages) to the user.

Quotas: Tablespace quotas controls the amount of the physical storage assigned to
the user.

Profiles: A profile is a named set of password & resource limit.

Generally this profile contain.

i) password assign & expiration


ii) account locking
iii) idle time
iv) Cpu Time
v) Connect time
vi) concurrent Session

Password:

Failed_loggon_attempts
Password_lifetime
Password_lock_time
Password_grace_time
Password_max_reuse

Resources:

Cpue_time
Logical_reads_per_session
Logical_reads_per_call
connect_time
Idle_time
Session_per_user

Profile: to manage of the users logoff their sessions,resource limits,password


control

Privilages: Privilage is a permission to perform transactions against the database.

System level privilages: create/alter/drop

Object level privilages: select,insert,delete,update with grant option

sys, xusera,yuser

>create table tab11(tno number) tablespace system;


>revoke unlimited tablespace from user1;

> select * from user_ts_quotas;

>grant connect,resource to user2;

> select * from user_ts_quotos;


> alater user user2 quota unlimited on test2;

> select * from user_ts_quotas;

> desc dba_profiles;

> create profile prof1 limit failed_login_attempts 3 idle_time 30


password_lock_time 3;

> alter user user2 profile prof1;

Checkout the provilages(password_lock_times]

> alter user user2 account unlock;

>show parameter resource_limit

init.ora: resource_limit=ture

o/s level authentication: os_authent_prefix=''

>show parameter os_authent_prefix

init.ora: remote_login_passwordfile=exclusive

$orapwd file=orapwd$ORACLD_SID password=diamond

>select * from v$pwfile_users;

>grant sysdba to users1;

>show users
>select * from session_privs;

> =========================================================================
Table Spaces:

views: dba_users

dba_synomyms,v$tempfile,dba_data_files,dba_tablespaces

create,alter,drop,online,offline,small,big,locally/dictionary management
read,read/write,

desc dba_data_files,
desc v$tempfile
desc database_properties

To create tablespace:
create tablespace ts1 datafile 'disk1/oradata/tsb/ts1.db' size 10m;

[Default locally managed in 10g]

create tablesapce ts2 datafile '/disk2/oradata/......ts2.db' size 10mb extent


management dictonary

select * from dba_data_files;

alter database datafile '/disk4/oradata/pal/ts11.dbf' resize 10m;


drop tablespace ts_dict;

alter tablespace ts1 read only;

alter tablespace ts1 read write;

alter tablespace ts1 offline;

alter tablespace ts1 online;

initdb.ora : db_2k_cache_size=16

>start force

>show parameter db_2k

>alter tablespace ts1 rename to ts2;

create tablespace ts_log datafile '/disk1/oradata/pal/tsl_log.dbf' size 110m


nologging'

>select * from dba_tablespaces;

> create temporary tablespace ttsg1 tempfile '/disk1/oradata/pal/


/ttsg2.dbf' size 15m tablespace gropu group1;

>alter database default temporary tablespace group1;

>select * from dba_properties;

>create bigfile tablespace ts_big datafile '/disk4/oradata/pal


/ts_big.dbf' size 10m ;

> alter tablespace ts_big resize 25m;

>alter tablespace temps datafile '/disk11/oradata/pal/temp1.dbf' size 5m

>alter tablespace temp1 offline;

> cp temp1.db /disk3/oradata/pal/temp1.dbf

====================

Use management and Role management


==============================
>select * from v$pwfile_users;

orapwd file=orapw%ORACLE_SID password=bunny

create daatabaselink pay_acc connectaa to scott identified by tiger using to_acct;

>select * from payroll;

select * from bank@pay_acc;

create synonym b for bank@pay_acc;


create database link pro_dev;

selecta table_name from user_tables;

select table_name from user_tables@aapro_dev;

select table_name from user_tables minus select table_name from


user_tables@prod_DEV;

Select table_name from user_table@prod_dev

grant create database link to rajpal;

select * from session_privs;

create database link link1 connect to wilshire identified by wilshire


using 'tnsname';

> select * from tab*link1;

select * from user_db_links;

insert into emp@link11 select * from emp@link1;

>commit;
>grant create synonym to rajpal;

>select * from d1;

>grant create public database link to rajpal;

>select * from user_db_links;


>select * from user_db_links;
>select * from all_db_links;
>select * from emp'a@link1;
>select * from dba_db_links;
>select * from all_db_links;

>drop database link link1;


>drop public database link plink1;

>grant create snapshot to rajpal;

conn rajpal/rajpal
>select * from session_privs;

>create materialized view mv1 refresh complete with rowid start with sysdate
nexta sysdate +1/(24*60*60)
os select * from emp@link1;

>save mv1.sql

select * from tab;


mv1

>alter table emp add primary key(empno);


>create maateriaalized view log on emp;
===============
to know the scn for any moment:
dbms_flashback_get_system_change_number [o package]
control file:v$controlfile
v$controlfile_record_section

> select type from v$controlfile_record_section;

select name from v$controlfile;


select name from v$database;
desc vaA$database_incornation;
select incarnation#,resetlogs_id from v$database_incarnation;

SET LINES 333 PAGES 222


COL OWNER FOR A11
COL TABLE_NAME FOR A23
COL GLOBAL_STATS FOR A13
COL PARTITION_NAME FOR A15
COL SUBPARTITION_NAME FOR A19
COL TABLE_OWNER FOR A15

SELECT TABLE_OWNER,TABLE_NAME,
PARTITION_NAME,SUBPARTITION_NAME,NUM_ROWS,TO_CHAR(LAST_ANALYZED,'DD-MON-
YYYY:HH24:MI:SS') LAST_ANALYZED,GLOBAL_STATS FROM DBA_TAB_SUBPARTITIONS
WHERE TABLE_OWNER='TBLUSR'
AND TABLE_NAME='MOTORFOTONG'
AND ROWNUM<11 ORDER BY
TABLE_OWNER,TABLE_NAME,PARTITION_NAME,SUBPARTITION_NAME,LAST_ANALYZED;
prompt$$$$$$$**Welcome to DBsGuru!**Share Learn Grow**$$$$$$$

==================
crontab: df -h:

https://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html

passwd:

https://docs.oracle.com/database/121/DBSEG/authentication.htm#DBSEG0032

Formct Help
tablespace_name,countsegment_name)frcmdba_segmentsgroupbytablespace_name;
--eachsegmentcorrespondstoatable,index,...
distinctsegment_type)fromdba_segmentswhereowner='CONCERTS';selecttablespace_name,co
untsegment_name)frcm
wheresegme1t_type='TABLE'groupbytablespace_na
shouldyieldthesamecountsoftablespertablespace
tablespace_name,counttable_name)fromall_tablesgroupbytablespace_name;

--tables,i1dexes,...containextentsastheyaresizedupwardstomeetdemand.Extentscan
--haveunusedblocks(emptyblocks,emptyspace)
selecttablespace_name,countextent_id)fromcba_extentsgroupbytablespace_name;
escuser_t3bles; I
ciescuser_i1dexes;
selecttablespace_name,countblocks)fromall_tablesgroupbytablespace_name;

You might also like