Tag: start

Create a database manually on windows in 11g?

-- Step 1) set up environment variables needed (ORACLE_HOME, ORACLE_SID and add ORACLE_HOME\bin to PATH) set ORACLE_HOME=e:\oracle\11g\product\11.2.0.1 set PATH=%ORACLE_HOME%\bin;%PATH% set ORACLE_SID=TESTDB -- Step 2) Sample pfile (parameter file) for the instance and place it in %ORCALE_HOME%\dbs db_name='TESTDB' memory_target=500m processes=150 audit_file_dest='E:\oracle\DB\TESTDB\admin\adump' audit_trail ='db' db_block_size=8192 db_domain='' diagnostic_dest=E:\oracle\DB\TESTDB\diagnostic_dest dispatchers='(PROTOCOL=TCP) (SERVICE=TESTDBXDB)' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' control_files = ("E:\oracle\DB\TESTDB\oradata\control1.ora", "E:\oracle\DB\TESTDB\oradata\control2.ora") compatible … Continue reading Create a database manually on windows in 11g?

How to start/stop Oracle Enterprise Manager (OEM)/ Grid Control (GC)?

To start the Oracle Enterprise Manager/Grid Control components in version 11g (11.1.0.1) $ cd /bin; ./emctl start oms $ cd /bin; ./emctl start agent Where OMS_HOME is /u01/weblogic/oms11g and AGENT_HOME is /u01/weblogic/agent11g Note: This will also start weblogic too To stop Oracle Enterprise Manager version 11g (11.1.0.1) $ cd /bin; ./emctl stop agent $ cd … Continue reading How to start/stop Oracle Enterprise Manager (OEM)/ Grid Control (GC)?

Using timing in SQL*Plus

Using timing feature on SQL*Plus one can monitor elapsed time. Example: -- start timer with the name monitor_timing, name is optional SQL> timing start monitor_timing SQL> select sysdate from dual; SYSDATE --------- 11-APR-10 -- display time elapsed for current timer SQL> timing show timing for: monitor_timing Elapsed: 00:00:21.35 SQL> select count(1) FROM dba_objects; COUNT(1) ---------- … Continue reading Using timing in SQL*Plus

Start/Stop SQL Server service through command line

To start SQL Server services (default instance) c:> net start mssqlserver Output: The SQL Server (MSSQLSERVER) service is starting. The SQL Server (MSSQLSERVER) service was started successfully. Show Service status that it's running c:> sc query mssqlserver SERVICE_NAME: mssqlserver TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 … Continue reading Start/Stop SQL Server service through command line

How to see backup history through the back-end?

By querying msdb.dbo.backupset and msdb.obackupmediafamily one can see backup history like start and end time, type of backup, location of the backup. select bs.database_name , bs.type , bs.backup_start_date , bs.backup_finish_date , bmf.physical_device_name FROM msdb.dbo.backupset bs , msdb.dbo.backupmediafamily bmf where bmf.media_set_id = bs.media_set_id and backup_start_date > '2010-01-22' testDB D 2010-01-22 00:00:02.000 2010-01-22 05:09:32.000 c:\Backup\testdb_full.bak testDB I … Continue reading How to see backup history through the back-end?

How to extract start and end time of a job in SQL Server?

In Query analyzer -- prints job name, step name, start time and end time of each step in the job and sorts by latest on the top -- if jh.sql_message_id is 0 then that step failed but that status is set set at the overall job outcome SELECT j.Name, jh.Step_name, CONVERT(DATETIME, RTRIM(jh.run_date)) + ((jh.run_time/10000 * … Continue reading How to extract start and end time of a job in SQL Server?

How to start/stop an instance on a RAC?

To start the instance: # check status of instance $ $CRS_HOME/bin/crs_stat # seen cases when CRS says OFFLINE but pmon is still running so double checking here $ ps -ef | grep <instance_name> | grep pmon # start one of the instance on one of the nodes if not running $ srvctl start database -d … Continue reading How to start/stop an instance on a RAC?

Information on Database in restricted mode.

When a database is started in restricted mode only users with restricted access can login to the database. The reason to start database in restrict is to restrict normal users to connect to the database. To switch the database back to normal mode, you would need to restart the database. One can start the database … Continue reading Information on Database in restricted mode.

Enable trace in a running session from PL/SQL or SQL*Plus

Using Oracle SID and SERIAL# can turn trace on/off a Oracle session that has already started. The values of SID and serial# can be obtained from GV$SESSION. This will create trace file in directory set by the parameter user_dump_dest. To find the SID and SERIAL# you want to debug you can query GV$session to query … Continue reading Enable trace in a running session from PL/SQL or SQL*Plus