{"id":7630,"date":"2018-06-23T09:52:16","date_gmt":"2018-06-23T01:52:16","guid":{"rendered":"http:\/\/rmohan.com\/?p=7630"},"modified":"2018-06-23T09:53:20","modified_gmt":"2018-06-23T01:53:20","slug":"oracle-databases-server","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7630","title":{"rendered":"oracle databases server"},"content":{"rendered":"<p><strong>oracle databases server <\/strong><\/p>\n<p>create database TEST<br \/>\nMAXLOGFILES 16<br \/>\nMAXLOGMEMBERS 3<br \/>\nMAXDATAFILES 100<br \/>\nMAXINSTANCES 8<br \/>\nMAXLOGHISTORY 292<br \/>\nLOGFILE<br \/>\nGROUP 1 &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\REDO01.LOG&#8217; SIZE 50M BLOCKSIZE 512,<br \/>\nGROUP 2 &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\REDO02.LOG&#8217; SIZE 50M BLOCKSIZE 512<br \/>\nDATAFILE&#8217;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\SYSTEM.DBF&#8217; size 100m autoextend on<br \/>\nsysaux datafile &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\SYSAUX.DBF&#8217; size 100m autoextend on<br \/>\nundo tablespace undotbs1 datafile &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\UNDOTBS1.DBF&#8217; size 100m autoextend on<br \/>\nCHARACTER SET AL32UTF8<br \/>\n;<\/p>\n<p>CREATE DATABASE axisdevdb<br \/>\nUSER SYS IDENTIFIED BY oracle<br \/>\nUSER SYSTEM IDENTIFIED BY oracle<br \/>\nGROUP 1 (&#8216;\/u01\/app\/oracle\/oradata\/axisdevdb\/Disk1\/redo01_a.log&#8217;) SIZE 100M<br \/>\nGROUP 2 (&#8216;\/u01\/app\/oracle\/oradata\/axisdevdb\/Disk1\/redo02_a.log&#8217;) SIZE 100M<br \/>\nGROUP 3 (&#8216;\/u01\/app\/oracle\/oradata\/axisdevdb\/Disk1\/redo03_a.log&#8217;) SIZE 100M<br \/>\nMAXLOGFILES 5<br \/>\nMAXLOGMEMBERS 5<br \/>\nMAXLOGHISTORY 1<br \/>\nMAXDATAFILES 100<br \/>\nMAXINSTANCES 1<br \/>\nCHARACTER SET US7ASCII<br \/>\nNATIONAL CHARACTER SET AL16UTF16<br \/>\nDATAFILE &#8216;\/u01\/app\/oracle\/oradata\/axisdevdb\/Disk1\/system01.dbf&#8217; SIZE 325M REUSE<br \/>\nEXTENT MANAGEMENT LOCAL<br \/>\nSYSAUX DATAFILE &#8216;\/u01\/app\/oracle\/oradata\/axisdevdb\/Disk1\/sysaux01.dbf&#8217; SIZE 325M REUSE<br \/>\nSIZE 20M REUSE<br \/>\nSIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;<\/p>\n<p>Log into the database server as a user belonging to \u2018dba\u2019 [unix ] or \u2018ora_dba\u2019 [windows ] group , typically \u2018oracle\u2019, or an administrator on your windos machine. You are able to log into Oracle as SYS user, and change the SYSTEM password by doing the following:<\/p>\n<p>$ sqlplus &#8220;\/ as sysdba&#8221;<br \/>\nSQL*Plus: Release 9.2.0.1.0 &#8211; Production on Mon Apr 5 15:32:09 2004<\/p>\n<p>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.<\/p>\n<p>Connected to:<br \/>\nOracle9i Enterprise Edition Release 9.2.0.1.0 &#8211; Production<br \/>\nWith the OLAP and Oracle Data Mining options<br \/>\nJServer Release 9.2.0.1.0 &#8211; Production<\/p>\n<p>SQL&gt; show user<\/p>\n<p>USER is &#8220;SYS&#8221;<\/p>\n<p>SQL&gt; passw system<br \/>\nChanging password for system<br \/>\nNew password:<br \/>\nRetype new password:<br \/>\nPassword changed<br \/>\nSQL&gt; quit<\/p>\n<p>Next, we need to change the password of SYS:<\/p>\n<p>$ sqlplus &#8220;\/ as system&#8221;<br \/>\nSQL*Plus: Release 9.2.0.1.0 &#8211; Production on Mon Apr 5 15:36:45 2004<\/p>\n<p>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.<\/p>\n<p>SP2-0306: Invalid option.<br \/>\nUsage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]<br \/>\nwhere &lt;logon&gt; ::= &lt;username&gt;[\/&lt;password&gt;][@&lt;connect_string&gt;] | \/<br \/>\nEnter user-name: system<br \/>\nEnter password:<\/p>\n<p>Connected to:<br \/>\nOracle9i Enterprise Edition Release 9.2.0.1.0 &#8211; Production<br \/>\nWith the OLAP and Oracle Data Mining options<br \/>\nJServer Release 9.2.0.1.0 &#8211; Production<\/p>\n<p>SQL&gt; passw sys<br \/>\nChanging password for sys<br \/>\nNew password:<br \/>\nRetype new password:<br \/>\nPassword changed<br \/>\nSQL&gt; quit<br \/>\nYou should now be able to log on the SYS and SYSTEM users, with the passwords you just typed in.<\/p>\n<p>Method 2: Creating pwd file (Tested on Windows Oracle 8.1.7)<\/p>\n<p>Stop the Oracle service of the instance you want to change the passwords of.<br \/>\nFind the PWD###.ora file for this instance, this is usuallly located atC:\\oracle\\ora81\\database\\, where ### is the SID of your database.<br \/>\nrename the PWD###.ora file to PWD###.ora.bak for obvious safety reasons.<br \/>\nCreate a new pwd file by issuing the command:<br \/>\norapwd file=C:\\oracle\\ora81\\database\\PWD###.ora password=XXXXX<br \/>\nwhere ### is the SID and XXXXX is the password you would like to use for the SYS and INTERNAL accounts.<br \/>\nStart the Oracle service for the instance you just fixed. You should be able to get in with the SYS user and change other passwords from there.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Oracle default user and password<\/p>\n<p>sqlplus \/nolog<br \/>\nconn \/as sysdba<br \/>\nalter user system identified by manager<\/p>\n<p>OK, you can now use the Oracle database service normally. Specific instructions and points of attention are given in the next section.<\/p>\n<p>Extra operation<br \/>\n1, modify the instance name<\/p>\n<p>select instance from v$thread;<\/p>\n<p>echo $ORACLE_SID<\/p>\n<p>First, create a user<br \/>\ncreate user test identified by password<br \/>\nalter user test identified by password ;<br \/>\nSecond, the authorization role<br \/>\ngrant connect, resource to test;<br \/>\nrevoke connect, resource from test;<br \/>\nSecond, delete the user<br \/>\ndrop user test;<br \/>\ndrop user test cascade;<br \/>\nFourth, create \/ authorize \/ delete the role<br \/>\ncreate role testRole;<br \/>\ngrant select on class to testRole;<br \/>\ndrop role testRole;<\/p>\n<p>test:<br \/>\ngrant resource to nova; \/\/<br \/>\nRole related<\/p>\n<p>Fifth, create wm_concat function on 12C<br \/>\n11g2 and 12C have abandoned the wm_concat function<\/p>\n<p>Create wm_concat function on 12C Oracle default user name and password cheat sheet<\/p>\n<p>create user ums_dev identified by ums_dev?<br \/>\ngrant session, connect, resource to ums_dev;<br \/>\nALTER USER ums_dev ACCOUNT UNLOCK;<br \/>\nalter user ums_dev identified by ums_dev;<br \/>\ngrant unlimited tablespace to ums_dev;<br \/>\nalter table table_user add (overdate TIMESTAMP(6));<\/p>\n<p>View Oracle Role Users and Permissions<\/p>\n<p>select user_id, username, DEFAULT_TABLESPACE, ACCOUNT_STATUS,PROFILE from dba_users;<\/p>\n<p>select username,default_tablespace from user_users;<\/p>\n<p>select * from user_role_privs;<\/p>\n<p>select * from user_sys_privs<\/p>\n<p>select * from user_tab_privs<\/p>\n<p>Check the table related information<\/p>\n<p>select sum(bytes)\/(1024*1024) tablesize from user_segments where segment_name=&#8217;ZW_YINGYEZ&#8217;;<\/p>\n<p>select index_name,index_type,table_name from user_indexes order by table_name<\/p>\n<p>select * from user_ind_columns where table_name=&#8217;CB_CHAOBIAOSJ201004&#8242;<\/p>\n<p>select sum(bytes)\/(1024*1024) as indexsize from user_segments<br \/>\nwhere segment_name=upper(&#8216;AS_MENUINFO&#8217;)<\/p>\n<p>select * from v$version<\/p>\n<p>Import and Export<\/p>\n<p>exp dbserver\/dbserver1234@ORCL file=\/opt\/dbserver.dmp owner=dbserver<\/p>\n<p>imp dbserver\/dbserver1234@XE file=c:\\orabackup\\full.dmp log=c:\\orabackup\\imp.log full=y<\/p>\n<p>Export<\/p>\n<p>exp dbserver\/dbserver1234@ORCL file=dbserver.dmp log=dbserver.log owner=ums rows=n<\/p>\n<p>exp dbserver\/dbserver1234 jdbc:oracle:thin:@10.10.73.206:1521:umpay file=dbserver.dmp log=dbserver.log owner=ums rows=n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>oracle databases server <\/p>\n<p>create database TEST MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\REDO01.LOG&#8217; SIZE 50M BLOCKSIZE 512, GROUP 2 &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\REDO02.LOG&#8217; SIZE 50M BLOCKSIZE 512 DATAFILE&#8217;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\SYSTEM.DBF&#8217; size 100m autoextend on sysaux datafile &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\SYSAUX.DBF&#8217; size 100m autoextend on undo tablespace undotbs1 datafile &#8216;C:\\oraclexe\\app\\oracle\\oradata\\TEST\\UNDOTBS1.DBF&#8217; size 100m autoextend on CHARACTER SET [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7630"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7630"}],"version-history":[{"count":3,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7630\/revisions"}],"predecessor-version":[{"id":7633,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7630\/revisions\/7633"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}