An evolution of the DBA role and responsibilities
The Database Administrator is one of the most difficult positions to fill and retain. DBAs must be able to react, communicate, and plan across many different business functions. They are not easy to find and are often shockingly costly as a percentage of IT payroll. Prior to the evolution of today’s comprehensive systems and greater reliance on data by 24×7 consumers, most DBAs functioned as “basement DBAs,” meaning that they generally were out of sight and out of mind, working on mainframe tasks associated with loading tapes and running backup job
That was 20 years ago.
In the current IT landscape, DBAs must understand an ever-expanding scope of hardware and applications, which includes web servers, middleware, and relational data models. They must deal effectively with new data/indexing schemes, application loads, clustering software, and replication techniques. Proficiency in networking, operating systems, storage area networks, and Sarbanes-Oxley regulations drives their value as DBAs. They also face constant change in encryption, multiple scripting languages,data retention, spatial data types, and third-party applications. Finally, they must know data warehousing, business intelligence, advanced performance tuning, high availability, code propagation, auditing, heuristics, and I/O layouts, among others. The likelihood of finding one individual with expertise in even a few of these key areas, much less all of them, is very low.
Since the DBA is often the first point of contact for system performance issues, they must be adept at problem solving, communication, collaboration, project management, process adherence, and even financial analysis. With the broadening and deepening of the job description of the average Database Administrator, they must demonstrate vertical platform expertise and horizontal functional expertise
Script To clone Oracle User
set lines 999 pages 999
set verify off
set feedback off
set heading off
select username
from dba_users
order by username
/
undefine user
accept userid prompt 'Enter user to clone: '
accept newuser prompt 'Enter new username: '
accept passwd prompt 'Enter new password: '
select username
, created
from dba_users
where lower(username) = lower('&newuser')
/
accept poo prompt 'Continue? (ctrl-c to exit)'
spool /tmp/user_clone_tmp.sql
select 'create user ' || '&newuser' ||
' identified by ' || '&passwd' ||
' default tablespace ' || default_tablespace ||
' temporary tablespace ' || temporary_tablespace || ';' "user"
from dba_users
where username = '&userid'
/
select 'alter user &newuser quota '||
decode(max_bytes, -1, 'unlimited'
, ceil(max_bytes / 1024 / 1024) || 'M') ||
' on ' || tablespace_name || ';'
from dba_ts_quotas
where username = '&&userid'
/
select 'grant ' ||granted_role || ' to &newuser' ||
decode(admin_option, 'NO', ';', 'YES', ' with admin option;') "ROLE"
from dba_role_privs
where grantee = '&&userid'
/
select 'grant ' || privilege || ' to &newuser' ||
decode(admin_option, 'NO', ';', 'YES', ' with admin option;') "PRIV"
from dba_sys_privs
where grantee = '&&userid'
/
spool off
undefine user
set verify on
set feedback on
set heading on
@/tmp/user_clone_tmp.sql
!rm /tmp/user_clone_tmp.sql
Vi for DBAs
Here are a few useful commands for those who are new to vi.
| esc :q! | Just quit – don’t save |
| esc :e! | Revert to saved |
| esc :wq | Save and exit |
| esc shift zz | Save and exit |
| esc i | Enter insert mode (edit mode) |
| esc a | Enter append mode (edit mode) |
| esc | Exit edit mode |
| esc r | Replace a single character |
| esc x | Delete a single character |
| esc dd | Delete a single line |
| esc yy | Copy a single line |
| esc p | Paste a single line |
| . | Repeat the last command |
| esc / | String search |
| esc $ | Jump to end of line |
| esc ^ | Jump to begining of line |
| shift g | Jump to the end of the file |
| :1 | Jump to the begining of the file |
| :.= | Display the current line number |



