ORACLE FOR BEGINNERS
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>SELECT FILE_NAME FROM DBA_DATA_FILES FILE_NAME;
--------------------------------------------------------------------------------
/oracle/BBC/data1/system_1/system.data1
/oracle/BBC/data1/sysaux_1/sysaux.data1
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>CREATE TABLESPACE PRUEBA
DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TORITO\PRUEBA.DBF' SIZE 10M
EXTENT MANAGEMENT LOCAL;
SQL>CREATE USER PRUEBA_USER IDENTIFIED BY torito;
SQL>GRANT SYSDBA TO PRUEBA_USER;
SQL>GRANT DBA TO PRUEBA_USER;
Verify user created
SQL>SELECT * FROM DBA_USERS WHERE USERNAME='PRUEBA_USER';
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>shutdown normal;
or
SQL>shutdown immediate;
#lsnrctl status stop/start
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>startup
SQL> show parameter back;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string C:\ORACLE\PRODUCT\10.2.0\ADMIN\TORITO\BDUMP
backup_tape_io_slaves boolean FALSE
db_flashback_retention_target integer 1440
fast_start_parallel_rollback string LOW
rollback_segments string
transactions_per_rollback_segment integer 5
C:\>more C:\ORACLE\PRODUCT\10.2.0\ADMIN\TORITO\BDUMP\alert_torito.log
8.1 Shutdown the database
SQL> shutdown immediate
8.2 Perform a startup with the mount option
SQL> startup mount
8.3 After mount the database execute the following command
SQL>alter database archivelog;
8.4 Open the database
SQL>alter database open;
8.5 Finally active the system archive log
SQL> alter system archive log start;
SQL> archive log list;
Modo log de la base de datos Archive Mode
Destino del archivo USE_DB_RECOVERY_FILE_DEST
Secuencia de log en lÝnea mßs antigua 13
Siguiente secuencia de log para archivar 15
Secuencia de log actual 15
SQL> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string C:\oracle\product\10.2.0\flash_recovery_area
db_recovery_file_dest_size big integer 2G
You can force a switch in order to write a archive log
SQL> alter system switch logfile;
System Altered
SQL> shutdown immediate;
10.1 Perform a startup with the mount option
SQL>startup mount;
10.2 Deactivate archivelog:
SQL>alter database noarchivelog;
10.3 Open the database
SQL>alter database open
10.4 Deactivate or stop the archive log
SQL>alter system archive log stop
Regards
Roger
1.-Check data files in Oracle Data Base
$sqlplus / as sysdbaConnected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>SELECT FILE_NAME FROM DBA_DATA_FILES FILE_NAME;
--------------------------------------------------------------------------------
/oracle/BBC/data1/system_1/system.data1
/oracle/BBC/data1/sysaux_1/sysaux.data1
2.-Create a Table Space "prueba" with local management , size 10 megabytes without autoxtend
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>CREATE TABLESPACE PRUEBA
DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\TORITO\PRUEBA.DBF' SIZE 10M
EXTENT MANAGEMENT LOCAL;
2- Create a user "prueba_user" and password "torito" and grant permission for this user
SQL>CREATE USER PRUEBA_USER IDENTIFIED BY torito;
SQL>GRANT SYSDBA TO PRUEBA_USER;
SQL>GRANT DBA TO PRUEBA_USER;
Verify user created
SQL>SELECT * FROM DBA_USERS WHERE USERNAME='PRUEBA_USER';
3- Shutdown the Oracle Data Base
Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>shutdown normal;
or
SQL>shutdown immediate;
4.- Shutdown the Listener
lnsrctl stop/start LISTENER
5- Start the Listener
#lsnrctl status stop/start6.-Start the Oracle Data Base
Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>startup
7.-Check the alert log file after startup process of the database
SQL> show parameter back;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
background_core_dump string partial
background_dump_dest string C:\ORACLE\PRODUCT\10.2.0\ADMIN\TORITO\BDUMP
backup_tape_io_slaves boolean FALSE
db_flashback_retention_target integer 1440
fast_start_parallel_rollback string LOW
rollback_segments string
transactions_per_rollback_segment integer 5
C:\>more C:\ORACLE\PRODUCT\10.2.0\ADMIN\TORITO\BDUMP\alert_torito.log
8- Activate archivelog mode in the Oracle Database
8.1 Shutdown the database
SQL> shutdown immediate
8.2 Perform a startup with the mount option
SQL> startup mount
8.3 After mount the database execute the following command
SQL>alter database archivelog;
8.4 Open the database
SQL>alter database open;
8.5 Finally active the system archive log
SQL> alter system archive log start;
SQL> archive log list;
Modo log de la base de datos Archive Mode
Destino del archivo USE_DB_RECOVERY_FILE_DEST
Secuencia de log en lÝnea mßs antigua 13
Siguiente secuencia de log para archivar 15
Secuencia de log actual 15
9.-Check archive path destination for the archive log
SQL> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string C:\oracle\product\10.2.0\flash_recovery_area
db_recovery_file_dest_size big integer 2G
You can force a switch in order to write a archive log
SQL> alter system switch logfile;
System Altered
10- Deactivate archive log mode in the database.
SQL> shutdown immediate;
10.1 Perform a startup with the mount option
SQL>startup mount;
10.2 Deactivate archivelog:
SQL>alter database noarchivelog;
10.3 Open the database
SQL>alter database open
10.4 Deactivate or stop the archive log
SQL>alter system archive log stop
Regards
Roger
Comments