D: \ oracle \ product \ 10.2.0 \ db_1 \ Network \ admin \ tnsnames. ora
Steps:
1. Create a database
2. Create a tablespace
3. Users who belong to the database
4. Specify the tablespace for the user
Table space creation statement:
Create tablespace news_tablespace datafile 'f: \ oracle \ product \ 10.1.0 \ oradata \ news \ news_data.dbf' size 500 m;
'News _ tablespace' is your custom tablespace name, which can be any name;
'F: \ oracle \ product \ 10.1.0 \ oradata \ news \ news_data.dbf 'is the storage location of data files,
'News _ data. dbf' file name is also arbitrary;
'Size m' indicates the size of the data file, that is, the size of the tablespace.
---------------------------------------
Create User Username identified by password default tablespace table;
For example:
Create user VCA identified by VCA default tablespace demo_tabs_vca;
Create user sh identified by SH default tablespace demo_tabs_sh;
The default tablespace 'default tablespace' uses the tablespace created above.
4. Authorize the new user:
SQL> grant connect, resource to VCA; -- Grant connect and resource permissions to news users.
SQL> grant DBA to VCA; -- Grant DBA permission to news users
Authorization successful.
Grant connect, resource to SH;
Grant DBA to SH;
Use commands to operate oracle in Linux
Use securecrt to enter
Su-Oracle
Sqlplus/nolog
Conn as sysdba
Enter user-Name: SYS
Enter Password: SYS
2. Check the listener: LSNRCTL status3. Start the listener: LSNRCTL start.
Create a tablespace
Create smallfile tablespace "demo_tabs_vca" datafile '/home/Oracle/oradata/autonavi/demo_tabs_vca' size 100 m logging extent management local segment space management auto;
Create smallfile tablespace "demo_tabs_sh" datafile '/home/Oracle/oradata/autonavi/demo_tabs_sh' size 100 m logging extent management local segment space management auto;
Bytes ----------------------------------------------------------------------------------------------------------------
Create smallfile tablespace "demo_tabs_vca_test" datafile '/home/Oracle/oradata/autonavi/demo_tabs_vca_test' size 100 m logging extent management local segment space management auto;
Create smallfile tablespace "demo_tabs_sh_test" datafile '/home/Oracle/oradata/autonavi/demo_tabs_sh_test' size 100 m logging extent management local segment space management auto;
Create user vca_test identified by vca_test default tablespace demo_tabs_vca_test;
Create user sh_test identified by sh_test default tablespace demo_tabs_sh_test;
SQL> grant connect, resource to vca_test; -- Grant connect and resource permissions to vca_test users.
SQL> grant DBA to vca_test; -- Grant DBA permission to vca_test user
Authorization successful.
Grant connect, resource to sh_test;
Grant DBA to sh_test;
Enable/disable Oracle
1. Switch User: su-Oracle
2. Start the listener: LSNRCTL start
3. sqlplus/nolog
4. Conn as sysdba
5. Enter the username and password as sys.
6. Enter the command "Startup" in the SQL state.
1. Switch User: su-Oracle
2. Start the listener: LSNRCTL start
3. sqlplus/nolog
A4. conn as sysdba
5. Enter the username and password as sys.
6. Enter the command shutdown in the SQL state.