User Tools

Site Tools


user_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
user_management [2018/12/08 12:49] – created 0.0.0.0user_management [2021/09/17 14:49] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== User_Management ======+  *  [[https://oracle-base.com/articles/misc/os-authentication|Create external user (using OPS$)]] 
 +  *  [[Create User like...]] 
 +==== Users created when installing Oracle 11.2.0.4 Standard Edition ==== 
 +<code> 
 +select username from dba_users order by 1;
  
-  * [[https://oracle-base.com/articles/misc/os-authentication|Create external user (using OPS$)]] +USERNAME 
-  * [[Create User like...]] +------------------------------ 
-=====Users created when installing Oracle 11.2.0.4 Standard Edition===== +ANONYMOUS 
-<code>0@@</code>+APEX_030200 
 +APEX_PUBLIC_USER 
 +APPQOSSYS 
 +CTXSYS 
 +DBSNMP 
 +DIP 
 +EXFSYS 
 +FLOWS_FILES 
 +MDSYS 
 +MGMT_VIEW 
 +ORACLE_OCM 
 +ORDDATA 
 +ORDPLUGINS 
 +ORDSYS 
 +OUTLN 
 +OWBSYS 
 +OWBSYS_AUDIT 
 +SI_INFORMTN_SCHEMA 
 +SYS 
 +SYSMAN 
 +SYSTEM 
 +WMSYS 
 +XDB 
 +XS$NULL
  
-=====Users created when installing Oracle 11.2.0.4 Enterprise Edition===== +25 rows selected
-<code>1@@</code>+</code>
  
-=====Show list of database users and their roles / privileges===== +==== Users created when installing Oracle 11.2.0.4 Enterprise Edition ==== 
-<code>2@@</code> +<code> 
-=====Rename an Oracle schema without exporting and importing all schema data===== +select username from dba_users order by 1; 
-If the user is very large, it can take a very long time to use the standard way expdp / impdp.<br />+ 
 +USERNAME 
 +------------------------------ 
 +ANONYMOUS 
 +APEX_030200 
 +APEX_PUBLIC_USER 
 +APPQOSSYS 
 +CTXSYS 
 +DBSNMP 
 +DIP 
 +EXFSYS 
 +FLOWS_FILES 
 +MDDATA 
 +MDSYS 
 +MGMT_VIEW 
 +OLAPSYS 
 +ORACLE_OCM 
 +ORDDATA 
 +ORDPLUGINS 
 +ORDSYS 
 +OUTLN 
 +OWBSYS 
 +OWBSYS_AUDIT 
 +SI_INFORMTN_SCHEMA 
 +SPATIAL_CSW_ADMIN_USR 
 +SPATIAL_WFS_ADMIN_USR 
 +SYS 
 +SYSMAN 
 +SYSTEM 
 +WMSYS 
 +XDB 
 +XS$NULL 
 + 
 +29 rows selected. 
 +</code> 
 + 
 +==== Show list of database users and their roles / privileges ==== 
 +<code> 
 +select 
 +  lpad(' ', 2*level) || granted_role "User, his roles and privileges" 
 +from 
 +  ( 
 +  /* THE USERS */ 
 +    select 
 +      null     grantee, 
 +      username granted_role 
 +    from 
 +      dba_users 
 +  /* THE ROLES TO ROLES RELATIONS */ 
 +  union 
 +    select 
 +      grantee, 
 +      granted_role 
 +    from 
 +      dba_role_privs 
 +  /* THE ROLES TO PRIVILEGE RELATIONS */ 
 +  union 
 +    select 
 +      grantee, 
 +      privilege 
 +    from 
 +      dba_sys_privs 
 +  ) 
 +start with grantee is null 
 +connect by grantee = prior granted_role; 
 +</code> 
 +==== Rename an Oracle schema without exporting and importing all schema data ==== 
 +If the user is very large, it can take a very long time to use the standard way expdp / impdp.\\
 It can be done more efficiently using transportable tablespaces technique to remap the schema. It can be done more efficiently using transportable tablespaces technique to remap the schema.
-  * [[https://pierreforstmanndotcom.wordpress.com/2015/02/27/how-to-rename-an-oracle-schema-without-exporting-and-importing-all-schema-data/|Rename an Oracle Schema using Transportable Tablespace]]+  *  [[https://pierreforstmanndotcom.wordpress.com/2015/02/27/how-to-rename-an-oracle-schema-without-exporting-and-importing-all-schema-data/|Rename an Oracle Schema using Transportable Tablespace]]
 Basic steps Basic steps
-  * check with DBMS_TTS.TRANSPORT_SET_CHECK that tablespace can be transported +  *  check with DBMS_TTS.TRANSPORT_SET_CHECK that tablespace can be transported 
-  * Make the tablespace read only +  *  Make the tablespace read only 
-  * Export tablespace metadata +  *  Export tablespace metadata 
-  * Drop the tablespace but keep its datafiles +  *  Drop the tablespace but keep its datafiles 
-  * Create the new user account representing the renamed schema and grant needed privileges +  *  Create the new user account representing the renamed schema and grant needed privileges 
-  * Import tablespace metadata and rename schema objects owner at the same time +  *  Import tablespace metadata and rename schema objects owner at the same time 
-  * Make tablespce read write +  *  Make tablespce read write 
-  * Set password for new user account and set default tablespace for this new account +  *  Set password for new user account and set default tablespace for this new account 
-  * Drop old user account representing the schema before renaming+  *  Drop old user account representing the schema before renaming
  
-====Unsupported way====+==== Rename an Oracle schema using Rodrigo Jorge's clever method ==== 
 +Essentially performs a network datapump from PL/SQL using a database link back to the same database so no intermediate dump file is necessary. 
 +  * https://www.dbarj.com.br/en/2014/11/rename-schema-oracle-11g-loopback-dblink/ 
 + 
 +=== Unsupported way (Oracle have closed this loophole as of 19.9!) ===
 An unsupported workaround to rename a schema is to simply update the username in sys.user$ and restart the database. An unsupported workaround to rename a schema is to simply update the username in sys.user$ and restart the database.
-<code>3@@</code> +<code> 
-<code>4@@</code> +select user# from sys.user$ where name = 'EPK'; 
-<code>5@@</code> +</code> 
-<code>6@@</code>+<code> 
 +   USER_ID 
 +---------- 
 +       172 
 +</code> 
 +<code> 
 +update sys.user$ set name = 'KPK' where user# = 172; 
 +</code> 
 +<code> 
 +1 row updated. 
 +</code>
  
-=====Create external user===== +==== Create external user ==== 
-====Check the authentification prefix==== +=== Check the authentification prefix === 
-<code>7@@</code> +<code> 
-====On Unix...==== +SQL> show parameter authent 
-<code>8@@</code> + 
-====On Windows...====+NAME                                 TYPE        VALUE 
 +------------------------------------ ----------- ------------------------------ 
 +os_authent_prefix                    string      ops$ 
 +SQL> 
 +</code> 
 +=== On Unix... === 
 +<code> 
 +create user ops$oracle identified externally; 
 +grant create session to ops$oracle; 
 +</code> 
 +=== On Windows... ===
 Watch out on Windows - the domain name needs to be included! Watch out on Windows - the domain name needs to be included!
-<code>9@@</code> +<code> 
-Additionally, the following option must be set in "%ORACLE_HOME%\network\admin\sqlnet.ora"<br />+create user "ops$domainname.com\\oracle" identified externally; 
 +grant create session to "ops$domainname.com\\oracle"; 
 +</code> 
 +Additionally, the following option must be set in "%ORACLE_HOME%\ 
 +etwork\\admin\\sqlnet.ora"\\
 If this is not present, you will not be able to connect as sysdba If this is not present, you will not be able to connect as sysdba
-<code>10@@</code>+<code> 
 +SQLNET.AUTHENTICATION_SERVICES=(NTS) 
 +</code> 
user_management.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki